source: LMDZ5/trunk/libf/phylmd/rrtm/sump_trans_preleg_mod.F90 @ 4799

Last change on this file since 4799 was 1990, checked in by Laurent Fairhead, 11 years ago

Corrections à la version r1989 pour permettre la compilation avec RRTM
Inclusion de la licence CeCILL_V2 pour RRTM


Changes to revision r1989 to enable RRTM code compilation
RRTM part put under CeCILL_V2 licence

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
File size: 3.7 KB
Line 
1MODULE SUMP_TRANS_PRELEG_MOD
2CONTAINS
3SUBROUTINE SUMP_TRANS_PRELEG
4
5! Set up distributed environment for the transform package (part 1)
6
7USE PARKIND1  ,ONLY : JPIM     ,JPRB
8
9USE TPM_GEN
10USE TPM_DIM
11USE TPM_DISTR
12
13USE SUWAVEDI_MOD
14USE ABORT_TRANS_MOD
15
16IMPLICIT NONE
17
18INTEGER(KIND=JPIM) :: JA,JJ,JM,JMLOC,ILATPP,IRESTL,IMLOC,IDT,INM
19
20INTEGER(KIND=JPIM) :: IMYMS(R%NSMAX+1),INUMTPP(NPRTRW)
21INTEGER(KIND=JPIM) :: IDUMI1,IDUMI2,IDUMI3
22INTEGER(KIND=JPIM) :: IDUM2(0:R%NSMAX), IDUM3(NPRTRW+1), IDUM4(R%NSMAX+1)
23
24LOGICAL :: LLP1,LLP2
25
26!     ------------------------------------------------------------------
27
28LLP1 = NPRINTLEV>0
29LLP2 = NPRINTLEV>1
30IF(LLP1) WRITE(NOUT,*) '=== ENTER ROUTINE SUMP_TRANS_PRELEG ==='
31
32!*       1.    Initialize partitioning of wave numbers to PEs !
33!             ----------------------------------------------
34
35ALLOCATE(D%NASM0(0:R%NSMAX))
36IF(LLP2)WRITE(NOUT,9) 'D%NASM0 ',SIZE(D%NASM0   ),SHAPE(D%NASM0   )
37ALLOCATE(D%NATM0(0:R%NTMAX))
38IF(LLP2)WRITE(NOUT,9) 'D%NATM0 ',SIZE(D%NATM0   ),SHAPE(D%NATM0   )
39ALLOCATE(D%NUMPP(NPRTRW))
40IF(LLP2)WRITE(NOUT,9) 'D%NUMPP ',SIZE(D%NUMPP   ),SHAPE(D%NUMPP   )
41ALLOCATE(D%NPOSSP(NPRTRW+1))
42IF(LLP2)WRITE(NOUT,9) 'D%NPOSSP',SIZE(D%NPOSSP  ),SHAPE(D%NPOSSP  )
43ALLOCATE(D%NPROCM(0:R%NSMAX))
44IF(LLP2)WRITE(NOUT,9) 'D%NPROCM',SIZE(D%NPROCM  ),SHAPE(D%NPROCM  )
45ALLOCATE(D%NPTRMS(NPRTRW))
46IF(LLP2)WRITE(NOUT,9) 'D%NPTRMS   ',SIZE(D%NPTRMS   ),SHAPE(D%NPTRMS   )
47ALLOCATE(D%NALLMS(R%NSMAX+1))
48IF(LLP2)WRITE(NOUT,9) 'D%NALLMS   ',SIZE(D%NALLMS   ),SHAPE(D%NALLMS   )
49ALLOCATE(D%NDIM0G(0:R%NSMAX))
50IF(LLP2)WRITE(NOUT,9) 'D%NDIM0G   ',SIZE(D%NDIM0G   ),SHAPE(D%NDIM0G   )
51
52CALL 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)
56CALL SUWAVEDI(R%NTMAX,R%NTMAX,NPRTRW,MYSETW,&
57    &KASM0=D%NATM0,KUMPP=INUMTPP,KSPEC2=D%NTPEC2)
58
59D%NUMP  = D%NUMPP (MYSETW)
60ALLOCATE(D%MYMS(D%NUMP))
61IF(LLP2)WRITE(NOUT,9) 'D%MYMS    ',SIZE(D%MYMS   ),SHAPE(D%MYMS   )
62D%MYMS(:) = IMYMS(1:D%NUMP)
63D%NUMTP = INUMTPP(MYSETW)
64
65IF (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')
70ENDIF
71
72ALLOCATE(D%NLATLS(NPRTRW))
73IF(LLP2)WRITE(NOUT,9) 'D%NLATLS',SIZE(D%NLATLS   ),SHAPE(D%NLATLS )
74ALLOCATE(D%NLATLE(NPRTRW))
75IF(LLP2)WRITE(NOUT,9) 'D%NLATLE',SIZE(D%NLATLE   ),SHAPE(D%NLATLE )
76
77D%NLATLS(:) = 9999
78D%NLATLE(:) = -1
79
80ILATPP = R%NDGNH/NPRTRW
81IRESTL  = R%NDGNH-NPRTRW*ILATPP
82DO 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
90ENDDO
91
92IF (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)
97ENDIF
98
99ALLOCATE(D%NPMT(0:R%NSMAX))
100IF(LLP2)WRITE(NOUT,9) 'D%NPMT   ',SIZE(D%NPMT   ),SHAPE(D%NPMT   )
101ALLOCATE(D%NPMS(0:R%NSMAX))
102IF(LLP2)WRITE(NOUT,9) 'D%NPMS   ',SIZE(D%NPMS   ),SHAPE(D%NPMS   )
103ALLOCATE(D%NPMG(0:R%NSMAX))
104IF(LLP2)WRITE(NOUT,9) 'D%NPMG   ',SIZE(D%NPMG   ),SHAPE(D%NPMG   )
105IDT = R%NTMAX-R%NSMAX
106INM = 0
107DO 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
112ENDDO
113INM = 0
114DO JM=0,R%NSMAX
115  D%NPMG(JM) = INM
116  INM = INM+R%NTMAX+2-JM
117ENDDO
118
119D%NLEI3D = (R%NLEI3-1)/NPRTRW+1
120
121!     ------------------------------------------------------------------
1229 FORMAT(1X,'ARRAY ',A10,' ALLOCATED ',8I8)
123
124END SUBROUTINE SUMP_TRANS_PRELEG
125END MODULE SUMP_TRANS_PRELEG_MOD
Note: See TracBrowser for help on using the repository browser.