finish_le_grids Subroutine

public subroutine finish_le_grids()

FIXME : Add documentation

Arguments

None

Contents

Source Code


Source Code

  subroutine finish_le_grids
    use redistribute, only: delete_redist
    use egrid, only: zeroes, x0, zeroes_maxw
    use species, only: nonmaxw_corr, f0_values, dlnf0drho

    implicit none
    real, dimension(1,1,1,1,1) :: tmpf
    real, dimension(1,1,1) :: tmpvflx

    if (allocated(zeroes)) deallocate (zeroes,x0,zeroes_maxw)
    if (allocated(energy)) deallocate (energy, energy_maxw, al, wl, &
         jend, forbid, xx, speed, speed_maxw)
    if (allocated(is_bounce_point)) deallocate(is_bounce_point)
    if (allocated(is_ttp)) deallocate(is_ttp)
    if (allocated(can_be_ttp)) deallocate(can_be_ttp)
    if (allocated(integration_work)) deallocate (integration_work)
    if (allocated(wlterr)) deallocate (wlterr)
    if (allocated(w)) deallocate (w,w_maxw)
    if (allocated(lpl)) deallocate (lpl, lpe)
    if (allocated(lpt)) deallocate (lpt)
    if (allocated(wlmod)) deallocate (wlmod)
    if (allocated(wmod)) deallocate (wmod)
    if (allocated(wtmod)) deallocate (wtmod)
    if (allocated(xi)) deallocate (xi)
    if (allocated(ixi_to_il)) deallocate (ixi_to_il)
    if (allocated(ixi_to_isgn)) deallocate (ixi_to_isgn)
    if (allocated(wxi)) deallocate (wxi)
    if (allocated(recvcnts_intspec)) deallocate (recvcnts_intspec)
    if (allocated(displs_intspec)) deallocate (displs_intspec)

    if (allocated(nonmaxw_corr)) deallocate(nonmaxw_corr)
    if (allocated(f0_values)) deallocate(f0_values)
    if (allocated(dlnf0drho)) deallocate(dlnf0drho)

    !Deallocate redistribute maps
    call delete_redist(lambda_map)
    call delete_redist(energy_map)
    call delete_redist(g2le)
    call delete_redist(g2gf)

    !Free internal saved arrays
    call get_flux_vs_theta_vs_vpa(tmpf,tmpvflx,.true.)

    test = .false. ; trapped_particles = .true.
    new_trap_int = .false.
    new_trap_int_split = .false.

    slintinit = .false. ; lintinit = .false. ; eintinit = .false.

    leinit = .false.
    gfinit = .false.
    lzinit = .false.
    einit = .false.
    initialized = .false.

    call le_grids_config%reset()
  end subroutine finish_le_grids