pe2set_mod.F90 Source File


This file depends on

sourcefile~~pe2set_mod.f90~~EfferentGraph sourcefile~pe2set_mod.f90 pe2set_mod.F90 sourcefile~abort_trans_mod.f90 abort_trans_mod.F90 sourcefile~pe2set_mod.f90->sourcefile~abort_trans_mod.f90 sourcefile~eq_regions_mod.f90 eq_regions_mod.F90 sourcefile~pe2set_mod.f90->sourcefile~eq_regions_mod.f90 sourcefile~tpm_distr.f90 tpm_distr.F90 sourcefile~pe2set_mod.f90->sourcefile~tpm_distr.f90 sourcefile~abort_trans_mod.f90->sourcefile~tpm_distr.f90 sourcefile~tpm_gen.f90 tpm_gen.F90 sourcefile~abort_trans_mod.f90->sourcefile~tpm_gen.f90 sourcefile~parkind_ectrans.f90 parkind_ectrans.F90 sourcefile~eq_regions_mod.f90->sourcefile~parkind_ectrans.f90 sourcefile~tpm_gen.f90->sourcefile~parkind_ectrans.f90

Files dependent on this one

sourcefile~~pe2set_mod.f90~~AfferentGraph sourcefile~pe2set_mod.f90 pe2set_mod.F90 sourcefile~spnormc_mod.f90 spnormc_mod.F90 sourcefile~spnormc_mod.f90->sourcefile~pe2set_mod.f90 sourcefile~spnormc_mod.f90~2 spnormc_mod.F90 sourcefile~spnormc_mod.f90~2->sourcefile~pe2set_mod.f90 sourcefile~sump_trans0_mod.f90 sump_trans0_mod.F90 sourcefile~sump_trans0_mod.f90->sourcefile~pe2set_mod.f90 sourcefile~sump_trans0_mod.f90~2 sump_trans0_mod.F90 sourcefile~sump_trans0_mod.f90~2->sourcefile~pe2set_mod.f90 sourcefile~trgtol_mod.f90 trgtol_mod.F90 sourcefile~trgtol_mod.f90->sourcefile~pe2set_mod.f90 sourcefile~trgtol_mod.f90~2 trgtol_mod.F90 sourcefile~trgtol_mod.f90~2->sourcefile~pe2set_mod.f90 sourcefile~trltog_mod.f90 trltog_mod.F90 sourcefile~trltog_mod.f90->sourcefile~pe2set_mod.f90 sourcefile~trltog_mod.f90~2 trltog_mod.F90 sourcefile~trltog_mod.f90~2->sourcefile~pe2set_mod.f90 sourcefile~dir_trans_ctl_mod.f90 dir_trans_ctl_mod.F90 sourcefile~dir_trans_ctl_mod.f90->sourcefile~trgtol_mod.f90 sourcefile~ftdir_ctl_mod.f90 ftdir_ctl_mod.F90 sourcefile~ftdir_ctl_mod.f90->sourcefile~trgtol_mod.f90 sourcefile~ftdir_ctlad_mod.f90 ftdir_ctlad_mod.F90 sourcefile~ftdir_ctlad_mod.f90->sourcefile~trltog_mod.f90 sourcefile~ftinv_ctl_mod.f90 ftinv_ctl_mod.F90 sourcefile~ftinv_ctl_mod.f90->sourcefile~trltog_mod.f90 sourcefile~ftinv_ctlad_mod.f90 ftinv_ctlad_mod.F90 sourcefile~ftinv_ctlad_mod.f90->sourcefile~trgtol_mod.f90 sourcefile~gpnorm_trans.f90 gpnorm_trans.F90 sourcefile~gpnorm_trans.f90->sourcefile~trgtol_mod.f90 sourcefile~gpnorm_trans_ctl_mod.f90 gpnorm_trans_ctl_mod.F90 sourcefile~gpnorm_trans_ctl_mod.f90->sourcefile~trgtol_mod.f90 sourcefile~gpnorm_trans_gpu.f90 gpnorm_trans_gpu.F90 sourcefile~gpnorm_trans_gpu.f90->sourcefile~trgtol_mod.f90 sourcefile~inv_trans_ctl_mod.f90 inv_trans_ctl_mod.F90 sourcefile~inv_trans_ctl_mod.f90->sourcefile~trltog_mod.f90 sourcefile~setup_trans0.f90 setup_trans0.F90 sourcefile~setup_trans0.f90->sourcefile~sump_trans0_mod.f90 sourcefile~setup_trans0.f90~2 setup_trans0.F90 sourcefile~setup_trans0.f90~2->sourcefile~sump_trans0_mod.f90 sourcefile~spnorm_ctl_mod.f90 spnorm_ctl_mod.F90 sourcefile~spnorm_ctl_mod.f90->sourcefile~spnormc_mod.f90 sourcefile~spnorm_ctl_mod.f90~2 spnorm_ctl_mod.F90 sourcefile~spnorm_ctl_mod.f90~2->sourcefile~spnormc_mod.f90 sourcefile~dir_trans.f90 dir_trans.F90 sourcefile~dir_trans.f90->sourcefile~dir_trans_ctl_mod.f90 sourcefile~dir_trans.f90~2 dir_trans.F90 sourcefile~dir_trans.f90~2->sourcefile~dir_trans_ctl_mod.f90 sourcefile~dir_trans_ctl_mod.f90~2 dir_trans_ctl_mod.F90 sourcefile~dir_trans_ctl_mod.f90~2->sourcefile~ftdir_ctl_mod.f90 sourcefile~dir_trans_ctlad_mod.f90 dir_trans_ctlad_mod.F90 sourcefile~dir_trans_ctlad_mod.f90->sourcefile~ftdir_ctlad_mod.f90 sourcefile~gpnorm_trans.f90~2 gpnorm_trans.F90 sourcefile~gpnorm_trans.f90~2->sourcefile~gpnorm_trans_ctl_mod.f90 sourcefile~inv_trans.f90 inv_trans.F90 sourcefile~inv_trans.f90->sourcefile~inv_trans_ctl_mod.f90 sourcefile~inv_trans.f90~2 inv_trans.F90 sourcefile~inv_trans.f90~2->sourcefile~inv_trans_ctl_mod.f90 sourcefile~inv_trans_ctl_mod.f90~2 inv_trans_ctl_mod.F90 sourcefile~inv_trans_ctl_mod.f90~2->sourcefile~ftinv_ctl_mod.f90 sourcefile~inv_trans_ctlad_mod.f90 inv_trans_ctlad_mod.F90 sourcefile~inv_trans_ctlad_mod.f90->sourcefile~ftinv_ctlad_mod.f90 sourcefile~specnorm.f90 specnorm.F90 sourcefile~specnorm.f90->sourcefile~spnorm_ctl_mod.f90 sourcefile~specnorm.f90~2 specnorm.F90 sourcefile~specnorm.f90~2->sourcefile~spnorm_ctl_mod.f90 sourcefile~dir_transad.f90~2 dir_transad.F90 sourcefile~dir_transad.f90~2->sourcefile~dir_trans_ctlad_mod.f90 sourcefile~inv_transad.f90~2 inv_transad.F90 sourcefile~inv_transad.f90~2->sourcefile~inv_trans_ctlad_mod.f90

Source Code

! (C) Copyright 1998- ECMWF.
! (C) Copyright 1998- 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 PE2SET_MOD
CONTAINS
SUBROUTINE PE2SET(KPE,KPRGPNS,KPRGPEW,KPRTRW,KPRTRV)


!**** *PE2SET* - Convert from PE number to set numbers

!     Purpose.
!     --------
!        Convert from PE number to set numbers in both
!                  grid-point space and spectral space

!**   Interface.
!     ----------
!        *CALL* *PE2SET(KPE,KPRGPNS,KPRGPEW,KPRTRW,KPRTRV)

!        Explicit arguments :
!        --------------------
!                  input:   KPE     - integer processor number
!                                     in the range 1 .. NPROC
!                  output:  KPRGPNS - integer A set number in grid space
!                                     in the range 1 .. NPRGPNS
!                           KPRGPEW - integer B set number in grid space
!                                     in the range 1 .. NPRGPEW
!                           KPRTRW  - integer A set number in spectral space
!                                     in the range 1 .. NPRTRW
!                           KPRTRV  - integer B set number in spectral space
!                                     in the range 1 .. NPRTRV

!        Implicit arguments :  YOMMP parameters
!                              NPRGPNS,NPRGPEW,NPRTRW,NPRTRV,NPROC

!        --------------------
!     Method.
!     -------

!        PE allocation order is row oriented (e.g. NPRGPNS or NPRTRW = 4):

!                1  2  3  4
!                5  6  7  8
!                9 10 11 12
!               13 14 15 16
!                .  .  .  .

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

!     Reference.
!     ----------
!        ECMWF Research Department documentation of the IFS

!     Author.
!     -------
!        David Dent *ECMWF*

!     Modifications.
!     --------------
!        Original : 98-08-19
!        Revision : 98-10-13 row ordering
!     ------------------------------------------------------------------

USE PARKIND1        ,ONLY : JPIM     ,JPRB

USE TPM_DISTR       ,ONLY : LEQ_REGIONS, NPRGPEW, NPROC, NPRTRV
USE EQ_REGIONS_MOD  ,ONLY : N_REGIONS, N_REGIONS_NS
USE ABORT_TRANS_MOD ,ONLY : ABORT_TRANS
!

IMPLICIT NONE
INTEGER(KIND=JPIM),INTENT(IN)  :: KPE
INTEGER(KIND=JPIM),INTENT(OUT) :: KPRGPNS,KPRGPEW,KPRTRW,KPRTRV

INTEGER(KIND=JPIM) :: IPE,JA
!     ------------------------------------------------------------------

!*       1.    Check input argument for validity
!              ---------------------------------

IF(KPE <= 0.OR.KPE > NPROC) THEN
  WRITE(*,'(A,2I8)') ' PE2SET INVALID ARGUMENT ',KPE,NPROC
  CALL ABORT_TRANS(' PE2SET INVALID ARGUMENT ')

ELSE

!*       2.    Compute output parameters
!              -------------------------

  IF( LEQ_REGIONS )THEN
    KPRGPNS=1
    IPE=KPE
    DO JA=1,N_REGIONS_NS
      IF( IPE > N_REGIONS(JA) )THEN
        IPE=IPE-N_REGIONS(JA)
        KPRGPNS=KPRGPNS+1
        CYCLE
      ENDIF
      KPRGPEW=IPE
      EXIT
    ENDDO
  ELSE
    KPRGPEW=MOD(KPE-1,NPRGPEW)+1
    KPRGPNS=(KPE-1)/NPRGPEW+1
  ENDIF
  KPRTRV =MOD(KPE-1,NPRTRV)+1
  KPRTRW =(KPE-1)/NPRTRV+1

ENDIF

END SUBROUTINE PE2SET
END MODULE PE2SET_MOD