GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: phylmd/rrtm/sump_trans_preleg_mod.F90 Lines: 0 66 0.0 %
Date: 2023-06-30 12:56:34 Branches: 0 160 0.0 %

Line Branch Exec Source
1
MODULE SUMP_TRANS_PRELEG_MOD
2
CONTAINS
3
SUBROUTINE SUMP_TRANS_PRELEG
4
5
! Set up distributed environment for the transform package (part 1)
6
7
USE PARKIND1  ,ONLY : JPIM     ,JPRB
8
9
USE TPM_GEN
10
USE TPM_DIM
11
USE TPM_DISTR
12
13
USE SUWAVEDI_MOD
14
USE ABORT_TRANS_MOD
15
16
IMPLICIT NONE
17
18
INTEGER(KIND=JPIM) :: JA,JJ,JM,JMLOC,ILATPP,IRESTL,IMLOC,IDT,INM
19
20
INTEGER(KIND=JPIM) :: IMYMS(R%NSMAX+1),INUMTPP(NPRTRW)
21
INTEGER(KIND=JPIM) :: IDUMI1,IDUMI2,IDUMI3
22
INTEGER(KIND=JPIM) :: IDUM2(0:R%NSMAX), IDUM3(NPRTRW+1), IDUM4(R%NSMAX+1)
23
24
LOGICAL :: LLP1,LLP2
25
26
!     ------------------------------------------------------------------
27
28
LLP1 = NPRINTLEV>0
29
LLP2 = NPRINTLEV>1
30
IF(LLP1) WRITE(NOUT,*) '=== ENTER ROUTINE SUMP_TRANS_PRELEG ==='
31
32
!*       1.    Initialize partitioning of wave numbers to PEs !
33
!             ----------------------------------------------
34
35
ALLOCATE(D%NASM0(0:R%NSMAX))
36
IF(LLP2)WRITE(NOUT,9) 'D%NASM0 ',SIZE(D%NASM0   ),SHAPE(D%NASM0   )
37
ALLOCATE(D%NATM0(0:R%NTMAX))
38
IF(LLP2)WRITE(NOUT,9) 'D%NATM0 ',SIZE(D%NATM0   ),SHAPE(D%NATM0   )
39
ALLOCATE(D%NUMPP(NPRTRW))
40
IF(LLP2)WRITE(NOUT,9) 'D%NUMPP ',SIZE(D%NUMPP   ),SHAPE(D%NUMPP   )
41
ALLOCATE(D%NPOSSP(NPRTRW+1))
42
IF(LLP2)WRITE(NOUT,9) 'D%NPOSSP',SIZE(D%NPOSSP  ),SHAPE(D%NPOSSP  )
43
ALLOCATE(D%NPROCM(0:R%NSMAX))
44
IF(LLP2)WRITE(NOUT,9) 'D%NPROCM',SIZE(D%NPROCM  ),SHAPE(D%NPROCM  )
45
ALLOCATE(D%NPTRMS(NPRTRW))
46
IF(LLP2)WRITE(NOUT,9) 'D%NPTRMS   ',SIZE(D%NPTRMS   ),SHAPE(D%NPTRMS   )
47
ALLOCATE(D%NALLMS(R%NSMAX+1))
48
IF(LLP2)WRITE(NOUT,9) 'D%NALLMS   ',SIZE(D%NALLMS   ),SHAPE(D%NALLMS   )
49
ALLOCATE(D%NDIM0G(0:R%NSMAX))
50
IF(LLP2)WRITE(NOUT,9) 'D%NDIM0G   ',SIZE(D%NDIM0G   ),SHAPE(D%NDIM0G   )
51
52
CALL SUWAVEDI(R%NSMAX,R%NTMAX,NPRTRW,MYSETW,&
53
    &D%NASM0,D%NSPOLEGL,D%NPROCM,D%NUMPP,&
54
    &D%NSPEC,D%NSPEC2,D%NSPEC2MX,D%NPOSSP,IMYMS,&
55
    &D%NPTRMS,D%NALLMS,D%NDIM0G)
56
CALL SUWAVEDI(R%NTMAX,R%NTMAX,NPRTRW,MYSETW,&
57
    &KASM0=D%NATM0,KUMPP=INUMTPP,KSPEC2=D%NTPEC2)
58
59
D%NUMP  = D%NUMPP (MYSETW)
60
ALLOCATE(D%MYMS(D%NUMP))
61
IF(LLP2)WRITE(NOUT,9) 'D%MYMS    ',SIZE(D%MYMS   ),SHAPE(D%MYMS   )
62
D%MYMS(:) = IMYMS(1:D%NUMP)
63
D%NUMTP = INUMTPP(MYSETW)
64
65
IF (D%NUMP == 0) THEN
66
  WRITE(NERR,'("SUMP: NPRTRW TOO LARGE FOR SPECTRAL RESOLUTION",/,&
67
  &"NOTE MAX VALUE FOR Tnnn CASE IS nnn+1",/,&
68
  &"MORE PROCESSORS CAN BE USED BY INCREASING NPRTRV")')
69
  CALL ABORT_TRANS('NPRTRW TOO LARGE FOR SPECTRAL RESOLUTION')
70
ENDIF
71
72
ALLOCATE(D%NLATLS(NPRTRW))
73
IF(LLP2)WRITE(NOUT,9) 'D%NLATLS',SIZE(D%NLATLS   ),SHAPE(D%NLATLS )
74
ALLOCATE(D%NLATLE(NPRTRW))
75
IF(LLP2)WRITE(NOUT,9) 'D%NLATLE',SIZE(D%NLATLE   ),SHAPE(D%NLATLE )
76
77
D%NLATLS(:) = 9999
78
D%NLATLE(:) = -1
79
80
ILATPP = R%NDGNH/NPRTRW
81
IRESTL  = R%NDGNH-NPRTRW*ILATPP
82
DO JA=1,NPRTRW
83
  IF (JA > IRESTL) THEN
84
    D%NLATLS(JA) = IRESTL*(ILATPP+1)+(JA-IRESTL-1)*ILATPP+1
85
    D%NLATLE(JA) = D%NLATLS(JA)+ILATPP-1
86
  ELSE
87
    D%NLATLS(JA) = (JA-1)*(ILATPP+1)+1
88
    D%NLATLE(JA) = D%NLATLS(JA)+ILATPP
89
  ENDIF
90
ENDDO
91
92
IF (LLP1) THEN
93
  WRITE(NOUT,'('' D%NLATLS '')')
94
  WRITE(NOUT,'(20(1X,I4))')(D%NLATLS(JJ),JJ=1,NPRTRW)
95
  WRITE(NOUT,'('' D%NLATLE '')')
96
  WRITE(NOUT,'(20(1X,I4))')(D%NLATLE(JJ),JJ=1,NPRTRW)
97
ENDIF
98
99
ALLOCATE(D%NPMT(0:R%NSMAX))
100
IF(LLP2)WRITE(NOUT,9) 'D%NPMT   ',SIZE(D%NPMT   ),SHAPE(D%NPMT   )
101
ALLOCATE(D%NPMS(0:R%NSMAX))
102
IF(LLP2)WRITE(NOUT,9) 'D%NPMS   ',SIZE(D%NPMS   ),SHAPE(D%NPMS   )
103
ALLOCATE(D%NPMG(0:R%NSMAX))
104
IF(LLP2)WRITE(NOUT,9) 'D%NPMG   ',SIZE(D%NPMG   ),SHAPE(D%NPMG   )
105
IDT = R%NTMAX-R%NSMAX
106
INM = 0
107
DO JMLOC=1,D%NUMP
108
  IMLOC = D%MYMS(JMLOC)
109
  D%NPMT(IMLOC) = INM
110
  D%NPMS(IMLOC) = INM+IDT
111
  INM = INM+R%NTMAX+2-IMLOC
112
ENDDO
113
INM = 0
114
DO JM=0,R%NSMAX
115
  D%NPMG(JM) = INM
116
  INM = INM+R%NTMAX+2-JM
117
ENDDO
118
119
D%NLEI3D = (R%NLEI3-1)/NPRTRW+1
120
121
!     ------------------------------------------------------------------
122
9 FORMAT(1X,'ARRAY ',A10,' ALLOCATED ',8I8)
123
124
END SUBROUTINE SUMP_TRANS_PRELEG
125
END MODULE SUMP_TRANS_PRELEG_MOD