ltinv_ctl_mod.F90 Source File


This file depends on

sourcefile~~ltinv_ctl_mod.f90~~EfferentGraph sourcefile~ltinv_ctl_mod.f90 ltinv_ctl_mod.F90 sourcefile~ltinv_mod.f90 ltinv_mod.F90 sourcefile~ltinv_ctl_mod.f90->sourcefile~ltinv_mod.f90 sourcefile~tpm_distr.f90 tpm_distr.F90 sourcefile~ltinv_ctl_mod.f90->sourcefile~tpm_distr.f90 sourcefile~tpm_flt.f90 tpm_flt.F90 sourcefile~ltinv_ctl_mod.f90->sourcefile~tpm_flt.f90 sourcefile~tpm_gen.f90 tpm_gen.F90 sourcefile~ltinv_ctl_mod.f90->sourcefile~tpm_gen.f90 sourcefile~tpm_trans.f90 tpm_trans.F90 sourcefile~ltinv_ctl_mod.f90->sourcefile~tpm_trans.f90 sourcefile~trmtol_mod.f90 trmtol_mod.F90 sourcefile~ltinv_ctl_mod.f90->sourcefile~trmtol_mod.f90 sourcefile~ltinv_mod.f90->sourcefile~tpm_distr.f90 sourcefile~ltinv_mod.f90->sourcefile~tpm_flt.f90 sourcefile~ltinv_mod.f90->sourcefile~tpm_gen.f90 sourcefile~ltinv_mod.f90->sourcefile~tpm_trans.f90 sourcefile~abort_trans_mod.f90 abort_trans_mod.F90 sourcefile~ltinv_mod.f90->sourcefile~abort_trans_mod.f90 sourcefile~buffered_allocator_mod.f90 buffered_allocator_mod.F90 sourcefile~ltinv_mod.f90->sourcefile~buffered_allocator_mod.f90 sourcefile~leinv_mod.f90 leinv_mod.F90 sourcefile~ltinv_mod.f90->sourcefile~leinv_mod.f90 sourcefile~parkind_ectrans.f90 parkind_ectrans.F90 sourcefile~ltinv_mod.f90->sourcefile~parkind_ectrans.f90 sourcefile~prfi1b_mod.f90 prfi1b_mod.F90 sourcefile~ltinv_mod.f90->sourcefile~prfi1b_mod.f90 sourcefile~spnsde_mod.f90 spnsde_mod.F90 sourcefile~ltinv_mod.f90->sourcefile~spnsde_mod.f90 sourcefile~tpm_dim.f90 tpm_dim.F90 sourcefile~ltinv_mod.f90->sourcefile~tpm_dim.f90 sourcefile~tpm_fields.f90 tpm_fields.F90 sourcefile~ltinv_mod.f90->sourcefile~tpm_fields.f90 sourcefile~tpm_geometry.f90 tpm_geometry.F90 sourcefile~ltinv_mod.f90->sourcefile~tpm_geometry.f90 sourcefile~tpm_stats.f90 tpm_stats.F90 sourcefile~ltinv_mod.f90->sourcefile~tpm_stats.f90 sourcefile~vdtuv_mod.f90 vdtuv_mod.F90 sourcefile~ltinv_mod.f90->sourcefile~vdtuv_mod.f90 sourcefile~tpm_flt.f90->sourcefile~parkind_ectrans.f90 sourcefile~seefmm_mix.f90 seefmm_mix.F90 sourcefile~tpm_flt.f90->sourcefile~seefmm_mix.f90 sourcefile~tpm_gen.f90->sourcefile~parkind_ectrans.f90 sourcefile~growing_allocator_mod.f90 growing_allocator_mod.F90 sourcefile~tpm_trans.f90->sourcefile~growing_allocator_mod.f90 sourcefile~tpm_trans.f90->sourcefile~parkind_ectrans.f90 sourcefile~trmtol_mod.f90->sourcefile~tpm_distr.f90 sourcefile~trmtol_mod.f90->sourcefile~tpm_gen.f90 sourcefile~trmtol_mod.f90->sourcefile~buffered_allocator_mod.f90 sourcefile~trmtol_mod.f90->sourcefile~parkind_ectrans.f90 sourcefile~trmtol_mod.f90->sourcefile~tpm_stats.f90 sourcefile~abort_trans_mod.f90->sourcefile~tpm_distr.f90 sourcefile~abort_trans_mod.f90->sourcefile~tpm_gen.f90 sourcefile~buffered_allocator_mod.f90->sourcefile~abort_trans_mod.f90 sourcefile~buffered_allocator_mod.f90->sourcefile~growing_allocator_mod.f90 sourcefile~buffered_allocator_mod.f90->sourcefile~parkind_ectrans.f90 sourcefile~leinv_mod.f90->sourcefile~tpm_distr.f90 sourcefile~leinv_mod.f90->sourcefile~tpm_gen.f90 sourcefile~leinv_mod.f90->sourcefile~buffered_allocator_mod.f90 sourcefile~leinv_mod.f90->sourcefile~parkind_ectrans.f90 sourcefile~leinv_mod.f90->sourcefile~tpm_dim.f90 sourcefile~leinv_mod.f90->sourcefile~tpm_fields.f90 sourcefile~leinv_mod.f90->sourcefile~tpm_geometry.f90 sourcefile~leinv_mod.f90->sourcefile~tpm_stats.f90 sourcefile~hicblas_mod.f90 hicblas_mod.F90 sourcefile~leinv_mod.f90->sourcefile~hicblas_mod.f90 sourcefile~prfi1b_mod.f90->sourcefile~tpm_distr.f90 sourcefile~prfi1b_mod.f90->sourcefile~tpm_dim.f90 sourcefile~seefmm_mix.f90->sourcefile~parkind_ectrans.f90 sourcefile~wts500_mod.f90 wts500_mod.F90 sourcefile~seefmm_mix.f90->sourcefile~wts500_mod.f90 sourcefile~spnsde_mod.f90->sourcefile~tpm_distr.f90 sourcefile~spnsde_mod.f90->sourcefile~tpm_gen.f90 sourcefile~spnsde_mod.f90->sourcefile~parkind_ectrans.f90 sourcefile~spnsde_mod.f90->sourcefile~tpm_dim.f90 sourcefile~spnsde_mod.f90->sourcefile~tpm_fields.f90 sourcefile~tpm_fields.f90->sourcefile~parkind_ectrans.f90 sourcefile~tpm_geometry.f90->sourcefile~parkind_ectrans.f90 sourcefile~tpm_stats.f90->sourcefile~parkind_ectrans.f90 sourcefile~vdtuv_mod.f90->sourcefile~tpm_distr.f90 sourcefile~vdtuv_mod.f90->sourcefile~tpm_gen.f90 sourcefile~vdtuv_mod.f90->sourcefile~parkind_ectrans.f90 sourcefile~vdtuv_mod.f90->sourcefile~tpm_dim.f90 sourcefile~vdtuv_mod.f90->sourcefile~tpm_fields.f90 sourcefile~hicblas_mod.f90->sourcefile~growing_allocator_mod.f90 sourcefile~wts500_mod.f90->sourcefile~parkind_ectrans.f90

Files dependent on this one

sourcefile~~ltinv_ctl_mod.f90~~AfferentGraph sourcefile~ltinv_ctl_mod.f90 ltinv_ctl_mod.F90 sourcefile~inv_trans_ctl_mod.f90~2 inv_trans_ctl_mod.F90 sourcefile~inv_trans_ctl_mod.f90~2->sourcefile~ltinv_ctl_mod.f90

Source Code

! (C) Copyright 2000- ECMWF.
! (C) Copyright 2000- Meteo-France.
! 
! This software is licensed under the terms of the Apache Licence Version 2.0
! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
! In applying this licence, ECMWF does not waive the privileges and immunities
! granted to it by virtue of its status as an intergovernmental organisation
! nor does it submit to any jurisdiction.
!

MODULE LTINV_CTL_MOD
CONTAINS
SUBROUTINE LTINV_CTL(KF_OUT_LT,KF_UV,KF_SCALARS,KF_SCDERS,&
 & PSPVOR,PSPDIV,PSPSCALAR,&
 & PSPSC3A,PSPSC3B,PSPSC2,&
 & KFLDPTRUV,KFLDPTRSC,FSPGL_PROC)

!**** *LTINV_CTL* - Control routine for inverse Legandre transform.

!     Purpose.
!     --------
!        Control routine for the inverse LEGENDRE transform

!**   Interface.
!     ----------
!     CALL INV_TRANS_CTL(...)
!     KF_OUT_LT    - number of fields coming out from inverse LT
!     KF_UV        - local number of spectral u-v fields
!     KF_SCALARS   - local number of scalar spectral fields
!     KF_SCDERS    - local number of derivatives of scalar spectral fields
!     PSPVOR(:,:)  - spectral vorticity (input)
!     PSPDIV(:,:)  - spectral divergence (input)
!     PSPSCALAR(:,:) - spectral scalarvalued fields (input)
!     KFLDPTRUV(:) - field pointer array for vor./div.
!     KFLDPTRSC(:) - field pointer array for PSPSCALAR
!     FSPGL_PROC  - external procedure to be executed in fourier space
!                   before transposition

!     Method.
!     -------

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

!     Author.
!     -------
!        Mats Hamrud *ECMWF*

!     Modifications.
!     --------------
!        Original : 00-06-03

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

USE PARKIND1   ,ONLY : JPIM     ,JPRB

USE TPM_GEN    ,ONLY : LALLOPERM
USE TPM_TRANS  ,ONLY : FOUBUF, FOUBUF_IN
USE TPM_DISTR  ,ONLY : D
USE TPM_FLT    ,ONLY : S

USE LTINV_MOD  ,ONLY : LTINV
USE TRMTOL_MOD ,ONLY : TRMTOL

IMPLICIT NONE

INTEGER(KIND=JPIM),INTENT(IN) :: KF_OUT_LT,KF_UV,KF_SCALARS,KF_SCDERS
REAL(KIND=JPRB) ,OPTIONAL, INTENT(IN)  :: PSPVOR(:,:)
REAL(KIND=JPRB) ,OPTIONAL, INTENT(IN)  :: PSPDIV(:,:)
REAL(KIND=JPRB) ,OPTIONAL, INTENT(IN)  :: PSPSCALAR(:,:)
REAL(KIND=JPRB) ,OPTIONAL, INTENT(IN)  :: PSPSC3A(:,:,:)
REAL(KIND=JPRB) ,OPTIONAL, INTENT(IN)  :: PSPSC3B(:,:,:)
REAL(KIND=JPRB) ,OPTIONAL, INTENT(IN)  :: PSPSC2(:,:)
INTEGER(KIND=JPIM),OPTIONAL,INTENT(IN) :: KFLDPTRUV(:)
INTEGER(KIND=JPIM),OPTIONAL,INTENT(IN) :: KFLDPTRSC(:)
EXTERNAL  FSPGL_PROC
OPTIONAL  FSPGL_PROC

INTEGER(KIND=JPIM) :: JM,IM,IBLEN,ILEI2,IDIM1

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

CALL GSTATS(102,0)
ILEI2 = 8*KF_UV + 2*KF_SCALARS + 2*KF_SCDERS
IDIM1 = 2*KF_OUT_LT
IBLEN = D%NLENGT0B*2*KF_OUT_LT
IF (ALLOCATED(FOUBUF)) THEN
  IF (MAX(1,IBLEN) > SIZE(FOUBUF)) THEN
    DEALLOCATE(FOUBUF)
    ALLOCATE(FOUBUF(MAX(1,IBLEN)))
  ENDIF
ELSE
  ALLOCATE(FOUBUF(MAX(1,IBLEN)))
ENDIF
IF (ALLOCATED(FOUBUF_IN)) THEN
  IF (MAX(1,IBLEN) > SIZE(FOUBUF_IN)) THEN
    DEALLOCATE(FOUBUF_IN)
    ALLOCATE(FOUBUF_IN(MAX(1,IBLEN)))
  ENDIF
ELSE
  ALLOCATE(FOUBUF_IN(MAX(1,IBLEN)))
  FOUBUF_IN(:) = 0
ENDIF

! Following switch necessary when latlon grids are used with different increments in NS and EW direction.
! Otherwise unassigned values will appear in output. This is very likely a bug (ATLAS-149)
IF (S%LDLL) THEN
  FOUBUF_IN(:) = 0
ENDIF

IF(KF_OUT_LT > 0) THEN
  CALL GSTATS(1647,0)

  !!!WARNING!!! Duplication of code besides the FSPGL_PROC argument.
              ! It seems that gfortran 10 does not retain the value
              ! of FSPGL_PROC within the OMP region.
  IF( PRESENT(FSPGL_PROC) ) THEN
    !$OMP PARALLEL DO SCHEDULE(DYNAMIC,1) PRIVATE(JM,IM)
    DO JM=1,D%NUMP
      IM = D%MYMS(JM)
      CALL LTINV(IM,JM,KF_OUT_LT,KF_UV,KF_SCALARS,KF_SCDERS,ILEI2,IDIM1,&
       & PSPVOR,PSPDIV,PSPSCALAR ,&
       & PSPSC3A,PSPSC3B,PSPSC2 , &
       & KFLDPTRUV,KFLDPTRSC,FSPGL_PROC)
    ENDDO
    !$OMP END PARALLEL DO
  ELSE
    !$OMP PARALLEL DO SCHEDULE(DYNAMIC,1) PRIVATE(JM,IM)
    DO JM=1,D%NUMP
      IM = D%MYMS(JM)
      CALL LTINV(IM,JM,KF_OUT_LT,KF_UV,KF_SCALARS,KF_SCDERS,ILEI2,IDIM1,&
       & PSPVOR,PSPDIV,PSPSCALAR ,&
       & PSPSC3A,PSPSC3B,PSPSC2 , &
       & KFLDPTRUV,KFLDPTRSC)
    ENDDO
    !$OMP END PARALLEL DO
  ENDIF
  CALL GSTATS(1647,1)
ENDIF

CALL GSTATS(102,1)

CALL GSTATS(152,0)
CALL TRMTOL(FOUBUF_IN,FOUBUF,2*KF_OUT_LT)
CALL GSTATS(152,1)
IF (.NOT.LALLOPERM) DEALLOCATE(FOUBUF_IN)
!     ------------------------------------------------------------------

END SUBROUTINE LTINV_CTL
END MODULE LTINV_CTL_MOD