FIXME : Add documentation
subroutine reset_init
use gs2_layouts, only: finish_jfields_layouts
! finish_fields_layouts name conflicts with routine in
! this module
use gs2_layouts, only: gs2lo_ffl => finish_fields_layouts
use unit_tests, only: debug_message
implicit none
integer :: i, j
integer, parameter :: verbosity=3
initialized = .false.
call debug_message(verbosity, &
'fields_implicit::reset_init starting')
if (.not. allocated (aminv)) return
do i = 1, size(aminv)
if (.not. allocated (aminv(i)%dcell)) cycle
do j = 1, size(aminv(i)%dcell)
if (allocated (aminv(i)%dcell(j)%supercell)) &
deallocate(aminv(i)%dcell(j)%supercell)
end do
if (allocated (aminv(i)%dcell)) deallocate (aminv(i)%dcell)
end do
deallocate (aminv)
call gs2lo_ffl
if (allocated(recvcnts)) deallocate(recvcnts, displs)
call finish_jfields_layouts
end subroutine reset_init