LMDZ
rrtm_rrtm_140gp.F90
Go to the documentation of this file.
1 !***************************************************************************
2 ! *
3 ! RRTM : RAPID RADIATIVE TRANSFER MODEL *
4 ! *
5 ! ATMOSPHERIC AND ENVIRONMENTAL RESEARCH, INC. *
6 ! 840 MEMORIAL DRIVE *
7 ! CAMBRIDGE, MA 02139 *
8 ! *
9 ! ELI J. MLAWER *
10 ! STEVEN J. TAUBMAN~ *
11 ! SHEPARD A. CLOUGH *
12 ! *
13 ! ~currently at GFDL *
14 ! *
15 ! email: mlawer@aer.com *
16 ! *
17 ! The authors wish to acknowledge the contributions of the *
18 ! following people: Patrick D. Brown, Michael J. Iacono, *
19 ! Ronald E. Farren, Luke Chen, Robert Bergstrom. *
20 ! *
21 !***************************************************************************
22 ! Reformatted for F90 by JJMorcrette, ECMWF, 980714 *
23 ! *
24 !***************************************************************************
25 ! *** mji ***
26 ! *** This version of RRTM has been altered to interface with either
27 ! the ECMWF numerical weather prediction model or the ECMWF column
28 ! radiation model (ECRT) package.
29 
30 ! Revised, April, 1997; Michael J. Iacono, AER, Inc.
31 ! - initial implementation of RRTM in ECRT code
32 ! Revised, June, 1999; Michael J. Iacono and Eli J. Mlawer, AER, Inc.
33 ! - to implement generalized maximum/random cloud overlap
34 
35 SUBROUTINE rrtm_rrtm_140gp &
36  & ( kidia , kfdia , klon , klev,&
37  & paer , paph , pap,&
38  & pts , pth , pt,&
39  & p_zemis , p_zemiw,&
40  & pq , pcco2 , pozn,&
41  & pcldf , ptaucld,&
42  & ptau_lw,&
43  & pemit , pflux , pfluc, ptclear &
44  & )
45 
46 ! *** This program is the driver for RRTM, the AER rapid model.
47 ! For each atmosphere the user wishes to analyze, this routine
48 ! a) calls ECRTATM to read in the atmospheric profile
49 ! b) calls SETCOEF to calculate various quantities needed for
50 ! the radiative transfer algorithm
51 ! c) calls RTRN to do the radiative transfer calculation for
52 ! clear or cloudy sky
53 ! d) writes out the upward, downward, and net flux for each
54 ! level and the heating rate for each layer
55 
56 USE parkind1 ,ONLY : jpim ,jprb
57 USE yomhook ,ONLY : lhook, dr_hook
58 USE yoerad ,ONLY : nlw
59 USE parrrtm , ONLY : jpband ,jpxsec ,jpgpt ,jplay ,&
60  & jpinpx
61 !------------------------------Arguments--------------------------------
62 
63 ! Input arguments
64 
65 IMPLICIT NONE
66 INTEGER(KIND=JPIM),INTENT(IN) :: KLON! Number of atmospheres (longitudes)
67 INTEGER(KIND=JPIM),INTENT(IN) :: KLEV! Number of atmospheric layers
68 INTEGER(KIND=JPIM),INTENT(IN) :: KIDIA ! First atmosphere index
69 INTEGER(KIND=JPIM),INTENT(IN) :: KFDIA ! Last atmosphere index
70 REAL(KIND=JPRB) ,INTENT(IN) :: PAER(klon,6,klev) ! Aerosol optical thickness
71 REAL(KIND=JPRB) ,INTENT(IN) :: PAPH(klon,klev+1) ! Interface pressures (Pa)
72 REAL(KIND=JPRB) ,INTENT(IN) :: PAP(klon,klev) ! Layer pressures (Pa)
73 REAL(KIND=JPRB) ,INTENT(IN) :: PTS(klon) ! Surface temperature (I_K)
74 REAL(KIND=JPRB) ,INTENT(IN) :: PTH(klon,klev+1) ! Interface temperatures (I_K)
75 REAL(KIND=JPRB) ,INTENT(IN) :: PT(klon,klev) ! Layer temperature (I_K)
76 REAL(KIND=JPRB) ,INTENT(IN) :: P_ZEMIS(klon) ! Non-window surface emissivity
77 REAL(KIND=JPRB) ,INTENT(IN) :: P_ZEMIW(klon) ! Window surface emissivity
78 REAL(KIND=JPRB) ,INTENT(IN) :: PQ(klon,klev) ! H2O specific humidity (mmr)
79 REAL(KIND=JPRB) ,INTENT(IN) :: PCCO2 ! CO2 mass mixing ratio
80 REAL(KIND=JPRB) ,INTENT(IN) :: POZN(klon,klev) ! O3 mass mixing ratio
81 REAL(KIND=JPRB) ,INTENT(IN) :: PCLDF(klon,klev) ! Cloud fraction
82 REAL(KIND=JPRB) ,INTENT(IN) :: PTAUCLD(klon,klev,jpband) ! Cloud optical depth
83 !--C.Kleinschmitt
84 REAL(KIND=JPRB) ,INTENT(IN) :: PTAU_LW(klon,klev,nlw) ! LW Optical depth of aerosols
85 !--end
86 REAL(KIND=JPRB) ,INTENT(OUT) :: PEMIT(klon) ! Surface LW emissivity
87 REAL(KIND=JPRB) ,INTENT(OUT) :: PFLUX(klon,2,klev+1) ! LW total sky flux (1=up, 2=down)
88 REAL(KIND=JPRB) ,INTENT(OUT) :: PFLUC(klon,2,klev+1) ! LW clear sky flux (1=up, 2=down)
89 REAL(KIND=JPRB) ,INTENT(OUT) :: PTCLEAR(klon) ! clear-sky fraction of column
90 INTEGER(KIND=JPIM) :: ICLDLYR(jplay) ! Cloud indicator
91 REAL(KIND=JPRB) :: Z_CLDFRAC(jplay) ! Cloud fraction
92 REAL(KIND=JPRB) :: Z_TAUCLD(jplay,jpband) ! Spectral optical thickness
93 
94 REAL(KIND=JPRB) :: Z_ABSS1 (jpgpt*jplay)
95 REAL(KIND=JPRB) :: Z_ATR1 (jpgpt,jplay)
96 equivalence(z_abss1(1),z_atr1(1,1))
97 
98 REAL(KIND=JPRB) :: Z_OD (jpgpt,jplay)
99 
100 REAL(KIND=JPRB) :: Z_TAUSF1(jpgpt*jplay)
101 REAL(KIND=JPRB) :: Z_TF1 (jpgpt,jplay)
102 equivalence(z_tausf1(1),z_tf1(1,1))
103 
104 REAL(KIND=JPRB) :: Z_COLDRY(jplay)
105 REAL(KIND=JPRB) :: Z_WKL(jpinpx,jplay)
106 
107 REAL(KIND=JPRB) :: Z_WX(jpxsec,jplay) ! Amount of trace gases
108 
109 REAL(KIND=JPRB) :: Z_CLFNET (0:jplay)
110 REAL(KIND=JPRB) :: Z_CLHTR (0:jplay)
111 REAL(KIND=JPRB) :: Z_FNET (0:jplay)
112 REAL(KIND=JPRB) :: Z_HTR (0:jplay)
113 REAL(KIND=JPRB) :: Z_TOTDFLUC(0:jplay)
114 REAL(KIND=JPRB) :: Z_TOTDFLUX(0:jplay)
115 REAL(KIND=JPRB) :: Z_TOTUFLUC(0:jplay)
116 REAL(KIND=JPRB) :: Z_TOTUFLUX(0:jplay)
117 
118 INTEGER(KIND=JPIM) :: i, icld, iplon, I_K
119 INTEGER(KIND=JPIM) :: ISTART
120 INTEGER(KIND=JPIM) :: IEND
121 
122 REAL(KIND=JPRB) :: Z_FLUXFAC, Z_HEATFAC, Z_PI, ZEPSEC, ZTCLEAR
123 
124 !- from AER
125 REAL(KIND=JPRB) :: Z_TAUAERL(jplay,jpband)
126 
127 !- from INTFAC
128 REAL(KIND=JPRB) :: Z_FAC00(jplay)
129 REAL(KIND=JPRB) :: Z_FAC01(jplay)
130 REAL(KIND=JPRB) :: Z_FAC10(jplay)
131 REAL(KIND=JPRB) :: Z_FAC11(jplay)
132 REAL(KIND=JPRB) :: Z_FORFAC(jplay)
133 
134 !- from INTIND
135 INTEGER(KIND=JPIM) :: JP(jplay)
136 INTEGER(KIND=JPIM) :: JT(jplay)
137 INTEGER(KIND=JPIM) :: JT1(jplay)
138 
139 !- from PRECISE
140 REAL(KIND=JPRB) :: Z_ONEMINUS
141 
142 !- from PROFDATA
143 REAL(KIND=JPRB) :: Z_COLH2O(jplay)
144 REAL(KIND=JPRB) :: Z_COLCO2(jplay)
145 REAL(KIND=JPRB) :: Z_COLO3 (jplay)
146 REAL(KIND=JPRB) :: Z_COLN2O(jplay)
147 REAL(KIND=JPRB) :: Z_COLCH4(jplay)
148 REAL(KIND=JPRB) :: Z_COLO2 (jplay)
149 REAL(KIND=JPRB) :: Z_CO2MULT(jplay)
150 INTEGER(KIND=JPIM) :: I_LAYTROP
151 INTEGER(KIND=JPIM) :: I_LAYSWTCH
152 INTEGER(KIND=JPIM) :: I_LAYLOW
153 
154 !- from PROFILE
155 REAL(KIND=JPRB) :: Z_PAVEL(jplay)
156 REAL(KIND=JPRB) :: Z_TAVEL(jplay)
157 REAL(KIND=JPRB) :: Z_PZ(0:jplay)
158 REAL(KIND=JPRB) :: Z_TZ(0:jplay)
159 REAL(KIND=JPRB) :: Z_TBOUND
160 INTEGER(KIND=JPIM) :: I_NLAYERS
161 
162 !- from SELF
163 REAL(KIND=JPRB) :: Z_SELFFAC(jplay)
164 REAL(KIND=JPRB) :: Z_SELFFRAC(jplay)
165 INTEGER(KIND=JPIM) :: INDSELF(jplay)
166 
167 !- from SP
168 REAL(KIND=JPRB) :: Z_PFRAC(jpgpt,jplay)
169 
170 !- from SURFACE
171 REAL(KIND=JPRB) :: Z_SEMISS(jpband)
172 REAL(KIND=JPRB) :: Z_SEMISLW
173 INTEGER(KIND=JPIM) :: IREFLECT
174 REAL(KIND=JPRB) :: ZHOOK_HANDLE
175 
176 #include "rrtm_ecrt_140gp.intfb.h"
177 #include "rrtm_gasabs1a_140gp.intfb.h"
178 #include "rrtm_rtrn1a_140gp.intfb.h"
179 #include "rrtm_setcoef_140gp.intfb.h"
180 
181 ! HEATFAC is the factor by which one must multiply delta-flux/
182 ! delta-pressure, with flux in w/m-2 and pressure in mbar, to get
183 ! the heating rate in units of degrees/day. It is equal to
184 ! (g)x(#sec/day)x(1e-5)/(specific heat of air at const. p)
185 ! = (9.8066)(86400)(1e-5)/(1.004)
186 
187 IF (lhook) CALL dr_hook('RRTM_RRTM_140GP',0,zhook_handle)
188 zepsec = 1.e-06_jprb
189 z_oneminus = 1.0_jprb - zepsec
190 z_pi = 2.0_jprb*asin(1.0_jprb)
191 z_fluxfac = z_pi * 2.d4
192 z_heatfac = 8.4391_jprb
193 
194 ! *** mji ***
195 ! For use with ECRT, this loop is over atmospheres (or longitudes)
196 DO iplon = kidia,kfdia
197 
198 ! *** mji ***
199 !- Prepare atmospheric profile from ECRT for use in RRTM, and define
200 ! other RRTM input parameters. Arrays are passed back through the
201 ! existing RRTM commons and arrays.
202  ztclear=1.0_jprb
203 
204  CALL rrtm_ecrt_140gp &
205  & ( iplon, klon , klev, icld,&
206  & paer , paph , pap,&
207  & pts , pth , pt,&
208  & p_zemis, p_zemiw,&
209  & pq , pcco2, pozn, pcldf, ptaucld, ztclear,&
210  & z_cldfrac,z_taucld,&
211  & ptau_lw,&
212  & z_coldry,z_wkl,z_wx,&
213  & z_tauaerl,z_pavel,z_tavel,z_pz,z_tz,z_tbound,i_nlayers,z_semiss,ireflect)
214 
215  ptclear(iplon)=ztclear
216 
217  istart = 1
218  iend = 16
219 
220 ! Calculate information needed by the radiative transfer routine
221 ! that is specific to this atmosphere, especially some of the
222 ! coefficients and indices needed to compute the optical depths
223 ! by interpolating data from stored reference atmospheres.
224 
225  CALL rrtm_setcoef_140gp (klev,z_coldry,z_wkl,&
226  & z_fac00,z_fac01,z_fac10,z_fac11,z_forfac,jp,jt,jt1,&
227  & z_colh2o,z_colco2,z_colo3,z_coln2o,z_colch4,z_colo2,z_co2mult,&
228  & i_laytrop,i_layswtch,i_laylow,z_pavel,z_tavel,z_selffac,z_selffrac,indself)
229 
230  CALL rrtm_gasabs1a_140gp (klev,z_atr1,z_od,z_tf1,z_coldry,z_wx,&
231  & z_tauaerl,z_fac00,z_fac01,z_fac10,z_fac11,z_forfac,jp,jt,jt1,z_oneminus,&
232  & z_colh2o,z_colco2,z_colo3,z_coln2o,z_colch4,z_colo2,z_co2mult,&
233  & i_laytrop,i_layswtch,i_laylow,z_selffac,z_selffrac,indself,z_pfrac)
234 
235 !- Call the radiative transfer routine.
236 
237 ! *** mji ***
238 ! Check for cloud in column. Use ECRT threshold set as flag icld in
239 ! routine ECRTATM. If icld=1 then column is cloudy, otherwise it is
240 ! clear. Also, set up flag array, icldlyr, for use in radiative
241 ! transfer. Set icldlyr to one for each layer with non-zero cloud
242 ! fraction.
243 
244  DO i_k = 1, klev
245  IF (icld == 1.AND.z_cldfrac(i_k) > zepsec) THEN
246  icldlyr(i_k) = 1
247  ELSE
248  icldlyr(i_k) = 0
249  ENDIF
250  ENDDO
251 
252 ! Clear and cloudy parts of column are treated together in RTRN.
253 ! Clear radiative transfer is done for clear layers and cloudy radiative
254 ! transfer is done for cloudy layers as identified by icldlyr.
255 
256  CALL rrtm_rtrn1a_140gp (klev,istart,iend,icldlyr,z_cldfrac,z_taucld,z_abss1,&
257  & z_od,z_tausf1,z_clfnet,z_clhtr,z_fnet,z_htr,z_totdfluc,z_totdflux,z_totufluc,z_totuflux,&
258  & z_tavel,z_pz,z_tz,z_tbound,z_pfrac,z_semiss,z_semislw,ireflect)
259 
260 ! *** Pass clear sky and total sky up and down flux profiles to ECRT
261 ! output arrays (zflux, zfluc). Array indexing from bottom to top
262 ! is preserved for ECRT.
263 ! Invert down flux arrays for consistency with ECRT sign conventions.
264 
265  pemit(iplon) = z_semislw
266  DO i = 0, klev
267  pfluc(iplon,1,i+1) = z_totufluc(i)*z_fluxfac
268  pfluc(iplon,2,i+1) = -z_totdfluc(i)*z_fluxfac
269  pflux(iplon,1,i+1) = z_totuflux(i)*z_fluxfac
270  pflux(iplon,2,i+1) = -z_totdflux(i)*z_fluxfac
271  ENDDO
272 ENDDO
273 
274 IF (lhook) CALL dr_hook('RRTM_RRTM_140GP',1,zhook_handle)
275 END SUBROUTINE rrtm_rrtm_140gp
subroutine rrtm_setcoef_140gp(KLEV, P_COLDRY, P_WKL, P_FAC00, P_FAC01, P_FAC10, P_FAC11, P_FORFAC, K_JP, K_JT, K_JT1, P_COLH2O, P_COLCO2, P_COLO3, P_COLN2O, P_COLCH4, P_COLO2, P_CO2MULT, K_LAYTROP, K_LAYSWTCH, K_LAYLOW, PAVEL, P_TAVEL, P_SELFFAC, P_SELFFRAC, K_INDSELF)
INTERFACE SUBROUTINE RRTM_ECRT_140GP pcco2
integer(kind=jpim) nlw
Definition: yoerad.F90:26
INTERFACE SUBROUTINE RRTM_ECRT_140GP pth
integer, save kidia
Definition: dimphy.F90:6
integer, save klon
Definition: dimphy.F90:3
integer, save klev
Definition: dimphy.F90:7
integer(kind=jpim), parameter jpinpx
Definition: parrrtm.F90:20
integer(kind=jpim), parameter jpgpt
Definition: parrrtm.F90:21
integer(kind=jpim), parameter jpband
Definition: parrrtm.F90:18
INTERFACE SUBROUTINE RRTM_ECRT_140GP pozn
integer, save kfdia
Definition: dimphy.F90:5
subroutine rrtm_ecrt_140gp(K_IPLON, klon, klev, kcld, paer, paph, pap, pts, pth, pt, P_ZEMIS, P_ZEMIW, pq, pcco2, pozn, pcldf, ptaucld, ptclear, P_CLDFRAC, P_TAUCLD, PTAU_LW, P_COLDRY, P_WKL, P_WX, P_TAUAERL, PAVEL, P_TAVEL, PZ, P_TZ, P_TBOUND, K_NLAYERS, P_SEMISS, K_IREFLECT)
integer, parameter jprb
Definition: parkind1.F90:31
Definition: yoerad.F90:1
INTERFACE SUBROUTINE RRTM_ECRT_140GP ptclear
logical lhook
Definition: yomhook.F90:12
subroutine rrtm_rrtm_140gp(KIDIA, KFDIA, KLON, KLEV, PAER, PAPH, PAP, PTS, PTH, PT, P_ZEMIS, P_ZEMIW, PQ, PCCO2, POZN, PCLDF, PTAUCLD, PTAU_LW, PEMIT, PFLUX, PFLUC, PTCLEAR)
INTERFACE SUBROUTINE RRTM_ECRT_140GP pcldf
subroutine rrtm_gasabs1a_140gp(KLEV, P_ATR1, P_OD, P_TF1, P_COLDRY, P_WX, P_TAUAERL, P_FAC00, P_FAC01, P_FAC10, P_FAC11, P_FORFAC, K_JP, K_JT, K_JT1, P_ONEMINUS, P_COLH2O, P_COLCO2, P_COLO3, P_COLN2O, P_COLCH4, P_COLO2, P_CO2MULT, K_LAYTROP, K_LAYSWTCH, K_LAYLOW, P_SELFFAC, P_SELFFRAC, K_INDSELF, PFRAC)
INTERFACE SUBROUTINE RRTM_ECRT_140GP paph
integer(kind=jpim), parameter jplay
Definition: parrrtm.F90:15
subroutine dr_hook(CDNAME, KSWITCH, PKEY)
Definition: yomhook.F90:17
INTERFACE SUBROUTINE RRTM_ECRT_140GP pt
INTERFACE SUBROUTINE RRTM_ECRT_140GP ptaucld
integer, parameter jpim
Definition: parkind1.F90:13
INTERFACE SUBROUTINE RRTM_ECRT_140GP pap
INTERFACE SUBROUTINE RRTM_ECRT_140GP && paer
INTERFACE SUBROUTINE RRTM_ECRT_140GP && pts
INTERFACE SUBROUTINE RRTM_ECRT_140GP && pq
subroutine rrtm_rtrn1a_140gp(KLEV, K_ISTART, K_IEND, K_ICLDLYR, P_CLDFRAC, P_TAUCLD, P_ABSS1, P_OD, P_TAUSF1, P_CLFNET, P_CLHTR, P_FNET, P_HTR, P_TOTDFLUC, P_TOTDFLUX, P_TOTUFLUC, P_TOTUFLUX, P_TAVEL, PZ, P_TZ, P_TBOUND, PFRAC, P_SEMISS, P_SEMISLW, K_IREFLECT)
integer(kind=jpim), parameter jpxsec
Definition: parrrtm.F90:19