source: LMDZ5/trunk/libf/phylmd/rrtm/lwu.F90 @ 1990

Last change on this file since 1990 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: 11.3 KB
Line 
1SUBROUTINE LWU &
2 & ( KIDIA, KFDIA, KLON, KLEV,&
3 & PAER , PCCO2, PDP , PPMB, PQOF , PTAVE, PVIEW, PWV,&
4 & PABCU &
5 & ) 
6
7!**** *LWU* - LONGWAVE EFFECTIVE ABSORBER AMOUNTS
8
9!     PURPOSE.
10!     --------
11!           COMPUTES ABSORBER AMOUNTS INCLUDING PRESSURE AND
12!           TEMPERATURE EFFECTS
13
14!**   INTERFACE.
15!     ----------
16
17!        EXPLICIT ARGUMENTS :
18!        --------------------
19!     ==== INPUTS ===
20! PAER   : (KLON,6,KLEV)     ; OPTICAL THICKNESS OF THE AEROSOLS
21! PCCO2  :                   ; CONCENTRATION IN CO2 (PA/PA)
22! PDP    : (KLON,KLEV)       ; LAYER PRESSURE THICKNESS (PA)
23! PPMB   : (KLON,KLEV+1)     ; HALF LEVEL PRESSURE
24! PQOF   : (KLON,KLEV)       ; CONCENTRATION IN OZONE (PA/PA)
25! PTAVE  : (KLON,KLEV)       ; TEMPERATURE
26! PWV    : (KLON,KLEV)       ; SPECIFIC HUMIDITY PA/PA
27! PVIEW  : (KLON)            ; COSECANT OF VIEWING ANGLE
28!     ==== OUTPUTS ===
29! PABCU  :(KLON,NUA,3*KLEV+1); EFFECTIVE ABSORBER AMOUNTS
30
31!        IMPLICIT ARGUMENTS :   NONE
32!        --------------------
33
34!     METHOD.
35!     -------
36
37!          1. COMPUTES THE PRESSURE AND TEMPERATURE WEIGHTED AMOUNTS OF
38!     ABSORBERS.
39
40!     EXTERNALS.
41!     ----------
42
43!          NONE
44
45!     REFERENCE.
46!     ----------
47
48!        SEE RADIATION'S PART OF THE MODEL'S DOCUMENTATION AND
49!        ECMWF RESEARCH DEPARTMENT DOCUMENTATION OF THE IFS
50
51!     AUTHOR.
52!     -------
53!        JEAN-JACQUES MORCRETTE  *ECMWF*
54
55!     MODIFICATIONS.
56!     --------------
57!        ORIGINAL : 89-07-14
58!        JJ Morcrette 97-04-18 Revised Continuum + Clean-up
59!        M.Hamrud      01-Oct-2003 CY28 Cleaning
60
61!-----------------------------------------------------------------------
62
63USE PARKIND1  ,ONLY : JPIM     ,JPRB
64USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
65
66USE YOMCST   , ONLY : RG
67USE YOESW    , ONLY : RAER
68USE YOELW    , ONLY : NSIL     ,NUA      ,NG1      ,NG1P1    ,&
69 & ALWT     ,BLWT     ,RO3T     ,RT1      ,TREF     ,&
70 & RVGCO2   ,RVGH2O   ,RVGO3 
71USE YOERDI   , ONLY : RCH4     ,RN2O     ,RCFC11   ,RCFC12
72USE YOERDU   , ONLY : R10E     ,REPSCO   ,REPSCQ
73
74IMPLICIT NONE
75
76INTEGER(KIND=JPIM),INTENT(IN)    :: KLON
77INTEGER(KIND=JPIM),INTENT(IN)    :: KLEV
78INTEGER(KIND=JPIM),INTENT(IN)    :: KIDIA
79INTEGER(KIND=JPIM),INTENT(IN)    :: KFDIA
80REAL(KIND=JPRB)   ,INTENT(IN)    :: PAER(KLON,6,KLEV)
81REAL(KIND=JPRB)   ,INTENT(IN)    :: PCCO2
82REAL(KIND=JPRB)   ,INTENT(IN)    :: PDP(KLON,KLEV)
83REAL(KIND=JPRB)   ,INTENT(IN)    :: PPMB(KLON,KLEV+1)
84REAL(KIND=JPRB)   ,INTENT(IN)    :: PQOF(KLON,KLEV)
85REAL(KIND=JPRB)   ,INTENT(IN)    :: PTAVE(KLON,KLEV)
86REAL(KIND=JPRB)   ,INTENT(IN)    :: PVIEW(KLON)
87REAL(KIND=JPRB)   ,INTENT(IN)    :: PWV(KLON,KLEV)
88REAL(KIND=JPRB)   ,INTENT(OUT)   :: PABCU(KLON,NUA,3*KLEV+1)
89!-----------------------------------------------------------------------
90
91!*       0.1   ARGUMENTS
92!              ---------
93
94!-----------------------------------------------------------------------
95
96!              ------------
97REAL(KIND=JPRB) :: ZABLY(KLON,7,3*KLEV+1)  , ZDPM(KLON,3*KLEV)&
98 & ,  ZDUC(KLON, 3*KLEV+1)    , ZFACT(KLON)&
99 & ,  ZUPM(KLON,3*KLEV) 
100REAL(KIND=JPRB) :: ZPHIO(KLON),ZPSC2(KLON) , ZPSC3(KLON), ZPSH1(KLON)&
101 & ,  ZPSH2(KLON),ZPSH3(KLON) , ZPSH4(KLON), ZPSH5(KLON)&
102 & ,  ZPSH6(KLON),ZPSIO(KLON) , ZTCON(KLON)&
103 & ,  ZPHM6(KLON),ZPSM6(KLON) , ZPHN6(KLON), ZPSN6(KLON) 
104REAL(KIND=JPRB) :: ZSSIG(KLON,3*KLEV+1)    , ZTAVI(KLON)&
105 & ,  ZUAER(KLON,NSIL)        , ZXOZ(KLON) , ZXWV(KLON) 
106
107INTEGER(KIND=JPIM) :: IAE1, IAE2, IAE3, IC, ICP1, IG1, IJ, IJPN,&
108 & IKIP1, IKJ, IKJP, IKJPN, IKJR, IKL, JA, JAE, &
109 & JK, JKI, JKK, JL 
110
111REAL(KIND=JPRB) :: ZALUP, ZCAC8, ZCAH1, ZCAH2, ZCAH3, ZCAH4,&
112 & ZCAH5, ZCAH6, ZCBC8, ZCBH1, ZCBH2, ZCBH3, &
113 & ZCBH4, ZCBH5, ZCBH6, ZDIFF, ZDPMG, ZDPMP0, &
114 & ZFPPW, ZTX, ZTX2, ZU6, ZUP, ZUPMCO2, ZUPMG, &
115 & ZUPMH2O, ZUPMO3, ZZABLY 
116REAL(KIND=JPRB) :: ZHOOK_HANDLE
117
118!-----------------------------------------------------------------------
119
120!*         1.    INITIALIZATION
121!                --------------
122
123!-----------------------------------------------------------------------
124
125!*         2.    PRESSURE OVER GAUSS SUB-LEVELS
126!                ------------------------------
127
128IF (LHOOK) CALL DR_HOOK('LWU',0,ZHOOK_HANDLE)
129DO JL = KIDIA,KFDIA
130  ZSSIG(JL, 1 ) = PPMB(JL,1) * 100._JPRB
131ENDDO
132
133DO JK = 1 , KLEV
134  IKJ=(JK-1)*NG1P1+1
135  IKJR = IKJ
136  IKJP = IKJ + NG1P1
137  DO JL = KIDIA,KFDIA
138    ZSSIG(JL,IKJP)=PPMB(JL,JK+1)* 100._JPRB
139  ENDDO
140  DO IG1=1,NG1
141    IKJ=IKJ+1
142    DO JL = KIDIA,KFDIA
143      ZSSIG(JL,IKJ)= (ZSSIG(JL,IKJR) + ZSSIG(JL,IKJP)) * 0.5_JPRB &
144       & + RT1(IG1) * (ZSSIG(JL,IKJP) - ZSSIG(JL,IKJR)) * 0.5_JPRB 
145    ENDDO
146  ENDDO
147ENDDO
148
149!-----------------------------------------------------------------------
150
151!*         4.    PRESSURE THICKNESS AND MEAN PRESSURE OF SUB-LAYERS
152!                --------------------------------------------------
153
154DO JKI=1,3*KLEV
155  IKIP1=JKI+1
156  DO JL = KIDIA,KFDIA
157    ZUPM(JL,JKI)=(ZSSIG(JL,JKI)+ZSSIG(JL,IKIP1))*0.5_JPRB
158    ZDPM(JL,JKI)=(ZSSIG(JL,JKI)-ZSSIG(JL,IKIP1))/(10._JPRB*RG)
159  ENDDO
160ENDDO
161
162DO JK = 1 , KLEV
163  IKL = KLEV+1 - JK
164  DO JL = KIDIA,KFDIA
165    ZXWV(JL) = MAX (PWV(JL,IKL) , REPSCQ )
166    ZXOZ(JL) = MAX (PQOF(JL,IKL) / PDP(JL,IKL) , REPSCO )
167  ENDDO
168  IKJ=(JK-1)*NG1P1+1
169  IKJPN=IKJ+NG1
170  DO JKK=IKJ,IKJPN
171    DO JL = KIDIA,KFDIA
172      ZDPMG = ZDPM(JL,JKK)
173      ZDPMP0 = ZDPMG / 101325._JPRB
174      ZUPMG = ZUPM(JL,JKK) * ZDPMP0
175      ZUPMCO2 = ( ZUPM(JL,JKK) + RVGCO2 ) * ZDPMP0
176      ZUPMH2O = ( ZUPM(JL,JKK) + RVGH2O ) * ZDPMP0
177      ZUPMO3  = ( ZUPM(JL,JKK) + RVGO3  ) * ZDPMP0
178      ZDUC(JL,JKK) = ZDPMG
179      ZABLY(JL,6,JKK) = ZXOZ(JL) * ZDPMG
180      ZABLY(JL,7,JKK) = ZXOZ(JL) * ZUPMO3
181      ZU6 = ZXWV(JL) * ZUPMG
182      ZFPPW = 1.6078_JPRB * ZXWV(JL) / (1.0_JPRB+0.608_JPRB*ZXWV(JL))
183      ZABLY(JL,1,JKK)  = ZXWV(JL) * ZUPMH2O
184      ZABLY(JL,5,JKK) = ZU6 * ZFPPW
185      ZABLY(JL,4,JKK) = ZU6 * (1.0_JPRB-ZFPPW)
186      ZABLY(JL,3,JKK)  = PCCO2 * ZUPMCO2
187      ZABLY(JL,2,JKK)  = PCCO2 * ZDPMG
188    ENDDO
189  ENDDO
190ENDDO
191
192!-----------------------------------------------------------------------
193
194!*         5.    CUMULATIVE ABSORBER AMOUNTS FROM TOP OF ATMOSPHERE
195!                --------------------------------------------------
196
197DO JA = 1, NUA
198  DO JL = KIDIA,KFDIA
199    PABCU(JL,JA,3*KLEV+1) = 0.0_JPRB
200  ENDDO
201ENDDO
202
203DO JK = 1 , KLEV
204  IJ=(JK-1)*NG1P1+1
205  IJPN=IJ+NG1
206  IKL=KLEV+1-JK
207
208!*         5.1  CUMULATIVE AEROSOL AMOUNTS FROM TOP OF ATMOSPHERE
209!               --------------------------------------------------
210! --            NB: 'PAER' AEROSOLS ARE ENTERED FROM TOP TO BOTTOM
211
212  IAE1=3*KLEV+1-IJ
213  IAE2=3*KLEV+1-(IJ+1)
214  IAE3=3*KLEV+1-IJPN
215! print *,'IAE1= ',IAE1
216! print *,'IAE2= ',IAE2
217! print *,'IAE3= ',IAE3
218! print *,'KIDIA= ',KIDIA
219! print *,'KFDIA= ',KFDIA
220! print *,'KLEV= ',KLEV
221  DO JAE=1,6
222    DO JL = KIDIA,KFDIA
223!   print *,'JL= ',JL,'-JAE= ',JAE,'-JK= ',JK,'-NSIL= ',NSIL
224      ZUAER(JL,JAE) =&
225       & (RAER(JAE,1)*PAER(JL,1,JK)+RAER(JAE,2)*PAER(JL,2,JK)&
226       & +RAER(JAE,3)*PAER(JL,3,JK)+RAER(JAE,4)*PAER(JL,4,JK)&
227       & +RAER(JAE,5)*PAER(JL,5,JK)+RAER(JAE,6)*PAER(JL,6,JK))&
228       & /(ZDUC(JL,IAE1)+ZDUC(JL,IAE2)+ZDUC(JL,IAE3)) 
229    ENDDO
230  ENDDO
231
232!*         5.2  INTRODUCES TEMPERATURE EFFECTS ON ABSORBER AMOUNTS
233!               --------------------------------------------------
234
235  DO JL = KIDIA,KFDIA
236    ZTAVI(JL)=PTAVE(JL,IKL)
237    ZFACT(JL)=1.0_JPRB-ZTAVI(JL)/296._JPRB
238    ZTCON(JL)=EXP(6.08_JPRB*(296._JPRB/ZTAVI(JL)-1.0_JPRB))
239!     ZTCON(JL)=EXP(6.08*ZFACT(JL))
240    ZTX=ZTAVI(JL)-TREF
241    ZTX2=ZTX*ZTX
242    ZZABLY = ZABLY(JL,1,IAE1)+ZABLY(JL,1,IAE2)+ZABLY(JL,1,IAE3)
243    ZUP=MIN( MAX( 0.5_JPRB*R10E*LOG( ZZABLY ) + 5._JPRB, 0.0_JPRB), 6.0_JPRB)
244    ZCAH1=ALWT(1,1)+ZUP*(ALWT(1,2)+ZUP*(ALWT(1,3)))
245    ZCBH1=BLWT(1,1)+ZUP*(BLWT(1,2)+ZUP*(BLWT(1,3)))
246    ZPSH1(JL)=EXP( ZCAH1 * ZTX + ZCBH1 * ZTX2 )
247    ZCAH2=ALWT(2,1)+ZUP*(ALWT(2,2)+ZUP*(ALWT(2,3)))
248    ZCBH2=BLWT(2,1)+ZUP*(BLWT(2,2)+ZUP*(BLWT(2,3)))
249    ZPSH2(JL)=EXP( ZCAH2 * ZTX + ZCBH2 * ZTX2 )
250    ZCAH3=ALWT(3,1)+ZUP*(ALWT(3,2)+ZUP*(ALWT(3,3)))
251    ZCBH3=BLWT(3,1)+ZUP*(BLWT(3,2)+ZUP*(BLWT(3,3)))
252    ZPSH3(JL)=EXP( ZCAH3 * ZTX + ZCBH3 * ZTX2 )
253    ZCAH4=ALWT(4,1)+ZUP*(ALWT(4,2)+ZUP*(ALWT(4,3)))
254    ZCBH4=BLWT(4,1)+ZUP*(BLWT(4,2)+ZUP*(BLWT(4,3)))
255    ZPSH4(JL)=EXP( ZCAH4 * ZTX + ZCBH4 * ZTX2 )
256    ZCAH5=ALWT(5,1)+ZUP*(ALWT(5,2)+ZUP*(ALWT(5,3)))
257    ZCBH5=BLWT(5,1)+ZUP*(BLWT(5,2)+ZUP*(BLWT(5,3)))
258    ZPSH5(JL)=EXP( ZCAH5 * ZTX + ZCBH5 * ZTX2 )
259    ZCAH6=ALWT(6,1)+ZUP*(ALWT(6,2)+ZUP*(ALWT(6,3)))
260    ZCBH6=BLWT(6,1)+ZUP*(BLWT(6,2)+ZUP*(BLWT(6,3)))
261    ZPSH6(JL)=EXP( ZCAH6 * ZTX + ZCBH6 * ZTX2 )
262    ZPHM6(JL)=EXP(-5.81E-4_JPRB * ZTX - 1.13E-6_JPRB * ZTX2 )
263    ZPSM6(JL)=EXP(-5.57E-4_JPRB * ZTX - 3.30E-6_JPRB * ZTX2 )
264    ZPHN6(JL)=EXP(-3.46E-5_JPRB * ZTX + 2.05E-7_JPRB * ZTX2 )
265    ZPSN6(JL)=EXP( 3.70E-3_JPRB * ZTX - 2.30E-6_JPRB * ZTX2 )
266  ENDDO
267
268  DO JL = KIDIA,KFDIA
269    ZTAVI(JL)=PTAVE(JL,IKL)
270    ZTX=ZTAVI(JL)-TREF
271    ZTX2=ZTX*ZTX
272    ZZABLY = ZABLY(JL,3,IAE1)+ZABLY(JL,3,IAE2)+ZABLY(JL,3,IAE3)
273    ZALUP = R10E * LOG ( ZZABLY )
274    ZUP   = MAX( 0.0_JPRB , 5.0_JPRB + 0.5_JPRB * ZALUP )
275    ZPSC2(JL) = (ZTAVI(JL)/TREF) ** ZUP
276    ZCAC8=ALWT(8,1)+ZUP*(ALWT(8,2)+ZUP*(ALWT(8,3)))
277    ZCBC8=BLWT(8,1)+ZUP*(BLWT(8,2)+ZUP*(BLWT(8,3)))
278    ZPSC3(JL)=EXP( ZCAC8 * ZTX + ZCBC8 * ZTX2 )
279    ZPHIO(JL) = EXP( RO3T(1) * ZTX + RO3T(2) * ZTX2)
280    ZPSIO(JL) = EXP( 2.0_JPRB* (RO3T(3)*ZTX+RO3T(4)*ZTX2))
281  ENDDO
282
283  DO JKK=IJ,IJPN
284    IC=3*KLEV+1-JKK
285    ICP1=IC+1
286    DO JL = KIDIA,KFDIA
287      ZDIFF = PVIEW(JL)
288!- H2O continuum     
289      PABCU(JL,10,IC)=PABCU(JL,10,ICP1)+ ZABLY(JL,4,IC)          *ZDIFF
290      PABCU(JL,11,IC)=PABCU(JL,11,ICP1)+ ZABLY(JL,5,IC)*ZTCON(JL)*ZDIFF
291!- O3     
292      PABCU(JL,12,IC)=PABCU(JL,12,ICP1)+ ZABLY(JL,6,IC)*ZPHIO(JL)*ZDIFF
293      PABCU(JL,13,IC)=PABCU(JL,13,ICP1)+ ZABLY(JL,7,IC)*ZPSIO(JL)*ZDIFF
294!- CO2
295      PABCU(JL,7,IC)=PABCU(JL,7,ICP1)+ ZABLY(JL,3,IC)*ZPSC2(JL)*ZDIFF
296      PABCU(JL,8,IC)=PABCU(JL,8,ICP1)+ ZABLY(JL,3,IC)*ZPSC3(JL)*ZDIFF
297      PABCU(JL,9,IC)=PABCU(JL,9,ICP1)+ ZABLY(JL,3,IC)*ZPSC3(JL)*ZDIFF
298!- H2O
299      PABCU(JL,1,IC)=PABCU(JL,1,ICP1)+ ZABLY(JL,1,IC)*ZPSH1(JL)
300      PABCU(JL,2,IC)=PABCU(JL,2,ICP1)+ ZABLY(JL,1,IC)*ZPSH2(JL)
301      PABCU(JL,3,IC)=PABCU(JL,3,ICP1)+ ZABLY(JL,1,IC)*ZPSH5(JL)*ZDIFF
302      PABCU(JL,4,IC)=PABCU(JL,4,ICP1)+ ZABLY(JL,1,IC)*ZPSH3(JL)
303      PABCU(JL,5,IC)=PABCU(JL,5,ICP1)+ ZABLY(JL,1,IC)*ZPSH4(JL)
304      PABCU(JL,6,IC)=PABCU(JL,6,ICP1)+ ZABLY(JL,1,IC)*ZPSH6(JL)*ZDIFF
305!- aerosols
306      PABCU(JL,14,IC)=PABCU(JL,14,ICP1)+ ZUAER(JL,1)    *ZDUC(JL,IC)*ZDIFF
307      PABCU(JL,15,IC)=PABCU(JL,15,ICP1)+ ZUAER(JL,2)    *ZDUC(JL,IC)*ZDIFF
308      PABCU(JL,16,IC)=PABCU(JL,16,ICP1)+ ZUAER(JL,3)    *ZDUC(JL,IC)*ZDIFF
309      PABCU(JL,17,IC)=PABCU(JL,17,ICP1)+ ZUAER(JL,4)    *ZDUC(JL,IC)*ZDIFF
310      PABCU(JL,18,IC)=PABCU(JL,18,ICP1)+ ZUAER(JL,5)    *ZDUC(JL,IC)*ZDIFF
311!- CH4
312      PABCU(JL,19,IC)=PABCU(JL,19,ICP1)&
313       & + ZABLY(JL,2,IC)*RCH4/PCCO2*ZPHM6(JL)*ZDIFF 
314      PABCU(JL,20,IC)=PABCU(JL,20,ICP1)&
315       & + ZABLY(JL,3,IC)*RCH4/PCCO2*ZPSM6(JL)*ZDIFF 
316!- N2O
317      PABCU(JL,21,IC)=PABCU(JL,21,ICP1)&
318       & + ZABLY(JL,2,IC)*RN2O/PCCO2*ZPHN6(JL)*ZDIFF 
319      PABCU(JL,22,IC)=PABCU(JL,22,ICP1)&
320       & + ZABLY(JL,3,IC)*RN2O/PCCO2*ZPSN6(JL)*ZDIFF 
321!- CFC11
322      PABCU(JL,23,IC)=PABCU(JL,23,ICP1)&
323       & + ZABLY(JL,2,IC)*RCFC11/PCCO2        *ZDIFF 
324!- CFC12
325      PABCU(JL,24,IC)=PABCU(JL,24,ICP1)&
326       & + ZABLY(JL,2,IC)*RCFC12/PCCO2        *ZDIFF 
327    ENDDO
328  ENDDO
329
330ENDDO
331!      print *,'END OF LWU'
332
333!-----------------------------------------------------------------------
334
335IF (LHOOK) CALL DR_HOOK('LWU',1,ZHOOK_HANDLE)
336END SUBROUTINE LWU
Note: See TracBrowser for help on using the repository browser.