dir_trans_ctlad_mod.F90 Source File


This file depends on

sourcefile~~dir_trans_ctlad_mod.f90~~EfferentGraph sourcefile~dir_trans_ctlad_mod.f90 dir_trans_ctlad_mod.F90 sourcefile~field_split_mod.f90 field_split_mod.F90 sourcefile~dir_trans_ctlad_mod.f90->sourcefile~field_split_mod.f90 sourcefile~ftdir_ctlad_mod.f90 ftdir_ctlad_mod.F90 sourcefile~dir_trans_ctlad_mod.f90->sourcefile~ftdir_ctlad_mod.f90 sourcefile~ltdir_ctlad_mod.f90 ltdir_ctlad_mod.F90 sourcefile~dir_trans_ctlad_mod.f90->sourcefile~ltdir_ctlad_mod.f90 sourcefile~shuffle_mod.f90 shuffle_mod.F90 sourcefile~dir_trans_ctlad_mod.f90->sourcefile~shuffle_mod.f90 sourcefile~tpm_gen.f90 tpm_gen.F90 sourcefile~dir_trans_ctlad_mod.f90->sourcefile~tpm_gen.f90 sourcefile~field_split_mod.f90->sourcefile~tpm_gen.f90 sourcefile~tpm_distr.f90 tpm_distr.F90 sourcefile~field_split_mod.f90->sourcefile~tpm_distr.f90 sourcefile~ftdir_ctlad_mod.f90->sourcefile~tpm_gen.f90 sourcefile~fourier_outad_mod.f90 fourier_outad_mod.F90 sourcefile~ftdir_ctlad_mod.f90->sourcefile~fourier_outad_mod.f90 sourcefile~ftdirad_mod.f90 ftdirad_mod.F90 sourcefile~ftdir_ctlad_mod.f90->sourcefile~ftdirad_mod.f90 sourcefile~ftdir_ctlad_mod.f90->sourcefile~tpm_distr.f90 sourcefile~trltog_mod.f90 trltog_mod.F90 sourcefile~ftdir_ctlad_mod.f90->sourcefile~trltog_mod.f90 sourcefile~ltdir_ctlad_mod.f90->sourcefile~tpm_gen.f90 sourcefile~ltdirad_mod.f90 ltdirad_mod.F90 sourcefile~ltdir_ctlad_mod.f90->sourcefile~ltdirad_mod.f90 sourcefile~ltdir_ctlad_mod.f90->sourcefile~tpm_distr.f90 sourcefile~tpm_trans.f90 tpm_trans.F90 sourcefile~ltdir_ctlad_mod.f90->sourcefile~tpm_trans.f90 sourcefile~trmtol_mod.f90 trmtol_mod.F90 sourcefile~ltdir_ctlad_mod.f90->sourcefile~trmtol_mod.f90 sourcefile~shuffle_mod.f90->sourcefile~tpm_distr.f90 sourcefile~parkind_ectrans.f90 parkind_ectrans.F90 sourcefile~tpm_gen.f90->sourcefile~parkind_ectrans.f90 sourcefile~fourier_outad_mod.f90->sourcefile~tpm_distr.f90 sourcefile~fourier_outad_mod.f90->sourcefile~tpm_trans.f90 sourcefile~tpm_geometry.f90 tpm_geometry.F90 sourcefile~fourier_outad_mod.f90->sourcefile~tpm_geometry.f90 sourcefile~ftdirad_mod.f90->sourcefile~tpm_distr.f90 sourcefile~tpm_dim.f90 tpm_dim.F90 sourcefile~ftdirad_mod.f90->sourcefile~tpm_dim.f90 sourcefile~tpm_fftw.f90 tpm_fftw.F90 sourcefile~ftdirad_mod.f90->sourcefile~tpm_fftw.f90 sourcefile~ftdirad_mod.f90->sourcefile~tpm_geometry.f90 sourcefile~ldfou2ad_mod.f90 ldfou2ad_mod.F90 sourcefile~ltdirad_mod.f90->sourcefile~ldfou2ad_mod.f90 sourcefile~ledirad_mod.f90 ledirad_mod.F90 sourcefile~ltdirad_mod.f90->sourcefile~ledirad_mod.f90 sourcefile~prepsnm_mod.f90 prepsnm_mod.F90 sourcefile~ltdirad_mod.f90->sourcefile~prepsnm_mod.f90 sourcefile~prfi2ad_mod.f90 prfi2ad_mod.F90 sourcefile~ltdirad_mod.f90->sourcefile~prfi2ad_mod.f90 sourcefile~ltdirad_mod.f90->sourcefile~tpm_dim.f90 sourcefile~ltdirad_mod.f90->sourcefile~tpm_geometry.f90 sourcefile~updspad_mod.f90 updspad_mod.F90 sourcefile~ltdirad_mod.f90->sourcefile~updspad_mod.f90 sourcefile~uvtvdad_mod.f90 uvtvdad_mod.F90 sourcefile~ltdirad_mod.f90->sourcefile~uvtvdad_mod.f90 sourcefile~tpm_trans.f90->sourcefile~parkind_ectrans.f90 sourcefile~growing_allocator_mod.f90 growing_allocator_mod.F90 sourcefile~tpm_trans.f90->sourcefile~growing_allocator_mod.f90 sourcefile~trltog_mod.f90->sourcefile~tpm_gen.f90 sourcefile~trltog_mod.f90->sourcefile~parkind_ectrans.f90 sourcefile~trltog_mod.f90->sourcefile~tpm_distr.f90 sourcefile~trltog_mod.f90->sourcefile~tpm_trans.f90 sourcefile~abort_trans_mod.f90 abort_trans_mod.F90 sourcefile~trltog_mod.f90->sourcefile~abort_trans_mod.f90 sourcefile~buffered_allocator_mod.f90 buffered_allocator_mod.F90 sourcefile~trltog_mod.f90->sourcefile~buffered_allocator_mod.f90 sourcefile~eq_regions_mod.f90 eq_regions_mod.F90 sourcefile~trltog_mod.f90->sourcefile~eq_regions_mod.f90 sourcefile~ext_acc.f90 ext_acc.F90 sourcefile~trltog_mod.f90->sourcefile~ext_acc.f90 sourcefile~pe2set_mod.f90 pe2set_mod.F90 sourcefile~trltog_mod.f90->sourcefile~pe2set_mod.f90 sourcefile~tpm_stats.f90 tpm_stats.F90 sourcefile~trltog_mod.f90->sourcefile~tpm_stats.f90 sourcefile~trmtol_mod.f90->sourcefile~tpm_gen.f90 sourcefile~trmtol_mod.f90->sourcefile~parkind_ectrans.f90 sourcefile~trmtol_mod.f90->sourcefile~tpm_distr.f90 sourcefile~trmtol_mod.f90->sourcefile~buffered_allocator_mod.f90 sourcefile~trmtol_mod.f90->sourcefile~tpm_stats.f90 sourcefile~abort_trans_mod.f90->sourcefile~tpm_gen.f90 sourcefile~abort_trans_mod.f90->sourcefile~tpm_distr.f90 sourcefile~buffered_allocator_mod.f90->sourcefile~parkind_ectrans.f90 sourcefile~buffered_allocator_mod.f90->sourcefile~abort_trans_mod.f90 sourcefile~buffered_allocator_mod.f90->sourcefile~growing_allocator_mod.f90 sourcefile~eq_regions_mod.f90->sourcefile~parkind_ectrans.f90 sourcefile~ldfou2ad_mod.f90->sourcefile~tpm_dim.f90 sourcefile~ldfou2ad_mod.f90->sourcefile~tpm_geometry.f90 sourcefile~tpm_fields.f90 tpm_fields.F90 sourcefile~ldfou2ad_mod.f90->sourcefile~tpm_fields.f90 sourcefile~ledirad_mod.f90->sourcefile~tpm_dim.f90 sourcefile~ledirad_mod.f90->sourcefile~tpm_geometry.f90 sourcefile~butterfly_alg_mod.f90 butterfly_alg_mod.F90 sourcefile~ledirad_mod.f90->sourcefile~butterfly_alg_mod.f90 sourcefile~ectrans_blas_mod.f90 ectrans_blas_mod.F90 sourcefile~ledirad_mod.f90->sourcefile~ectrans_blas_mod.f90 sourcefile~ledirad_mod.f90->sourcefile~tpm_fields.f90 sourcefile~tpm_flt.f90 tpm_flt.F90 sourcefile~ledirad_mod.f90->sourcefile~tpm_flt.f90 sourcefile~pe2set_mod.f90->sourcefile~tpm_distr.f90 sourcefile~pe2set_mod.f90->sourcefile~abort_trans_mod.f90 sourcefile~pe2set_mod.f90->sourcefile~eq_regions_mod.f90 sourcefile~prepsnm_mod.f90->sourcefile~tpm_gen.f90 sourcefile~prepsnm_mod.f90->sourcefile~parkind_ectrans.f90 sourcefile~prepsnm_mod.f90->sourcefile~tpm_distr.f90 sourcefile~prepsnm_mod.f90->sourcefile~tpm_dim.f90 sourcefile~prepsnm_mod.f90->sourcefile~tpm_fields.f90 sourcefile~prfi2bad_mod.f90 prfi2bad_mod.F90 sourcefile~prfi2ad_mod.f90->sourcefile~prfi2bad_mod.f90 sourcefile~tpm_geometry.f90->sourcefile~parkind_ectrans.f90 sourcefile~tpm_stats.f90->sourcefile~parkind_ectrans.f90 sourcefile~updspad_mod.f90->sourcefile~tpm_distr.f90 sourcefile~updspad_mod.f90->sourcefile~tpm_trans.f90 sourcefile~updspad_mod.f90->sourcefile~tpm_dim.f90 sourcefile~updspbad_mod.f90 updspbad_mod.F90 sourcefile~updspad_mod.f90->sourcefile~updspbad_mod.f90 sourcefile~uvtvdad_mod.f90->sourcefile~tpm_dim.f90 sourcefile~uvtvdad_mod.f90->sourcefile~tpm_fields.f90 sourcefile~butterfly_alg_mod.f90->sourcefile~ectrans_blas_mod.f90 sourcefile~interpol_decomp_mod.f90 interpol_decomp_mod.F90 sourcefile~butterfly_alg_mod.f90->sourcefile~interpol_decomp_mod.f90 sourcefile~sharedmem_mod.f90 sharedmem_mod.F90 sourcefile~butterfly_alg_mod.f90->sourcefile~sharedmem_mod.f90 sourcefile~prfi2bad_mod.f90->sourcefile~tpm_distr.f90 sourcefile~prfi2bad_mod.f90->sourcefile~tpm_trans.f90 sourcefile~prfi2bad_mod.f90->sourcefile~tpm_dim.f90 sourcefile~prfi2bad_mod.f90->sourcefile~tpm_geometry.f90 sourcefile~tpm_fields.f90->sourcefile~parkind_ectrans.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~updspbad_mod.f90->sourcefile~tpm_distr.f90 sourcefile~updspbad_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~wts500_mod.f90->sourcefile~parkind_ectrans.f90

Files dependent on this one

sourcefile~~dir_trans_ctlad_mod.f90~~AfferentGraph sourcefile~dir_trans_ctlad_mod.f90 dir_trans_ctlad_mod.F90 sourcefile~dir_transad.f90~2 dir_transad.F90 sourcefile~dir_transad.f90~2->sourcefile~dir_trans_ctlad_mod.f90

Source Code

! (C) Copyright 2001- ECMWF.
! (C) Copyright 2001- 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 DIR_TRANS_CTLAD_MOD
CONTAINS
SUBROUTINE DIR_TRANS_CTLAD(KF_UV_G,KF_SCALARS_G,KF_GP,KF_FS,KF_UV,KF_SCALARS,&
 & PSPVOR,PSPDIV,PSPSCALAR,KVSETUV,KVSETSC,PGP,&
 & PSPSC3A,PSPSC3B,PSPSC2,KVSETSC3A,KVSETSC3B,KVSETSC2,PGPUV,PGP3A,PGP3B,PGP2)

!**** *DIR_TRANS_CTLAD* - Control routine for direct spectral transform-adj.

!     Purpose.
!     --------
!        Control routine for the direct spectral transform

!**   Interface.
!     ----------
!     CALL DIR_TRANS_CTLAD(...)

!     Explicit arguments :
!     --------------------
!     KF_UV_G      - global number of spectral u-v fields
!     KF_SCALARS_G - global number of scalar spectral fields
!     KF_GP        - total number of output gridpoint fields
!     KF_FS        - total number of fields in fourier space
!     KF_UV        - local number of spectral u-v fields
!     KF_SCALARS   - local number of scalar spectral fields
!     PSPVOR(:,:)  - spectral vorticity
!     PSPDIV(:,:)  - spectral divergence
!     PSPSCALAR(:,:) - spectral scalarvalued fields
!     KVSETUV(:)  - indicating which 'b-set' in spectral space owns a
!                   vor/div field. Equivalant to NBSETLEV in the IFS.
!                   The length of KVSETUV should be the GLOBAL number
!                   of u/v fields which is the dimension of u and v releated
!                   fields in grid-point space.
!     KVESETSC(:) - indicating which 'b-set' in spectral space owns a
!                   scalar field. As for KVSETUV this argument is required
!                   if the total number of processors is greater than
!                   the number of processors used for distribution in
!                   spectral wave space.
!     PGP(:,:,:)  - gridpoint fields

!                  The ordering of the output fields is as follows (all
!                  parts are optional depending on the input switches):

!       u             : KF_UV_G fields
!       v             : KF_UV_G fields
!       scalar fields : KF_SCALARS_G fields

!     Method.
!     -------

!     Externals.  SHUFFLE     - reshuffle fields for load balancing
!     ----------  FIELD_SPLIT - split fields in NPROMATR packets
!                 LTDIR_CTLAD   - control of Legendre transform
!                 FTDIR_CTLAD   - control of Fourier transform

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

!     Modifications.
!     --------------
!        Original : 01-01-03

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

USE PARKIND1  ,ONLY : JPIM     ,JPRB
USE TPM_GEN         ,ONLY : NPROMATR

USE SHUFFLE_MOD     ,ONLY : SHUFFLE
USE FIELD_SPLIT_MOD ,ONLY : FIELD_SPLIT
USE LTDIR_CTLAD_MOD ,ONLY : LTDIR_CTLAD
USE FTDIR_CTLAD_MOD ,ONLY : FTDIR_CTLAD
!

IMPLICIT NONE

! Declaration of arguments

INTEGER(KIND=JPIM), INTENT(IN) :: KF_UV_G
INTEGER(KIND=JPIM), INTENT(IN) :: KF_SCALARS_G
INTEGER(KIND=JPIM), INTENT(IN) :: KF_GP
INTEGER(KIND=JPIM), INTENT(IN) :: KF_FS
INTEGER(KIND=JPIM), INTENT(IN) :: KF_UV
INTEGER(KIND=JPIM), INTENT(IN) :: KF_SCALARS
REAL(KIND=JPRB)    ,OPTIONAL, INTENT(INOUT) :: PSPVOR(:,:)
REAL(KIND=JPRB)    ,OPTIONAL, INTENT(INOUT) :: PSPDIV(:,:)
REAL(KIND=JPRB)    ,OPTIONAL, INTENT(INOUT) :: PSPSCALAR(:,:)
REAL(KIND=JPRB)    ,OPTIONAL, INTENT(INOUT) :: PSPSC3A(:,:,:)
REAL(KIND=JPRB)    ,OPTIONAL, INTENT(INOUT) :: PSPSC3B(:,:,:)
REAL(KIND=JPRB)    ,OPTIONAL, INTENT(INOUT) :: PSPSC2(:,:)
INTEGER(KIND=JPIM) ,OPTIONAL, INTENT(IN)    :: KVSETUV(:)
INTEGER(KIND=JPIM) ,OPTIONAL, INTENT(IN)    :: KVSETSC(:)
INTEGER(KIND=JPIM) ,OPTIONAL, INTENT(IN)    :: KVSETSC3A(:)
INTEGER(KIND=JPIM) ,OPTIONAL, INTENT(IN)    :: KVSETSC3B(:)
INTEGER(KIND=JPIM) ,OPTIONAL, INTENT(IN)    :: KVSETSC2(:)
REAL(KIND=JPRB)    ,OPTIONAL, INTENT(OUT)   :: PGP(:,:,:)
REAL(KIND=JPRB)    ,OPTIONAL, INTENT(OUT)   :: PGPUV(:,:,:,:)
REAL(KIND=JPRB)    ,OPTIONAL, INTENT(OUT)   :: PGP3A(:,:,:,:)
REAL(KIND=JPRB)    ,OPTIONAL, INTENT(OUT)   :: PGP3B(:,:,:,:)
REAL(KIND=JPRB)    ,OPTIONAL, INTENT(OUT)   :: PGP2(:,:,:)

! Local variables

INTEGER(KIND=JPIM) :: IPTRGP(KF_GP),IPTRSPUV(NPROMATR),IPTRSPSC(NPROMATR)
INTEGER(KIND=JPIM) :: ISHFUV_G(KF_GP),ISHFSC_G(KF_GP)
INTEGER(KIND=JPIM) :: IVSETUV(KF_GP),IVSETSC(KF_GP)
INTEGER(KIND=JPIM) :: IBLKS,JBLK,ISTUV_G,IENUV_G
INTEGER(KIND=JPIM) :: IF_UV_G,IF_UV,ISTUV,IF_SCALARS,IF_SCALARS_G,IF_FS,IF_GP
INTEGER(KIND=JPIM) :: JFLD,ISTSC_G,IENSC_G,ISTSC,IENSC,IENUV,IF_GPB


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

! Perform transform

IF_GPB = 2*KF_UV_G+KF_SCALARS_G
IF(NPROMATR > 0 .AND. IF_GPB > NPROMATR) THEN

  ! Fields to be split into packets

  CALL SHUFFLE(KF_UV_G,KF_SCALARS_G,ISHFUV_G,IVSETUV,ISHFSC_G,IVSETSC,&
 & KVSETUV,KVSETSC)

  IBLKS=(IF_GPB-1)/NPROMATR+1

  DO JBLK=1,IBLKS
  
    CALL FIELD_SPLIT(JBLK,KF_GP,KF_UV_G,IVSETUV,IVSETSC,&
     & ISTUV_G,IENUV_G,IF_UV_G,ISTSC_G,IENSC_G,IF_SCALARS_G,&
     & ISTUV,IENUV,IF_UV,ISTSC,IENSC,IF_SCALARS)

    IF_FS = 2*IF_UV + IF_SCALARS
    IF_GP = 2*IF_UV_G+IF_SCALARS_G
    DO JFLD=1,IF_UV_G
      IPTRGP(JFLD) = ISHFUV_G(ISTUV_G+JFLD-1)
      IPTRGP(JFLD+IF_UV_G) = KF_UV_G+ISHFUV_G(ISTUV_G+JFLD-1)
    ENDDO
    DO JFLD=1,IF_SCALARS_G
      IPTRGP(JFLD+2*IF_UV_G) = 2*KF_UV_G+ISHFSC_G(ISTSC_G+JFLD-1)
    ENDDO
    DO JFLD=1,IF_UV
      IPTRSPUV(JFLD) = ISTUV+JFLD-1
    ENDDO
    DO JFLD=1,IF_SCALARS
      IPTRSPSC(JFLD) = ISTSC+JFLD-1
    ENDDO

    CALL LTDIR_CTLAD(IF_FS,IF_UV,IF_SCALARS, &
     & PSPVOR=PSPVOR,PSPDIV=PSPDIV,PSPSCALAR=PSPSCALAR,&
     & KFLDPTRUV=IPTRSPUV,KFLDPTRSC=IPTRSPSC)
    IF(IF_UV_G > 0 .AND. IF_SCALARS_G > 0) THEN
      CALL FTDIR_CTLAD(IF_UV_G,IF_SCALARS_G,IF_GP,IF_FS,&
       & KVSETUV=IVSETUV(ISTUV_G:IENUV_G),&
       & KVSETSC=IVSETSC(ISTSC_G:IENSC_G),KPTRGP=IPTRGP,PGP=PGP)
    ELSEIF(IF_UV_G > 0) THEN
      CALL FTDIR_CTLAD(IF_UV_G,IF_SCALARS_G,IF_GP,IF_FS,&
       & KVSETUV=IVSETUV(ISTUV_G:IENUV_G),&
       & KPTRGP=IPTRGP,PGP=PGP)
    ELSEIF(IF_SCALARS_G > 0) THEN
      CALL FTDIR_CTLAD(IF_UV_G,IF_SCALARS_G,IF_GP,IF_FS,&
       & KVSETSC=IVSETSC(ISTSC_G:IENSC_G),KPTRGP=IPTRGP,PGP=PGP)
    ENDIF
  ENDDO

ELSE

  ! No splitting of fields, transform done in one go

  CALL LTDIR_CTLAD(KF_FS,KF_UV,KF_SCALARS, &
   &PSPVOR=PSPVOR,PSPDIV=PSPDIV,PSPSCALAR=PSPSCALAR,&
   &PSPSC3A=PSPSC3A,PSPSC3B=PSPSC3B,PSPSC2=PSPSC2)

  CALL FTDIR_CTLAD(KF_UV_G,KF_SCALARS_G,KF_GP,KF_FS,&
   & KVSETUV=KVSETUV,KVSETSC=KVSETSC,&
   & KVSETSC3A=KVSETSC3A,KVSETSC3B=KVSETSC3B,KVSETSC2=KVSETSC2,&
   & PGP=PGP,PGPUV=PGPUV,PGP3A=PGP3A,PGP3B=PGP3B,PGP2=PGP2)

ENDIF

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

END SUBROUTINE DIR_TRANS_CTLAD
END MODULE DIR_TRANS_CTLAD_MOD