1 | ! AI mars 2021 |
---|
2 | ! ====================== Interface between ECRAD and LMDZ ==================== |
---|
3 | ! radiation_scheme.F90 appelee dans radlwsw_m.F90 si iflag_rttm = 2 |
---|
4 | ! revoir toutes les parties avec "AI ATTENTION" |
---|
5 | ! Mars 2021 : |
---|
6 | ! - Revoir toutes les parties commentees AI ATTENTION |
---|
7 | ! 1. Traitement des aerosols |
---|
8 | ! 2. Verifier les parametres times issus de LMDZ (calcul issed) |
---|
9 | ! 3. Configuration a partir de namelist |
---|
10 | ! 4. frac_std = 0.75 |
---|
11 | ! ============================================================================ |
---|
12 | |
---|
13 | SUBROUTINE RADIATION_SCHEME & |
---|
14 | ! Inputs |
---|
15 | & (KIDIA, KFDIA, KLON, KLEV, KAEROSOL, NSW, & |
---|
16 | & IDAY, TIME, & |
---|
17 | & PSOLAR_IRRADIANCE, & |
---|
18 | & PMU0, PTEMPERATURE_SKIN, & |
---|
19 | & PALBEDO_DIF, PALBEDO_DIR, & |
---|
20 | & PEMIS, PEMIS_WINDOW, & |
---|
21 | & PGELAM, PGEMU, & |
---|
22 | & PPRESSURE_H, PTEMPERATURE_H, PQ, PQSAT, & |
---|
23 | & PCO2, PCH4, PN2O, PNO2, PCFC11, PCFC12, PHCFC22, & |
---|
24 | & PCCL4, PO3, PO2, & |
---|
25 | & PCLOUD_FRAC, PQ_LIQUID, PQ_ICE, PQ_SNOW, & |
---|
26 | & ZRE_LIQUID_UM, ZRE_ICE_UM, & |
---|
27 | & PAEROSOL_OLD, PAEROSOL, & |
---|
28 | ! Outputs |
---|
29 | & PFLUX_SW, PFLUX_LW, PFLUX_SW_CLEAR, PFLUX_LW_CLEAR, & |
---|
30 | & PFLUX_SW_DN, PFLUX_LW_DN, PFLUX_SW_DN_CLEAR, PFLUX_LW_DN_CLEAR, & |
---|
31 | & PFLUX_SW_UP, PFLUX_LW_UP, PFLUX_SW_UP_CLEAR, PFLUX_LW_UP_CLEAR, & |
---|
32 | & PFLUX_DIR, PFLUX_DIR_CLEAR, PFLUX_DIR_INTO_SUN, & |
---|
33 | & PFLUX_UV, PFLUX_PAR, PFLUX_PAR_CLEAR, & |
---|
34 | & PEMIS_OUT, PLWDERIVATIVE, & |
---|
35 | & PSWDIFFUSEBAND, PSWDIRECTBAND) |
---|
36 | |
---|
37 | |
---|
38 | ! RADIATION_SCHEME - Interface to modular radiation scheme |
---|
39 | ! |
---|
40 | ! (C) Copyright 2015- ECMWF. |
---|
41 | ! |
---|
42 | ! This software is licensed under the terms of the Apache Licence Version 2.0 |
---|
43 | ! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. |
---|
44 | ! |
---|
45 | ! In applying this licence, ECMWF does not waive the privileges and immunities |
---|
46 | ! granted to it by virtue of its status as an intergovernmental organisation |
---|
47 | ! nor does it submit to any jurisdiction. |
---|
48 | ! |
---|
49 | ! PURPOSE |
---|
50 | ! ------- |
---|
51 | ! The modular radiation scheme is contained in a separate |
---|
52 | ! library. This routine puts the the IFS arrays into appropriate |
---|
53 | ! objects, computing the additional data that is required, and sends |
---|
54 | ! it to the radiation scheme. It returns net fluxes and surface |
---|
55 | ! flux components needed by the rest of the model. |
---|
56 | ! |
---|
57 | ! Lower case is used for variables and types taken from the |
---|
58 | ! radiation library |
---|
59 | ! |
---|
60 | ! INTERFACE |
---|
61 | ! --------- |
---|
62 | ! RADIATION_SCHEME is called from RADLSWR. The |
---|
63 | ! SETUP_RADIATION_SCHEME routine (in the RADIATION_SETUP module) |
---|
64 | ! should have been run first. |
---|
65 | ! |
---|
66 | ! AUTHOR |
---|
67 | ! ------ |
---|
68 | ! Robin Hogan, ECMWF |
---|
69 | ! Original: 2015-09-16 |
---|
70 | ! |
---|
71 | ! MODIFICATIONS |
---|
72 | ! ------------- |
---|
73 | ! |
---|
74 | ! TO DO |
---|
75 | ! ----- |
---|
76 | ! |
---|
77 | !----------------------------------------------------------------------- |
---|
78 | |
---|
79 | ! Modules from ifs or ifsaux libraries |
---|
80 | USE PARKIND1 , ONLY : JPIM, JPRB |
---|
81 | USE YOMHOOK , ONLY : LHOOK, DR_HOOK |
---|
82 | ! AI ATTENTION module propre a ifs commentes |
---|
83 | !USE YOERAD , ONLY : YRERAD |
---|
84 | USE RADIATION_SETUP, ONLY : SETUP_RADIATION_SCHEME, rad_config, & |
---|
85 | !USE RADIATION_SETUP, ONLY : & |
---|
86 | & NWEIGHT_UV, IBAND_UV, WEIGHT_UV, & |
---|
87 | & NWEIGHT_PAR, IBAND_PAR, WEIGHT_PAR, & |
---|
88 | & ITYPE_TROP_BG_AER, TROP_BG_AER_MASS_EXT, & |
---|
89 | & ITYPE_STRAT_BG_AER, STRAT_BG_AER_MASS_EXT, ISolverSpartacus |
---|
90 | ! Commentes : jour, date de la simulation |
---|
91 | !USE YOMRIP0 , ONLY : NINDAT |
---|
92 | !USE YOMCT3 , ONLY : NSTEP |
---|
93 | !USE YOMRIP , ONLY : YRRIP |
---|
94 | USE YOMCST , ONLY : RSIGMA ! Stefan-Boltzmann constant |
---|
95 | |
---|
96 | ! Modules from radiation library |
---|
97 | USE radiation_single_level, ONLY : single_level_type |
---|
98 | USE radiation_thermodynamics, ONLY : thermodynamics_type |
---|
99 | USE radiation_gas |
---|
100 | USE radiation_cloud, ONLY : cloud_type |
---|
101 | USE radiation_aerosol, ONLY : aerosol_type |
---|
102 | USE radiation_flux, ONLY : flux_type |
---|
103 | USE radiation_interface, ONLY : radiation, set_gas_units |
---|
104 | USE radiation_save, ONLY : save_inputs |
---|
105 | |
---|
106 | USE mod_phys_lmdz_para |
---|
107 | USE setup_config_from_lmdz, ONLY : driver_config_type |
---|
108 | |
---|
109 | IMPLICIT NONE |
---|
110 | |
---|
111 | ! INPUT ARGUMENTS |
---|
112 | ! *** Array dimensions and ranges |
---|
113 | INTEGER(KIND=JPIM),INTENT(IN) :: KIDIA ! Start column to process |
---|
114 | INTEGER(KIND=JPIM),INTENT(IN) :: KFDIA ! End column to process |
---|
115 | !INTEGER, INTENT(IN) :: KIDIA, KFDIA |
---|
116 | INTEGER(KIND=JPIM),INTENT(IN) :: KLON ! Number of columns |
---|
117 | INTEGER(KIND=JPIM),INTENT(IN) :: KLEV ! Number of levels |
---|
118 | !INTEGER, INTENT(IN) :: KLON, KLEV |
---|
119 | !INTEGER(KIND=JPIM),INTENT(IN) :: KAEROLMDZ ! Number of aerosol types |
---|
120 | INTEGER(KIND=JPIM),INTENT(IN) :: KAEROSOL |
---|
121 | INTEGER(KIND=JPIM),INTENT(IN) :: NSW ! Numbe of bands |
---|
122 | |
---|
123 | ! AI ATTENTION |
---|
124 | !INTEGER, PARAMETER :: KAEROSOL = 12 |
---|
125 | |
---|
126 | ! *** Single-level fields |
---|
127 | REAL(KIND=JPRB), INTENT(IN) :: PSOLAR_IRRADIANCE ! (W m-2) |
---|
128 | REAL(KIND=JPRB), INTENT(IN) :: PMU0(KLON) ! Cosine of solar zenith ang |
---|
129 | REAL(KIND=JPRB), INTENT(IN) :: PTEMPERATURE_SKIN(KLON) ! (K) |
---|
130 | ! Diffuse and direct components of surface shortwave albedo |
---|
131 | !REAL(KIND=JPRB), INTENT(IN) :: PALBEDO_DIF(KLON,YRERAD%NSW) |
---|
132 | !REAL(KIND=JPRB), INTENT(IN) :: PALBEDO_DIR(KLON,YRERAD%NSW) |
---|
133 | REAL(KIND=JPRB), INTENT(IN) :: PALBEDO_DIF(KLON,NSW) |
---|
134 | REAL(KIND=JPRB), INTENT(IN) :: PALBEDO_DIR(KLON,NSW) |
---|
135 | ! Longwave emissivity outside and inside the window region |
---|
136 | REAL(KIND=JPRB), INTENT(IN) :: PEMIS(KLON) |
---|
137 | REAL(KIND=JPRB), INTENT(IN) :: PEMIS_WINDOW(KLON) |
---|
138 | ! Longitude (radians), sine of latitude |
---|
139 | REAL(KIND=JPRB), INTENT(IN) :: PGELAM(KLON) |
---|
140 | REAL(KIND=JPRB), INTENT(IN) :: PGEMU(KLON) |
---|
141 | ! Land-sea mask |
---|
142 | !REAL(KIND=JPRB), INTENT(IN) :: PLAND_SEA_MASK(KLON) |
---|
143 | |
---|
144 | ! *** Variables on full levels |
---|
145 | !REAL(KIND=JPRB), INTENT(IN) :: PPRESSURE(KLON,KLEV) ! (Pa) |
---|
146 | !REAL(KIND=JPRB), INTENT(IN) :: PTEMPERATURE(KLON,KLEV) ! (K) |
---|
147 | ! *** Variables on half levels |
---|
148 | REAL(KIND=JPRB), INTENT(IN) :: PPRESSURE_H(KLON,KLEV+1) ! (Pa) |
---|
149 | REAL(KIND=JPRB), INTENT(IN) :: PTEMPERATURE_H(KLON,KLEV+1) ! (K) |
---|
150 | |
---|
151 | ! *** Gas mass mixing ratios on full levels |
---|
152 | REAL(KIND=JPRB), INTENT(IN) :: PQ(KLON,KLEV) |
---|
153 | ! AI |
---|
154 | REAL(KIND=JPRB), INTENT(IN) :: PQSAT(KLON,KLEV) |
---|
155 | REAL(KIND=JPRB), INTENT(IN) :: PCO2 |
---|
156 | REAL(KIND=JPRB), INTENT(IN) :: PCH4 |
---|
157 | REAL(KIND=JPRB), INTENT(IN) :: PN2O |
---|
158 | REAL(KIND=JPRB), INTENT(IN) :: PNO2 |
---|
159 | REAL(KIND=JPRB), INTENT(IN) :: PCFC11 |
---|
160 | REAL(KIND=JPRB), INTENT(IN) :: PCFC12 |
---|
161 | REAL(KIND=JPRB), INTENT(IN) :: PHCFC22 |
---|
162 | REAL(KIND=JPRB), INTENT(IN) :: PCCL4 |
---|
163 | REAL(KIND=JPRB), INTENT(IN) :: PO3(KLON,KLEV) ! AI (kg/kg) ATTENTION (Pa*kg/kg) |
---|
164 | REAL(KIND=JPRB), INTENT(IN) :: PO2 |
---|
165 | |
---|
166 | ! *** Cloud fraction and hydrometeor mass mixing ratios |
---|
167 | REAL(KIND=JPRB), INTENT(IN) :: PCLOUD_FRAC(KLON,KLEV) |
---|
168 | REAL(KIND=JPRB), INTENT(IN) :: PQ_LIQUID(KLON,KLEV) |
---|
169 | REAL(KIND=JPRB), INTENT(IN) :: PQ_ICE(KLON,KLEV) |
---|
170 | !REAL(KIND=JPRB), INTENT(IN) :: PQ_RAIN(KLON,KLEV) |
---|
171 | REAL(KIND=JPRB), INTENT(IN) :: PQ_SNOW(KLON,KLEV) |
---|
172 | |
---|
173 | ! *** Aerosol mass mixing ratios |
---|
174 | REAL(KIND=JPRB), INTENT(IN) :: PAEROSOL_OLD(KLON,6,KLEV) |
---|
175 | REAL(KIND=JPRB), INTENT(IN) :: PAEROSOL(KLON,KLEV,KAEROSOL) |
---|
176 | |
---|
177 | !REAL(KIND=JPRB), INTENT(IN) :: PCCN_LAND(KLON) |
---|
178 | !REAL(KIND=JPRB), INTENT(IN) :: PCCN_SEA(KLON) |
---|
179 | |
---|
180 | !AI mars 2021 |
---|
181 | INTEGER(KIND=JPIM), INTENT(IN) :: IDAY |
---|
182 | REAL(KIND=JPRB), INTENT(IN) :: TIME |
---|
183 | |
---|
184 | |
---|
185 | ! OUTPUT ARGUMENTS |
---|
186 | |
---|
187 | ! *** Net fluxes on half-levels (W m-2) |
---|
188 | REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_SW(KLON,KLEV+1) |
---|
189 | REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_LW(KLON,KLEV+1) |
---|
190 | REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_SW_CLEAR(KLON,KLEV+1) |
---|
191 | REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_LW_CLEAR(KLON,KLEV+1) |
---|
192 | |
---|
193 | !*** DN and UP flux on half-levels (W m-2) |
---|
194 | REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_SW_DN(KLON,KLEV+1) |
---|
195 | REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_LW_DN(KLON,KLEV+1) |
---|
196 | REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_SW_DN_CLEAR(KLON,KLEV+1) |
---|
197 | REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_LW_DN_CLEAR(KLON,KLEV+1) |
---|
198 | REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_SW_UP(KLON,KLEV+1) |
---|
199 | REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_LW_UP(KLON,KLEV+1) |
---|
200 | REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_SW_UP_CLEAR(KLON,KLEV+1) |
---|
201 | REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_LW_UP_CLEAR(KLON,KLEV+1) |
---|
202 | |
---|
203 | ! *** Surface flux components (W m-2) |
---|
204 | ! AI ATTENTION |
---|
205 | !REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_SW_DN_SURF(KLON) |
---|
206 | !REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_LW_DN_SURF(KLON) |
---|
207 | !REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_SW_DN_CLEAR_SURF(KLON) |
---|
208 | !REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_LW_DN_CLEAR_SURF(KLON) |
---|
209 | !REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_SW_UP_SURF(KLON) |
---|
210 | !REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_LW_UP_SURF(KLON) |
---|
211 | !REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_SW_UP_CLEAR_SURF(KLON) |
---|
212 | !REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_LW_UP_CLEAR_SURF(KLON) |
---|
213 | |
---|
214 | ! Direct component of surface flux into horizontal plane |
---|
215 | REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_DIR(KLON) |
---|
216 | REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_DIR_CLEAR(KLON) |
---|
217 | ! As PFLUX_DIR but into a plane perpendicular to the sun |
---|
218 | REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_DIR_INTO_SUN(KLON) |
---|
219 | |
---|
220 | ! *** Ultraviolet and photosynthetically active radiation (W m-2) |
---|
221 | REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_UV(KLON) |
---|
222 | REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_PAR(KLON) |
---|
223 | REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_PAR_CLEAR(KLON) |
---|
224 | |
---|
225 | ! *** Other single-level diagnostics |
---|
226 | ! Top-of-atmosphere incident solar flux (W m-2) |
---|
227 | ! AI ATTENTION |
---|
228 | !REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_SW_DN_TOA(KLON) |
---|
229 | !REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_SW_UP_TOA(KLON) |
---|
230 | !REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_LW_DN_TOA(KLON) |
---|
231 | !REAL(KIND=JPRB), INTENT(OUT) :: PFLUX_LW_UP_TOA(KLON) |
---|
232 | |
---|
233 | ! Diagnosed longwave surface emissivity across the whole spectrum |
---|
234 | REAL(KIND=JPRB), INTENT(OUT) :: PEMIS_OUT(KLON) |
---|
235 | |
---|
236 | ! Partial derivative of total-sky longwave upward flux at each level |
---|
237 | ! with respect to upward flux at surface, used to correct heating |
---|
238 | ! rates at gridpoints/timesteps between calls to the full radiation |
---|
239 | ! scheme. Note that this version uses the convention of level index |
---|
240 | ! increasing downwards, unlike the local variable ZLwDerivative that |
---|
241 | ! is returned from the LW radiation scheme. |
---|
242 | REAL(KIND=JPRB), INTENT(OUT) :: PLWDERIVATIVE(KLON,KLEV+1) |
---|
243 | |
---|
244 | ! Surface diffuse and direct downwelling shortwave flux in each |
---|
245 | ! shortwave albedo band, used in RADINTG to update the surface fluxes |
---|
246 | ! accounting for high-resolution albedo information |
---|
247 | REAL(KIND=JPRB), INTENT(OUT) :: PSWDIFFUSEBAND(KLON,NSW) |
---|
248 | REAL(KIND=JPRB), INTENT(OUT) :: PSWDIRECTBAND (KLON,NSW) |
---|
249 | |
---|
250 | ! LOCAL VARIABLES |
---|
251 | ! AI ATTENTION |
---|
252 | !type(config_type) :: rad_config |
---|
253 | TYPE(single_level_type) :: single_level |
---|
254 | TYPE(thermodynamics_type) :: thermodynamics |
---|
255 | TYPE(gas_type) :: gas |
---|
256 | TYPE(cloud_type) :: cloud |
---|
257 | TYPE(aerosol_type) :: aerosol |
---|
258 | TYPE(flux_type) :: flux |
---|
259 | |
---|
260 | ! Mass mixing ratio of ozone (kg/kg) |
---|
261 | REAL(KIND=JPRB) :: ZO3(KLON,KLEV) |
---|
262 | |
---|
263 | ! Cloud effective radii in microns |
---|
264 | REAL(KIND=JPRB) :: ZRE_LIQUID_UM(KLON,KLEV) |
---|
265 | REAL(KIND=JPRB) :: ZRE_ICE_UM(KLON,KLEV) |
---|
266 | |
---|
267 | ! Cloud overlap decorrelation length for cloud boundaries in km |
---|
268 | REAL(KIND=JPRB) :: ZDECORR_LEN_KM(KLON) |
---|
269 | |
---|
270 | ! Ratio of cloud overlap decorrelation length for cloud water |
---|
271 | ! inhomogeneities to that for cloud boundaries (typically 0.5) |
---|
272 | !REAL(KIND=JPRB) :: ZDECORR_LEN_RATIO = 0.5_jprb |
---|
273 | |
---|
274 | !AI mai 2023 |
---|
275 | ! A mettre dans namelist |
---|
276 | !real(jprb) :: high_inv_effective_size |
---|
277 | !real(jprb) :: middle_inv_effective_size |
---|
278 | !real(jprb) :: low_inv_effective_size |
---|
279 | |
---|
280 | !real(jprb) :: cloud_inhom_separation_factor |
---|
281 | !real(jprb) :: cloud_separation_scale_surface |
---|
282 | !real(jprb) :: cloud_separation_scale_toa |
---|
283 | !real(jprb) :: cloud_separation_scale_power |
---|
284 | |
---|
285 | ! The surface net longwave flux if the surface was a black body, used |
---|
286 | ! to compute the effective broadband surface emissivity |
---|
287 | REAL(KIND=JPRB) :: ZBLACK_BODY_NET_LW(KIDIA:KFDIA) |
---|
288 | |
---|
289 | ! Layer mass in kg m-2 |
---|
290 | REAL(KIND=JPRB) :: ZLAYER_MASS(KIDIA:KFDIA,KLEV) |
---|
291 | |
---|
292 | ! Time integers |
---|
293 | INTEGER :: ITIM |
---|
294 | |
---|
295 | ! Loop indices |
---|
296 | INTEGER :: JLON, JLEV, JBAND, JB_ALBEDO, JAER |
---|
297 | |
---|
298 | REAL(KIND=JPRB) :: ZHOOK_HANDLE |
---|
299 | |
---|
300 | ! AI ATTENTION traitement aerosols |
---|
301 | INTEGER, PARAMETER :: NAERMACC = 1 |
---|
302 | |
---|
303 | ! AI ATTENTION |
---|
304 | ! A mettre dans namelist |
---|
305 | !real(jprb), parameter :: frac_std = 0.75 |
---|
306 | |
---|
307 | ! Name of file names specified on command line |
---|
308 | character(len=512) :: file_name |
---|
309 | |
---|
310 | logical :: loutput=.true. |
---|
311 | logical :: lprint_input=.false. |
---|
312 | logical :: lprint_config=.false. |
---|
313 | logical, save :: debut_ecrad=.true. |
---|
314 | !$OMP THREADPRIVATE(debut_ecrad) |
---|
315 | |
---|
316 | type(driver_config_type) :: driver_config |
---|
317 | ! Import time functions for iseed calculation |
---|
318 | ! AI ATTENTION propre a ifs |
---|
319 | !#include "fcttim.func.h" |
---|
320 | !#include "liquid_effective_radius.intfb.h" |
---|
321 | !#include "ice_effective_radius.intfb.h" |
---|
322 | !#include "cloud_overlap_decorr_len.intfb.h" |
---|
323 | !#include "satur.intfb.h" |
---|
324 | |
---|
325 | ! Verifier les inputs |
---|
326 | print*,'=============== dans radiation_scheme : ===================' |
---|
327 | if (lprint_input) then |
---|
328 | print*,'********** Verification des entrees *************' |
---|
329 | print*,'KIDIA, KFDIA, KLON, KLEV, KAEROSOL, NSW =', & |
---|
330 | KIDIA, KFDIA, KLON, KLEV, KAEROSOL, NSW |
---|
331 | print*,'IDAY, TIME =', IDAY, TIME |
---|
332 | print*,'PSOLAR_IRRADIANCE =', PSOLAR_IRRADIANCE |
---|
333 | print*,'PMU0 =', PMU0 |
---|
334 | print*,'PTEMPERATURE_SKIN =',PTEMPERATURE_SKIN |
---|
335 | print*,'PEMIS, PEMIS_WINDOW =', PEMIS, PEMIS_WINDOW |
---|
336 | print*,'PGELAM, PGEMU =', PGELAM, PGEMU |
---|
337 | print*,'PPRESSURE_H =', PPRESSURE_H |
---|
338 | print*,'PTEMPERATURE_H =', PTEMPERATURE_H |
---|
339 | print*,'PQ =', PQ |
---|
340 | print*,'PQSAT=',PQSAT |
---|
341 | print*,'PCO2, PCH4, PN2O, PNO2, PCFC11, PCFC12, PHCFC22, PCCL4 =', & |
---|
342 | PCO2, PCH4, PN2O, PNO2, PCFC11, PCFC12, PHCFC22, PCCL4 |
---|
343 | print*,'PO3 =',PO3 |
---|
344 | print*,'PCLOUD_FRAC, PQ_LIQUID, PQ_ICE, PQ_SNOW =', & |
---|
345 | PCLOUD_FRAC, PQ_LIQUID, PQ_ICE, PQ_SNOW |
---|
346 | print*,'ZRE_LIQUID_UM, ZRE_ICE_UM =', & |
---|
347 | ZRE_LIQUID_UM, ZRE_ICE_UM |
---|
348 | print*,'PAEROSOL_OLD, PAEROSOL =', PAEROSOL_OLD, PAEROSOL |
---|
349 | endif |
---|
350 | |
---|
351 | IF (LHOOK) CALL DR_HOOK('RADIATION_SCHEME',0,ZHOOK_HANDLE) |
---|
352 | print*,'Entree dans radiation_scheme' |
---|
353 | |
---|
354 | !$OMP MASTER |
---|
355 | if (debut_ecrad) then |
---|
356 | ! AI appel radiation_setup |
---|
357 | call SETUP_RADIATION_SCHEME(loutput) |
---|
358 | ! Read "radiation_driver" namelist into radiation driver config type |
---|
359 | file_name="namelist_ecrad" |
---|
360 | call driver_config%read(file_name) |
---|
361 | |
---|
362 | if (rad_config%i_solver_sw == ISolverSPARTACUS & |
---|
363 | & .or. rad_config%i_solver_lw == ISolverSPARTACUS) then |
---|
364 | print*,'Solveur SW: ', rad_config%i_solver_sw |
---|
365 | print*,'Solveur LW: ', rad_config%i_solver_lw |
---|
366 | if (driver_config%ok_effective_size) then |
---|
367 | print*,'low_inv_effective_size = ',driver_config%low_inv_effective_size |
---|
368 | print*,'middle_inv_effective_size = ',driver_config%middle_inv_effective_size |
---|
369 | print*,'high_inv_effective_size = ',driver_config%high_inv_effective_size |
---|
370 | else if (driver_config%ok_separation) then |
---|
371 | print*,'cloud_separation_scale_surface =',driver_config%cloud_separation_scale_surface |
---|
372 | print*,'cloud_separation_scale_toa =',driver_config%cloud_separation_scale_toa |
---|
373 | print*,'cloud_separation_scale_power =',driver_config%cloud_separation_scale_power |
---|
374 | print*,'cloud_inhom_separation_factor =',driver_config%cloud_inhom_separation_factor |
---|
375 | endif |
---|
376 | endif |
---|
377 | |
---|
378 | if (lprint_config) then |
---|
379 | print*,'************* Parametres de configuration ********************' |
---|
380 | print*,'rad_config%iverbosesetup = ',rad_config%iverbosesetup |
---|
381 | print*,'rad_config%iverbose = ',rad_config%iverbose |
---|
382 | print*,'rad_config%directory_name =', rad_config%directory_name |
---|
383 | print*,'rad_config%do_lw_derivatives =',rad_config%do_lw_derivatives |
---|
384 | print*,'rad_config%do_surface_sw_spectral_flux =', & |
---|
385 | rad_config%do_surface_sw_spectral_flux |
---|
386 | print*,'rad_config%do_setup_ifsrrtm =', rad_config%do_setup_ifsrrtm |
---|
387 | print*,'rad_config%i_liq_model =',rad_config%i_liq_model |
---|
388 | print*,'rad_config%i_ice_model =',rad_config%i_ice_model |
---|
389 | print*,'rad_config%i_overlap_scheme =', rad_config%i_overlap_scheme |
---|
390 | print*,'rad_config%use_aerosols = ', rad_config%use_aerosols |
---|
391 | print*,'rad_config%n_aerosol_types = ', rad_config%n_aerosol_types |
---|
392 | print*,'rad_config%i_solver_lw =',rad_config%i_solver_lw |
---|
393 | print*,'rad_config%i_solver_sw =',rad_config%i_solver_sw |
---|
394 | print*,'rad_config%do_3d_effects =', rad_config%do_3d_effects |
---|
395 | print*,'rad_config%do_sw_delta_scaling_with_gases =', & |
---|
396 | rad_config%do_sw_delta_scaling_with_gases |
---|
397 | print*,'rad_config%do_lw_aerosol_scattering =', & |
---|
398 | rad_config%do_lw_aerosol_scattering |
---|
399 | print*,'rad_config%i_albedo_from_band_sw = ', & |
---|
400 | rad_config%i_albedo_from_band_sw |
---|
401 | print*,'n_bands_lw =', rad_config%n_bands_lw |
---|
402 | print*,'rad_config%i_emiss_from_band_lw =', rad_config%i_emiss_from_band_lw |
---|
403 | endif |
---|
404 | debut_ecrad=.false. |
---|
405 | endif |
---|
406 | !$OMP END MASTER |
---|
407 | !$OMP BARRIER |
---|
408 | ! Fin partie initialisation et configuration |
---|
409 | |
---|
410 | ! AI : allocation des tableaux pour chaque partie (thermo, ...) |
---|
411 | ! passage des champs LMDZ aux structures Ecrad |
---|
412 | ! calculs Ecrad |
---|
413 | ! AI ATTENTION |
---|
414 | ! Allocate memory in radiation objects |
---|
415 | ! emissivite avec une seule bande |
---|
416 | CALL single_level%allocate(KLON, NSW, 1, & |
---|
417 | & use_sw_albedo_direct=.TRUE.) |
---|
418 | |
---|
419 | print*,'************* THERMO (allocate + input) ************************************' |
---|
420 | ! Set thermodynamic profiles: simply copy over the half-level |
---|
421 | ! pressure and temperature |
---|
422 | !print*,'Appel allocate thermo' |
---|
423 | CALL thermodynamics%allocate(KLON, KLEV, use_h2o_sat=.true.) |
---|
424 | !print*,'Definir les champs thermo' |
---|
425 | ! AI |
---|
426 | ! pressure_hl > paprs |
---|
427 | ! temperature_hl calculee dans radlsw de la meme facon que pour RRTM |
---|
428 | thermodynamics%pressure_hl (KIDIA:KFDIA,:) = PPRESSURE_H (KIDIA:KFDIA,:) |
---|
429 | thermodynamics%temperature_hl(KIDIA:KFDIA,:) = PTEMPERATURE_H(KIDIA:KFDIA,:) |
---|
430 | |
---|
431 | !print*,'Compute saturation specific humidity' |
---|
432 | ! Compute saturation specific humidity, used to hydrate aerosols. The |
---|
433 | ! "2" for the last argument indicates that the routine is not being |
---|
434 | ! called from within the convection scheme. |
---|
435 | !CALL SATUR(KIDIA, KFDIA, KLON, 1, KLEV, & |
---|
436 | ! & PPRESSURE, PTEMPERATURE, thermodynamics%h2o_sat_liq, 2) |
---|
437 | ! Alternative approximate version using temperature and pressure from |
---|
438 | ! the thermodynamics structure |
---|
439 | !CALL thermodynamics%calc_saturation_wrt_liquid(KIDIA, KFDIA) |
---|
440 | !AI ATTENTION |
---|
441 | thermodynamics%h2o_sat_liq = PQSAT |
---|
442 | |
---|
443 | print*,'********** SINGLE LEVEL VARS **********************************' |
---|
444 | !AI ATTENTION |
---|
445 | ! Set single-level fileds |
---|
446 | single_level%solar_irradiance = PSOLAR_IRRADIANCE |
---|
447 | single_level%cos_sza(KIDIA:KFDIA) = PMU0(KIDIA:KFDIA) |
---|
448 | single_level%skin_temperature(KIDIA:KFDIA) = PTEMPERATURE_SKIN(KIDIA:KFDIA) |
---|
449 | single_level%sw_albedo(KIDIA:KFDIA,:) = PALBEDO_DIF(KIDIA:KFDIA,:) |
---|
450 | single_level%sw_albedo_direct(KIDIA:KFDIA,:)=PALBEDO_DIR(KIDIA:KFDIA,:) |
---|
451 | single_level%lw_emissivity(KIDIA:KFDIA,1) = PEMIS(KIDIA:KFDIA) |
---|
452 | !single_level%lw_emissivity(KIDIA:KFDIA,2) = PEMIS_WINDOW(KIDIA:KFDIA) |
---|
453 | |
---|
454 | ! Create the relevant seed from date and time get the starting day |
---|
455 | ! and number of minutes since start |
---|
456 | !IDAY = NDD(NINDAT) |
---|
457 | !cur_day |
---|
458 | !ITIM = NINT(NSTEP * YRRIP%TSTEP / 60.0_JPRB) |
---|
459 | ITIM = NINT(TIME / 60.0_JPRB) |
---|
460 | !current_time |
---|
461 | !allocate(single_level%iseed(KIDIA:KFDIA)) |
---|
462 | DO JLON = KIDIA, KFDIA |
---|
463 | ! This method gives a unique value for roughly every 1-km square |
---|
464 | ! on the globe and every minute. ASIN(PGEMU)*60 gives rough |
---|
465 | ! latitude in degrees, which we multiply by 100 to give a unique |
---|
466 | ! value for roughly every km. PGELAM*60*100 gives a unique number |
---|
467 | ! for roughly every km of longitude around the equator, which we |
---|
468 | ! multiply by 180*100 so there is no overlap with the latitude |
---|
469 | ! values. The result can be contained in a 32-byte integer (but |
---|
470 | ! since random numbers are generated with the help of integer |
---|
471 | ! overflow, it should not matter if the number did overflow). |
---|
472 | single_level%iseed(JLON) = ITIM + IDAY & |
---|
473 | & + NINT(PGELAM(JLON)*108000000.0_JPRB & |
---|
474 | & + ASIN(PGEMU(JLON))*6000.0_JPRB) |
---|
475 | ENDDO |
---|
476 | |
---|
477 | print*,'********** CLOUDS (allocate + input) *******************************************' |
---|
478 | !print*,'Appel Allocate clouds' |
---|
479 | CALL cloud%allocate(KLON, KLEV) |
---|
480 | ! Set cloud fields |
---|
481 | cloud%q_liq(KIDIA:KFDIA,:) = PQ_LIQUID(KIDIA:KFDIA,:) |
---|
482 | cloud%q_ice(KIDIA:KFDIA,:) = PQ_ICE(KIDIA:KFDIA,:) + PQ_SNOW(KIDIA:KFDIA,:) |
---|
483 | cloud%fraction(KIDIA:KFDIA,:) = PCLOUD_FRAC(KIDIA:KFDIA,:) |
---|
484 | |
---|
485 | !!! ok AI ATTENTION a voir avec JL |
---|
486 | ! Compute effective radi and convert to metres |
---|
487 | ! AI. : on passe directement les champs de LMDZ |
---|
488 | cloud%re_liq(KIDIA:KFDIA,:) = ZRE_LIQUID_UM(KIDIA:KFDIA,:) |
---|
489 | cloud%re_ice(KIDIA:KFDIA,:) = ZRE_ICE_UM(KIDIA:KFDIA,:) |
---|
490 | |
---|
491 | ! Get the cloud overlap decorrelation length (for cloud boundaries), |
---|
492 | ! in km, according to the parameterization specified by NDECOLAT, |
---|
493 | ! and insert into the "cloud" object. Also get the ratio of |
---|
494 | ! decorrelation lengths for cloud water content inhomogeneities and |
---|
495 | ! cloud boundaries, and set it in the "rad_config" object. |
---|
496 | ! IFS : |
---|
497 | !CALL CLOUD_OVERLAP_DECORR_LEN(KIDIA, KFDIA, KLON, PGEMU, YRERAD%NDECOLAT, & |
---|
498 | ! & ZDECORR_LEN_KM, PDECORR_LEN_RATIO=ZDECORR_LEN_RATIO) |
---|
499 | ! AI valeur dans namelist |
---|
500 | ! rad_config%cloud_inhom_decorr_scaling = ZDECORR_LEN_RATIO |
---|
501 | |
---|
502 | !AI ATTENTION meme valeur que dans offline |
---|
503 | ! A mettre dans namelist |
---|
504 | ZDECORR_LEN_KM = driver_config%overlap_decorr_length |
---|
505 | DO JLON = KIDIA,KFDIA |
---|
506 | CALL cloud%set_overlap_param(thermodynamics, & |
---|
507 | & ZDECORR_LEN_KM(JLON), & |
---|
508 | & istartcol=JLON, iendcol=JLON) |
---|
509 | ENDDO |
---|
510 | |
---|
511 | ! IFS : |
---|
512 | ! Cloud water content fractional standard deviation is configurable |
---|
513 | ! from namelist NAERAD but must be globally constant. Before it was |
---|
514 | ! hard coded at 1.0. |
---|
515 | !CALL cloud%create_fractional_std(KLON, KLEV, YRERAD%RCLOUD_FRAC_STD) |
---|
516 | ! AI ATTENTION frac_std=0.75 meme valeur que dans la version offline |
---|
517 | CALL cloud%create_fractional_std(KLON, KLEV, driver_config%frac_std) |
---|
518 | |
---|
519 | if (rad_config%i_solver_sw == ISolverSPARTACUS & |
---|
520 | & .or. rad_config%i_solver_lw == ISolverSPARTACUS) then |
---|
521 | ! AI ! Read cloud properties needed by SPARTACUS |
---|
522 | !AI ATTENTION meme traitement dans le version offline |
---|
523 | |
---|
524 | ! By default mid and high cloud effective size is 10 km |
---|
525 | !CALL cloud%create_inv_cloud_effective_size(KLON,KLEV,1.0_JPRB/10000.0_JPRB) |
---|
526 | |
---|
527 | ! if (driver_config%low_inv_effective_size >= 0.0_jprb & |
---|
528 | ! & .or. driver_config%middle_inv_effective_size >= 0.0_jprb & |
---|
529 | ! & .or. driver_config%high_inv_effective_size >= 0.0_jprb) then |
---|
530 | if (driver_config%ok_effective_size) then |
---|
531 | call cloud%create_inv_cloud_effective_size_eta(klon, klev, & |
---|
532 | & thermodynamics%pressure_hl, & |
---|
533 | & driver_config%low_inv_effective_size, & |
---|
534 | & driver_config%middle_inv_effective_size, & |
---|
535 | & driver_config%high_inv_effective_size, 0.8_jprb, 0.45_jprb) |
---|
536 | ! else if (driver_config%cloud_separation_scale_surface > 0.0_jprb & |
---|
537 | ! .and. driver_config%cloud_separation_scale_toa > 0.0_jprb) then |
---|
538 | else if (driver_config%ok_separation) then |
---|
539 | call cloud%param_cloud_effective_separation_eta(klon, klev, & |
---|
540 | & thermodynamics%pressure_hl, & |
---|
541 | & driver_config%cloud_separation_scale_surface, & |
---|
542 | & driver_config%cloud_separation_scale_toa, & |
---|
543 | & driver_config%cloud_separation_scale_power, & |
---|
544 | & driver_config%cloud_inhom_separation_factor) |
---|
545 | endif |
---|
546 | endif |
---|
547 | |
---|
548 | print*,'******** AEROSOLS (allocate + input) **************************************' |
---|
549 | !IF (NAERMACC > 0) THEN |
---|
550 | CALL aerosol%allocate(KLON, 1, KLEV, KAEROSOL) ! MACC climatology |
---|
551 | !ELSE |
---|
552 | ! CALL aerosol%allocate(KLON, 1, KLEV, 6) ! Tegen climatology |
---|
553 | !ENDIF |
---|
554 | ! Compute the dry mass of each layer neglecting humidity effects, in |
---|
555 | ! kg m-2, needed to scale some of the aerosol inputs |
---|
556 | ! AI commente ATTENTION |
---|
557 | !CALL thermodynamics%get_layer_mass(ZLAYER_MASS) |
---|
558 | |
---|
559 | ! Copy over aerosol mass mixing ratio |
---|
560 | !IF (NAERMACC > 0) THEN |
---|
561 | |
---|
562 | ! MACC aerosol climatology - this is already in mass mixing ratio |
---|
563 | ! units with the required array orientation so we can copy it over |
---|
564 | ! directly |
---|
565 | aerosol%mixing_ratio(KIDIA:KFDIA,:,:) = PAEROSOL(KIDIA:KFDIA,:,:) |
---|
566 | |
---|
567 | ! Add the tropospheric and stratospheric backgrounds contained in the |
---|
568 | ! old Tegen arrays - this is very ugly! |
---|
569 | ! AI ATTENTION |
---|
570 | ! IF (TROP_BG_AER_MASS_EXT > 0.0_JPRB) THEN |
---|
571 | ! aerosol%mixing_ratio(KIDIA:KFDIA,:,ITYPE_TROP_BG_AER) & |
---|
572 | ! & = aerosol%mixing_ratio(KIDIA:KFDIA,:,ITYPE_TROP_BG_AER) & |
---|
573 | ! & + PAEROSOL_OLD(KIDIA:KFDIA,1,:) & |
---|
574 | ! & / (ZLAYER_MASS * TROP_BG_AER_MASS_EXT) |
---|
575 | ! ENDIF |
---|
576 | ! IF (STRAT_BG_AER_MASS_EXT > 0.0_JPRB) THEN |
---|
577 | ! aerosol%mixing_ratio(KIDIA:KFDIA,:,ITYPE_STRAT_BG_AER) & |
---|
578 | ! & = aerosol%mixing_ratio(KIDIA:KFDIA,:,ITYPE_STRAT_BG_AER) & |
---|
579 | ! & + PAEROSOL_OLD(KIDIA:KFDIA,6,:) & |
---|
580 | ! & / (ZLAYER_MASS * STRAT_BG_AER_MASS_EXT) |
---|
581 | ! ENDIF |
---|
582 | |
---|
583 | !ELSE |
---|
584 | |
---|
585 | ! Tegen aerosol climatology - the array PAEROSOL_OLD contains the |
---|
586 | ! 550-nm optical depth in each layer. The optics data file |
---|
587 | ! aerosol_ifs_rrtm_tegen.nc does not contain mass extinction |
---|
588 | ! coefficient, but a scaling factor that the 550-nm optical depth |
---|
589 | ! should be multiplied by to obtain the optical depth in each |
---|
590 | ! spectral band. Therefore, in order for the units to work out, we |
---|
591 | ! need to divide by the layer mass (in kg m-2) to obtain the 550-nm |
---|
592 | ! cross-section per unit mass of dry air (so in m2 kg-1). We also |
---|
593 | ! need to permute the array. |
---|
594 | ! DO JLEV = 1,KLEV |
---|
595 | ! DO JAER = 1,6 |
---|
596 | ! aerosol%mixing_ratio(KIDIA:KFDIA,JLEV,JAER) & |
---|
597 | ! & = PAEROSOL_OLD(KIDIA:KFDIA,JAER,JLEV) & |
---|
598 | ! & / ZLAYER_MASS(KIDIA:KFDIA,JLEV) |
---|
599 | ! ENDDO |
---|
600 | ! ENDDO |
---|
601 | |
---|
602 | !ENDIF |
---|
603 | |
---|
604 | print*,'********** GAS (allocate + input) ************************************************' |
---|
605 | !print*,'Appel Allocate gas' |
---|
606 | CALL gas%allocate(KLON, KLEV) |
---|
607 | |
---|
608 | ! Convert ozone Pa*kg/kg to kg/kg |
---|
609 | ! AI ATTENTION |
---|
610 | !DO JLEV = 1,KLEV |
---|
611 | ! DO JLON = KIDIA,KFDIA |
---|
612 | ! ZO3(JLON,JLEV) = PO3_DP(JLON,JLEV) & |
---|
613 | ! & / (PPRESSURE_H(JLON,JLEV+1)-PPRESSURE_H(JLON,JLEV)) |
---|
614 | ! ENDDO |
---|
615 | !ENDDO |
---|
616 | |
---|
617 | ! Insert gas mixing ratios |
---|
618 | !print*,'Insert gas mixing ratios' |
---|
619 | CALL gas%put(IH2O, IMassMixingRatio, PQ) |
---|
620 | CALL gas%put(IO3, IMassMixingRatio, PO3) |
---|
621 | CALL gas%put_well_mixed(ICO2, IMAssMixingRatio, PCO2) |
---|
622 | CALL gas%put_well_mixed(ICH4, IMassMixingRatio, PCH4) |
---|
623 | CALL gas%put_well_mixed(IN2O, IMassMixingRatio, PN2O) |
---|
624 | CALL gas%put_well_mixed(ICFC11, IMassMixingRatio, PCFC11) |
---|
625 | CALL gas%put_well_mixed(ICFC12, IMassMixingRatio, PCFC12) |
---|
626 | CALL gas%put_well_mixed(IHCFC22, IMassMixingRatio, PHCFC22) |
---|
627 | CALL gas%put_well_mixed(ICCL4, IMassMixingRatio, PCCL4) |
---|
628 | CALL gas%put_well_mixed(IO2, IMassMixingRatio, PO2) |
---|
629 | ! Ensure the units of the gas mixing ratios are what is required by |
---|
630 | ! the gas absorption model |
---|
631 | call set_gas_units(rad_config, gas) |
---|
632 | |
---|
633 | print*,'************** FLUX (allocate) ***********************' |
---|
634 | CALL flux%allocate(rad_config, 1, KLON, KLEV) |
---|
635 | |
---|
636 | ! Call radiation scheme |
---|
637 | print*,'******** Appel radiation scheme **************************' |
---|
638 | CALL radiation(KLON, KLEV, KIDIA, KFDIA, rad_config, & |
---|
639 | & single_level, thermodynamics, gas, cloud, aerosol, flux) |
---|
640 | |
---|
641 | ! Compute required output fluxes |
---|
642 | ! DN and UP flux |
---|
643 | PFLUX_SW_DN(KIDIA:KFDIA,:) = flux%sw_dn(KIDIA:KFDIA,:) |
---|
644 | PFLUX_SW_UP(KIDIA:KFDIA,:) = flux%sw_up(KIDIA:KFDIA,:) |
---|
645 | PFLUX_LW_DN(KIDIA:KFDIA,:) = flux%lw_dn(KIDIA:KFDIA,:) |
---|
646 | PFLUX_LW_UP(KIDIA:KFDIA,:) = flux%lw_up(KIDIA:KFDIA,:) |
---|
647 | PFLUX_SW_DN_CLEAR(KIDIA:KFDIA,:) = flux%sw_dn_clear(KIDIA:KFDIA,:) |
---|
648 | PFLUX_SW_UP_CLEAR(KIDIA:KFDIA,:) = flux%sw_up_clear(KIDIA:KFDIA,:) |
---|
649 | PFLUX_LW_DN_CLEAR(KIDIA:KFDIA,:) = flux%lw_dn_clear(KIDIA:KFDIA,:) |
---|
650 | PFLUX_LW_UP_CLEAR(KIDIA:KFDIA,:) = flux%lw_up_clear(KIDIA:KFDIA,:) |
---|
651 | |
---|
652 | ! First the net fluxes |
---|
653 | PFLUX_SW(KIDIA:KFDIA,:) = flux%sw_dn(KIDIA:KFDIA,:) - flux%sw_up(KIDIA:KFDIA,:) |
---|
654 | PFLUX_LW(KIDIA:KFDIA,:) = flux%lw_dn(KIDIA:KFDIA,:) - flux%lw_up(KIDIA:KFDIA,:) |
---|
655 | PFLUX_SW_CLEAR(KIDIA:KFDIA,:) & |
---|
656 | & = flux%sw_dn_clear(KIDIA:KFDIA,:) - flux%sw_up_clear(KIDIA:KFDIA,:) |
---|
657 | PFLUX_LW_CLEAR(KIDIA:KFDIA,:) & |
---|
658 | & = flux%lw_dn_clear(KIDIA:KFDIA,:) - flux%lw_up_clear(KIDIA:KFDIA,:) |
---|
659 | |
---|
660 | ! Now the surface fluxes |
---|
661 | !PFLUX_SW_DN_SURF(KIDIA:KFDIA) = flux%sw_dn(KIDIA:KFDIA,KLEV+1) |
---|
662 | !PFLUX_LW_DN_SURF(KIDIA:KFDIA) = flux%lw_dn(KIDIA:KFDIA,KLEV+1) |
---|
663 | !PFLUX_SW_UP_SURF(KIDIA:KFDIA) = flux%sw_up(KIDIA:KFDIA,KLEV+1) |
---|
664 | !PFLUX_LW_UP_SURF(KIDIA:KFDIA) = flux%lw_up(KIDIA:KFDIA,KLEV+1) |
---|
665 | !PFLUX_SW_DN_CLEAR_SURF(KIDIA:KFDIA) = flux%sw_dn_clear(KIDIA:KFDIA,KLEV+1) |
---|
666 | !PFLUX_LW_DN_CLEAR_SURF(KIDIA:KFDIA) = flux%lw_dn_clear(KIDIA:KFDIA,KLEV+1) |
---|
667 | !PFLUX_SW_UP_CLEAR_SURF(KIDIA:KFDIA) = flux%sw_up_clear(KIDIA:KFDIA,KLEV+1) |
---|
668 | !PFLUX_LW_UP_CLEAR_SURF(KIDIA:KFDIA) = flux%lw_up_clear(KIDIA:KFDIA,KLEV+1) |
---|
669 | PFLUX_DIR(KIDIA:KFDIA) = flux%sw_dn_direct(KIDIA:KFDIA,KLEV+1) |
---|
670 | PFLUX_DIR_CLEAR(KIDIA:KFDIA) = flux%sw_dn_direct_clear(KIDIA:KFDIA,KLEV+1) |
---|
671 | PFLUX_DIR_INTO_SUN(KIDIA:KFDIA) = 0.0_JPRB |
---|
672 | WHERE (PMU0(KIDIA:KFDIA) > EPSILON(1.0_JPRB)) |
---|
673 | PFLUX_DIR_INTO_SUN(KIDIA:KFDIA) = PFLUX_DIR(KIDIA:KFDIA) / PMU0(KIDIA:KFDIA) |
---|
674 | END WHERE |
---|
675 | |
---|
676 | ! Top-of-atmosphere downwelling flux |
---|
677 | !PFLUX_SW_DN_TOA(KIDIA:KFDIA) = flux%sw_dn(KIDIA:KFDIA,1) |
---|
678 | !PFLUX_SW_UP_TOA(KIDIA:KFDIA) = flux%sw_up(KIDIA:KFDIA,1) |
---|
679 | !PFLUX_LW_DN_TOA(KIDIA:KFDIA) = flux%lw_dn(KIDIA:KFDIA,1) |
---|
680 | !PFLUX_LW_UP_TOA(KIDIA:KFDIA) = flux%lw_up(KIDIA:KFDIA,1) |
---|
681 | |
---|
682 | ! Compute UV fluxes as weighted sum of appropriate shortwave bands |
---|
683 | !AI ATTENTION |
---|
684 | if (0.eq.1) then |
---|
685 | PFLUX_UV (KIDIA:KFDIA) = 0.0_JPRB |
---|
686 | DO JBAND = 1,NWEIGHT_UV |
---|
687 | PFLUX_UV(KIDIA:KFDIA) = PFLUX_UV(KIDIA:KFDIA) + WEIGHT_UV(JBAND) & |
---|
688 | & * flux%sw_dn_surf_band(IBAND_UV(JBAND),KIDIA:KFDIA) |
---|
689 | ENDDO |
---|
690 | |
---|
691 | ! Compute photosynthetically active radiation similarly |
---|
692 | PFLUX_PAR (KIDIA:KFDIA) = 0.0_JPRB |
---|
693 | PFLUX_PAR_CLEAR(KIDIA:KFDIA) = 0.0_JPRB |
---|
694 | DO JBAND = 1,NWEIGHT_PAR |
---|
695 | PFLUX_PAR(KIDIA:KFDIA) = PFLUX_PAR(KIDIA:KFDIA) + WEIGHT_PAR(JBAND) & |
---|
696 | & * flux%sw_dn_surf_band(IBAND_PAR(JBAND),KIDIA:KFDIA) |
---|
697 | PFLUX_PAR_CLEAR(KIDIA:KFDIA) = PFLUX_PAR_CLEAR(KIDIA:KFDIA) & |
---|
698 | & + WEIGHT_PAR(JBAND) & |
---|
699 | & * flux%sw_dn_surf_clear_band(IBAND_PAR(JBAND),KIDIA:KFDIA) |
---|
700 | ENDDO |
---|
701 | endif |
---|
702 | ! Compute effective broadband emissivity |
---|
703 | ZBLACK_BODY_NET_LW = flux%lw_dn(KIDIA:KFDIA,KLEV+1) & |
---|
704 | & - RSIGMA*PTEMPERATURE_SKIN(KIDIA:KFDIA)**4 |
---|
705 | PEMIS_OUT(KIDIA:KFDIA) = PEMIS(KIDIA:KFDIA) |
---|
706 | WHERE (ABS(ZBLACK_BODY_NET_LW) > 1.0E-5) |
---|
707 | PEMIS_OUT(KIDIA:KFDIA) = PFLUX_LW(KIDIA:KFDIA,KLEV+1) / ZBLACK_BODY_NET_LW |
---|
708 | END WHERE |
---|
709 | |
---|
710 | ! Copy longwave derivatives |
---|
711 | ! AI ATTENTION |
---|
712 | !IF (YRERAD%LAPPROXLWUPDATE) THEN |
---|
713 | IF (rad_config%do_lw_derivatives) THEN |
---|
714 | PLWDERIVATIVE(KIDIA:KFDIA,:) = flux%lw_derivatives(KIDIA:KFDIA,:) |
---|
715 | END IF |
---|
716 | |
---|
717 | ! Store the shortwave downwelling fluxes in each albedo band |
---|
718 | !AI ATTENTION |
---|
719 | !IF (YRERAD%LAPPROXSWUPDATE) THEN |
---|
720 | if (0.eq.1) then |
---|
721 | IF (rad_config%do_surface_sw_spectral_flux) THEN |
---|
722 | PSWDIFFUSEBAND(KIDIA:KFDIA,:) = 0.0_JPRB |
---|
723 | PSWDIRECTBAND (KIDIA:KFDIA,:) = 0.0_JPRB |
---|
724 | DO JBAND = 1,rad_config%n_bands_sw |
---|
725 | JB_ALBEDO = rad_config%i_albedo_from_band_sw(JBAND) |
---|
726 | DO JLON = KIDIA,KFDIA |
---|
727 | PSWDIFFUSEBAND(JLON,JB_ALBEDO) = PSWDIFFUSEBAND(JLON,JB_ALBEDO) & |
---|
728 | & + flux%sw_dn_surf_band(JBAND,JLON) & |
---|
729 | & - flux%sw_dn_direct_surf_band(JBAND,JLON) |
---|
730 | PSWDIRECTBAND(JLON,JB_ALBEDO) = PSWDIRECTBAND(JLON,JB_ALBEDO) & |
---|
731 | & + flux%sw_dn_direct_surf_band(JBAND,JLON) |
---|
732 | ENDDO |
---|
733 | ENDDO |
---|
734 | ENDIF |
---|
735 | endif |
---|
736 | CALL single_level%deallocate |
---|
737 | CALL thermodynamics%deallocate |
---|
738 | CALL gas%deallocate |
---|
739 | CALL cloud%deallocate |
---|
740 | CALL aerosol%deallocate |
---|
741 | CALL flux%deallocate |
---|
742 | |
---|
743 | IF (LHOOK) CALL DR_HOOK('RADIATION_SCHEME',1,ZHOOK_HANDLE) |
---|
744 | |
---|
745 | END SUBROUTINE RADIATION_SCHEME |
---|