source: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/suecrad15.F90 @ 5441

Last change on this file since 5441 was 5154, checked in by abarral, 5 months ago

Fix ecrad & rrtm compilation

  • 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: 8.9 KB
Line 
1!OPTIONS XOPT(NOEVAL)
2SUBROUTINE SUECRAD15 (KULOUT, KLEV, PETAH )
3
4!**** *SUECRAD15*   - INITIALIZE COMMONS YOMRxx15 CONTROLLING RADIATION
5!****                 FROZEN VERSION (CYCLE 15) OF SUECRAD
6
7!     PURPOSE.
8!     --------
9!           INITIALIZE YOMRAD15, THE COMMON THAT CONTROLS THE
10!           RADIATION OF THE MODEL, AND YOMRDU15 THAT INCLUDES
11!           ADJUSTABLE PARAMETERS FOR RADIATION COMPUTATIONS
12
13!**   INTERFACE.
14!     ----------
15!        CALL *SUECRAD15* FROM *SUPHEC*
16!              ---------        ------
17
18!        EXPLICIT ARGUMENTS :
19!        --------------------
20!        NONE
21
22!        IMPLICIT ARGUMENTS :
23!        --------------------
24!        COMMONS YOMRAD15, YOMRDU15
25
26!     METHOD.
27!     -------
28!        SEE DOCUMENTATION
29
30!     EXTERNALS.
31!     ----------
32!        SUAER, SUAERH, SUAERV, SULW, SUSW, SUCLD, SUOCST, SUSAT
33
34!     REFERENCE.
35!     ----------
36!        ECMWF Research Department documentation of the IFS
37
38!     AUTHOR.
39!     -------
40!        96-11: Ph. Dandin. Meteo-France
41!        ORIGINAL : 88-12-15 BY JEAN-JACQUES MORCRETTE  *ECMWF*
42
43!     MODIFICATIONS.
44!     --------------
45!        R. El Khatib 01-02-02 proper initialization of NFRRC moved in SUCFU
46!        M.Hamrud      01-Oct-2003 CY28 Cleaning
47!        F. Bouyssel 27-09-04 initialisation of NSW
48!        A. Alias    29-09-05 Sulfate aerosols (Hu Rong Ming)
49!     ------------------------------------------------------------------
50
51USE PARKIND1  ,ONLY : JPIM     ,JPRB
52USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
53
54USE YOMCT0   , ONLY : NPRINTLEV
55USE YOMDIM   , ONLY : NDLON    ,NSMAX   ,NGPBLKS  ,NFLEVG   ,NPROMA
56USE YOMDYN   , ONLY : TSTEP
57! Ce qui concerne NULNAM commente par MPL le 15.04.09
58!USE YOMLUN   , ONLY : NULNAM
59USE YOMCST   , ONLY : RDAY     ,RG       ,RCPD
60USE YOMPHY   , ONLY : LRAYFM15
61USE YOEPHY   , ONLY : LEPHYS   ,LERADI
62USE YOMRAD15 , ONLY : NAER15   ,NFLUX15  ,NMODE15  ,NRAD15   ,&
63 & NRADFR15 ,NRADPFR15,NRADPLA15,NRINT15  ,NRADNFR15,&
64 & NRADSFR15,NOVLP15  ,NRPROMA15,NRADF2C15,NRADC2F15,&
65 & LERAD6H15,LERADHS15,LRADAER15,LNEWAER15
66USE YOERAD   , ONLY : NAER     ,NTSW
67!USE YOERAD   , ONLY : NAER     ,NSW      ,NTSW
68! NSW mis dans .def MPL 20140211
69USE YOMRDU15 , ONLY : NUAER15  ,NTRAER15 ,RCDAY15  ,R10E15   ,&
70 & REELOG15 ,REPSC15  ,REPSCO15 ,REPSCQ15 ,REPSCT15 ,&
71 & REPSCW15 ,DIFF15 
72USE YOMAERD15, ONLY : CVDAES15 ,CVDAEL15 ,CVDAEU15 ,CVDAED15 ,&
73 & CVDAEF15 ,&
74 & RCAEOPS15,RCAEOPL15,RCAEOPU15,RCAEOPD15,RCTRBGA15,&
75 & RCAEOPF15,&
76 & RCVOBGA15,RCSTBGA15,RCTRPT15 ,RCAEADM15,RCAEROS15,&
77 & RCAEADK15 
78USE YOMPRAD  , ONLY : LODBGRADI,LODBGRADL
79USE YOMRADF  , ONLY : EMTD     ,EMTU      ,TRSW    ,RMOON
80USE lmdz_clesphys
81
82IMPLICIT NONE
83
84INTEGER(KIND=JPIM),INTENT(IN)    :: KLEV
85INTEGER(KIND=JPIM),INTENT(IN)    :: KULOUT
86REAL(KIND=JPRB)   ,INTENT(IN)    :: PETAH(KLEV+1)
87LOGICAL :: LLP
88
89#include "namrad15.h"
90!      ----------------------------------------------------------------
91
92LOGICAL :: LLMESS
93
94INTEGER(KIND=JPIM) :: IRADFR, IST1HR, IST6HR
95
96
97REAL(KIND=JPRB) :: ZSTPHR, ZTSTEP
98REAL(KIND=JPRB) :: ZHOOK_HANDLE
99
100#include "posnam.intfb.h"
101#include "suaer15.intfb.h"
102#include "suaerv15.intfb.h"
103#include "suecradi15.intfb.h"
104#include "suecradl.intfb.h"
105#include "sulw15.intfb.h"
106#include "surdi15.intfb.h"
107#include "susat.intfb.h"
108#include "susw15.intfb.h"
109
110!      ----------------------------------------------------------------
111
112!*         1.       SET DEFAULT VALUES.
113!                   -------------------
114
115!*         1.1      PRESET INDICES IN *YOMRAD15*
116!                   --------------------------
117
118IF (LHOOK) CALL DR_HOOK('SUECRAD15',0,ZHOOK_HANDLE)
119LLMESS=.FALSE.
120LERAD6H15=.TRUE.
121LERADHS15=.TRUE.
122LRADAER15=.TRUE.
123LNEWAER15=.FALSE.
124NAER15   =1
125NAER=0
126NFLUX15  =6
127NMODE15  =0
128NRAD15   =1
129NRADFR15 =-3
130NRADPFR15=36
131NRADPLA15=15
132NRINT15  =4
133NRADF2C15=1
134NRADC2F15=1
135NUAER15  = 24
136NTRAER15 = 15
137NOVLP15 = 1
138NSW=2
139NTSW=2
140IF(NSMAX >= 106) THEN
141  NRPROMA15 = 80
142ELSEIF(NSMAX == 63) THEN
143  NRPROMA15=48
144ELSE
145  NRPROMA15=20
146ENDIF
147
148!*         1.3      SET SECURITY PARAMETERS
149!                   -----------------------
150
151REPSC15  = 1.E-12_JPRB
152REPSCO15 = 1.E-12_JPRB
153REPSCQ15 = 1.E-12_JPRB
154REPSCT15 = 1.E-12_JPRB
155REPSCW15 = 1.E-12_JPRB
156REELOG15 = 1.E-12_JPRB
157
158!     ------------------------------------------------------------------
159
160!*         2.       READ VALUES OF RADIATION CONFIGURATION
161!                   --------------------------------------
162
163! Ce qui concerne NAMRAD15 commente par MPL le 15.04.09
164!CALL POSNAM(NULNAM,'NAMRAD15')
165!READ (NULNAM,NAMRAD15)
166
167!     INITIALISE DATA STRUCTURES REQUIRED FOR RADIATION INTERPOLATION
168
169LODBGRADI=.FALSE.
170CALL SUECRADI15
171
172IF( LLMESS )THEN
173
174!     INITIALISE DATA STRUCTURES REQUIRED FOR RADIATION COURSE GRID
175!     LOAD BALANCING
176
177  LODBGRADL=.FALSE.
178! CALL SUECRADL   ! MPL 1.12.08
179  CALL ABOR1('JUSTE APRES CALL SUECRADL COMMENTE')
180ENDIF
181
182!      ----------------------------------------------------------------
183
184!*       3.    INITIALIZE RADIATION COEFFICIENTS.
185!              ----------------------------------
186
187RCDAY15  = RDAY * RG / RCPD
188DIFF15   = 1.66_JPRB
189R10E15   = 0.4342945_JPRB
190
191CALL SURDI15
192
193!      ----------------------------------------------------------------
194
195!*       4.    INITIALIZE RADIATION ABSORPTION COEFFICIENTS
196!              --------------------------------------------
197
198CALL SULW15
199CALL SUSW15
200
201!      ----------------------------------------------------------------
202
203!*       5.    INITIALIZE AEROSOL OPTICAL PARAMETERS AND DISTRIBUTION
204!              ------------------------------------------------------
205
206!     INITIALIZATION DONE IN BLOCK DATA SUAERHBD
207
208!- optical properties
209CALL SUAER15
210
211!     CALL SUAERH
212
213CALL SUAERV15 ( KLEV  , PETAH,&
214 & CVDAES15, CVDAEL15, CVDAEU15, CVDAED15, CVDAEF15,&
215 & RCTRBGA15, RCVOBGA15, RCSTBGA15, RCAEOPS15, RCAEOPL15, RCAEOPU15,&
216 & RCAEOPF15,&
217 & RCAEOPD15, RCTRPT15 , RCAEADK15, RCAEADM15, RCAEROS15        ) 
218
219!      ----------------------------------------------------------------
220
221!*       6.    INITIALIZE SATELLITE GEOMETRICAL/RADIOMETRIC PARAMETERS
222!              -------------------------------------------------------
223
224IF (LEPHYS) THEN
225  IF (NMODE15 > 1) THEN
226    CALL SUSAT
227  ENDIF
228ENDIF
229
230!      ----------------------------------------------------------------
231
232!*       7.    INITIALIZE CLIMATOLOGICAL OZONE DISTRIBUTION
233!              --------------------------------------------
234!                  (not done here!!!  called from APLPAR as it depends
235!                     on model pressure levels!)
236
237!      ----------------------------------------------------------------
238
239!*       8.    SET UP MODEL CONFIGURATION FOR TIME-SPACE INTERPOLATION
240!              -------------------------------------------------------
241
242ZTSTEP=MAX(TSTEP,1.0_JPRB)
243ZSTPHR=3600._JPRB/ZTSTEP
244IRADFR=NRADFR15
245IF(NRADFR15 < 0) THEN
246  NRADFR15=-NRADFR15*ZSTPHR+0.5_JPRB
247ENDIF
248NRADPFR15=NRADPFR15*NRADFR15
249IF (MOD(NRADPLA15,2) == 0.AND. NRADPLA15 /= 0) THEN
250  NRADPLA15=NRADPLA15+1
251ENDIF
252
253IST1HR=ZSTPHR+0.05_JPRB
254IST6HR=6._JPRB*ZSTPHR+0.05_JPRB
255IF (MOD(3600._JPRB,ZTSTEP) > 0.1_JPRB) THEN
256  IST1HR=IST1HR+1
257  DO WHILE (MOD(IST6HR,IST1HR) /= 0)
258    IST1HR=IST1HR+1
259  ENDDO
260ENDIF
261NRADSFR15=IST1HR
262NRADNFR15=NRADFR15
263
264IF(LRAYFM15) THEN
265  NRPROMA15=NDLON+6+(1-MOD(NDLON,2))
266ENDIF
267
268
269
270!*       9.    ALLOCATE WORK ARRAYS
271!               --------------------
272
273LLP = NPRINTLEV >= 1
274
275  ALLOCATE(EMTD(NPROMA,NFLEVG+1,NGPBLKS))
276  IF(LLP)WRITE(UNIT=KULOUT,FMT=9) 'EMTD     ',SIZE(EMTD     ),SHAPE(EMTD     )
277  ALLOCATE(TRSW(NPROMA,NFLEVG+1,NGPBLKS))
278  IF(LLP)WRITE(UNIT=KULOUT,FMT=9) 'TRSW     ',SIZE(TRSW     ),SHAPE(TRSW     )
279  ALLOCATE(EMTU(NPROMA,NFLEVG+1,NGPBLKS))
280  IF(LLP)WRITE(UNIT=KULOUT,FMT=9) 'EMTU     ',SIZE(EMTU     ),SHAPE(EMTU     )
281  ALLOCATE(RMOON(NPROMA,NGPBLKS))
282  IF(LLP)WRITE(UNIT=KULOUT,FMT=9) 'RMOON    ',SIZE(RMOON    ),SHAPE(RMOON    )
283
2849 FORMAT(1X,'ARRAY ',A10,' ALLOCATED ',8I8)
285
286!      ----------------------------------------------------------------
287
288!*       9.    PRINT FINAL VALUES.
289!              -------------------
290
291
292
293
294IF (LLP) THEN
295  WRITE(UNIT=KULOUT,FMT='('' COMMON YOMRAD15 '')')
296  WRITE(UNIT=KULOUT,FMT='('' LERADI  = '',L5 &
297   & ,'' LERAD6H15 = '',L5)')&
298   & LERADI,LERAD6H15 
299  WRITE(UNIT=KULOUT,FMT='('' NRADFR15  = '',I2 &
300   & ,'' NRADPFR15 = '',I3 &
301   & ,'' NRADPLA15 = '',I2 &
302   & ,'' NRINT15   = '',I1 &
303   & ,'' NRPROMA15 = '',I5 &
304   & ,'' NRADF2C15 = '',I1 &
305   & ,'' NRADC2F15 = '',I1 &
306   & )')&
307   & NRADFR15,NRADPFR15,NRADPLA15,NRINT15,&
308   & NRPROMA15,NRADF2C15,NRADC2F15 
309   
310  WRITE(UNIT=KULOUT,FMT='('' LERADHS15= '',L5,'' LRADAER15= '',L5 &
311   & ,'' LNEWAER15= '',L5 &
312   & ,'' NMODE15 = '',I1 &
313   & ,'' NAER15  = '',I1 &
314   & ,'' NFLUX15 = '',I2 &
315   & ,'' NRAD15  = '',I2 &
316   & )')&
317   & LERADHS15,LRADAER15,LNEWAER15,NMODE15,NAER15,NFLUX15,NRAD15 
318  WRITE(KULOUT,FMT='('' WARNING! CLOUD OVERLAP ASSUMPTION IS''&
319   & ,'' NOVLP15   = '',I2 &
320   & )')&
321   & NOVLP15 
322
323  WRITE(UNIT=KULOUT,FMT='('' MODULE YOERAD '')')
324  WRITE(UNIT=KULOUT,FMT='('' NSW = '',I2, '' NTSW = '',I2)') NSW,NTSW
325ENDIF
326
327!     ------------------------------------------------------------------
328
329IF (LHOOK) CALL DR_HOOK('SUECRAD15',1,ZHOOK_HANDLE)
330END SUBROUTINE SUECRAD15
Note: See TracBrowser for help on using the repository browser.