FIXME : Add documentation
subroutine finish_nonlinear_terms
use gs2_transforms, only: finish_transforms
#ifdef SHMEM
use shm_mpi3, only : shm_free
#endif
implicit none
#ifndef SHMEM
if (allocated(aba)) deallocate (aba, agb, abracket)
if (allocated(ba)) deallocate (ba, gb, bracket)
#else
if (associated(aba)) call shm_free(aba)
if (associated(agb)) call shm_free(agb)
if (associated(abracket)) call shm_free(abracket)
if (associated(ba)) then
call shm_free(ba)
endif
if (associated(gb)) then
call shm_free(gb)
endif
if (associated(bracket)) then
call shm_free(bracket)
endif
#endif
nonlin = .false. ; alloc = .true. ; zip = .false. ; accelerated = .false.
initialized = .false. ; initializing = .true.
call finish_transforms
call nonlinear_terms_config%reset()
end subroutine finish_nonlinear_terms