edealloc_resol_mod.F90 Source File


This file depends on

sourcefile~~edealloc_resol_mod.f90~2~~EfferentGraph sourcefile~edealloc_resol_mod.f90~2 edealloc_resol_mod.F90 sourcefile~eset_resol_mod.f90 eset_resol_mod.F90 sourcefile~edealloc_resol_mod.f90~2->sourcefile~eset_resol_mod.f90 sourcefile~tpm_dim.f90 tpm_dim.F90 sourcefile~edealloc_resol_mod.f90~2->sourcefile~tpm_dim.f90 sourcefile~tpm_distr.f90 tpm_distr.F90 sourcefile~edealloc_resol_mod.f90~2->sourcefile~tpm_distr.f90 sourcefile~tpm_fields.f90 tpm_fields.F90 sourcefile~edealloc_resol_mod.f90~2->sourcefile~tpm_fields.f90 sourcefile~tpm_gen.f90 tpm_gen.F90 sourcefile~edealloc_resol_mod.f90~2->sourcefile~tpm_gen.f90 sourcefile~tpm_geometry.f90 tpm_geometry.F90 sourcefile~edealloc_resol_mod.f90~2->sourcefile~tpm_geometry.f90 sourcefile~tpm_hicfft.f90 tpm_hicfft.F90 sourcefile~edealloc_resol_mod.f90~2->sourcefile~tpm_hicfft.f90 sourcefile~tpmald_dim.f90 tpmald_dim.F90 sourcefile~edealloc_resol_mod.f90~2->sourcefile~tpmald_dim.f90 sourcefile~tpmald_distr.f90 tpmald_distr.F90 sourcefile~edealloc_resol_mod.f90~2->sourcefile~tpmald_distr.f90 sourcefile~tpmald_fields.f90 tpmald_fields.F90 sourcefile~edealloc_resol_mod.f90~2->sourcefile~tpmald_fields.f90 sourcefile~eset_resol_mod.f90->sourcefile~tpm_dim.f90 sourcefile~eset_resol_mod.f90->sourcefile~tpm_distr.f90 sourcefile~eset_resol_mod.f90->sourcefile~tpm_fields.f90 sourcefile~eset_resol_mod.f90->sourcefile~tpm_gen.f90 sourcefile~eset_resol_mod.f90->sourcefile~tpm_geometry.f90 sourcefile~eset_resol_mod.f90->sourcefile~tpmald_dim.f90 sourcefile~eset_resol_mod.f90->sourcefile~tpmald_distr.f90 sourcefile~eset_resol_mod.f90->sourcefile~tpmald_fields.f90 sourcefile~abort_trans_mod.f90 abort_trans_mod.F90 sourcefile~eset_resol_mod.f90->sourcefile~abort_trans_mod.f90 sourcefile~tpm_ctl.f90 tpm_ctl.F90 sourcefile~eset_resol_mod.f90->sourcefile~tpm_ctl.f90 sourcefile~tpmald_geo.f90 tpmald_geo.F90 sourcefile~eset_resol_mod.f90->sourcefile~tpmald_geo.f90 sourcefile~growing_allocator_mod.f90 growing_allocator_mod.F90 sourcefile~tpm_hicfft.f90->sourcefile~growing_allocator_mod.f90 sourcefile~abort_trans_mod.f90->sourcefile~tpm_gen.f90 sourcefile~growing_allocator_mod.f90->sourcefile~tpm_gen.f90 sourcefile~growing_allocator_mod.f90->sourcefile~abort_trans_mod.f90 sourcefile~sharedmem_mod.f90 sharedmem_mod.F90 sourcefile~tpm_ctl.f90->sourcefile~sharedmem_mod.f90

Source Code

MODULE EDEALLOC_RESOL_MOD
CONTAINS
SUBROUTINE EDEALLOC_RESOL(KRESOL)

!**** *EDEALLOC_RESOL_MOD* - Deallocations of a resolution

!     Purpose.
!     --------
!     Release allocated arrays for a given resolution

!**   Interface.
!     ----------
!     CALL EDEALLOC_RESOL_MOD

!     Explicit arguments : KRESOL : resolution tag
!     --------------------

!     Method.
!     -------

!     Externals.  None
!     ----------

!     Author.
!     -------
!        R. El Khatib *METEO-FRANCE*

!     Modifications.
!     --------------
!       Original : 09-Jul-2013 from etrans_end
!       B. Bochenek (Apr 2015): Phasing: update
!     ------------------------------------------------------------------

USE PARKIND1  ,ONLY : JPIM     ,JPRB

USE TPM_GEN         ,ONLY : LENABLED, NOUT
USE TPM_DISTR       ,ONLY : D
USE TPM_GEOMETRY    ,ONLY : G
USE TPM_FIELDS      ,ONLY : F
USE TPM_DIM         ,ONLY : R
USE TPMALD_DISTR    ,ONLY : DALD
USE TPMALD_DIM    ,ONLY : RALD
USE TPMALD_FIELDS   ,ONLY : FALD
USE TPM_HICFFT,      ONLY: CLEAN_FFT

USE ESET_RESOL_MOD  ,ONLY : ESET_RESOL

IMPLICIT NONE

INTEGER(KIND=JPIM), INTENT(IN) :: KRESOL

!     ------------------------------------------------------------------

IF (.NOT.LENABLED(KRESOL)) THEN

  WRITE(UNIT=NOUT,FMT='('' EDEALLOC_RESOL WARNING: KRESOL = '',I3,'' ALREADY DISABLED '')') KRESOL

ELSE

  CALL ESET_RESOL(KRESOL)
  
!$ACC EXIT DATA DELETE(R%NSMAX,R%NTMAX,R%NDGL,R%NDGNH,D%NSTAGT0B,D%NSTAGT1B,&
!$ACC&                  D%NPNTGTB1,D%NPROCL,D%NUMP,D%NDGL_FS,D%MYMS,D%NASM0,D%NSTAGTF,D%MSTABF,&
!$ACC&                  D%NPNTGTB0,D%NPROCM,D%NPTRLS,G%NDGLU,G%NMEN,G%NLOEN,&
!$ACC&                  DALD%NESM0,DALD%NCPL2M, DALD%NPME, FALD%RLEPINM, &
!$ACC&                  RALD%NLOENS_LON,RALD%NOFFSETS_LON,RALD%NLOENS_LAT,RALD%NOFFSETS_LAT)
!$ACC EXIT DATA DELETE(R,D,G,DALD,FALD,RALD)

  CALL CLEAN_FFT(KRESOL)
 
  !TPM_DISTR
  DEALLOCATE(D%NFRSTLAT,D%NLSTLAT,D%NPTRLAT,D%NPTRFRSTLAT,D%NPTRLSTLAT)
  DEALLOCATE(D%LSPLITLAT,D%NSTA,D%NONL,D%NGPTOTL,D%NPROCA_GP)

  IF(D%LWEIGHTED_DISTR) THEN
    DEALLOCATE(D%RWEIGHT)
  ENDIF

  IF(.NOT.D%LGRIDONLY) THEN

    DEALLOCATE(D%MYMS,D%NUMPP,D%NPOSSP,D%NPROCM,D%NDIM0G,D%NASM0,D%NATM0)
    DEALLOCATE(D%NLATLS,D%NLATLE,D%NPMT,D%NPMS,D%NPMG,D%NULTPP,D%NPROCL)
    DEALLOCATE(D%NPTRLS,D%NALLMS,D%NPTRMS,D%NSTAGT0B,D%NSTAGT1B,D%NPNTGTB0)
    DEALLOCATE(D%NPNTGTB1,D%NLTSFTB,D%NLTSGTB,D%MSTABF)
    DEALLOCATE(D%NSTAGTF)
    DEALLOCATE(G%NMEN,G%NDGLU)

  ELSE

    DEALLOCATE(G%NLOEN)

  ENDIF

  LENABLED(KRESOL)=.FALSE.

ENDIF

!     ------------------------------------------------------------------

END SUBROUTINE EDEALLOC_RESOL
END MODULE EDEALLOC_RESOL_MOD