1 | ! |
---|
2 | ! $Id: radlwsw_m.F90 3880 2021-04-28 14:55:57Z crisi $ |
---|
3 | ! |
---|
4 | module radlwsw_m |
---|
5 | |
---|
6 | IMPLICIT NONE |
---|
7 | |
---|
8 | contains |
---|
9 | |
---|
10 | SUBROUTINE radlwsw( & |
---|
11 | dist, rmu0, fract, & |
---|
12 | !albedo SB >>> |
---|
13 | ! paprs, pplay,tsol,alb1, alb2, & |
---|
14 | paprs, pplay,tsol,SFRWL,alb_dir, alb_dif, & |
---|
15 | !albedo SB <<< |
---|
16 | t,q,wo,& |
---|
17 | cldfra, cldemi, cldtaupd,& |
---|
18 | ok_ade, ok_aie, ok_volcan, flag_aerosol,& |
---|
19 | flag_aerosol_strat, flag_aer_feedback, & |
---|
20 | tau_aero, piz_aero, cg_aero,& |
---|
21 | tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm,& ! rajoute par OB RRTM |
---|
22 | tau_aero_lw_rrtm, & ! rajoute par C.Kleinschmitt pour RRTM |
---|
23 | cldtaupi, & |
---|
24 | qsat, flwc, fiwc, & |
---|
25 | ref_liq, ref_ice, ref_liq_pi, ref_ice_pi, & |
---|
26 | heat,heat0,cool,cool0,albpla,& |
---|
27 | heat_volc, cool_volc,& |
---|
28 | topsw,toplw,solsw,solswfdiff,sollw,& |
---|
29 | sollwdown,& |
---|
30 | topsw0,toplw0,solsw0,sollw0,& |
---|
31 | lwdnc0, lwdn0, lwdn, lwupc0, lwup0, lwup,& |
---|
32 | swdnc0, swdn0, swdn, swupc0, swup0, swup,& |
---|
33 | topswad_aero, solswad_aero,& |
---|
34 | topswai_aero, solswai_aero, & |
---|
35 | topswad0_aero, solswad0_aero,& |
---|
36 | topsw_aero, topsw0_aero,& |
---|
37 | solsw_aero, solsw0_aero, & |
---|
38 | topswcf_aero, solswcf_aero,& |
---|
39 | !-C. Kleinschmitt for LW diagnostics |
---|
40 | toplwad_aero, sollwad_aero,& |
---|
41 | toplwai_aero, sollwai_aero, & |
---|
42 | toplwad0_aero, sollwad0_aero,& |
---|
43 | !-end |
---|
44 | ZLWFT0_i, ZFLDN0, ZFLUP0,& |
---|
45 | ZSWFT0_i, ZFSDN0, ZFSUP0) |
---|
46 | |
---|
47 | ! Modules necessaires |
---|
48 | USE DIMPHY |
---|
49 | USE assert_m, ONLY : assert |
---|
50 | USE infotrac_phy, ONLY : type_trac |
---|
51 | USE write_field_phy |
---|
52 | |
---|
53 | #ifdef REPROBUS |
---|
54 | USE CHEM_REP, ONLY : solaireTIME, ok_SUNTIME, ndimozon |
---|
55 | #endif |
---|
56 | |
---|
57 | #ifdef CPP_RRTM |
---|
58 | ! modules necessaires au rayonnement |
---|
59 | ! ----------------------------------------- |
---|
60 | USE YOERAD , ONLY : NLW, LRRTM ,LCCNL ,LCCNO ,& |
---|
61 | NRADIP , NRADLP , NICEOPT, NLIQOPT ,RCCNLND , RCCNSEA |
---|
62 | USE YOELW , ONLY : NSIL ,NTRA ,NUA ,TSTAND ,XP |
---|
63 | USE YOESW , ONLY : RYFWCA ,RYFWCB ,RYFWCC ,RYFWCD,& |
---|
64 | RYFWCE ,RYFWCF ,REBCUA ,REBCUB ,REBCUC,& |
---|
65 | REBCUD ,REBCUE ,REBCUF ,REBCUI ,REBCUJ,& |
---|
66 | REBCUG ,REBCUH ,RHSAVI ,RFULIO ,RFLAA0,& |
---|
67 | RFLAA1 ,RFLBB0 ,RFLBB1 ,RFLBB2 ,RFLBB3,& |
---|
68 | RFLCC0 ,RFLCC1 ,RFLCC2 ,RFLCC3 ,RFLDD0,& |
---|
69 | RFLDD1 ,RFLDD2 ,RFLDD3 ,RFUETA ,RASWCA,& |
---|
70 | RASWCB ,RASWCC ,RASWCD ,RASWCE ,RASWCF |
---|
71 | USE YOERDU , ONLY : NUAER ,NTRAER ,REPLOG ,REPSC ,REPSCW ,DIFF |
---|
72 | USE YOERRTWN , ONLY : DELWAVE ,TOTPLNK |
---|
73 | USE YOMPHY3 , ONLY : RII0 |
---|
74 | #endif |
---|
75 | USE aero_mod |
---|
76 | |
---|
77 | ! AI 02.2021 |
---|
78 | ! Besoin pour ECRAD de pctsrf, zmasq, longitude, altitude |
---|
79 | #ifdef CPP_ECRAD |
---|
80 | USE geometry_mod, ONLY: latitude, longitude |
---|
81 | USE phys_state_var_mod, ONLY: pctsrf |
---|
82 | USE indice_sol_mod |
---|
83 | USE time_phylmdz_mod, only: current_time |
---|
84 | USE phys_cal_mod, only: day_cur |
---|
85 | #endif |
---|
86 | |
---|
87 | !====================================================================== |
---|
88 | ! Auteur(s): Z.X. Li (LMD/CNRS) date: 19960719 |
---|
89 | ! Objet: interface entre le modele et les rayonnements |
---|
90 | ! Arguments: |
---|
91 | ! INPUTS |
---|
92 | ! dist----- input-R- distance astronomique terre-soleil |
---|
93 | ! rmu0----- input-R- cosinus de l'angle zenithal |
---|
94 | ! fract---- input-R- duree d'ensoleillement normalisee |
---|
95 | ! co2_ppm-- input-R- concentration du gaz carbonique (en ppm) |
---|
96 | ! paprs---- input-R- pression a inter-couche (Pa) |
---|
97 | ! pplay---- input-R- pression au milieu de couche (Pa) |
---|
98 | ! tsol----- input-R- temperature du sol (en K) |
---|
99 | ! alb1----- input-R- albedo du sol(entre 0 et 1) dans l'interval visible |
---|
100 | ! alb2----- input-R- albedo du sol(entre 0 et 1) dans l'interval proche infra-rouge |
---|
101 | ! t-------- input-R- temperature (K) |
---|
102 | ! q-------- input-R- vapeur d'eau (en kg/kg) |
---|
103 | ! cldfra--- input-R- fraction nuageuse (entre 0 et 1) |
---|
104 | ! cldtaupd- input-R- epaisseur optique des nuages dans le visible (present-day value) |
---|
105 | ! cldemi--- input-R- emissivite des nuages dans l'IR (entre 0 et 1) |
---|
106 | ! ok_ade--- input-L- apply the Aerosol Direct Effect or not? |
---|
107 | ! ok_aie--- input-L- apply the Aerosol Indirect Effect or not? |
---|
108 | ! ok_volcan input-L- activate volcanic diags (SW heat & LW cool rate, SW & LW flux) |
---|
109 | ! flag_aerosol input-I- aerosol flag from 0 to 6 |
---|
110 | ! flag_aerosol_strat input-I- use stratospheric aerosols flag (0, 1, 2) |
---|
111 | ! flag_aer_feedback input-I- activate aerosol radiative feedback (T, F) |
---|
112 | ! tau_ae, piz_ae, cg_ae input-R- aerosol optical properties (calculated in aeropt.F) |
---|
113 | ! cldtaupi input-R- epaisseur optique des nuages dans le visible |
---|
114 | ! calculated for pre-industrial (pi) aerosol concentrations, i.e. with smaller |
---|
115 | ! droplet concentration, thus larger droplets, thus generally cdltaupi cldtaupd |
---|
116 | ! it is needed for the diagnostics of the aerosol indirect radiative forcing |
---|
117 | ! |
---|
118 | ! OUTPUTS |
---|
119 | ! heat-----output-R- echauffement atmospherique (visible) (K/jour) |
---|
120 | ! cool-----output-R- refroidissement dans l'IR (K/jour) |
---|
121 | ! albpla---output-R- albedo planetaire (entre 0 et 1) |
---|
122 | ! topsw----output-R- flux solaire net au sommet de l'atm. |
---|
123 | ! toplw----output-R- ray. IR montant au sommet de l'atmosphere |
---|
124 | ! solsw----output-R- flux solaire net a la surface |
---|
125 | ! solswfdiff----output-R- fraction de rayonnement diffus pour le flux solaire descendant a la surface |
---|
126 | ! sollw----output-R- ray. IR montant a la surface |
---|
127 | ! solswad---output-R- ray. solaire net absorbe a la surface (aerosol dir) |
---|
128 | ! topswad---output-R- ray. solaire absorbe au sommet de l'atm. (aerosol dir) |
---|
129 | ! solswai---output-R- ray. solaire net absorbe a la surface (aerosol ind) |
---|
130 | ! topswai---output-R- ray. solaire absorbe au sommet de l'atm. (aerosol ind) |
---|
131 | ! |
---|
132 | ! heat_volc-----output-R- echauffement atmospherique du au forcage volcanique (visible) (K/s) |
---|
133 | ! cool_volc-----output-R- refroidissement dans l'IR du au forcage volcanique (K/s) |
---|
134 | ! |
---|
135 | ! ATTENTION: swai and swad have to be interpreted in the following manner: |
---|
136 | ! --------- |
---|
137 | ! ok_ade=F & ok_aie=F -both are zero |
---|
138 | ! ok_ade=T & ok_aie=F -aerosol direct forcing is F_{AD} = topsw-topswad |
---|
139 | ! indirect is zero |
---|
140 | ! ok_ade=F & ok_aie=T -aerosol indirect forcing is F_{AI} = topsw-topswai |
---|
141 | ! direct is zero |
---|
142 | ! ok_ade=T & ok_aie=T -aerosol indirect forcing is F_{AI} = topsw-topswai |
---|
143 | ! aerosol direct forcing is F_{AD} = topswai-topswad |
---|
144 | ! |
---|
145 | ! --------- RRTM: output RECMWFL |
---|
146 | ! ZEMTD (KPROMA,KLEV+1) ; TOTAL DOWNWARD LONGWAVE EMISSIVITY |
---|
147 | ! ZEMTU (KPROMA,KLEV+1) ; TOTAL UPWARD LONGWAVE EMISSIVITY |
---|
148 | ! ZTRSO (KPROMA,KLEV+1) ; TOTAL SHORTWAVE TRANSMISSIVITY |
---|
149 | ! ZTH (KPROMA,KLEV+1) ; HALF LEVEL TEMPERATURE |
---|
150 | ! ZCTRSO(KPROMA,2) ; CLEAR-SKY SHORTWAVE TRANSMISSIVITY |
---|
151 | ! ZCEMTR(KPROMA,2) ; CLEAR-SKY NET LONGWAVE EMISSIVITY |
---|
152 | ! ZTRSOD(KPROMA) ; TOTAL-SKY SURFACE SW TRANSMISSITY |
---|
153 | ! ZLWFC (KPROMA,2) ; CLEAR-SKY LONGWAVE FLUXES |
---|
154 | ! ZLWFT (KPROMA,KLEV+1) ; TOTAL-SKY LONGWAVE FLUXES |
---|
155 | ! ZLWFT0(KPROMA,KLEV+1) ; CLEAR-SKY LONGWAVE FLUXES ! added by MPL 090109 |
---|
156 | ! ZSWFC (KPROMA,2) ; CLEAR-SKY SHORTWAVE FLUXES |
---|
157 | ! ZSWFT (KPROMA,KLEV+1) ; TOTAL-SKY SHORTWAVE FLUXES |
---|
158 | ! ZSWFT0(KPROMA,KLEV+1) ; CLEAR-SKY SHORTWAVE FLUXES ! added by MPL 090109 |
---|
159 | ! ZFLUX (KLON,2,KLEV+1) ; TOTAL LW FLUXES 1=up, 2=DWN ! added by MPL 080411 |
---|
160 | ! ZFLUC (KLON,2,KLEV+1) ; CLEAR SKY LW FLUXES ! added by MPL 080411 |
---|
161 | ! ZFSDWN(klon,KLEV+1) ; TOTAL SW DWN FLUXES ! added by MPL 080411 |
---|
162 | ! ZFCDWN(klon,KLEV+1) ; CLEAR SKY SW DWN FLUXES ! added by MPL 080411 |
---|
163 | ! ZFCCDWN(klon,KLEV+1) ; CLEAR SKY CLEAN (NO AEROSOL) SW DWN FLUXES ! added by OB 211117 |
---|
164 | ! ZFSUP (klon,KLEV+1) ; TOTAL SW UP FLUXES ! added by MPL 080411 |
---|
165 | ! ZFCUP (klon,KLEV+1) ; CLEAR SKY SW UP FLUXES ! added by MPL 080411 |
---|
166 | ! ZFCCUP (klon,KLEV+1) ; CLEAR SKY CLEAN (NO AEROSOL) SW UP FLUXES ! added by OB 211117 |
---|
167 | ! ZFLCCDWN(klon,KLEV+1) ; CLEAR SKY CLEAN (NO AEROSOL) LW DWN FLUXES ! added by OB 211117 |
---|
168 | ! ZFLCCUP (klon,KLEV+1) ; CLEAR SKY CLEAN (NO AEROSOL) LW UP FLUXES ! added by OB 211117 |
---|
169 | |
---|
170 | !====================================================================== |
---|
171 | |
---|
172 | ! ==================================================================== |
---|
173 | ! Adapte au modele de chimie INCA par Celine Deandreis & Anne Cozic -- 2009 |
---|
174 | ! 1 = ZERO |
---|
175 | ! 2 = AER total |
---|
176 | ! 3 = NAT |
---|
177 | ! 4 = BC |
---|
178 | ! 5 = SO4 |
---|
179 | ! 6 = POM |
---|
180 | ! 7 = DUST |
---|
181 | ! 8 = SS |
---|
182 | ! 9 = NO3 |
---|
183 | ! |
---|
184 | ! ==================================================================== |
---|
185 | |
---|
186 | ! ============== |
---|
187 | ! DECLARATIONS |
---|
188 | ! ============== |
---|
189 | include "YOETHF.h" |
---|
190 | include "YOMCST.h" |
---|
191 | include "clesphys.h" |
---|
192 | |
---|
193 | ! Input arguments |
---|
194 | REAL, INTENT(in) :: dist |
---|
195 | REAL, INTENT(in) :: rmu0(KLON), fract(KLON) |
---|
196 | REAL, INTENT(in) :: paprs(KLON,KLEV+1), pplay(KLON,KLEV) |
---|
197 | !albedo SB >>> |
---|
198 | ! REAL, INTENT(in) :: alb1(KLON), alb2(KLON), tsol(KLON) |
---|
199 | REAL, INTENT(in) :: tsol(KLON) |
---|
200 | REAL, INTENT(in) :: alb_dir(KLON,NSW),alb_dif(KLON,NSW) |
---|
201 | REAL, INTENT(in) :: SFRWL(6) |
---|
202 | !albedo SB <<< |
---|
203 | REAL, INTENT(in) :: t(KLON,KLEV), q(KLON,KLEV) |
---|
204 | |
---|
205 | REAL, INTENT(in):: wo(:, :, :) ! dimension(KLON,KLEV, 1 or 2) |
---|
206 | ! column-density of ozone in a layer, in kilo-Dobsons |
---|
207 | ! "wo(:, :, 1)" is for the average day-night field, |
---|
208 | ! "wo(:, :, 2)" is for daylight time. |
---|
209 | |
---|
210 | LOGICAL, INTENT(in) :: ok_ade, ok_aie ! switches whether to use aerosol direct (indirect) effects or not |
---|
211 | LOGICAL, INTENT(in) :: ok_volcan ! produce volcanic diags (SW/LW heat flux and rate) |
---|
212 | LOGICAL :: lldebug |
---|
213 | INTEGER, INTENT(in) :: flag_aerosol ! takes value 0 (no aerosol) or 1 to 6 (aerosols) |
---|
214 | INTEGER, INTENT(in) :: flag_aerosol_strat ! use stratospheric aerosols |
---|
215 | LOGICAL, INTENT(in) :: flag_aer_feedback ! activate aerosol radiative feedback |
---|
216 | REAL, INTENT(in) :: cldfra(KLON,KLEV), cldemi(KLON,KLEV), cldtaupd(KLON,KLEV) |
---|
217 | REAL, INTENT(in) :: tau_aero(KLON,KLEV,naero_grp,2) ! aerosol optical properties (see aeropt.F) |
---|
218 | REAL, INTENT(in) :: piz_aero(KLON,KLEV,naero_grp,2) ! aerosol optical properties (see aeropt.F) |
---|
219 | REAL, INTENT(in) :: cg_aero(KLON,KLEV,naero_grp,2) ! aerosol optical properties (see aeropt.F) |
---|
220 | !--OB |
---|
221 | REAL, INTENT(in) :: tau_aero_sw_rrtm(KLON,KLEV,2,NSW) ! aerosol optical properties RRTM |
---|
222 | REAL, INTENT(in) :: piz_aero_sw_rrtm(KLON,KLEV,2,NSW) ! aerosol optical properties RRTM |
---|
223 | REAL, INTENT(in) :: cg_aero_sw_rrtm(KLON,KLEV,2,NSW) ! aerosol optical properties RRTM |
---|
224 | !--OB fin |
---|
225 | |
---|
226 | !--C. Kleinschmitt |
---|
227 | #ifdef CPP_RRTM |
---|
228 | REAL, INTENT(in) :: tau_aero_lw_rrtm(KLON,KLEV,2,NLW) ! LW aerosol optical properties RRTM |
---|
229 | #else |
---|
230 | REAL, INTENT(in) :: tau_aero_lw_rrtm(KLON,KLEV,2,nbands_lw_rrtm) |
---|
231 | #endif |
---|
232 | !--C. Kleinschmitt end |
---|
233 | |
---|
234 | REAL, INTENT(in) :: cldtaupi(KLON,KLEV) ! cloud optical thickness for pre-industrial aerosol concentrations |
---|
235 | REAL, INTENT(in) :: qsat(klon,klev) ! Variable pour iflag_rrtm=1 |
---|
236 | REAL, INTENT(in) :: flwc(klon,klev) ! Variable pour iflag_rrtm=1 |
---|
237 | REAL, INTENT(in) :: fiwc(klon,klev) ! Variable pour iflag_rrtm=1 |
---|
238 | REAL, INTENT(in) :: ref_liq(klon,klev) ! cloud droplet radius present-day from newmicro |
---|
239 | REAL, INTENT(in) :: ref_ice(klon,klev) ! ice crystal radius present-day from newmicro |
---|
240 | REAL, INTENT(in) :: ref_liq_pi(klon,klev) ! cloud droplet radius pre-industrial from newmicro |
---|
241 | REAL, INTENT(in) :: ref_ice_pi(klon,klev) ! ice crystal radius pre-industrial from newmicro |
---|
242 | |
---|
243 | ! Output arguments |
---|
244 | REAL, INTENT(out) :: heat(KLON,KLEV), cool(KLON,KLEV) |
---|
245 | REAL, INTENT(out) :: heat0(KLON,KLEV), cool0(KLON,KLEV) |
---|
246 | REAL, INTENT(out) :: heat_volc(KLON,KLEV), cool_volc(KLON,KLEV) !NL |
---|
247 | REAL, INTENT(out) :: topsw(KLON), toplw(KLON) |
---|
248 | REAL, INTENT(out) :: solsw(KLON), sollw(KLON), albpla(KLON), solswfdiff(KLON) |
---|
249 | REAL, INTENT(out) :: topsw0(KLON), toplw0(KLON), solsw0(KLON), sollw0(KLON) |
---|
250 | REAL, INTENT(out) :: sollwdown(KLON) |
---|
251 | REAL, INTENT(out) :: swdn(KLON,kflev+1),swdn0(KLON,kflev+1), swdnc0(KLON,kflev+1) |
---|
252 | REAL, INTENT(out) :: swup(KLON,kflev+1),swup0(KLON,kflev+1), swupc0(KLON,kflev+1) |
---|
253 | REAL, INTENT(out) :: lwdn(KLON,kflev+1),lwdn0(KLON,kflev+1), lwdnc0(KLON,kflev+1) |
---|
254 | REAL, INTENT(out) :: lwup(KLON,kflev+1),lwup0(KLON,kflev+1), lwupc0(KLON,kflev+1) |
---|
255 | REAL, INTENT(out) :: topswad_aero(KLON), solswad_aero(KLON) ! output: aerosol direct forcing at TOA and surface |
---|
256 | REAL, INTENT(out) :: topswai_aero(KLON), solswai_aero(KLON) ! output: aerosol indirect forcing atTOA and surface |
---|
257 | REAL, INTENT(out) :: toplwad_aero(KLON), sollwad_aero(KLON) ! output: LW aerosol direct forcing at TOA and surface |
---|
258 | REAL, INTENT(out) :: toplwai_aero(KLON), sollwai_aero(KLON) ! output: LW aerosol indirect forcing atTOA and surface |
---|
259 | REAL, DIMENSION(klon), INTENT(out) :: topswad0_aero |
---|
260 | REAL, DIMENSION(klon), INTENT(out) :: solswad0_aero |
---|
261 | REAL, DIMENSION(klon), INTENT(out) :: toplwad0_aero |
---|
262 | REAL, DIMENSION(klon), INTENT(out) :: sollwad0_aero |
---|
263 | REAL, DIMENSION(kdlon,9), INTENT(out) :: topsw_aero |
---|
264 | REAL, DIMENSION(kdlon,9), INTENT(out) :: topsw0_aero |
---|
265 | REAL, DIMENSION(kdlon,9), INTENT(out) :: solsw_aero |
---|
266 | REAL, DIMENSION(kdlon,9), INTENT(out) :: solsw0_aero |
---|
267 | REAL, DIMENSION(kdlon,3), INTENT(out) :: topswcf_aero |
---|
268 | REAL, DIMENSION(kdlon,3), INTENT(out) :: solswcf_aero |
---|
269 | REAL, DIMENSION(kdlon,kflev+1), INTENT(out) :: ZSWFT0_i |
---|
270 | REAL, DIMENSION(kdlon,kflev+1), INTENT(out) :: ZLWFT0_i |
---|
271 | |
---|
272 | ! Local variables |
---|
273 | REAL(KIND=8) ZFSUP(KDLON,KFLEV+1) |
---|
274 | REAL(KIND=8) ZFSDN(KDLON,KFLEV+1) |
---|
275 | REAL(KIND=8) ZFSUP0(KDLON,KFLEV+1) |
---|
276 | REAL(KIND=8) ZFSDN0(KDLON,KFLEV+1) |
---|
277 | REAL(KIND=8) ZFSUPC0(KDLON,KFLEV+1) |
---|
278 | REAL(KIND=8) ZFSDNC0(KDLON,KFLEV+1) |
---|
279 | REAL(KIND=8) ZFLUP(KDLON,KFLEV+1) |
---|
280 | REAL(KIND=8) ZFLDN(KDLON,KFLEV+1) |
---|
281 | REAL(KIND=8) ZFLUP0(KDLON,KFLEV+1) |
---|
282 | REAL(KIND=8) ZFLDN0(KDLON,KFLEV+1) |
---|
283 | REAL(KIND=8) ZFLUPC0(KDLON,KFLEV+1) |
---|
284 | REAL(KIND=8) ZFLDNC0(KDLON,KFLEV+1) |
---|
285 | REAL(KIND=8) zx_alpha1, zx_alpha2 |
---|
286 | INTEGER k, kk, i, j, iof, nb_gr |
---|
287 | INTEGER ist,iend,ktdia,kmode |
---|
288 | REAL(KIND=8) PSCT |
---|
289 | REAL(KIND=8) PALBD(kdlon,2), PALBP(kdlon,2) |
---|
290 | ! MPL 06.01.09: pour RRTM, creation de PALBD_NEW et PALBP_NEW |
---|
291 | ! avec NSW en deuxieme dimension |
---|
292 | REAL(KIND=8) PALBD_NEW(kdlon,NSW), PALBP_NEW(kdlon,NSW) |
---|
293 | REAL(KIND=8) PEMIS(kdlon), PDT0(kdlon), PVIEW(kdlon) |
---|
294 | REAL(KIND=8) PPSOL(kdlon), PDP(kdlon,KLEV) |
---|
295 | REAL(KIND=8) PTL(kdlon,kflev+1), PPMB(kdlon,kflev+1) |
---|
296 | REAL(KIND=8) PTAVE(kdlon,kflev) |
---|
297 | REAL(KIND=8) PWV(kdlon,kflev), PQS(kdlon,kflev) |
---|
298 | |
---|
299 | !!!!!!! Declarations specifiques pour ECRAD !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
300 | ! AI 02.2021 |
---|
301 | #ifdef CPP_ECRAD |
---|
302 | ! ATTENTION les dimensions klon, kdlon ??? |
---|
303 | ! INPUTS |
---|
304 | REAL(KIND=8) ZEMISW(klon), & ! LW emissivity inside the window region |
---|
305 | ZEMIS(klon) ! LW emissivity outside the window region |
---|
306 | REAL(KIND=8) ZGELAM(klon), & ! longitudes en rad |
---|
307 | ZGEMU(klon) ! sin(latitude) |
---|
308 | REAL(KIND=8) ZCO2(klon,klev), & ! CO2 mass mixing ratios on full levels |
---|
309 | ZCH4(klon,klev), & ! CH4 mass mixing ratios on full levels |
---|
310 | ZN2O(klon,klev), & ! N2O mass mixing ratios on full levels |
---|
311 | ZNO2(klon,klev), & ! NO2 mass mixing ratios on full levels |
---|
312 | ZCFC11(klon,klev), & ! CFC11 |
---|
313 | ZCFC12(klon,klev), & ! CFC12 |
---|
314 | ZHCFC22(klon,klev), & ! HCFC22 |
---|
315 | ZCCL4(klon,klev), & ! CCL4 |
---|
316 | ZO3_DP(klon,klev), ZO3_DP_i(klon,klev) ! Ozone |
---|
317 | REAL(KIND=8) ZQ_RAIN(klon,klev), & ! Rain cloud mass mixing ratio (kg/kg) ? |
---|
318 | ZQ_SNOW(klon,klev) ! Snow cloud mass mixing ratio (kg/kg) ? |
---|
319 | REAL(KIND=8) ZAEROSOL_OLD(KLON,6,KLEV), & ! |
---|
320 | ZAEROSOL(KLON,KLEV,naero_tot) ! |
---|
321 | ! OUTPUTS |
---|
322 | REAL(KIND=8) ZFLUX_DIR(klon), & ! Direct compt of surf flux into horizontal plane |
---|
323 | ZFLUX_DIR_CLEAR(klon), & ! CS Direct |
---|
324 | ZFLUX_DIR_INTO_SUN(klon), & ! |
---|
325 | ZFLUX_UV(klon), & ! UV flux |
---|
326 | ZFLUX_PAR(klon), & ! photosynthetically active radiation similarly |
---|
327 | ZFLUX_PAR_CLEAR(klon), & ! CS photosynthetically |
---|
328 | ZFLUX_SW_DN_TOA(klon), & ! DN SW flux at TOA |
---|
329 | ZEMIS_OUT(klon) ! effective broadband emissivity |
---|
330 | REAL(KIND=8) ZLWDERIVATIVE(klon,klev+1) ! LW derivatives |
---|
331 | REAL(KIND=8) ZSWDIFFUSEBAND(klon,NSW), & ! SW DN flux in diffuse albedo band |
---|
332 | ZSWDIRECTBAND(klon,NSW) ! SW DN flux in direct albedo band |
---|
333 | #endif |
---|
334 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
335 | |
---|
336 | REAL(kind=8) POZON(kdlon, kflev, size(wo, 3)) ! mass fraction of ozone |
---|
337 | ! "POZON(:, :, 1)" is for the average day-night field, |
---|
338 | ! "POZON(:, :, 2)" is for daylight time. |
---|
339 | !!!!! Modif MPL 6.01.09 avec RRTM, on passe de 5 a 6 |
---|
340 | REAL(KIND=8) PAER(kdlon,kflev,6) |
---|
341 | REAL(KIND=8) PCLDLD(kdlon,kflev) |
---|
342 | REAL(KIND=8) PCLDLU(kdlon,kflev) |
---|
343 | REAL(KIND=8) PCLDSW(kdlon,kflev) |
---|
344 | REAL(KIND=8) PTAU(kdlon,2,kflev) |
---|
345 | REAL(KIND=8) POMEGA(kdlon,2,kflev) |
---|
346 | REAL(KIND=8) PCG(kdlon,2,kflev) |
---|
347 | REAL(KIND=8) zfract(kdlon), zrmu0(kdlon), zdist |
---|
348 | REAL(KIND=8) zheat(kdlon,kflev), zcool(kdlon,kflev) |
---|
349 | REAL(KIND=8) zheat0(kdlon,kflev), zcool0(kdlon,kflev) |
---|
350 | REAL(KIND=8) zheat_volc(kdlon,kflev), zcool_volc(kdlon,kflev) !NL |
---|
351 | REAL(KIND=8) ztopsw(kdlon), ztoplw(kdlon) |
---|
352 | REAL(KIND=8) zsolsw(kdlon), zsollw(kdlon), zalbpla(kdlon), zsolswfdiff(kdlon) |
---|
353 | REAL(KIND=8) zsollwdown(kdlon) |
---|
354 | REAL(KIND=8) ztopsw0(kdlon), ztoplw0(kdlon) |
---|
355 | REAL(KIND=8) zsolsw0(kdlon), zsollw0(kdlon) |
---|
356 | REAL(KIND=8) zznormcp |
---|
357 | REAL(KIND=8) tauaero(kdlon,kflev,naero_grp,2) ! aer opt properties |
---|
358 | REAL(KIND=8) pizaero(kdlon,kflev,naero_grp,2) |
---|
359 | REAL(KIND=8) cgaero(kdlon,kflev,naero_grp,2) |
---|
360 | REAL(KIND=8) PTAUA(kdlon,2,kflev) ! present-day value of cloud opt thickness (PTAU is pre-industrial value), local use |
---|
361 | REAL(KIND=8) POMEGAA(kdlon,2,kflev) ! dito for single scatt albedo |
---|
362 | REAL(KIND=8) ztopswadaero(kdlon), zsolswadaero(kdlon) ! Aerosol direct forcing at TOAand surface |
---|
363 | REAL(KIND=8) ztopswad0aero(kdlon), zsolswad0aero(kdlon) ! Aerosol direct forcing at TOAand surface |
---|
364 | REAL(KIND=8) ztopswaiaero(kdlon), zsolswaiaero(kdlon) ! dito, indirect |
---|
365 | !--NL |
---|
366 | REAL(KIND=8) zswadaero(kdlon,kflev+1) ! SW Aerosol direct forcing |
---|
367 | REAL(KIND=8) zlwadaero(kdlon,kflev+1) ! LW Aerosol direct forcing |
---|
368 | !-LW by CK |
---|
369 | REAL(KIND=8) ztoplwadaero(kdlon), zsollwadaero(kdlon) ! LW Aerosol direct forcing at TOAand surface |
---|
370 | REAL(KIND=8) ztoplwad0aero(kdlon), zsollwad0aero(kdlon) ! LW Aerosol direct forcing at TOAand surface |
---|
371 | REAL(KIND=8) ztoplwaiaero(kdlon), zsollwaiaero(kdlon) ! dito, indirect |
---|
372 | !-end |
---|
373 | REAL(KIND=8) ztopsw_aero(kdlon,9), ztopsw0_aero(kdlon,9) |
---|
374 | REAL(KIND=8) zsolsw_aero(kdlon,9), zsolsw0_aero(kdlon,9) |
---|
375 | REAL(KIND=8) ztopswcf_aero(kdlon,3), zsolswcf_aero(kdlon,3) |
---|
376 | ! real, parameter:: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2 deje declare dans physiq.F MPL 20130618 |
---|
377 | !MPL input supplementaires pour RECMWFL |
---|
378 | ! flwc, fiwc = Liquid Water Content & Ice Water Content (kg/kg) |
---|
379 | REAL(KIND=8) GEMU(klon) |
---|
380 | !MPL input RECMWFL: |
---|
381 | ! Tableaux aux niveaux inverses pour respecter convention Arpege |
---|
382 | REAL(KIND=8) ref_liq_i(klon,klev) ! cloud droplet radius present-day from newmicro (inverted) |
---|
383 | REAL(KIND=8) ref_ice_i(klon,klev) ! ice crystal radius present-day from newmicro (inverted) |
---|
384 | !--OB |
---|
385 | REAL(KIND=8) ref_liq_pi_i(klon,klev) ! cloud droplet radius pre-industrial from newmicro (inverted) |
---|
386 | REAL(KIND=8) ref_ice_pi_i(klon,klev) ! ice crystal radius pre-industrial from newmicro (inverted) |
---|
387 | !--end OB |
---|
388 | REAL(KIND=8) paprs_i(klon,klev+1) |
---|
389 | REAL(KIND=8) pplay_i(klon,klev) |
---|
390 | REAL(KIND=8) cldfra_i(klon,klev) |
---|
391 | REAL(KIND=8) POZON_i(kdlon,kflev, size(wo, 3)) ! mass fraction of ozone |
---|
392 | ! "POZON(:, :, 1)" is for the average day-night field, |
---|
393 | ! "POZON(:, :, 2)" is for daylight time. |
---|
394 | !!!!! Modif MPL 6.01.09 avec RRTM, on passe de 5 a 6 |
---|
395 | REAL(KIND=8) PAER_i(kdlon,kflev,6) |
---|
396 | REAL(KIND=8) PDP_i(klon,klev) |
---|
397 | REAL(KIND=8) t_i(klon,klev),q_i(klon,klev),qsat_i(klon,klev) |
---|
398 | REAL(KIND=8) flwc_i(klon,klev),fiwc_i(klon,klev) |
---|
399 | !MPL output RECMWFL: |
---|
400 | REAL(KIND=8) ZEMTD (klon,klev+1),ZEMTD_i (klon,klev+1) |
---|
401 | REAL(KIND=8) ZEMTU (klon,klev+1),ZEMTU_i (klon,klev+1) |
---|
402 | REAL(KIND=8) ZTRSO (klon,klev+1),ZTRSO_i (klon,klev+1) |
---|
403 | REAL(KIND=8) ZTH (klon,klev+1),ZTH_i (klon,klev+1) |
---|
404 | REAL(KIND=8) ZCTRSO(klon,2) |
---|
405 | REAL(KIND=8) ZCEMTR(klon,2) |
---|
406 | REAL(KIND=8) ZTRSOD(klon) |
---|
407 | REAL(KIND=8) ZLWFC (klon,2) |
---|
408 | REAL(KIND=8) ZLWFT (klon,klev+1),ZLWFT_i (klon,klev+1) |
---|
409 | REAL(KIND=8) ZSWFC (klon,2) |
---|
410 | REAL(KIND=8) ZSWFT (klon,klev+1),ZSWFT_i (klon,klev+1) |
---|
411 | REAL(KIND=8) ZFLUCDWN_i(klon,klev+1),ZFLUCUP_i(klon,klev+1) |
---|
412 | REAL(KIND=8) PPIZA_TOT(klon,klev,NSW) |
---|
413 | REAL(KIND=8) PCGA_TOT(klon,klev,NSW) |
---|
414 | REAL(KIND=8) PTAU_TOT(klon,klev,NSW) |
---|
415 | REAL(KIND=8) PPIZA_NAT(klon,klev,NSW) |
---|
416 | REAL(KIND=8) PCGA_NAT(klon,klev,NSW) |
---|
417 | REAL(KIND=8) PTAU_NAT(klon,klev,NSW) |
---|
418 | #ifdef CPP_RRTM |
---|
419 | REAL(KIND=8) PTAU_LW_TOT(klon,klev,NLW) |
---|
420 | REAL(KIND=8) PTAU_LW_NAT(klon,klev,NLW) |
---|
421 | #endif |
---|
422 | REAL(KIND=8) PSFSWDIR(klon,NSW) |
---|
423 | REAL(KIND=8) PSFSWDIF(klon,NSW) |
---|
424 | REAL(KIND=8) PFSDNN(klon) |
---|
425 | REAL(KIND=8) PFSDNV(klon) |
---|
426 | !MPL On ne redefinit pas les tableaux ZFLUX,ZFLUC, |
---|
427 | !MPL ZFSDWN,ZFCDWN,ZFSUP,ZFCUP car ils existent deja |
---|
428 | !MPL sous les noms de ZFLDN,ZFLDN0,ZFLUP,ZFLUP0, |
---|
429 | !MPL ZFSDN,ZFSDN0,ZFSUP,ZFSUP0 |
---|
430 | REAL(KIND=8) ZFLUX_i (klon,2,klev+1) |
---|
431 | REAL(KIND=8) ZFLUC_i (klon,2,klev+1) |
---|
432 | REAL(KIND=8) ZFSDWN_i (klon,klev+1) |
---|
433 | REAL(KIND=8) ZFCDWN_i (klon,klev+1) |
---|
434 | REAL(KIND=8) ZFCCDWN_i (klon,klev+1) |
---|
435 | REAL(KIND=8) ZFSUP_i (klon,klev+1) |
---|
436 | REAL(KIND=8) ZFCUP_i (klon,klev+1) |
---|
437 | REAL(KIND=8) ZFCCUP_i (klon,klev+1) |
---|
438 | REAL(KIND=8) ZFLCCDWN_i (klon,klev+1) |
---|
439 | REAL(KIND=8) ZFLCCUP_i (klon,klev+1) |
---|
440 | ! 3 lignes suivantes a activer pour CCMVAL (MPL 20100412) |
---|
441 | ! REAL(KIND=8) RSUN(3,2) |
---|
442 | ! REAL(KIND=8) SUN(3) |
---|
443 | ! REAL(KIND=8) SUN_FRACT(2) |
---|
444 | REAL, PARAMETER:: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2 |
---|
445 | CHARACTER (LEN=80) :: abort_message |
---|
446 | CHARACTER (LEN=80) :: modname='radlwsw_m' |
---|
447 | |
---|
448 | REAL zdir, zdif |
---|
449 | |
---|
450 | ! ========= INITIALISATIONS ============================================== |
---|
451 | print*,'Entree dans radlwsw ' |
---|
452 | print*,'************* INITIALISATIONS *****************************' |
---|
453 | print*,'klon, kdlon, klev, kflev =',klon, kdlon, klev, kflev |
---|
454 | |
---|
455 | CALL assert(size(wo, 1) == klon, size(wo, 2) == klev, "radlwsw wo") |
---|
456 | |
---|
457 | ist=1 |
---|
458 | iend=klon |
---|
459 | ktdia=1 |
---|
460 | kmode=ist |
---|
461 | ! Aeros |
---|
462 | tauaero(:,:,:,:)=0. |
---|
463 | pizaero(:,:,:,:)=0. |
---|
464 | cgaero(:,:,:,:)=0. |
---|
465 | lldebug=.FALSE. |
---|
466 | |
---|
467 | ztopsw_aero(:,:) = 0. !ym missing init : warning : not initialized in SW_AEROAR4 |
---|
468 | ztopsw0_aero(:,:) = 0. !ym missing init : warning : not initialized in SW_AEROAR4 |
---|
469 | zsolsw_aero(:,:) = 0. !ym missing init : warning : not initialized in SW_AEROAR4 |
---|
470 | zsolsw0_aero(:,:) = 0. !ym missing init : warning : not initialized in SW_AEROAR4 |
---|
471 | |
---|
472 | ZTOPSWADAERO(:) = 0. !ym missing init |
---|
473 | ZSOLSWADAERO(:) = 0. !ym missing init |
---|
474 | ZTOPSWAD0AERO(:) = 0. !ym missing init |
---|
475 | ZSOLSWAD0AERO(:) = 0. !ym missing init |
---|
476 | ZTOPSWAIAERO(:) = 0. !ym missing init |
---|
477 | ZSOLSWAIAERO(:) = 0. !ym missing init |
---|
478 | ZTOPSWCF_AERO(:,:)= 0.!ym missing init |
---|
479 | ZSOLSWCF_AERO(:,:) =0. !ym missing init |
---|
480 | |
---|
481 | ! |
---|
482 | !------------------------------------------- |
---|
483 | nb_gr = KLON / kdlon |
---|
484 | IF (nb_gr*kdlon .NE. KLON) THEN |
---|
485 | PRINT*, "kdlon mauvais:", KLON, kdlon, nb_gr |
---|
486 | call abort_physic("radlwsw", "", 1) |
---|
487 | ENDIF |
---|
488 | IF (kflev .NE. KLEV) THEN |
---|
489 | PRINT*, "kflev differe de KLEV, kflev, KLEV" |
---|
490 | call abort_physic("radlwsw", "", 1) |
---|
491 | ENDIF |
---|
492 | !------------------------------------------- |
---|
493 | DO k = 1, KLEV |
---|
494 | DO i = 1, KLON |
---|
495 | heat(i,k)=0. |
---|
496 | cool(i,k)=0. |
---|
497 | heat_volc(i,k)=0. !NL |
---|
498 | cool_volc(i,k)=0. !NL |
---|
499 | heat0(i,k)=0. |
---|
500 | cool0(i,k)=0. |
---|
501 | ENDDO |
---|
502 | ENDDO |
---|
503 | ! |
---|
504 | zdist = dist |
---|
505 | ! |
---|
506 | PSCT = solaire/zdist/zdist |
---|
507 | |
---|
508 | IF (type_trac == 'repr') THEN |
---|
509 | #ifdef REPROBUS |
---|
510 | IF (iflag_rrtm==0) THEN |
---|
511 | IF (ok_SUNTIME) PSCT = solaireTIME/zdist/zdist |
---|
512 | print*,'Constante solaire: ',PSCT*zdist*zdist |
---|
513 | ENDIF |
---|
514 | #endif |
---|
515 | ENDIF |
---|
516 | |
---|
517 | print*,'************** Debut boucle de 1 a ', nb_gr |
---|
518 | DO j = 1, nb_gr |
---|
519 | iof = kdlon*(j-1) |
---|
520 | DO i = 1, kdlon |
---|
521 | zfract(i) = fract(iof+i) |
---|
522 | zrmu0(i) = rmu0(iof+i) |
---|
523 | |
---|
524 | |
---|
525 | IF (iflag_rrtm==0) THEN |
---|
526 | ! Albedo |
---|
527 | PALBD(i,1)=alb_dif(iof+i,1) |
---|
528 | PALBD(i,2)=alb_dif(iof+i,2) |
---|
529 | PALBP(i,1)=alb_dir(iof+i,1) |
---|
530 | PALBP(i,2)=alb_dir(iof+i,2) |
---|
531 | ! AI 02.2021 cas iflag_rrtm=1 et 2 |
---|
532 | ELSEIF (iflag_rrtm==1.OR.iflag_rrtm==2) THEN |
---|
533 | DO kk=1,NSW |
---|
534 | PALBD_NEW(i,kk)=alb_dif(iof+i,kk) |
---|
535 | PALBP_NEW(i,kk)=alb_dir(iof+i,kk) |
---|
536 | ENDDO |
---|
537 | ! |
---|
538 | ENDIF |
---|
539 | !albedo SB <<< |
---|
540 | |
---|
541 | PEMIS(i) = 1.0 !!!!! A REVOIR (MPL) |
---|
542 | PVIEW(i) = 1.66 |
---|
543 | PPSOL(i) = paprs(iof+i,1) |
---|
544 | zx_alpha1 = (paprs(iof+i,1)-pplay(iof+i,2))/(pplay(iof+i,1)-pplay(iof+i,2)) |
---|
545 | zx_alpha2 = 1.0 - zx_alpha1 |
---|
546 | PTL(i,1) = t(iof+i,1) * zx_alpha1 + t(iof+i,2) * zx_alpha2 |
---|
547 | PTL(i,KLEV+1) = t(iof+i,KLEV) |
---|
548 | PDT0(i) = tsol(iof+i) - PTL(i,1) |
---|
549 | ENDDO |
---|
550 | DO k = 2, kflev |
---|
551 | DO i = 1, kdlon |
---|
552 | PTL(i,k) = (t(iof+i,k)+t(iof+i,k-1))*0.5 |
---|
553 | ENDDO |
---|
554 | ENDDO |
---|
555 | DO k = 1, kflev |
---|
556 | DO i = 1, kdlon |
---|
557 | PDP(i,k) = paprs(iof+i,k)-paprs(iof+i,k+1) |
---|
558 | PTAVE(i,k) = t(iof+i,k) |
---|
559 | PWV(i,k) = MAX (q(iof+i,k), 1.0e-12) |
---|
560 | PQS(i,k) = PWV(i,k) |
---|
561 | ! Confert from column density of ozone in a cell, in kDU, to a mass fraction |
---|
562 | POZON(i,k, :) = wo(iof+i, k, :) * RG * dobson_u * 1e3 & |
---|
563 | / (paprs(iof+i, k) - paprs(iof+i, k+1)) |
---|
564 | ZO3_DP(i,k) = wo(iof+i, k, 1) * RG * dobson_u * 1e3 |
---|
565 | ! A activer pour CCMVAL on prend l'ozone impose (MPL 07042010) |
---|
566 | ! POZON(i,k,:) = wo(i,k,:) |
---|
567 | ! print *,'RADLWSW: POZON',k, POZON(i,k,1) |
---|
568 | PCLDLD(i,k) = cldfra(iof+i,k)*cldemi(iof+i,k) |
---|
569 | PCLDLU(i,k) = cldfra(iof+i,k)*cldemi(iof+i,k) |
---|
570 | PCLDSW(i,k) = cldfra(iof+i,k) |
---|
571 | PTAU(i,1,k) = MAX(cldtaupi(iof+i,k), 1.0e-05)! 1e-12 serait instable |
---|
572 | PTAU(i,2,k) = MAX(cldtaupi(iof+i,k), 1.0e-05)! pour 32-bit machines |
---|
573 | POMEGA(i,1,k) = 0.9999 - 5.0e-04 * EXP(-0.5 * PTAU(i,1,k)) |
---|
574 | POMEGA(i,2,k) = 0.9988 - 2.5e-03 * EXP(-0.05 * PTAU(i,2,k)) |
---|
575 | PCG(i,1,k) = 0.865 |
---|
576 | PCG(i,2,k) = 0.910 |
---|
577 | !- |
---|
578 | ! Introduced for aerosol indirect forcings. |
---|
579 | ! The following values use the cloud optical thickness calculated from |
---|
580 | ! present-day aerosol concentrations whereas the quantities without the |
---|
581 | ! "A" at the end are for pre-industial (natural-only) aerosol concentrations |
---|
582 | ! |
---|
583 | PTAUA(i,1,k) = MAX(cldtaupd(iof+i,k), 1.0e-05)! 1e-12 serait instable |
---|
584 | PTAUA(i,2,k) = MAX(cldtaupd(iof+i,k), 1.0e-05)! pour 32-bit machines |
---|
585 | POMEGAA(i,1,k) = 0.9999 - 5.0e-04 * EXP(-0.5 * PTAUA(i,1,k)) |
---|
586 | POMEGAA(i,2,k) = 0.9988 - 2.5e-03 * EXP(-0.05 * PTAUA(i,2,k)) |
---|
587 | ENDDO |
---|
588 | ENDDO |
---|
589 | |
---|
590 | IF (type_trac == 'repr') THEN |
---|
591 | #ifdef REPROBUS |
---|
592 | ndimozon = size(wo, 3) |
---|
593 | CALL RAD_INTERACTIF(POZON,iof) |
---|
594 | #endif |
---|
595 | ENDIF |
---|
596 | ! |
---|
597 | DO k = 1, kflev+1 |
---|
598 | DO i = 1, kdlon |
---|
599 | PPMB(i,k) = paprs(iof+i,k)/100.0 |
---|
600 | ENDDO |
---|
601 | ENDDO |
---|
602 | ! |
---|
603 | !!!!! Modif MPL 6.01.09 avec RRTM, on passe de 5 a 6 |
---|
604 | DO kk = 1, 6 |
---|
605 | DO k = 1, kflev |
---|
606 | DO i = 1, kdlon |
---|
607 | PAER(i,k,kk) = 1.0E-15 !!!!! A REVOIR (MPL) |
---|
608 | ENDDO |
---|
609 | ENDDO |
---|
610 | ENDDO |
---|
611 | DO k = 1, kflev |
---|
612 | DO i = 1, kdlon |
---|
613 | tauaero(i,k,:,1)=tau_aero(iof+i,k,:,1) |
---|
614 | pizaero(i,k,:,1)=piz_aero(iof+i,k,:,1) |
---|
615 | cgaero(i,k,:,1) =cg_aero(iof+i,k,:,1) |
---|
616 | tauaero(i,k,:,2)=tau_aero(iof+i,k,:,2) |
---|
617 | pizaero(i,k,:,2)=piz_aero(iof+i,k,:,2) |
---|
618 | cgaero(i,k,:,2) =cg_aero(iof+i,k,:,2) |
---|
619 | ENDDO |
---|
620 | ENDDO |
---|
621 | ! |
---|
622 | ! AI 02.2021 |
---|
623 | #ifdef CPP_ECRAD |
---|
624 | ZEMIS = 1.0 |
---|
625 | ZEMISW = 1.0 |
---|
626 | ZGELAM = longitude |
---|
627 | ZGEMU = sin(latitude) |
---|
628 | ZCO2 = RCO2 |
---|
629 | ZCH4 = RCH4 |
---|
630 | ZN2O = RN2O |
---|
631 | ZNO2 = 0.0 |
---|
632 | ZCFC11 = RCFC11 |
---|
633 | ZCFC12 = RCFC12 |
---|
634 | ZHCFC22 = 0.0 |
---|
635 | ZCCL4 = 0.0 |
---|
636 | ZQ_RAIN = 0.0 |
---|
637 | ZQ_SNOW = 0.0 |
---|
638 | ZAEROSOL_OLD = 0.0 |
---|
639 | ZAEROSOL = 0.0 |
---|
640 | #endif |
---|
641 | ! |
---|
642 | !===== iflag_rrtm ================================================ |
---|
643 | ! |
---|
644 | IF (iflag_rrtm == 0) THEN !!!! remettre 0 juste pour tester l'ancien rayt via rrtm |
---|
645 | ! |
---|
646 | !--- Mise a zero des tableaux output du rayonnement LW-AR4 ---------- |
---|
647 | DO k = 1, kflev+1 |
---|
648 | DO i = 1, kdlon |
---|
649 | ! print *,'RADLWSW: boucle mise a zero i k',i,k |
---|
650 | ZFLUP(i,k)=0. |
---|
651 | ZFLDN(i,k)=0. |
---|
652 | ZFLUP0(i,k)=0. |
---|
653 | ZFLDN0(i,k)=0. |
---|
654 | ZLWFT0_i(i,k)=0. |
---|
655 | ZFLUCUP_i(i,k)=0. |
---|
656 | ZFLUCDWN_i(i,k)=0. |
---|
657 | ENDDO |
---|
658 | ENDDO |
---|
659 | DO k = 1, kflev |
---|
660 | DO i = 1, kdlon |
---|
661 | zcool(i,k)=0. |
---|
662 | zcool_volc(i,k)=0. !NL |
---|
663 | zcool0(i,k)=0. |
---|
664 | ENDDO |
---|
665 | ENDDO |
---|
666 | DO i = 1, kdlon |
---|
667 | ztoplw(i)=0. |
---|
668 | zsollw(i)=0. |
---|
669 | ztoplw0(i)=0. |
---|
670 | zsollw0(i)=0. |
---|
671 | zsollwdown(i)=0. |
---|
672 | ENDDO |
---|
673 | ! Old radiation scheme, used for AR4 runs |
---|
674 | ! average day-night ozone for longwave |
---|
675 | CALL LW_LMDAR4(& |
---|
676 | PPMB, PDP,& |
---|
677 | PPSOL,PDT0,PEMIS,& |
---|
678 | PTL, PTAVE, PWV, POZON(:, :, 1), PAER,& |
---|
679 | PCLDLD,PCLDLU,& |
---|
680 | PVIEW,& |
---|
681 | zcool, zcool0,& |
---|
682 | ztoplw,zsollw,ztoplw0,zsollw0,& |
---|
683 | zsollwdown,& |
---|
684 | ZFLUP, ZFLDN, ZFLUP0,ZFLDN0) |
---|
685 | !----- Mise a zero des tableaux output du rayonnement SW-AR4 |
---|
686 | DO k = 1, kflev+1 |
---|
687 | DO i = 1, kdlon |
---|
688 | ZFSUP(i,k)=0. |
---|
689 | ZFSDN(i,k)=0. |
---|
690 | ZFSUP0(i,k)=0. |
---|
691 | ZFSDN0(i,k)=0. |
---|
692 | ZFSUPC0(i,k)=0. |
---|
693 | ZFSDNC0(i,k)=0. |
---|
694 | ZFLUPC0(i,k)=0. |
---|
695 | ZFLDNC0(i,k)=0. |
---|
696 | ZSWFT0_i(i,k)=0. |
---|
697 | ZFCUP_i(i,k)=0. |
---|
698 | ZFCDWN_i(i,k)=0. |
---|
699 | ZFCCUP_i(i,k)=0. |
---|
700 | ZFCCDWN_i(i,k)=0. |
---|
701 | ZFLCCUP_i(i,k)=0. |
---|
702 | ZFLCCDWN_i(i,k)=0. |
---|
703 | zswadaero(i,k)=0. !--NL |
---|
704 | ENDDO |
---|
705 | ENDDO |
---|
706 | DO k = 1, kflev |
---|
707 | DO i = 1, kdlon |
---|
708 | zheat(i,k)=0. |
---|
709 | zheat_volc(i,k)=0. |
---|
710 | zheat0(i,k)=0. |
---|
711 | ENDDO |
---|
712 | ENDDO |
---|
713 | DO i = 1, kdlon |
---|
714 | zalbpla(i)=0. |
---|
715 | ztopsw(i)=0. |
---|
716 | zsolsw(i)=0. |
---|
717 | ztopsw0(i)=0. |
---|
718 | zsolsw0(i)=0. |
---|
719 | ztopswadaero(i)=0. |
---|
720 | zsolswadaero(i)=0. |
---|
721 | ztopswaiaero(i)=0. |
---|
722 | zsolswaiaero(i)=0. |
---|
723 | ENDDO |
---|
724 | |
---|
725 | !--fraction of diffuse radiation in surface SW downward radiation |
---|
726 | !--not computed with old radiation scheme |
---|
727 | zsolswfdiff(:) = -999.999 |
---|
728 | |
---|
729 | ! print *,'Avant SW_LMDAR4: PSCT zrmu0 zfract',PSCT, zrmu0, zfract |
---|
730 | ! daylight ozone, if we have it, for short wave |
---|
731 | CALL SW_AEROAR4(PSCT, zrmu0, zfract,& |
---|
732 | PPMB, PDP,& |
---|
733 | PPSOL, PALBD, PALBP,& |
---|
734 | PTAVE, PWV, PQS, POZON(:, :, size(wo, 3)), PAER,& |
---|
735 | PCLDSW, PTAU, POMEGA, PCG,& |
---|
736 | zheat, zheat0,& |
---|
737 | zalbpla,ztopsw,zsolsw,ztopsw0,zsolsw0,& |
---|
738 | ZFSUP,ZFSDN,ZFSUP0,ZFSDN0,& |
---|
739 | tauaero, pizaero, cgaero, & |
---|
740 | PTAUA, POMEGAA,& |
---|
741 | ztopswadaero,zsolswadaero,& |
---|
742 | ztopswad0aero,zsolswad0aero,& |
---|
743 | ztopswaiaero,zsolswaiaero, & |
---|
744 | ztopsw_aero,ztopsw0_aero,& |
---|
745 | zsolsw_aero,zsolsw0_aero,& |
---|
746 | ztopswcf_aero,zsolswcf_aero, & |
---|
747 | ok_ade, ok_aie, flag_aerosol,flag_aerosol_strat) |
---|
748 | |
---|
749 | ZSWFT0_i(:,:) = ZFSDN0(:,:)-ZFSUP0(:,:) |
---|
750 | ZLWFT0_i(:,:) =-ZFLDN0(:,:)-ZFLUP0(:,:) |
---|
751 | |
---|
752 | DO i=1,kdlon |
---|
753 | DO k=1,kflev+1 |
---|
754 | lwdn0 ( iof+i,k) = ZFLDN0 ( i,k) |
---|
755 | lwdn ( iof+i,k) = ZFLDN ( i,k) |
---|
756 | lwup0 ( iof+i,k) = ZFLUP0 ( i,k) |
---|
757 | lwup ( iof+i,k) = ZFLUP ( i,k) |
---|
758 | swdn0 ( iof+i,k) = ZFSDN0 ( i,k) |
---|
759 | swdn ( iof+i,k) = ZFSDN ( i,k) |
---|
760 | swup0 ( iof+i,k) = ZFSUP0 ( i,k) |
---|
761 | swup ( iof+i,k) = ZFSUP ( i,k) |
---|
762 | ENDDO |
---|
763 | ENDDO |
---|
764 | ! |
---|
765 | ELSE IF (iflag_rrtm == 1) then |
---|
766 | #ifdef CPP_RRTM |
---|
767 | ! if (prt_level.gt.10)write(lunout,*)'CPP_RRTM=.T.' |
---|
768 | !===== iflag_rrtm=1, on passe dans SW via RECMWFL =============== |
---|
769 | |
---|
770 | DO k = 1, kflev+1 |
---|
771 | DO i = 1, kdlon |
---|
772 | ZEMTD_i(i,k)=0. |
---|
773 | ZEMTU_i(i,k)=0. |
---|
774 | ZTRSO_i(i,k)=0. |
---|
775 | ZTH_i(i,k)=0. |
---|
776 | ZLWFT_i(i,k)=0. |
---|
777 | ZSWFT_i(i,k)=0. |
---|
778 | ZFLUX_i(i,1,k)=0. |
---|
779 | ZFLUX_i(i,2,k)=0. |
---|
780 | ZFLUC_i(i,1,k)=0. |
---|
781 | ZFLUC_i(i,2,k)=0. |
---|
782 | ZFSDWN_i(i,k)=0. |
---|
783 | ZFCDWN_i(i,k)=0. |
---|
784 | ZFCCDWN_i(i,k)=0. |
---|
785 | ZFSUP_i(i,k)=0. |
---|
786 | ZFCUP_i(i,k)=0. |
---|
787 | ZFCCUP_i(i,k)=0. |
---|
788 | ZFLCCDWN_i(i,k)=0. |
---|
789 | ZFLCCUP_i(i,k)=0. |
---|
790 | ENDDO |
---|
791 | ENDDO |
---|
792 | ! |
---|
793 | !--OB |
---|
794 | !--aerosol TOT - anthropogenic+natural - index 2 |
---|
795 | !--aerosol NAT - natural only - index 1 |
---|
796 | ! |
---|
797 | DO i = 1, kdlon |
---|
798 | DO k = 1, kflev |
---|
799 | DO kk=1, NSW |
---|
800 | ! |
---|
801 | PTAU_TOT(i,kflev+1-k,kk)=tau_aero_sw_rrtm(i,k,2,kk) |
---|
802 | PPIZA_TOT(i,kflev+1-k,kk)=piz_aero_sw_rrtm(i,k,2,kk) |
---|
803 | PCGA_TOT(i,kflev+1-k,kk)=cg_aero_sw_rrtm(i,k,2,kk) |
---|
804 | ! |
---|
805 | PTAU_NAT(i,kflev+1-k,kk)=tau_aero_sw_rrtm(i,k,1,kk) |
---|
806 | PPIZA_NAT(i,kflev+1-k,kk)=piz_aero_sw_rrtm(i,k,1,kk) |
---|
807 | PCGA_NAT(i,kflev+1-k,kk)=cg_aero_sw_rrtm(i,k,1,kk) |
---|
808 | ! |
---|
809 | ENDDO |
---|
810 | ENDDO |
---|
811 | ENDDO |
---|
812 | !-end OB |
---|
813 | ! |
---|
814 | !--C. Kleinschmitt |
---|
815 | !--aerosol TOT - anthropogenic+natural - index 2 |
---|
816 | !--aerosol NAT - natural only - index 1 |
---|
817 | ! |
---|
818 | DO i = 1, kdlon |
---|
819 | DO k = 1, kflev |
---|
820 | DO kk=1, NLW |
---|
821 | ! |
---|
822 | PTAU_LW_TOT(i,kflev+1-k,kk)=tau_aero_lw_rrtm(i,k,2,kk) |
---|
823 | PTAU_LW_NAT(i,kflev+1-k,kk)=tau_aero_lw_rrtm(i,k,1,kk) |
---|
824 | ! |
---|
825 | ENDDO |
---|
826 | ENDDO |
---|
827 | ENDDO |
---|
828 | !-end C. Kleinschmitt |
---|
829 | ! |
---|
830 | DO i = 1, kdlon |
---|
831 | ZCTRSO(i,1)=0. |
---|
832 | ZCTRSO(i,2)=0. |
---|
833 | ZCEMTR(i,1)=0. |
---|
834 | ZCEMTR(i,2)=0. |
---|
835 | ZTRSOD(i)=0. |
---|
836 | ZLWFC(i,1)=0. |
---|
837 | ZLWFC(i,2)=0. |
---|
838 | ZSWFC(i,1)=0. |
---|
839 | ZSWFC(i,2)=0. |
---|
840 | PFSDNN(i)=0. |
---|
841 | PFSDNV(i)=0. |
---|
842 | DO kk = 1, NSW |
---|
843 | PSFSWDIR(i,kk)=0. |
---|
844 | PSFSWDIF(i,kk)=0. |
---|
845 | ENDDO |
---|
846 | ENDDO |
---|
847 | !----- Fin des mises a zero des tableaux output de RECMWF ------------------- |
---|
848 | ! GEMU(1:klon)=sin(rlatd(1:klon)) |
---|
849 | ! On met les donnees dans l'ordre des niveaux arpege |
---|
850 | paprs_i(:,1)=paprs(:,klev+1) |
---|
851 | DO k=1,klev |
---|
852 | paprs_i(1:klon,k+1) =paprs(1:klon,klev+1-k) |
---|
853 | pplay_i(1:klon,k) =pplay(1:klon,klev+1-k) |
---|
854 | cldfra_i(1:klon,k) =cldfra(1:klon,klev+1-k) |
---|
855 | PDP_i(1:klon,k) =PDP(1:klon,klev+1-k) |
---|
856 | t_i(1:klon,k) =t(1:klon,klev+1-k) |
---|
857 | q_i(1:klon,k) =q(1:klon,klev+1-k) |
---|
858 | qsat_i(1:klon,k) =qsat(1:klon,klev+1-k) |
---|
859 | flwc_i(1:klon,k) =flwc(1:klon,klev+1-k) |
---|
860 | fiwc_i(1:klon,k) =fiwc(1:klon,klev+1-k) |
---|
861 | ref_liq_i(1:klon,k) =ref_liq(1:klon,klev+1-k) |
---|
862 | ref_ice_i(1:klon,k) =ref_ice(1:klon,klev+1-k) |
---|
863 | !-OB |
---|
864 | ref_liq_pi_i(1:klon,k) =ref_liq_pi(1:klon,klev+1-k) |
---|
865 | ref_ice_pi_i(1:klon,k) =ref_ice_pi(1:klon,klev+1-k) |
---|
866 | ENDDO |
---|
867 | DO k=1,kflev |
---|
868 | POZON_i(1:klon,k,:)=POZON(1:klon,kflev+1-k,:) |
---|
869 | !!! POZON_i(1:klon,k)=POZON(1:klon,k) !!! on laisse 1=sol et klev=top |
---|
870 | ! print *,'Juste avant RECMWFL: k tsol temp',k,tsol,t(1,k) |
---|
871 | !!!!!!! Modif MPL 6.01.09 avec RRTM, on passe de 5 a 6 |
---|
872 | DO i=1,6 |
---|
873 | PAER_i(1:klon,k,i)=PAER(1:klon,kflev+1-k,i) |
---|
874 | ENDDO |
---|
875 | ENDDO |
---|
876 | |
---|
877 | ! print *,'RADLWSW: avant RECMWFL, RI0,rmu0=',solaire,rmu0 |
---|
878 | |
---|
879 | ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
880 | ! La version ARPEGE1D utilise differentes valeurs de la constante |
---|
881 | ! solaire suivant le rayonnement utilise. |
---|
882 | ! A controler ... |
---|
883 | ! SOLAR FLUX AT THE TOP (/YOMPHY3/) |
---|
884 | ! introduce season correction |
---|
885 | !-------------------------------------- |
---|
886 | ! RII0 = RIP0 |
---|
887 | ! IF(LRAYFM) |
---|
888 | ! RII0 = RIP0M ! =rip0m if Morcrette non-each time step call. |
---|
889 | ! IF(LRAYFM15) |
---|
890 | ! RII0 = RIP0M15 ! =rip0m if Morcrette non-each time step call. |
---|
891 | RII0=solaire/zdist/zdist |
---|
892 | !print*,'+++ radlwsw: solaire ,RII0',solaire,RII0 |
---|
893 | ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
894 | ! Ancien appel a RECMWF (celui du cy25) |
---|
895 | ! CALL RECMWF (ist , iend, klon , ktdia , klev , kmode , |
---|
896 | ! s PALBD , PALBP , paprs_i , pplay_i , RCO2 , cldfra_i, |
---|
897 | ! s POZON_i , PAER_i , PDP_i , PEMIS , GEMU , rmu0, |
---|
898 | ! s q_i , qsat_i , fiwc_i , flwc_i , zmasq , t_i ,tsol, |
---|
899 | ! s ZEMTD_i , ZEMTU_i , ZTRSO_i , |
---|
900 | ! s ZTH_i , ZCTRSO , ZCEMTR , ZTRSOD , |
---|
901 | ! s ZLWFC , ZLWFT_i , ZSWFC , ZSWFT_i , |
---|
902 | ! s ZFLUX_i , ZFLUC_i , ZFSDWN_i, ZFSUP_i , ZFCDWN_i,ZFCUP_i) |
---|
903 | ! s 'RECMWF ') |
---|
904 | ! |
---|
905 | IF (lldebug) THEN |
---|
906 | CALL writefield_phy('paprs_i',paprs_i,klev+1) |
---|
907 | CALL writefield_phy('pplay_i',pplay_i,klev) |
---|
908 | CALL writefield_phy('cldfra_i',cldfra_i,klev) |
---|
909 | CALL writefield_phy('pozon_i',POZON_i,klev) |
---|
910 | CALL writefield_phy('paer_i',PAER_i,klev) |
---|
911 | CALL writefield_phy('pdp_i',PDP_i,klev) |
---|
912 | CALL writefield_phy('q_i',q_i,klev) |
---|
913 | CALL writefield_phy('qsat_i',qsat_i,klev) |
---|
914 | CALL writefield_phy('fiwc_i',fiwc_i,klev) |
---|
915 | CALL writefield_phy('flwc_i',flwc_i,klev) |
---|
916 | CALL writefield_phy('t_i',t_i,klev) |
---|
917 | CALL writefield_phy('palbd_new',PALBD_NEW,NSW) |
---|
918 | CALL writefield_phy('palbp_new',PALBP_NEW,NSW) |
---|
919 | ENDIF |
---|
920 | |
---|
921 | ! Nouvel appel a RECMWF (celui du cy32t0) |
---|
922 | CALL RECMWF_AERO (ist , iend, klon , ktdia , klev , kmode ,& |
---|
923 | ! KST, KEND, KPROMA, KTDIA , KLEV, KMODE |
---|
924 | PALBD_NEW,PALBP_NEW, paprs_i , pplay_i , RCO2 , cldfra_i,& |
---|
925 | ! PALBD , PALBP , PAPRS , PAPRSF , PCCO2 , PCLFR |
---|
926 | POZON_i , PAER_i , PDP_i , PEMIS , rmu0 ,& |
---|
927 | ! PQO3 , PAER , PDP , PEMIS , PMU0 |
---|
928 | q_i , qsat_i , fiwc_i , flwc_i , zmasq , t_i ,tsol,& |
---|
929 | ! PQ , PQS , PQIWP , PQLWP , PSLM , PT , PTS, |
---|
930 | ref_liq_i, ref_ice_i, & |
---|
931 | ! PREF_LIQ, PREF_ICE |
---|
932 | ref_liq_pi_i, ref_ice_pi_i, & ! rajoute par OB pour diagnostiquer effet indirect |
---|
933 | ! PREF_LIQ_PI, PREF_ICE_PI |
---|
934 | ZEMTD_i , ZEMTU_i , ZTRSO_i ,& |
---|
935 | ! PEMTD , PEMTU , PTRSO |
---|
936 | ZTH_i , ZCTRSO , ZCEMTR , ZTRSOD ,& |
---|
937 | ! PTH , PCTRSO, PCEMTR, PTRSOD |
---|
938 | ZLWFC , ZLWFT_i , ZSWFC , ZSWFT_i ,& |
---|
939 | ! PLWFC, PLWFT, PSWFC, PSWFT, |
---|
940 | PSFSWDIR , PSFSWDIF, PFSDNN , PFSDNV ,& |
---|
941 | ! PSFSWDIR, PSFSWDIF, PFSDNN, PFSDNV |
---|
942 | PPIZA_TOT, PCGA_TOT,PTAU_TOT,& |
---|
943 | ! PPIZA_TOT, PCGA_TOT,PTAU_TOT |
---|
944 | PPIZA_NAT, PCGA_NAT,PTAU_NAT, & ! rajoute par OB pour diagnostiquer effet direct |
---|
945 | ! PPIZA_NAT,PCGA_NAT,PTAU_NAT |
---|
946 | PTAU_LW_TOT, PTAU_LW_NAT, & ! rajoute par C. Kleinschmitt |
---|
947 | ! PTAU_LW_TOT, PTAU_LW_NAT, |
---|
948 | ZFLUX_i , ZFLUC_i ,& |
---|
949 | ! PFLUX, PFLUC |
---|
950 | ZFSDWN_i , ZFSUP_i , ZFCDWN_i, ZFCUP_i, ZFCCDWN_i, ZFCCUP_i, ZFLCCDWN_i, ZFLCCUP_i, & |
---|
951 | ! PFSDN , PFSUP , PFSCDN , PFSCUP, PFSCCDN, PFSCCUP, PFLCCDN, PFLCCUP |
---|
952 | ZTOPSWADAERO,ZSOLSWADAERO,& ! rajoute par OB pour diagnostics |
---|
953 | ! PTOPSWADAERO,PSOLSWADAERO |
---|
954 | ZTOPSWAD0AERO,ZSOLSWAD0AERO,& |
---|
955 | ZTOPSWAIAERO,ZSOLSWAIAERO, & |
---|
956 | ZTOPSWCF_AERO,ZSOLSWCF_AERO, & |
---|
957 | ZSWADAERO, & !--NL |
---|
958 | ZTOPLWADAERO,ZSOLLWADAERO,& ! rajoute par C. Kleinscmitt pour LW diagnostics |
---|
959 | ZTOPLWAD0AERO,ZSOLLWAD0AERO,& |
---|
960 | ZTOPLWAIAERO,ZSOLLWAIAERO, & |
---|
961 | ZLWADAERO, & !--NL |
---|
962 | ok_ade, ok_aie, ok_volcan, flag_aerosol,flag_aerosol_strat, flag_aer_feedback) ! flags aerosols |
---|
963 | |
---|
964 | !--OB diagnostics |
---|
965 | ! & PTOPSWAIAERO,PSOLSWAIAERO,& |
---|
966 | ! & PTOPSWCFAERO,PSOLSWCFAERO,& |
---|
967 | ! & PSWADAERO,& !--NL |
---|
968 | !!--LW diagnostics CK |
---|
969 | ! & PTOPLWADAERO,PSOLLWADAERO,& |
---|
970 | ! & PTOPLWAD0AERO,PSOLLWAD0AERO,& |
---|
971 | ! & PTOPLWAIAERO,PSOLLWAIAERO,& |
---|
972 | ! & PLWADAERO,& !--NL |
---|
973 | !!..end |
---|
974 | ! & ok_ade, ok_aie, ok_volcan, flag_aerosol,flag_aerosol_strat,& |
---|
975 | ! & flag_aer_feedback) |
---|
976 | |
---|
977 | |
---|
978 | ! print *,'RADLWSW: apres RECMWF' |
---|
979 | IF (lldebug) THEN |
---|
980 | CALL writefield_phy('zemtd_i',ZEMTD_i,klev+1) |
---|
981 | CALL writefield_phy('zemtu_i',ZEMTU_i,klev+1) |
---|
982 | CALL writefield_phy('ztrso_i',ZTRSO_i,klev+1) |
---|
983 | CALL writefield_phy('zth_i',ZTH_i,klev+1) |
---|
984 | CALL writefield_phy('zctrso',ZCTRSO,2) |
---|
985 | CALL writefield_phy('zcemtr',ZCEMTR,2) |
---|
986 | CALL writefield_phy('ztrsod',ZTRSOD,1) |
---|
987 | CALL writefield_phy('zlwfc',ZLWFC,2) |
---|
988 | CALL writefield_phy('zlwft_i',ZLWFT_i,klev+1) |
---|
989 | CALL writefield_phy('zswfc',ZSWFC,2) |
---|
990 | CALL writefield_phy('zswft_i',ZSWFT_i,klev+1) |
---|
991 | CALL writefield_phy('psfswdir',PSFSWDIR,6) |
---|
992 | CALL writefield_phy('psfswdif',PSFSWDIF,6) |
---|
993 | CALL writefield_phy('pfsdnn',PFSDNN,1) |
---|
994 | CALL writefield_phy('pfsdnv',PFSDNV,1) |
---|
995 | CALL writefield_phy('ppiza_dst',PPIZA_TOT,klev) |
---|
996 | CALL writefield_phy('pcga_dst',PCGA_TOT,klev) |
---|
997 | CALL writefield_phy('ptaurel_dst',PTAU_TOT,klev) |
---|
998 | CALL writefield_phy('zflux_i',ZFLUX_i,klev+1) |
---|
999 | CALL writefield_phy('zfluc_i',ZFLUC_i,klev+1) |
---|
1000 | CALL writefield_phy('zfsdwn_i',ZFSDWN_i,klev+1) |
---|
1001 | CALL writefield_phy('zfsup_i',ZFSUP_i,klev+1) |
---|
1002 | CALL writefield_phy('zfcdwn_i',ZFCDWN_i,klev+1) |
---|
1003 | CALL writefield_phy('zfcup_i',ZFCUP_i,klev+1) |
---|
1004 | ENDIF |
---|
1005 | ! --------- output RECMWFL |
---|
1006 | ! ZEMTD (KPROMA,KLEV+1) ; TOTAL DOWNWARD LONGWAVE EMISSIVITY |
---|
1007 | ! ZEMTU (KPROMA,KLEV+1) ; TOTAL UPWARD LONGWAVE EMISSIVITY |
---|
1008 | ! ZTRSO (KPROMA,KLEV+1) ; TOTAL SHORTWAVE TRANSMISSIVITY |
---|
1009 | ! ZTH (KPROMA,KLEV+1) ; HALF LEVEL TEMPERATURE |
---|
1010 | ! ZCTRSO (KPROMA,2) ; CLEAR-SKY SHORTWAVE TRANSMISSIVITY |
---|
1011 | ! ZCEMTR (KPROMA,2) ; CLEAR-SKY NET LONGWAVE EMISSIVITY |
---|
1012 | ! ZTRSOD (KPROMA) ; TOTAL-SKY SURFACE SW TRANSMISSITY |
---|
1013 | ! ZLWFC (KPROMA,2) ; CLEAR-SKY LONGWAVE FLUXES |
---|
1014 | ! ZLWFT (KPROMA,KLEV+1) ; TOTAL-SKY LONGWAVE FLUXES |
---|
1015 | ! ZSWFC (KPROMA,2) ; CLEAR-SKY SHORTWAVE FLUXES |
---|
1016 | ! ZSWFT (KPROMA,KLEV+1) ; TOTAL-SKY SHORTWAVE FLUXES |
---|
1017 | ! PPIZA_TOT (KPROMA,KLEV,NSW); Single scattering albedo of total aerosols |
---|
1018 | ! PCGA_TOT (KPROMA,KLEV,NSW); Assymetry factor for total aerosols |
---|
1019 | ! PTAU_TOT (KPROMA,KLEV,NSW); Optical depth of total aerosols |
---|
1020 | ! PPIZA_NAT (KPROMA,KLEV,NSW); Single scattering albedo of natural aerosols |
---|
1021 | ! PCGA_NAT (KPROMA,KLEV,NSW); Assymetry factor for natural aerosols |
---|
1022 | ! PTAU_NAT (KPROMA,KLEV,NSW); Optical depth of natiral aerosols |
---|
1023 | ! PTAU_LW_TOT (KPROMA,KLEV,NLW); LW Optical depth of total aerosols |
---|
1024 | ! PTAU_LW_NAT (KPROMA,KLEV,NLW); LW Optical depth of natural aerosols |
---|
1025 | ! PSFSWDIR (KPROMA,NSW) ; |
---|
1026 | ! PSFSWDIF (KPROMA,NSW) ; |
---|
1027 | ! PFSDNN (KPROMA) ; |
---|
1028 | ! PFSDNV (KPROMA) ; |
---|
1029 | ! --------- |
---|
1030 | ! --------- |
---|
1031 | ! On retablit l'ordre des niveaux lmd pour les tableaux de sortie |
---|
1032 | ! D autre part, on multiplie les resultats SW par fract pour etre coherent |
---|
1033 | ! avec l ancien rayonnement AR4. Si nuit, fract=0 donc pas de |
---|
1034 | ! rayonnement SW. (MPL 260609) |
---|
1035 | DO k=0,klev |
---|
1036 | DO i=1,klon |
---|
1037 | ZEMTD(i,k+1) = ZEMTD_i(i,k+1) |
---|
1038 | ZEMTU(i,k+1) = ZEMTU_i(i,k+1) |
---|
1039 | ZTRSO(i,k+1) = ZTRSO_i(i,k+1) |
---|
1040 | ZTH(i,k+1) = ZTH_i(i,k+1) |
---|
1041 | ! ZLWFT(i,k+1) = ZLWFT_i(i,klev+1-k) |
---|
1042 | ! ZSWFT(i,k+1) = ZSWFT_i(i,klev+1-k) |
---|
1043 | ZFLUP(i,k+1) = ZFLUX_i(i,1,k+1) |
---|
1044 | ZFLDN(i,k+1) = ZFLUX_i(i,2,k+1) |
---|
1045 | ZFLUP0(i,k+1) = ZFLUC_i(i,1,k+1) |
---|
1046 | ZFLDN0(i,k+1) = ZFLUC_i(i,2,k+1) |
---|
1047 | ZFSDN(i,k+1) = ZFSDWN_i(i,k+1)*fract(i) |
---|
1048 | ZFSDN0(i,k+1) = ZFCDWN_i(i,k+1)*fract(i) |
---|
1049 | ZFSDNC0(i,k+1)= ZFCCDWN_i(i,k+1)*fract(i) |
---|
1050 | ZFSUP (i,k+1) = ZFSUP_i(i,k+1)*fract(i) |
---|
1051 | ZFSUP0(i,k+1) = ZFCUP_i(i,k+1)*fract(i) |
---|
1052 | ZFSUPC0(i,k+1)= ZFCCUP_i(i,k+1)*fract(i) |
---|
1053 | ZFLDNC0(i,k+1)= ZFLCCDWN_i(i,k+1) |
---|
1054 | ZFLUPC0(i,k+1)= ZFLCCUP_i(i,k+1) |
---|
1055 | IF (ok_volcan) THEN |
---|
1056 | ZSWADAERO(i,k+1)=ZSWADAERO(i,k+1)*fract(i) !--NL |
---|
1057 | ENDIF |
---|
1058 | |
---|
1059 | ! Nouveau calcul car visiblement ZSWFT et ZSWFC sont nuls dans RRTM cy32 |
---|
1060 | ! en sortie de radlsw.F90 - MPL 7.01.09 |
---|
1061 | ZSWFT(i,k+1) = (ZFSDWN_i(i,k+1)-ZFSUP_i(i,k+1))*fract(i) |
---|
1062 | ZSWFT0_i(i,k+1) = (ZFCDWN_i(i,k+1)-ZFCUP_i(i,k+1))*fract(i) |
---|
1063 | ! WRITE(*,'("FSDN FSUP FCDN FCUP: ",4E12.5)') ZFSDWN_i(i,k+1),& |
---|
1064 | ! ZFSUP_i(i,k+1),ZFCDWN_i(i,k+1),ZFCUP_i(i,k+1) |
---|
1065 | ZLWFT(i,k+1) =-ZFLUX_i(i,2,k+1)-ZFLUX_i(i,1,k+1) |
---|
1066 | ZLWFT0_i(i,k+1)=-ZFLUC_i(i,2,k+1)-ZFLUC_i(i,1,k+1) |
---|
1067 | ! print *,'FLUX2 FLUX1 FLUC2 FLUC1',ZFLUX_i(i,2,k+1),& |
---|
1068 | ! & ZFLUX_i(i,1,k+1),ZFLUC_i(i,2,k+1),ZFLUC_i(i,1,k+1) |
---|
1069 | ENDDO |
---|
1070 | ENDDO |
---|
1071 | |
---|
1072 | !--ajout OB |
---|
1073 | ZTOPSWADAERO(:) =ZTOPSWADAERO(:) *fract(:) |
---|
1074 | ZSOLSWADAERO(:) =ZSOLSWADAERO(:) *fract(:) |
---|
1075 | ZTOPSWAD0AERO(:)=ZTOPSWAD0AERO(:)*fract(:) |
---|
1076 | ZSOLSWAD0AERO(:)=ZSOLSWAD0AERO(:)*fract(:) |
---|
1077 | ZTOPSWAIAERO(:) =ZTOPSWAIAERO(:) *fract(:) |
---|
1078 | ZSOLSWAIAERO(:) =ZSOLSWAIAERO(:) *fract(:) |
---|
1079 | ZTOPSWCF_AERO(:,1)=ZTOPSWCF_AERO(:,1)*fract(:) |
---|
1080 | ZTOPSWCF_AERO(:,2)=ZTOPSWCF_AERO(:,2)*fract(:) |
---|
1081 | ZTOPSWCF_AERO(:,3)=ZTOPSWCF_AERO(:,3)*fract(:) |
---|
1082 | ZSOLSWCF_AERO(:,1)=ZSOLSWCF_AERO(:,1)*fract(:) |
---|
1083 | ZSOLSWCF_AERO(:,2)=ZSOLSWCF_AERO(:,2)*fract(:) |
---|
1084 | ZSOLSWCF_AERO(:,3)=ZSOLSWCF_AERO(:,3)*fract(:) |
---|
1085 | |
---|
1086 | ! print*,'SW_RRTM ZFSDN0 1 , klev:',ZFSDN0(1:klon,1),ZFSDN0(1:klon,klev) |
---|
1087 | ! print*,'SW_RRTM ZFSUP0 1 , klev:',ZFSUP0(1:klon,1),ZFSUP0(1:klon,klev) |
---|
1088 | ! print*,'SW_RRTM ZFSDN 1 , klev:',ZFSDN(1:klon,1),ZFSDN(1:klon,klev) |
---|
1089 | ! print*,'SW_RRTM ZFSUP 1 , klev:',ZFSUP(1:klon,1),ZFSUP(1:klon,klev) |
---|
1090 | ! print*,'OK1' |
---|
1091 | ! --------- |
---|
1092 | ! --------- |
---|
1093 | ! On renseigne les champs LMDz, pour avoir la meme chose qu'en sortie de |
---|
1094 | ! LW_LMDAR4 et SW_LMDAR4 |
---|
1095 | |
---|
1096 | !--fraction of diffuse radiation in surface SW downward radiation |
---|
1097 | DO i = 1, kdlon |
---|
1098 | IF (fract(i).GT.0.0) THEN |
---|
1099 | zdir=SUM(PSFSWDIR(i,:)) |
---|
1100 | zdif=SUM(PSFSWDIF(i,:)) |
---|
1101 | zsolswfdiff(i) = zdif/(zdir+zdif) |
---|
1102 | ELSE !--night |
---|
1103 | zsolswfdiff(i) = 1.0 |
---|
1104 | ENDIF |
---|
1105 | ENDDO |
---|
1106 | ! |
---|
1107 | DO i = 1, kdlon |
---|
1108 | zsolsw(i) = ZSWFT(i,1) |
---|
1109 | zsolsw0(i) = ZSWFT0_i(i,1) |
---|
1110 | ! zsolsw0(i) = ZFSDN0(i,1) -ZFSUP0(i,1) |
---|
1111 | ztopsw(i) = ZSWFT(i,klev+1) |
---|
1112 | ztopsw0(i) = ZSWFT0_i(i,klev+1) |
---|
1113 | ! ztopsw0(i) = ZFSDN0(i,klev+1)-ZFSUP0(i,klev+1) |
---|
1114 | ! |
---|
1115 | ! zsollw(i) = ZFLDN(i,1) -ZFLUP(i,1) |
---|
1116 | ! zsollw0(i) = ZFLDN0(i,1) -ZFLUP0(i,1) |
---|
1117 | ! ztoplw(i) = ZFLDN(i,klev+1) -ZFLUP(i,klev+1) |
---|
1118 | ! ztoplw0(i) = ZFLDN0(i,klev+1)-ZFLUP0(i,klev+1) |
---|
1119 | zsollw(i) = ZLWFT(i,1) |
---|
1120 | zsollw0(i) = ZLWFT0_i(i,1) |
---|
1121 | ztoplw(i) = ZLWFT(i,klev+1)*(-1) |
---|
1122 | ztoplw0(i) = ZLWFT0_i(i,klev+1)*(-1) |
---|
1123 | ! |
---|
1124 | IF (fract(i) == 0.) THEN |
---|
1125 | !!!!! A REVOIR MPL (20090630) ca n a pas de sens quand fract=0 |
---|
1126 | ! pas plus que dans le sw_AR4 |
---|
1127 | zalbpla(i) = 1.0e+39 |
---|
1128 | ELSE |
---|
1129 | zalbpla(i) = ZFSUP(i,klev+1)/ZFSDN(i,klev+1) |
---|
1130 | ENDIF |
---|
1131 | !!! 5 juin 2015 |
---|
1132 | !!! Correction MP bug RRTM |
---|
1133 | zsollwdown(i)= -1.*ZFLDN(i,1) |
---|
1134 | ENDDO |
---|
1135 | ! print*,'OK2' |
---|
1136 | |
---|
1137 | ! extrait de SW_AR4 |
---|
1138 | ! DO k = 1, KFLEV |
---|
1139 | ! kpl1 = k+1 |
---|
1140 | ! DO i = 1, KDLON |
---|
1141 | ! PHEAT(i,k) = -(ZFSUP(i,kpl1)-ZFSUP(i,k)) -(ZFSDN(i,k)-ZFSDN(i,kpl1)) |
---|
1142 | ! PHEAT(i,k) = PHEAT(i,k) * RDAY*RG/RCPD / PDP(i,k) |
---|
1143 | ! ZLWFT(klon,k),ZSWFT |
---|
1144 | |
---|
1145 | DO k=1,kflev |
---|
1146 | DO i=1,kdlon |
---|
1147 | zheat(i,k)=(ZSWFT(i,k+1)-ZSWFT(i,k))*RDAY*RG/RCPD/PDP(i,k) |
---|
1148 | zheat0(i,k)=(ZSWFT0_i(i,k+1)-ZSWFT0_i(i,k))*RDAY*RG/RCPD/PDP(i,k) |
---|
1149 | zcool(i,k)=(ZLWFT(i,k)-ZLWFT(i,k+1))*RDAY*RG/RCPD/PDP(i,k) |
---|
1150 | zcool0(i,k)=(ZLWFT0_i(i,k)-ZLWFT0_i(i,k+1))*RDAY*RG/RCPD/PDP(i,k) |
---|
1151 | IF (ok_volcan) THEN |
---|
1152 | zheat_volc(i,k)=(ZSWADAERO(i,k+1)-ZSWADAERO(i,k))*RG/RCPD/PDP(i,k) !NL |
---|
1153 | zcool_volc(i,k)=(ZLWADAERO(i,k)-ZLWADAERO(i,k+1))*RG/RCPD/PDP(i,k) !NL |
---|
1154 | ENDIF |
---|
1155 | ! print *,'heat cool heat0 cool0 ',zheat(i,k),zcool(i,k),zheat0(i,k),zcool0(i,k) |
---|
1156 | ! ZFLUCUP_i(i,k)=ZFLUC_i(i,1,k) |
---|
1157 | ! ZFLUCDWN_i(i,k)=ZFLUC_i(i,2,k) |
---|
1158 | ENDDO |
---|
1159 | ENDDO |
---|
1160 | #else |
---|
1161 | abort_message="You should compile with -rrtm if running with iflag_rrtm=1" |
---|
1162 | call abort_physic(modname, abort_message, 1) |
---|
1163 | #endif |
---|
1164 | !====================================================================== |
---|
1165 | ! AI fev 2021 |
---|
1166 | ELSE IF(iflag_rrtm == 2) THEN |
---|
1167 | print*,'Traitement cas iflag_rrtm = ',iflag_rrtm |
---|
1168 | print*,'Mise a zero des flux ' |
---|
1169 | #ifdef CPP_ECRAD |
---|
1170 | DO k = 1, kflev+1 |
---|
1171 | DO i = 1, kdlon |
---|
1172 | ZEMTD_i(i,k)=0. |
---|
1173 | ZEMTU_i(i,k)=0. |
---|
1174 | ZTRSO_i(i,k)=0. |
---|
1175 | ZTH_i(i,k)=0. |
---|
1176 | ZLWFT_i(i,k)=0. |
---|
1177 | ZSWFT_i(i,k)=0. |
---|
1178 | ZFLUX_i(i,1,k)=0. |
---|
1179 | ZFLUX_i(i,2,k)=0. |
---|
1180 | ZFLUC_i(i,1,k)=0. |
---|
1181 | ZFLUC_i(i,2,k)=0. |
---|
1182 | ZFSDWN_i(i,k)=0. |
---|
1183 | ZFCDWN_i(i,k)=0. |
---|
1184 | ZFCCDWN_i(i,k)=0. |
---|
1185 | ZFSUP_i(i,k)=0. |
---|
1186 | ZFCUP_i(i,k)=0. |
---|
1187 | ZFCCUP_i(i,k)=0. |
---|
1188 | ZFLCCDWN_i(i,k)=0. |
---|
1189 | ZFLCCUP_i(i,k)=0. |
---|
1190 | ENDDO |
---|
1191 | ENDDO |
---|
1192 | ! |
---|
1193 | ! Aerosols A REVOIR |
---|
1194 | ! DO i = 1, kdlon |
---|
1195 | ! DO k = 1, kflev |
---|
1196 | ! DO kk=1, NSW |
---|
1197 | ! |
---|
1198 | ! PTAU_TOT(i,kflev+1-k,kk)=tau_aero_sw_rrtm(i,k,2,kk) |
---|
1199 | ! PPIZA_TOT(i,kflev+1-k,kk)=piz_aero_sw_rrtm(i,k,2,kk) |
---|
1200 | ! PCGA_TOT(i,kflev+1-k,kk)=cg_aero_sw_rrtm(i,k,2,kk) |
---|
1201 | ! |
---|
1202 | ! PTAU_NAT(i,kflev+1-k,kk)=tau_aero_sw_rrtm(i,k,1,kk) |
---|
1203 | ! PPIZA_NAT(i,kflev+1-k,kk)=piz_aero_sw_rrtm(i,k,1,kk) |
---|
1204 | ! PCGA_NAT(i,kflev+1-k,kk)=cg_aero_sw_rrtm(i,k,1,kk) |
---|
1205 | ! |
---|
1206 | ! ENDDO |
---|
1207 | ! ENDDO |
---|
1208 | ! ENDDO |
---|
1209 | !-end OB |
---|
1210 | ! |
---|
1211 | ! DO i = 1, kdlon |
---|
1212 | ! DO k = 1, kflev |
---|
1213 | ! DO kk=1, NLW |
---|
1214 | ! |
---|
1215 | ! PTAU_LW_TOT(i,kflev+1-k,kk)=tau_aero_lw_rrtm(i,k,2,kk) |
---|
1216 | ! PTAU_LW_NAT(i,kflev+1-k,kk)=tau_aero_lw_rrtm(i,k,1,kk) |
---|
1217 | ! |
---|
1218 | ! ENDDO |
---|
1219 | ! ENDDO |
---|
1220 | ! ENDDO |
---|
1221 | !-end C. Kleinschmitt |
---|
1222 | ! |
---|
1223 | DO i = 1, kdlon |
---|
1224 | ZCTRSO(i,1)=0. |
---|
1225 | ZCTRSO(i,2)=0. |
---|
1226 | ZCEMTR(i,1)=0. |
---|
1227 | ZCEMTR(i,2)=0. |
---|
1228 | ZTRSOD(i)=0. |
---|
1229 | ZLWFC(i,1)=0. |
---|
1230 | ZLWFC(i,2)=0. |
---|
1231 | ZSWFC(i,1)=0. |
---|
1232 | ZSWFC(i,2)=0. |
---|
1233 | PFSDNN(i)=0. |
---|
1234 | PFSDNV(i)=0. |
---|
1235 | DO kk = 1, NSW |
---|
1236 | PSFSWDIR(i,kk)=0. |
---|
1237 | PSFSWDIF(i,kk)=0. |
---|
1238 | ENDDO |
---|
1239 | ENDDO |
---|
1240 | !----- Fin des mises a zero des tableaux output ------------------- |
---|
1241 | |
---|
1242 | ! On met les donnees dans l'ordre des niveaux ecrad |
---|
1243 | print*,'On inverse sur la verticale ' |
---|
1244 | paprs_i(:,1)=paprs(:,klev+1) |
---|
1245 | DO k=1,klev |
---|
1246 | paprs_i(1:klon,k+1) =paprs(1:klon,klev+1-k) |
---|
1247 | pplay_i(1:klon,k) =pplay(1:klon,klev+1-k) |
---|
1248 | cldfra_i(1:klon,k) =cldfra(1:klon,klev+1-k) |
---|
1249 | PDP_i(1:klon,k) =PDP(1:klon,klev+1-k) |
---|
1250 | t_i(1:klon,k) =t(1:klon,klev+1-k) |
---|
1251 | q_i(1:klon,k) =q(1:klon,klev+1-k) |
---|
1252 | qsat_i(1:klon,k) =qsat(1:klon,klev+1-k) |
---|
1253 | flwc_i(1:klon,k) =flwc(1:klon,klev+1-k) |
---|
1254 | fiwc_i(1:klon,k) =fiwc(1:klon,klev+1-k) |
---|
1255 | ref_liq_i(1:klon,k) =ref_liq(1:klon,klev+1-k) |
---|
1256 | ref_ice_i(1:klon,k) =ref_ice(1:klon,klev+1-k) |
---|
1257 | !-OB |
---|
1258 | ref_liq_pi_i(1:klon,k) =ref_liq_pi(1:klon,klev+1-k) |
---|
1259 | ref_ice_pi_i(1:klon,k) =ref_ice_pi(1:klon,klev+1-k) |
---|
1260 | ENDDO |
---|
1261 | DO k=1,kflev |
---|
1262 | ZO3_DP_i(1:klon,k)=ZO3_DP(1:klon,kflev+1-k) |
---|
1263 | DO i=1,6 |
---|
1264 | PAER_i(1:klon,k,i)=PAER(1:klon,kflev+1-k,i) |
---|
1265 | ENDDO |
---|
1266 | ENDDO |
---|
1267 | ! AI 02.2021 |
---|
1268 | ! Calcul of ZTH_i |
---|
1269 | DO K=2,KLEV |
---|
1270 | ZTH_i(:,K)=& |
---|
1271 | & (t_i(:,K-1)*pplay_i(:,K-1)*(pplay_i(:,K)-paprs_i(:,K))& |
---|
1272 | & +t_i(:,K)*pplay_i(:,K)*(paprs_i(:,K)-pplay_i(:,K-1)))& |
---|
1273 | & *(1.0/(paprs_i(:,K)*(pplay_i(:,K)-pplay_i(:,K-1)))) |
---|
1274 | ENDDO |
---|
1275 | ZTH_i(:,KLEV+1)=tsol(:) |
---|
1276 | ZTH_i(:,1)=t_i(:,1)-pplay_i(:,1)*(t_i(:,1)-ZTH_i(:,2))& |
---|
1277 | & /(pplay_i(:,1)-paprs_i(:,2)) |
---|
1278 | |
---|
1279 | print *,'RADLWSW: avant RADIATION_SCHEME ' |
---|
1280 | IF (lldebug) THEN |
---|
1281 | CALL writefield_phy('rmu0',rmu0,1) |
---|
1282 | CALL writefield_phy('tsol',tsol,1) |
---|
1283 | CALL writefield_phy('emissiv_out',ZEMIS,1) |
---|
1284 | CALL writefield_phy('emissiv_in',ZEMISW,1) |
---|
1285 | CALL writefield_phy('pctsrf_ter',pctsrf(:,is_ter),1) |
---|
1286 | CALL writefield_phy('pctsrf_oce',pctsrf(:,is_oce),1) |
---|
1287 | CALL writefield_phy('ZGELAM',ZGELAM,1) |
---|
1288 | CALL writefield_phy('ZGEMU',ZGEMU,1) |
---|
1289 | CALL writefield_phy('zmasq',zmasq,1) |
---|
1290 | CALL writefield_phy('paprs_i',paprs_i,klev+1) |
---|
1291 | CALL writefield_phy('pplay_i',pplay_i,klev) |
---|
1292 | CALL writefield_phy('t_i',t_i,klev) |
---|
1293 | CALL writefield_phy('ZTH_i',ZTH_i,klev+1) |
---|
1294 | CALL writefield_phy('cldfra_i',cldfra_i,klev) |
---|
1295 | CALL writefield_phy('paer_i',PAER_i,klev) |
---|
1296 | CALL writefield_phy('q_i',q_i,klev) |
---|
1297 | CALL writefield_phy('fiwc_i',fiwc_i,klev) |
---|
1298 | CALL writefield_phy('flwc_i',flwc_i,klev) |
---|
1299 | CALL writefield_phy('palbd_new',PALBD_NEW,NSW) |
---|
1300 | CALL writefield_phy('palbp_new',PALBP_NEW,NSW) |
---|
1301 | CALL writefield_phy('ZO3_DP',ZO3_DP,klev) |
---|
1302 | ENDIF |
---|
1303 | |
---|
1304 | CALL RADIATION_SCHEME & |
---|
1305 | & (ist, iend, klon, klev, naero_tot, NSW, & |
---|
1306 | ! ??? naero_tot |
---|
1307 | & day_cur, current_time, & |
---|
1308 | & solaire, & |
---|
1309 | & rmu0, tsol, PALBD_NEW,PALBP_NEW, & |
---|
1310 | ! PEMIS_WINDOW (???), & |
---|
1311 | & ZEMIS, ZEMISW, & |
---|
1312 | ! PCCN_LAND, PCCN_SEA, & ??? |
---|
1313 | & pctsrf(:,is_ter), pctsrf(:,is_oce), & |
---|
1314 | ! longitude(rad), sin(latitude), PMASQ_ ??? |
---|
1315 | & ZGELAM, ZGEMU, zmasq, & |
---|
1316 | & pplay_i, t_i, & |
---|
1317 | ! PTEMPERATURE_H ?, & |
---|
1318 | & paprs_i, ZTH_i, q_i, qsat_i, & |
---|
1319 | & ZCO2, ZCH4, ZN2O, ZNO2, ZCFC11, ZCFC12, ZHCFC22, ZCCL4, ZO3_DP_i, & |
---|
1320 | & cldfra_i, flwc_i, fiwc_i, ZQ_RAIN, ZQ_SNOW, & |
---|
1321 | & ref_liq_i, ref_ice_i, & |
---|
1322 | ! aerosols |
---|
1323 | & ZAEROSOL_OLD, ZAEROSOL, & |
---|
1324 | ! Outputs |
---|
1325 | ! Net flux |
---|
1326 | & ZSWFT_i, ZLWFT_i, ZSWFT0_i, ZLWFT0_i, & |
---|
1327 | ! DN flux |
---|
1328 | & ZFSDWN_i, ZFLUX_i(:,2,:), ZFCDWN_i, ZFLUC_i(:,2,:), & |
---|
1329 | ! UP flux |
---|
1330 | & ZFSUP_i, ZFLUX_i(:,1,:), ZFCUP_i, ZFLUC_i(:,1,:), & |
---|
1331 | ! Surf Direct flux |
---|
1332 | & ZFLUX_DIR, ZFLUX_DIR_CLEAR, ZFLUX_DIR_INTO_SUN, & |
---|
1333 | ! UV and para flux |
---|
1334 | & ZFLUX_UV, ZFLUX_PAR, ZFLUX_PAR_CLEAR, & |
---|
1335 | ! & ZFLUX_SW_DN_TOA, |
---|
1336 | & ZEMIS_OUT, ZLWDERIVATIVE, & |
---|
1337 | & PSFSWDIF, PSFSWDIR) |
---|
1338 | |
---|
1339 | print *,'========= RADLWSW: apres RADIATION_SCHEME ==================== ' |
---|
1340 | if (0.eq.0) then |
---|
1341 | print *,' Net Flux ' |
---|
1342 | print *,'ZSWFT_i =', ZSWFT_i |
---|
1343 | print *,'ZLWFT_i =', ZLWFT_i |
---|
1344 | print *,'ZSWFT0_i =', ZSWFT0_i |
---|
1345 | print*,'ZLWFT0_i =', ZLWFT0_i |
---|
1346 | |
---|
1347 | print*,'DN Flux ' |
---|
1348 | print*,'ZFSDWN_i =', ZFSDWN_i |
---|
1349 | print*,'ZFLUX_i(:,2,:)', ZFLUX_i(:,2,:) |
---|
1350 | print*,'ZFCDWN_i =', ZFCDWN_i |
---|
1351 | print*,'ZFLUC_i(:,2,:) =', ZFLUC_i(:,2,:) |
---|
1352 | |
---|
1353 | print*,'UP Flux ' |
---|
1354 | print*,'ZFSUP_i =', ZFSUP_i |
---|
1355 | print*,'ZFLUX_i(:,1,:) =', ZFLUX_i(:,1,:) |
---|
1356 | print*,'ZFCUP_i =', ZFCUP_i |
---|
1357 | print*,'ZFLUC_i(:,1,:) =', ZFLUC_i(:,1,:) |
---|
1358 | |
---|
1359 | print*,'UV and para flux ' |
---|
1360 | print*,'ZFLUX_DIR =', ZFLUX_DIR |
---|
1361 | print*,'ZFLUX_DIR_CLEAR', ZFLUX_DIR_CLEAR |
---|
1362 | print*,'ZFLUX_DIR_INTO_SUN', ZFLUX_DIR_INTO_SUN |
---|
1363 | endif |
---|
1364 | |
---|
1365 | IF (lldebug) THEN |
---|
1366 | CALL writefield_phy('zlwft_i',ZLWFT_i,klev+1) |
---|
1367 | CALL writefield_phy('zlwft0_i',ZLWFT0_i,klev+1) |
---|
1368 | CALL writefield_phy('zswft_i',ZSWFT_i,klev+1) |
---|
1369 | CALL writefield_phy('zswft0_i',ZSWFT0_i,klev+1) |
---|
1370 | CALL writefield_phy('psfswdir',PSFSWDIR,6) |
---|
1371 | CALL writefield_phy('psfswdif',PSFSWDIF,6) |
---|
1372 | CALL writefield_phy('zflux_i',ZFLUX_i,klev+1) |
---|
1373 | CALL writefield_phy('zfluc_i',ZFLUC_i,klev+1) |
---|
1374 | CALL writefield_phy('zfsdwn_i',ZFSDWN_i,klev+1) |
---|
1375 | CALL writefield_phy('zfsup_i',ZFSUP_i,klev+1) |
---|
1376 | CALL writefield_phy('zfcdwn_i',ZFCDWN_i,klev+1) |
---|
1377 | CALL writefield_phy('zfcup_i',ZFCUP_i,klev+1) |
---|
1378 | ENDIF |
---|
1379 | ! --------- |
---|
1380 | ! On retablit l'ordre des niveaux lmd pour les tableaux de sortie |
---|
1381 | ! D autre part, on multiplie les resultats SW par fract pour etre coherent |
---|
1382 | ! avec l ancien rayonnement AR4. Si nuit, fract=0 donc pas de |
---|
1383 | ! rayonnement SW. (MPL 260609) |
---|
1384 | print*,'On retablit ordre des niveaux verticaux' |
---|
1385 | print*,'On multiplie les flux SW par fract ?' |
---|
1386 | DO k=0,klev |
---|
1387 | DO i=1,klon |
---|
1388 | ZEMTD(i,k+1) = ZEMTD_i(i,k+1) |
---|
1389 | ZEMTU(i,k+1) = ZEMTU_i(i,k+1) |
---|
1390 | ZTRSO(i,k+1) = ZTRSO_i(i,k+1) |
---|
1391 | ZTH(i,k+1) = ZTH_i(i,k+1) |
---|
1392 | ZFLUP(i,k+1) = ZFLUX_i(i,1,k+1) |
---|
1393 | ZFLDN(i,k+1) = ZFLUX_i(i,2,k+1) |
---|
1394 | ZFLUP0(i,k+1) = ZFLUC_i(i,1,k+1) |
---|
1395 | ZFLDN0(i,k+1) = ZFLUC_i(i,2,k+1) |
---|
1396 | ZFSDN(i,k+1) = ZFSDWN_i(i,k+1)*fract(i) |
---|
1397 | ZFSDN0(i,k+1) = ZFCDWN_i(i,k+1)*fract(i) |
---|
1398 | ZFSDNC0(i,k+1)= ZFCCDWN_i(i,k+1)*fract(i) |
---|
1399 | ZFSUP (i,k+1) = ZFSUP_i(i,k+1)*fract(i) |
---|
1400 | ZFSUP0(i,k+1) = ZFCUP_i(i,k+1)*fract(i) |
---|
1401 | ZFSUPC0(i,k+1)= ZFCCUP_i(i,k+1)*fract(i) |
---|
1402 | ZFLDNC0(i,k+1)= ZFLCCDWN_i(i,k+1) |
---|
1403 | ZFLUPC0(i,k+1)= ZFLCCUP_i(i,k+1) |
---|
1404 | IF (ok_volcan) THEN |
---|
1405 | ZSWADAERO(i,k+1)=ZSWADAERO(i,k+1)*fract(i) !--NL |
---|
1406 | ENDIF |
---|
1407 | |
---|
1408 | ! Nouveau calcul car visiblement ZSWFT et ZSWFC sont nuls dans RRTM cy32 |
---|
1409 | ! en sortie de radlsw.F90 - MPL 7.01.09 |
---|
1410 | ZSWFT(i,k+1) = (ZFSDWN_i(i,k+1)-ZFSUP_i(i,k+1))*fract(i) |
---|
1411 | ZSWFT0_i(i,k+1) = (ZFCDWN_i(i,k+1)-ZFCUP_i(i,k+1))*fract(i) |
---|
1412 | ZLWFT(i,k+1) =-ZFLUX_i(i,2,k+1)-ZFLUX_i(i,1,k+1) |
---|
1413 | ZLWFT0_i(i,k+1)=-ZFLUC_i(i,2,k+1)-ZFLUC_i(i,1,k+1) |
---|
1414 | ENDDO |
---|
1415 | ENDDO |
---|
1416 | |
---|
1417 | !--ajout OB |
---|
1418 | ZTOPSWADAERO(:) =ZTOPSWADAERO(:) *fract(:) |
---|
1419 | ZSOLSWADAERO(:) =ZSOLSWADAERO(:) *fract(:) |
---|
1420 | ZTOPSWAD0AERO(:)=ZTOPSWAD0AERO(:)*fract(:) |
---|
1421 | ZSOLSWAD0AERO(:)=ZSOLSWAD0AERO(:)*fract(:) |
---|
1422 | ZTOPSWAIAERO(:) =ZTOPSWAIAERO(:) *fract(:) |
---|
1423 | ZSOLSWAIAERO(:) =ZSOLSWAIAERO(:) *fract(:) |
---|
1424 | ZTOPSWCF_AERO(:,1)=ZTOPSWCF_AERO(:,1)*fract(:) |
---|
1425 | ZTOPSWCF_AERO(:,2)=ZTOPSWCF_AERO(:,2)*fract(:) |
---|
1426 | ZTOPSWCF_AERO(:,3)=ZTOPSWCF_AERO(:,3)*fract(:) |
---|
1427 | ZSOLSWCF_AERO(:,1)=ZSOLSWCF_AERO(:,1)*fract(:) |
---|
1428 | ZSOLSWCF_AERO(:,2)=ZSOLSWCF_AERO(:,2)*fract(:) |
---|
1429 | ZSOLSWCF_AERO(:,3)=ZSOLSWCF_AERO(:,3)*fract(:) |
---|
1430 | |
---|
1431 | ! --------- |
---|
1432 | ! On renseigne les champs LMDz, pour avoir la meme chose qu'en sortie de |
---|
1433 | ! LW_LMDAR4 et SW_LMDAR4 |
---|
1434 | |
---|
1435 | !--fraction of diffuse radiation in surface SW downward radiation |
---|
1436 | DO i = 1, kdlon |
---|
1437 | IF (fract(i).GT.0.0) THEN |
---|
1438 | zdir=SUM(PSFSWDIR(i,:)) |
---|
1439 | zdif=SUM(PSFSWDIF(i,:)) |
---|
1440 | zsolswfdiff(i) = zdif/(zdir+zdif) |
---|
1441 | ELSE !--night |
---|
1442 | zsolswfdiff(i) = 1.0 |
---|
1443 | ENDIF |
---|
1444 | ENDDO |
---|
1445 | ! |
---|
1446 | DO i = 1, kdlon |
---|
1447 | zsolsw(i) = ZSWFT(i,1) |
---|
1448 | zsolsw0(i) = ZSWFT0_i(i,1) |
---|
1449 | ztopsw(i) = ZSWFT(i,klev+1) |
---|
1450 | ztopsw0(i) = ZSWFT0_i(i,klev+1) |
---|
1451 | zsollw(i) = ZLWFT(i,1) |
---|
1452 | zsollw0(i) = ZLWFT0_i(i,1) |
---|
1453 | ztoplw(i) = ZLWFT(i,klev+1)*(-1) |
---|
1454 | ztoplw0(i) = ZLWFT0_i(i,klev+1)*(-1) |
---|
1455 | ! |
---|
1456 | zsollwdown(i)= -1.*ZFLDN(i,1) |
---|
1457 | ENDDO |
---|
1458 | |
---|
1459 | DO k=1,kflev |
---|
1460 | DO i=1,kdlon |
---|
1461 | zheat(i,k)=(ZSWFT(i,k+1)-ZSWFT(i,k))*RDAY*RG/RCPD/PDP(i,k) |
---|
1462 | zheat0(i,k)=(ZSWFT0_i(i,k+1)-ZSWFT0_i(i,k))*RDAY*RG/RCPD/PDP(i,k) |
---|
1463 | zcool(i,k)=(ZLWFT(i,k)-ZLWFT(i,k+1))*RDAY*RG/RCPD/PDP(i,k) |
---|
1464 | zcool0(i,k)=(ZLWFT0_i(i,k)-ZLWFT0_i(i,k+1))*RDAY*RG/RCPD/PDP(i,k) |
---|
1465 | IF (ok_volcan) THEN |
---|
1466 | zheat_volc(i,k)=(ZSWADAERO(i,k+1)-ZSWADAERO(i,k))*RG/RCPD/PDP(i,k) !NL |
---|
1467 | zcool_volc(i,k)=(ZLWADAERO(i,k)-ZLWADAERO(i,k+1))*RG/RCPD/PDP(i,k) !NL |
---|
1468 | ENDIF |
---|
1469 | ENDDO |
---|
1470 | ENDDO |
---|
1471 | #endif |
---|
1472 | print*,'Fin traitement ECRAD' |
---|
1473 | ! Fin ECRAD |
---|
1474 | ENDIF ! iflag_rrtm |
---|
1475 | ! ecrad |
---|
1476 | !====================================================================== |
---|
1477 | |
---|
1478 | DO i = 1, kdlon |
---|
1479 | topsw(iof+i) = ztopsw(i) |
---|
1480 | toplw(iof+i) = ztoplw(i) |
---|
1481 | solsw(iof+i) = zsolsw(i) |
---|
1482 | solswfdiff(iof+i) = zsolswfdiff(i) |
---|
1483 | sollw(iof+i) = zsollw(i) |
---|
1484 | sollwdown(iof+i) = zsollwdown(i) |
---|
1485 | DO k = 1, kflev+1 |
---|
1486 | lwdn0 ( iof+i,k) = ZFLDN0 ( i,k) |
---|
1487 | lwdn ( iof+i,k) = ZFLDN ( i,k) |
---|
1488 | lwup0 ( iof+i,k) = ZFLUP0 ( i,k) |
---|
1489 | lwup ( iof+i,k) = ZFLUP ( i,k) |
---|
1490 | ENDDO |
---|
1491 | topsw0(iof+i) = ztopsw0(i) |
---|
1492 | toplw0(iof+i) = ztoplw0(i) |
---|
1493 | solsw0(iof+i) = zsolsw0(i) |
---|
1494 | sollw0(iof+i) = zsollw0(i) |
---|
1495 | albpla(iof+i) = zalbpla(i) |
---|
1496 | |
---|
1497 | DO k = 1, kflev+1 |
---|
1498 | swdnc0( iof+i,k) = ZFSDNC0( i,k) |
---|
1499 | swdn0 ( iof+i,k) = ZFSDN0 ( i,k) |
---|
1500 | swdn ( iof+i,k) = ZFSDN ( i,k) |
---|
1501 | swupc0( iof+i,k) = ZFSUPC0( i,k) |
---|
1502 | swup0 ( iof+i,k) = ZFSUP0 ( i,k) |
---|
1503 | swup ( iof+i,k) = ZFSUP ( i,k) |
---|
1504 | lwdnc0( iof+i,k) = ZFLDNC0( i,k) |
---|
1505 | lwupc0( iof+i,k) = ZFLUPC0( i,k) |
---|
1506 | ENDDO |
---|
1507 | ENDDO |
---|
1508 | !-transform the aerosol forcings, if they have |
---|
1509 | ! to be calculated |
---|
1510 | IF (ok_ade) THEN |
---|
1511 | DO i = 1, kdlon |
---|
1512 | topswad_aero(iof+i) = ztopswadaero(i) |
---|
1513 | topswad0_aero(iof+i) = ztopswad0aero(i) |
---|
1514 | solswad_aero(iof+i) = zsolswadaero(i) |
---|
1515 | solswad0_aero(iof+i) = zsolswad0aero(i) |
---|
1516 | topsw_aero(iof+i,:) = ztopsw_aero(i,:) |
---|
1517 | topsw0_aero(iof+i,:) = ztopsw0_aero(i,:) |
---|
1518 | solsw_aero(iof+i,:) = zsolsw_aero(i,:) |
---|
1519 | solsw0_aero(iof+i,:) = zsolsw0_aero(i,:) |
---|
1520 | topswcf_aero(iof+i,:) = ztopswcf_aero(i,:) |
---|
1521 | solswcf_aero(iof+i,:) = zsolswcf_aero(i,:) |
---|
1522 | !-LW |
---|
1523 | toplwad_aero(iof+i) = ztoplwadaero(i) |
---|
1524 | toplwad0_aero(iof+i) = ztoplwad0aero(i) |
---|
1525 | sollwad_aero(iof+i) = zsollwadaero(i) |
---|
1526 | sollwad0_aero(iof+i) = zsollwad0aero(i) |
---|
1527 | ENDDO |
---|
1528 | ELSE |
---|
1529 | DO i = 1, kdlon |
---|
1530 | topswad_aero(iof+i) = 0.0 |
---|
1531 | solswad_aero(iof+i) = 0.0 |
---|
1532 | topswad0_aero(iof+i) = 0.0 |
---|
1533 | solswad0_aero(iof+i) = 0.0 |
---|
1534 | topsw_aero(iof+i,:) = 0. |
---|
1535 | topsw0_aero(iof+i,:) =0. |
---|
1536 | solsw_aero(iof+i,:) = 0. |
---|
1537 | solsw0_aero(iof+i,:) = 0. |
---|
1538 | !-LW |
---|
1539 | toplwad_aero(iof+i) = 0.0 |
---|
1540 | sollwad_aero(iof+i) = 0.0 |
---|
1541 | toplwad0_aero(iof+i) = 0.0 |
---|
1542 | sollwad0_aero(iof+i) = 0.0 |
---|
1543 | ENDDO |
---|
1544 | ENDIF |
---|
1545 | IF (ok_aie) THEN |
---|
1546 | DO i = 1, kdlon |
---|
1547 | topswai_aero(iof+i) = ztopswaiaero(i) |
---|
1548 | solswai_aero(iof+i) = zsolswaiaero(i) |
---|
1549 | !-LW |
---|
1550 | toplwai_aero(iof+i) = ztoplwaiaero(i) |
---|
1551 | sollwai_aero(iof+i) = zsollwaiaero(i) |
---|
1552 | ENDDO |
---|
1553 | ELSE |
---|
1554 | DO i = 1, kdlon |
---|
1555 | topswai_aero(iof+i) = 0.0 |
---|
1556 | solswai_aero(iof+i) = 0.0 |
---|
1557 | !-LW |
---|
1558 | toplwai_aero(iof+i) = 0.0 |
---|
1559 | sollwai_aero(iof+i) = 0.0 |
---|
1560 | ENDDO |
---|
1561 | ENDIF |
---|
1562 | DO k = 1, kflev |
---|
1563 | DO i = 1, kdlon |
---|
1564 | ! scale factor to take into account the difference between |
---|
1565 | ! dry air and watter vapour scpecifi! heat capacity |
---|
1566 | zznormcp=1.0+RVTMP2*PWV(i,k) |
---|
1567 | heat(iof+i,k) = zheat(i,k)/zznormcp |
---|
1568 | cool(iof+i,k) = zcool(i,k)/zznormcp |
---|
1569 | heat0(iof+i,k) = zheat0(i,k)/zznormcp |
---|
1570 | cool0(iof+i,k) = zcool0(i,k)/zznormcp |
---|
1571 | IF(ok_volcan) THEN !NL |
---|
1572 | heat_volc(iof+i,k) = zheat_volc(i,k)/zznormcp |
---|
1573 | cool_volc(iof+i,k) = zcool_volc(i,k)/zznormcp |
---|
1574 | ENDIF |
---|
1575 | ENDDO |
---|
1576 | ENDDO |
---|
1577 | |
---|
1578 | ENDDO ! j = 1, nb_gr |
---|
1579 | |
---|
1580 | END SUBROUTINE radlwsw |
---|
1581 | |
---|
1582 | end module radlwsw_m |
---|