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