1 | ! |
---|
2 | ! $Id: radlwsw_m.F90 3918 2021-05-28 13:39:30Z 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=.false. |
---|
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 | IF (lldebug) THEN |
---|
452 | print*,'Entree dans radlwsw ' |
---|
453 | print*,'************* INITIALISATIONS *****************************' |
---|
454 | print*,'klon, kdlon, klev, kflev =',klon, kdlon, klev, kflev |
---|
455 | ENDIF |
---|
456 | |
---|
457 | CALL assert(size(wo, 1) == klon, size(wo, 2) == klev, "radlwsw wo") |
---|
458 | |
---|
459 | ist=1 |
---|
460 | iend=klon |
---|
461 | ktdia=1 |
---|
462 | kmode=ist |
---|
463 | ! Aeros |
---|
464 | tauaero(:,:,:,:)=0. |
---|
465 | pizaero(:,:,:,:)=0. |
---|
466 | cgaero(:,:,:,:)=0. |
---|
467 | ! lldebug=.FALSE. |
---|
468 | |
---|
469 | ztopsw_aero(:,:) = 0. !ym missing init : warning : not initialized in SW_AEROAR4 |
---|
470 | ztopsw0_aero(:,:) = 0. !ym missing init : warning : not initialized in SW_AEROAR4 |
---|
471 | zsolsw_aero(:,:) = 0. !ym missing init : warning : not initialized in SW_AEROAR4 |
---|
472 | zsolsw0_aero(:,:) = 0. !ym missing init : warning : not initialized in SW_AEROAR4 |
---|
473 | |
---|
474 | ZTOPSWADAERO(:) = 0. !ym missing init |
---|
475 | ZSOLSWADAERO(:) = 0. !ym missing init |
---|
476 | ZTOPSWAD0AERO(:) = 0. !ym missing init |
---|
477 | ZSOLSWAD0AERO(:) = 0. !ym missing init |
---|
478 | ZTOPSWAIAERO(:) = 0. !ym missing init |
---|
479 | ZSOLSWAIAERO(:) = 0. !ym missing init |
---|
480 | ZTOPSWCF_AERO(:,:)= 0.!ym missing init |
---|
481 | ZSOLSWCF_AERO(:,:) =0. !ym missing init |
---|
482 | |
---|
483 | ! |
---|
484 | !------------------------------------------- |
---|
485 | nb_gr = KLON / kdlon |
---|
486 | IF (nb_gr*kdlon .NE. KLON) THEN |
---|
487 | PRINT*, "kdlon mauvais:", KLON, kdlon, nb_gr |
---|
488 | call abort_physic("radlwsw", "", 1) |
---|
489 | ENDIF |
---|
490 | IF (kflev .NE. KLEV) THEN |
---|
491 | PRINT*, "kflev differe de KLEV, kflev, KLEV" |
---|
492 | call abort_physic("radlwsw", "", 1) |
---|
493 | ENDIF |
---|
494 | !------------------------------------------- |
---|
495 | DO k = 1, KLEV |
---|
496 | DO i = 1, KLON |
---|
497 | heat(i,k)=0. |
---|
498 | cool(i,k)=0. |
---|
499 | heat_volc(i,k)=0. !NL |
---|
500 | cool_volc(i,k)=0. !NL |
---|
501 | heat0(i,k)=0. |
---|
502 | cool0(i,k)=0. |
---|
503 | ENDDO |
---|
504 | ENDDO |
---|
505 | ! |
---|
506 | zdist = dist |
---|
507 | ! |
---|
508 | PSCT = solaire/zdist/zdist |
---|
509 | |
---|
510 | IF (type_trac == 'repr') THEN |
---|
511 | #ifdef REPROBUS |
---|
512 | IF (iflag_rrtm==0) THEN |
---|
513 | IF (ok_SUNTIME) PSCT = solaireTIME/zdist/zdist |
---|
514 | print*,'Constante solaire: ',PSCT*zdist*zdist |
---|
515 | ENDIF |
---|
516 | #endif |
---|
517 | ENDIF |
---|
518 | |
---|
519 | IF (lldebug) THEN |
---|
520 | print*,'************** Debut boucle de 1 a ', nb_gr |
---|
521 | ENDIF |
---|
522 | |
---|
523 | DO j = 1, nb_gr |
---|
524 | iof = kdlon*(j-1) |
---|
525 | DO i = 1, kdlon |
---|
526 | zfract(i) = fract(iof+i) |
---|
527 | zrmu0(i) = rmu0(iof+i) |
---|
528 | |
---|
529 | |
---|
530 | IF (iflag_rrtm==0) THEN |
---|
531 | ! Albedo |
---|
532 | PALBD(i,1)=alb_dif(iof+i,1) |
---|
533 | PALBD(i,2)=alb_dif(iof+i,2) |
---|
534 | PALBP(i,1)=alb_dir(iof+i,1) |
---|
535 | PALBP(i,2)=alb_dir(iof+i,2) |
---|
536 | ! AI 02.2021 cas iflag_rrtm=1 et 2 |
---|
537 | ELSEIF (iflag_rrtm==1.OR.iflag_rrtm==2) THEN |
---|
538 | DO kk=1,NSW |
---|
539 | PALBD_NEW(i,kk)=alb_dif(iof+i,kk) |
---|
540 | PALBP_NEW(i,kk)=alb_dir(iof+i,kk) |
---|
541 | ENDDO |
---|
542 | ! |
---|
543 | ENDIF |
---|
544 | !albedo SB <<< |
---|
545 | |
---|
546 | PEMIS(i) = 1.0 !!!!! A REVOIR (MPL) |
---|
547 | PVIEW(i) = 1.66 |
---|
548 | PPSOL(i) = paprs(iof+i,1) |
---|
549 | zx_alpha1 = (paprs(iof+i,1)-pplay(iof+i,2))/(pplay(iof+i,1)-pplay(iof+i,2)) |
---|
550 | zx_alpha2 = 1.0 - zx_alpha1 |
---|
551 | PTL(i,1) = t(iof+i,1) * zx_alpha1 + t(iof+i,2) * zx_alpha2 |
---|
552 | PTL(i,KLEV+1) = t(iof+i,KLEV) |
---|
553 | PDT0(i) = tsol(iof+i) - PTL(i,1) |
---|
554 | ENDDO |
---|
555 | DO k = 2, kflev |
---|
556 | DO i = 1, kdlon |
---|
557 | PTL(i,k) = (t(iof+i,k)+t(iof+i,k-1))*0.5 |
---|
558 | ENDDO |
---|
559 | ENDDO |
---|
560 | DO k = 1, kflev |
---|
561 | DO i = 1, kdlon |
---|
562 | PDP(i,k) = paprs(iof+i,k)-paprs(iof+i,k+1) |
---|
563 | PTAVE(i,k) = t(iof+i,k) |
---|
564 | PWV(i,k) = MAX (q(iof+i,k), 1.0e-12) |
---|
565 | PQS(i,k) = PWV(i,k) |
---|
566 | ! Confert from column density of ozone in a cell, in kDU, to a mass fraction |
---|
567 | POZON(i,k, :) = wo(iof+i, k, :) * RG * dobson_u * 1e3 & |
---|
568 | / (paprs(iof+i, k) - paprs(iof+i, k+1)) |
---|
569 | #ifdef CPP_ECRAD |
---|
570 | ZO3_DP(i,k) = wo(iof+i, k, 1) * RG * dobson_u * 1e3 |
---|
571 | #endif |
---|
572 | ! A activer pour CCMVAL on prend l'ozone impose (MPL 07042010) |
---|
573 | ! POZON(i,k,:) = wo(i,k,:) |
---|
574 | ! print *,'RADLWSW: POZON',k, POZON(i,k,1) |
---|
575 | PCLDLD(i,k) = cldfra(iof+i,k)*cldemi(iof+i,k) |
---|
576 | PCLDLU(i,k) = cldfra(iof+i,k)*cldemi(iof+i,k) |
---|
577 | PCLDSW(i,k) = cldfra(iof+i,k) |
---|
578 | PTAU(i,1,k) = MAX(cldtaupi(iof+i,k), 1.0e-05)! 1e-12 serait instable |
---|
579 | PTAU(i,2,k) = MAX(cldtaupi(iof+i,k), 1.0e-05)! pour 32-bit machines |
---|
580 | POMEGA(i,1,k) = 0.9999 - 5.0e-04 * EXP(-0.5 * PTAU(i,1,k)) |
---|
581 | POMEGA(i,2,k) = 0.9988 - 2.5e-03 * EXP(-0.05 * PTAU(i,2,k)) |
---|
582 | PCG(i,1,k) = 0.865 |
---|
583 | PCG(i,2,k) = 0.910 |
---|
584 | !- |
---|
585 | ! Introduced for aerosol indirect forcings. |
---|
586 | ! The following values use the cloud optical thickness calculated from |
---|
587 | ! present-day aerosol concentrations whereas the quantities without the |
---|
588 | ! "A" at the end are for pre-industial (natural-only) aerosol concentrations |
---|
589 | ! |
---|
590 | PTAUA(i,1,k) = MAX(cldtaupd(iof+i,k), 1.0e-05)! 1e-12 serait instable |
---|
591 | PTAUA(i,2,k) = MAX(cldtaupd(iof+i,k), 1.0e-05)! pour 32-bit machines |
---|
592 | POMEGAA(i,1,k) = 0.9999 - 5.0e-04 * EXP(-0.5 * PTAUA(i,1,k)) |
---|
593 | POMEGAA(i,2,k) = 0.9988 - 2.5e-03 * EXP(-0.05 * PTAUA(i,2,k)) |
---|
594 | ENDDO |
---|
595 | ENDDO |
---|
596 | |
---|
597 | IF (type_trac == 'repr') THEN |
---|
598 | #ifdef REPROBUS |
---|
599 | ndimozon = size(wo, 3) |
---|
600 | CALL RAD_INTERACTIF(POZON,iof) |
---|
601 | #endif |
---|
602 | ENDIF |
---|
603 | ! |
---|
604 | DO k = 1, kflev+1 |
---|
605 | DO i = 1, kdlon |
---|
606 | PPMB(i,k) = paprs(iof+i,k)/100.0 |
---|
607 | ENDDO |
---|
608 | ENDDO |
---|
609 | ! |
---|
610 | !!!!! Modif MPL 6.01.09 avec RRTM, on passe de 5 a 6 |
---|
611 | DO kk = 1, 6 |
---|
612 | DO k = 1, kflev |
---|
613 | DO i = 1, kdlon |
---|
614 | PAER(i,k,kk) = 1.0E-15 !!!!! A REVOIR (MPL) |
---|
615 | ENDDO |
---|
616 | ENDDO |
---|
617 | ENDDO |
---|
618 | DO k = 1, kflev |
---|
619 | DO i = 1, kdlon |
---|
620 | tauaero(i,k,:,1)=tau_aero(iof+i,k,:,1) |
---|
621 | pizaero(i,k,:,1)=piz_aero(iof+i,k,:,1) |
---|
622 | cgaero(i,k,:,1) =cg_aero(iof+i,k,:,1) |
---|
623 | tauaero(i,k,:,2)=tau_aero(iof+i,k,:,2) |
---|
624 | pizaero(i,k,:,2)=piz_aero(iof+i,k,:,2) |
---|
625 | cgaero(i,k,:,2) =cg_aero(iof+i,k,:,2) |
---|
626 | ENDDO |
---|
627 | ENDDO |
---|
628 | ! |
---|
629 | ! AI 02.2021 |
---|
630 | #ifdef CPP_ECRAD |
---|
631 | ZEMIS = 1.0 |
---|
632 | ZEMISW = 1.0 |
---|
633 | ZGELAM = longitude |
---|
634 | ZGEMU = sin(latitude) |
---|
635 | ZCO2 = RCO2 |
---|
636 | ZCH4 = RCH4 |
---|
637 | ZN2O = RN2O |
---|
638 | ZNO2 = 0.0 |
---|
639 | ZCFC11 = RCFC11 |
---|
640 | ZCFC12 = RCFC12 |
---|
641 | ZHCFC22 = 0.0 |
---|
642 | ZCCL4 = 0.0 |
---|
643 | ZQ_RAIN = 0.0 |
---|
644 | ZQ_SNOW = 0.0 |
---|
645 | ZAEROSOL_OLD = 0.0 |
---|
646 | ZAEROSOL = 0.0 |
---|
647 | #endif |
---|
648 | ! |
---|
649 | !===== iflag_rrtm ================================================ |
---|
650 | ! |
---|
651 | IF (iflag_rrtm == 0) THEN !!!! remettre 0 juste pour tester l'ancien rayt via rrtm |
---|
652 | ! |
---|
653 | !--- Mise a zero des tableaux output du rayonnement LW-AR4 ---------- |
---|
654 | DO k = 1, kflev+1 |
---|
655 | DO i = 1, kdlon |
---|
656 | ! print *,'RADLWSW: boucle mise a zero i k',i,k |
---|
657 | ZFLUP(i,k)=0. |
---|
658 | ZFLDN(i,k)=0. |
---|
659 | ZFLUP0(i,k)=0. |
---|
660 | ZFLDN0(i,k)=0. |
---|
661 | ZLWFT0_i(i,k)=0. |
---|
662 | ZFLUCUP_i(i,k)=0. |
---|
663 | ZFLUCDWN_i(i,k)=0. |
---|
664 | ENDDO |
---|
665 | ENDDO |
---|
666 | DO k = 1, kflev |
---|
667 | DO i = 1, kdlon |
---|
668 | zcool(i,k)=0. |
---|
669 | zcool_volc(i,k)=0. !NL |
---|
670 | zcool0(i,k)=0. |
---|
671 | ENDDO |
---|
672 | ENDDO |
---|
673 | DO i = 1, kdlon |
---|
674 | ztoplw(i)=0. |
---|
675 | zsollw(i)=0. |
---|
676 | ztoplw0(i)=0. |
---|
677 | zsollw0(i)=0. |
---|
678 | zsollwdown(i)=0. |
---|
679 | ENDDO |
---|
680 | ! Old radiation scheme, used for AR4 runs |
---|
681 | ! average day-night ozone for longwave |
---|
682 | CALL LW_LMDAR4(& |
---|
683 | PPMB, PDP,& |
---|
684 | PPSOL,PDT0,PEMIS,& |
---|
685 | PTL, PTAVE, PWV, POZON(:, :, 1), PAER,& |
---|
686 | PCLDLD,PCLDLU,& |
---|
687 | PVIEW,& |
---|
688 | zcool, zcool0,& |
---|
689 | ztoplw,zsollw,ztoplw0,zsollw0,& |
---|
690 | zsollwdown,& |
---|
691 | ZFLUP, ZFLDN, ZFLUP0,ZFLDN0) |
---|
692 | !----- Mise a zero des tableaux output du rayonnement SW-AR4 |
---|
693 | DO k = 1, kflev+1 |
---|
694 | DO i = 1, kdlon |
---|
695 | ZFSUP(i,k)=0. |
---|
696 | ZFSDN(i,k)=0. |
---|
697 | ZFSUP0(i,k)=0. |
---|
698 | ZFSDN0(i,k)=0. |
---|
699 | ZFSUPC0(i,k)=0. |
---|
700 | ZFSDNC0(i,k)=0. |
---|
701 | ZFLUPC0(i,k)=0. |
---|
702 | ZFLDNC0(i,k)=0. |
---|
703 | ZSWFT0_i(i,k)=0. |
---|
704 | ZFCUP_i(i,k)=0. |
---|
705 | ZFCDWN_i(i,k)=0. |
---|
706 | ZFCCUP_i(i,k)=0. |
---|
707 | ZFCCDWN_i(i,k)=0. |
---|
708 | ZFLCCUP_i(i,k)=0. |
---|
709 | ZFLCCDWN_i(i,k)=0. |
---|
710 | zswadaero(i,k)=0. !--NL |
---|
711 | ENDDO |
---|
712 | ENDDO |
---|
713 | DO k = 1, kflev |
---|
714 | DO i = 1, kdlon |
---|
715 | zheat(i,k)=0. |
---|
716 | zheat_volc(i,k)=0. |
---|
717 | zheat0(i,k)=0. |
---|
718 | ENDDO |
---|
719 | ENDDO |
---|
720 | DO i = 1, kdlon |
---|
721 | zalbpla(i)=0. |
---|
722 | ztopsw(i)=0. |
---|
723 | zsolsw(i)=0. |
---|
724 | ztopsw0(i)=0. |
---|
725 | zsolsw0(i)=0. |
---|
726 | ztopswadaero(i)=0. |
---|
727 | zsolswadaero(i)=0. |
---|
728 | ztopswaiaero(i)=0. |
---|
729 | zsolswaiaero(i)=0. |
---|
730 | ENDDO |
---|
731 | |
---|
732 | !--fraction of diffuse radiation in surface SW downward radiation |
---|
733 | !--not computed with old radiation scheme |
---|
734 | zsolswfdiff(:) = -999.999 |
---|
735 | |
---|
736 | ! print *,'Avant SW_LMDAR4: PSCT zrmu0 zfract',PSCT, zrmu0, zfract |
---|
737 | ! daylight ozone, if we have it, for short wave |
---|
738 | CALL SW_AEROAR4(PSCT, zrmu0, zfract,& |
---|
739 | PPMB, PDP,& |
---|
740 | PPSOL, PALBD, PALBP,& |
---|
741 | PTAVE, PWV, PQS, POZON(:, :, size(wo, 3)), PAER,& |
---|
742 | PCLDSW, PTAU, POMEGA, PCG,& |
---|
743 | zheat, zheat0,& |
---|
744 | zalbpla,ztopsw,zsolsw,ztopsw0,zsolsw0,& |
---|
745 | ZFSUP,ZFSDN,ZFSUP0,ZFSDN0,& |
---|
746 | tauaero, pizaero, cgaero, & |
---|
747 | PTAUA, POMEGAA,& |
---|
748 | ztopswadaero,zsolswadaero,& |
---|
749 | ztopswad0aero,zsolswad0aero,& |
---|
750 | ztopswaiaero,zsolswaiaero, & |
---|
751 | ztopsw_aero,ztopsw0_aero,& |
---|
752 | zsolsw_aero,zsolsw0_aero,& |
---|
753 | ztopswcf_aero,zsolswcf_aero, & |
---|
754 | ok_ade, ok_aie, flag_aerosol,flag_aerosol_strat) |
---|
755 | |
---|
756 | ZSWFT0_i(:,:) = ZFSDN0(:,:)-ZFSUP0(:,:) |
---|
757 | ZLWFT0_i(:,:) =-ZFLDN0(:,:)-ZFLUP0(:,:) |
---|
758 | |
---|
759 | DO i=1,kdlon |
---|
760 | DO k=1,kflev+1 |
---|
761 | lwdn0 ( iof+i,k) = ZFLDN0 ( i,k) |
---|
762 | lwdn ( iof+i,k) = ZFLDN ( i,k) |
---|
763 | lwup0 ( iof+i,k) = ZFLUP0 ( i,k) |
---|
764 | lwup ( iof+i,k) = ZFLUP ( i,k) |
---|
765 | swdn0 ( iof+i,k) = ZFSDN0 ( i,k) |
---|
766 | swdn ( iof+i,k) = ZFSDN ( i,k) |
---|
767 | swup0 ( iof+i,k) = ZFSUP0 ( i,k) |
---|
768 | swup ( iof+i,k) = ZFSUP ( i,k) |
---|
769 | ENDDO |
---|
770 | ENDDO |
---|
771 | ! |
---|
772 | ELSE IF (iflag_rrtm == 1) then |
---|
773 | #ifdef CPP_RRTM |
---|
774 | ! if (prt_level.gt.10)write(lunout,*)'CPP_RRTM=.T.' |
---|
775 | !===== iflag_rrtm=1, on passe dans SW via RECMWFL =============== |
---|
776 | |
---|
777 | DO k = 1, kflev+1 |
---|
778 | DO i = 1, kdlon |
---|
779 | ZEMTD_i(i,k)=0. |
---|
780 | ZEMTU_i(i,k)=0. |
---|
781 | ZTRSO_i(i,k)=0. |
---|
782 | ZTH_i(i,k)=0. |
---|
783 | ZLWFT_i(i,k)=0. |
---|
784 | ZSWFT_i(i,k)=0. |
---|
785 | ZFLUX_i(i,1,k)=0. |
---|
786 | ZFLUX_i(i,2,k)=0. |
---|
787 | ZFLUC_i(i,1,k)=0. |
---|
788 | ZFLUC_i(i,2,k)=0. |
---|
789 | ZFSDWN_i(i,k)=0. |
---|
790 | ZFCDWN_i(i,k)=0. |
---|
791 | ZFCCDWN_i(i,k)=0. |
---|
792 | ZFSUP_i(i,k)=0. |
---|
793 | ZFCUP_i(i,k)=0. |
---|
794 | ZFCCUP_i(i,k)=0. |
---|
795 | ZFLCCDWN_i(i,k)=0. |
---|
796 | ZFLCCUP_i(i,k)=0. |
---|
797 | ENDDO |
---|
798 | ENDDO |
---|
799 | ! |
---|
800 | !--OB |
---|
801 | !--aerosol TOT - anthropogenic+natural - index 2 |
---|
802 | !--aerosol NAT - natural only - index 1 |
---|
803 | ! |
---|
804 | DO i = 1, kdlon |
---|
805 | DO k = 1, kflev |
---|
806 | DO kk=1, NSW |
---|
807 | ! |
---|
808 | PTAU_TOT(i,kflev+1-k,kk)=tau_aero_sw_rrtm(i,k,2,kk) |
---|
809 | PPIZA_TOT(i,kflev+1-k,kk)=piz_aero_sw_rrtm(i,k,2,kk) |
---|
810 | PCGA_TOT(i,kflev+1-k,kk)=cg_aero_sw_rrtm(i,k,2,kk) |
---|
811 | ! |
---|
812 | PTAU_NAT(i,kflev+1-k,kk)=tau_aero_sw_rrtm(i,k,1,kk) |
---|
813 | PPIZA_NAT(i,kflev+1-k,kk)=piz_aero_sw_rrtm(i,k,1,kk) |
---|
814 | PCGA_NAT(i,kflev+1-k,kk)=cg_aero_sw_rrtm(i,k,1,kk) |
---|
815 | ! |
---|
816 | ENDDO |
---|
817 | ENDDO |
---|
818 | ENDDO |
---|
819 | !-end OB |
---|
820 | ! |
---|
821 | !--C. Kleinschmitt |
---|
822 | !--aerosol TOT - anthropogenic+natural - index 2 |
---|
823 | !--aerosol NAT - natural only - index 1 |
---|
824 | ! |
---|
825 | DO i = 1, kdlon |
---|
826 | DO k = 1, kflev |
---|
827 | DO kk=1, NLW |
---|
828 | ! |
---|
829 | PTAU_LW_TOT(i,kflev+1-k,kk)=tau_aero_lw_rrtm(i,k,2,kk) |
---|
830 | PTAU_LW_NAT(i,kflev+1-k,kk)=tau_aero_lw_rrtm(i,k,1,kk) |
---|
831 | ! |
---|
832 | ENDDO |
---|
833 | ENDDO |
---|
834 | ENDDO |
---|
835 | !-end C. Kleinschmitt |
---|
836 | ! |
---|
837 | DO i = 1, kdlon |
---|
838 | ZCTRSO(i,1)=0. |
---|
839 | ZCTRSO(i,2)=0. |
---|
840 | ZCEMTR(i,1)=0. |
---|
841 | ZCEMTR(i,2)=0. |
---|
842 | ZTRSOD(i)=0. |
---|
843 | ZLWFC(i,1)=0. |
---|
844 | ZLWFC(i,2)=0. |
---|
845 | ZSWFC(i,1)=0. |
---|
846 | ZSWFC(i,2)=0. |
---|
847 | PFSDNN(i)=0. |
---|
848 | PFSDNV(i)=0. |
---|
849 | DO kk = 1, NSW |
---|
850 | PSFSWDIR(i,kk)=0. |
---|
851 | PSFSWDIF(i,kk)=0. |
---|
852 | ENDDO |
---|
853 | ENDDO |
---|
854 | !----- Fin des mises a zero des tableaux output de RECMWF ------------------- |
---|
855 | ! GEMU(1:klon)=sin(rlatd(1:klon)) |
---|
856 | ! On met les donnees dans l'ordre des niveaux arpege |
---|
857 | paprs_i(:,1)=paprs(:,klev+1) |
---|
858 | DO k=1,klev |
---|
859 | paprs_i(1:klon,k+1) =paprs(1:klon,klev+1-k) |
---|
860 | pplay_i(1:klon,k) =pplay(1:klon,klev+1-k) |
---|
861 | cldfra_i(1:klon,k) =cldfra(1:klon,klev+1-k) |
---|
862 | PDP_i(1:klon,k) =PDP(1:klon,klev+1-k) |
---|
863 | t_i(1:klon,k) =t(1:klon,klev+1-k) |
---|
864 | q_i(1:klon,k) =q(1:klon,klev+1-k) |
---|
865 | qsat_i(1:klon,k) =qsat(1:klon,klev+1-k) |
---|
866 | flwc_i(1:klon,k) =flwc(1:klon,klev+1-k) |
---|
867 | fiwc_i(1:klon,k) =fiwc(1:klon,klev+1-k) |
---|
868 | ref_liq_i(1:klon,k) =ref_liq(1:klon,klev+1-k) |
---|
869 | ref_ice_i(1:klon,k) =ref_ice(1:klon,klev+1-k) |
---|
870 | !-OB |
---|
871 | ref_liq_pi_i(1:klon,k) =ref_liq_pi(1:klon,klev+1-k) |
---|
872 | ref_ice_pi_i(1:klon,k) =ref_ice_pi(1:klon,klev+1-k) |
---|
873 | ENDDO |
---|
874 | DO k=1,kflev |
---|
875 | POZON_i(1:klon,k,:)=POZON(1:klon,kflev+1-k,:) |
---|
876 | !!! POZON_i(1:klon,k)=POZON(1:klon,k) !!! on laisse 1=sol et klev=top |
---|
877 | ! print *,'Juste avant RECMWFL: k tsol temp',k,tsol,t(1,k) |
---|
878 | !!!!!!! Modif MPL 6.01.09 avec RRTM, on passe de 5 a 6 |
---|
879 | DO i=1,6 |
---|
880 | PAER_i(1:klon,k,i)=PAER(1:klon,kflev+1-k,i) |
---|
881 | ENDDO |
---|
882 | ENDDO |
---|
883 | |
---|
884 | ! print *,'RADLWSW: avant RECMWFL, RI0,rmu0=',solaire,rmu0 |
---|
885 | |
---|
886 | ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
887 | ! La version ARPEGE1D utilise differentes valeurs de la constante |
---|
888 | ! solaire suivant le rayonnement utilise. |
---|
889 | ! A controler ... |
---|
890 | ! SOLAR FLUX AT THE TOP (/YOMPHY3/) |
---|
891 | ! introduce season correction |
---|
892 | !-------------------------------------- |
---|
893 | ! RII0 = RIP0 |
---|
894 | ! IF(LRAYFM) |
---|
895 | ! RII0 = RIP0M ! =rip0m if Morcrette non-each time step call. |
---|
896 | ! IF(LRAYFM15) |
---|
897 | ! RII0 = RIP0M15 ! =rip0m if Morcrette non-each time step call. |
---|
898 | RII0=solaire/zdist/zdist |
---|
899 | !print*,'+++ radlwsw: solaire ,RII0',solaire,RII0 |
---|
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 | ! KST, KEND, KPROMA, KTDIA , KLEV, KMODE |
---|
931 | PALBD_NEW,PALBP_NEW, paprs_i , pplay_i , RCO2 , cldfra_i,& |
---|
932 | ! PALBD , PALBP , PAPRS , PAPRSF , PCCO2 , PCLFR |
---|
933 | POZON_i , PAER_i , PDP_i , PEMIS , rmu0 ,& |
---|
934 | ! PQO3 , PAER , PDP , PEMIS , PMU0 |
---|
935 | q_i , qsat_i , fiwc_i , flwc_i , zmasq , t_i ,tsol,& |
---|
936 | ! PQ , PQS , PQIWP , PQLWP , PSLM , PT , PTS, |
---|
937 | ref_liq_i, ref_ice_i, & |
---|
938 | ! PREF_LIQ, PREF_ICE |
---|
939 | ref_liq_pi_i, ref_ice_pi_i, & ! rajoute par OB pour diagnostiquer effet indirect |
---|
940 | ! PREF_LIQ_PI, PREF_ICE_PI |
---|
941 | ZEMTD_i , ZEMTU_i , ZTRSO_i ,& |
---|
942 | ! PEMTD , PEMTU , PTRSO |
---|
943 | ZTH_i , ZCTRSO , ZCEMTR , ZTRSOD ,& |
---|
944 | ! PTH , PCTRSO, PCEMTR, PTRSOD |
---|
945 | ZLWFC , ZLWFT_i , ZSWFC , ZSWFT_i ,& |
---|
946 | ! PLWFC, PLWFT, PSWFC, PSWFT, |
---|
947 | PSFSWDIR , PSFSWDIF, PFSDNN , PFSDNV ,& |
---|
948 | ! PSFSWDIR, PSFSWDIF, PFSDNN, PFSDNV |
---|
949 | PPIZA_TOT, PCGA_TOT,PTAU_TOT,& |
---|
950 | ! PPIZA_TOT, PCGA_TOT,PTAU_TOT |
---|
951 | PPIZA_NAT, PCGA_NAT,PTAU_NAT, & ! rajoute par OB pour diagnostiquer effet direct |
---|
952 | ! PPIZA_NAT,PCGA_NAT,PTAU_NAT |
---|
953 | PTAU_LW_TOT, PTAU_LW_NAT, & ! rajoute par C. Kleinschmitt |
---|
954 | ! PTAU_LW_TOT, PTAU_LW_NAT, |
---|
955 | ZFLUX_i , ZFLUC_i ,& |
---|
956 | ! PFLUX, PFLUC |
---|
957 | ZFSDWN_i , ZFSUP_i , ZFCDWN_i, ZFCUP_i, ZFCCDWN_i, ZFCCUP_i, ZFLCCDWN_i, ZFLCCUP_i, & |
---|
958 | ! PFSDN , PFSUP , PFSCDN , PFSCUP, PFSCCDN, PFSCCUP, PFLCCDN, PFLCCUP |
---|
959 | ZTOPSWADAERO,ZSOLSWADAERO,& ! rajoute par OB pour diagnostics |
---|
960 | ! PTOPSWADAERO,PSOLSWADAERO |
---|
961 | ZTOPSWAD0AERO,ZSOLSWAD0AERO,& |
---|
962 | ZTOPSWAIAERO,ZSOLSWAIAERO, & |
---|
963 | ZTOPSWCF_AERO,ZSOLSWCF_AERO, & |
---|
964 | ZSWADAERO, & !--NL |
---|
965 | ZTOPLWADAERO,ZSOLLWADAERO,& ! rajoute par C. Kleinscmitt pour LW diagnostics |
---|
966 | ZTOPLWAD0AERO,ZSOLLWAD0AERO,& |
---|
967 | ZTOPLWAIAERO,ZSOLLWAIAERO, & |
---|
968 | ZLWADAERO, & !--NL |
---|
969 | ok_ade, ok_aie, ok_volcan, flag_aerosol,flag_aerosol_strat, flag_aer_feedback) ! flags aerosols |
---|
970 | |
---|
971 | !--OB diagnostics |
---|
972 | ! & PTOPSWAIAERO,PSOLSWAIAERO,& |
---|
973 | ! & PTOPSWCFAERO,PSOLSWCFAERO,& |
---|
974 | ! & PSWADAERO,& !--NL |
---|
975 | !!--LW diagnostics CK |
---|
976 | ! & PTOPLWADAERO,PSOLLWADAERO,& |
---|
977 | ! & PTOPLWAD0AERO,PSOLLWAD0AERO,& |
---|
978 | ! & PTOPLWAIAERO,PSOLLWAIAERO,& |
---|
979 | ! & PLWADAERO,& !--NL |
---|
980 | !!..end |
---|
981 | ! & ok_ade, ok_aie, ok_volcan, flag_aerosol,flag_aerosol_strat,& |
---|
982 | ! & flag_aer_feedback) |
---|
983 | |
---|
984 | |
---|
985 | ! print *,'RADLWSW: apres RECMWF' |
---|
986 | IF (lldebug) THEN |
---|
987 | CALL writefield_phy('zemtd_i',ZEMTD_i,klev+1) |
---|
988 | CALL writefield_phy('zemtu_i',ZEMTU_i,klev+1) |
---|
989 | CALL writefield_phy('ztrso_i',ZTRSO_i,klev+1) |
---|
990 | CALL writefield_phy('zth_i',ZTH_i,klev+1) |
---|
991 | CALL writefield_phy('zctrso',ZCTRSO,2) |
---|
992 | CALL writefield_phy('zcemtr',ZCEMTR,2) |
---|
993 | CALL writefield_phy('ztrsod',ZTRSOD,1) |
---|
994 | CALL writefield_phy('zlwfc',ZLWFC,2) |
---|
995 | CALL writefield_phy('zlwft_i',ZLWFT_i,klev+1) |
---|
996 | CALL writefield_phy('zswfc',ZSWFC,2) |
---|
997 | CALL writefield_phy('zswft_i',ZSWFT_i,klev+1) |
---|
998 | CALL writefield_phy('psfswdir',PSFSWDIR,6) |
---|
999 | CALL writefield_phy('psfswdif',PSFSWDIF,6) |
---|
1000 | CALL writefield_phy('pfsdnn',PFSDNN,1) |
---|
1001 | CALL writefield_phy('pfsdnv',PFSDNV,1) |
---|
1002 | CALL writefield_phy('ppiza_dst',PPIZA_TOT,klev) |
---|
1003 | CALL writefield_phy('pcga_dst',PCGA_TOT,klev) |
---|
1004 | CALL writefield_phy('ptaurel_dst',PTAU_TOT,klev) |
---|
1005 | CALL writefield_phy('zflux_i',ZFLUX_i,klev+1) |
---|
1006 | CALL writefield_phy('zfluc_i',ZFLUC_i,klev+1) |
---|
1007 | CALL writefield_phy('zfsdwn_i',ZFSDWN_i,klev+1) |
---|
1008 | CALL writefield_phy('zfsup_i',ZFSUP_i,klev+1) |
---|
1009 | CALL writefield_phy('zfcdwn_i',ZFCDWN_i,klev+1) |
---|
1010 | CALL writefield_phy('zfcup_i',ZFCUP_i,klev+1) |
---|
1011 | ENDIF |
---|
1012 | ! --------- output RECMWFL |
---|
1013 | ! ZEMTD (KPROMA,KLEV+1) ; TOTAL DOWNWARD LONGWAVE EMISSIVITY |
---|
1014 | ! ZEMTU (KPROMA,KLEV+1) ; TOTAL UPWARD LONGWAVE EMISSIVITY |
---|
1015 | ! ZTRSO (KPROMA,KLEV+1) ; TOTAL SHORTWAVE TRANSMISSIVITY |
---|
1016 | ! ZTH (KPROMA,KLEV+1) ; HALF LEVEL TEMPERATURE |
---|
1017 | ! ZCTRSO (KPROMA,2) ; CLEAR-SKY SHORTWAVE TRANSMISSIVITY |
---|
1018 | ! ZCEMTR (KPROMA,2) ; CLEAR-SKY NET LONGWAVE EMISSIVITY |
---|
1019 | ! ZTRSOD (KPROMA) ; TOTAL-SKY SURFACE SW TRANSMISSITY |
---|
1020 | ! ZLWFC (KPROMA,2) ; CLEAR-SKY LONGWAVE FLUXES |
---|
1021 | ! ZLWFT (KPROMA,KLEV+1) ; TOTAL-SKY LONGWAVE FLUXES |
---|
1022 | ! ZSWFC (KPROMA,2) ; CLEAR-SKY SHORTWAVE FLUXES |
---|
1023 | ! ZSWFT (KPROMA,KLEV+1) ; TOTAL-SKY SHORTWAVE FLUXES |
---|
1024 | ! PPIZA_TOT (KPROMA,KLEV,NSW); Single scattering albedo of total aerosols |
---|
1025 | ! PCGA_TOT (KPROMA,KLEV,NSW); Assymetry factor for total aerosols |
---|
1026 | ! PTAU_TOT (KPROMA,KLEV,NSW); Optical depth of total aerosols |
---|
1027 | ! PPIZA_NAT (KPROMA,KLEV,NSW); Single scattering albedo of natural aerosols |
---|
1028 | ! PCGA_NAT (KPROMA,KLEV,NSW); Assymetry factor for natural aerosols |
---|
1029 | ! PTAU_NAT (KPROMA,KLEV,NSW); Optical depth of natiral aerosols |
---|
1030 | ! PTAU_LW_TOT (KPROMA,KLEV,NLW); LW Optical depth of total aerosols |
---|
1031 | ! PTAU_LW_NAT (KPROMA,KLEV,NLW); LW Optical depth of natural aerosols |
---|
1032 | ! PSFSWDIR (KPROMA,NSW) ; |
---|
1033 | ! PSFSWDIF (KPROMA,NSW) ; |
---|
1034 | ! PFSDNN (KPROMA) ; |
---|
1035 | ! PFSDNV (KPROMA) ; |
---|
1036 | ! --------- |
---|
1037 | ! --------- |
---|
1038 | ! On retablit l'ordre des niveaux lmd pour les tableaux de sortie |
---|
1039 | ! D autre part, on multiplie les resultats SW par fract pour etre coherent |
---|
1040 | ! avec l ancien rayonnement AR4. Si nuit, fract=0 donc pas de |
---|
1041 | ! rayonnement SW. (MPL 260609) |
---|
1042 | DO k=0,klev |
---|
1043 | DO i=1,klon |
---|
1044 | ZEMTD(i,k+1) = ZEMTD_i(i,k+1) |
---|
1045 | ZEMTU(i,k+1) = ZEMTU_i(i,k+1) |
---|
1046 | ZTRSO(i,k+1) = ZTRSO_i(i,k+1) |
---|
1047 | ZTH(i,k+1) = ZTH_i(i,k+1) |
---|
1048 | ! ZLWFT(i,k+1) = ZLWFT_i(i,klev+1-k) |
---|
1049 | ! ZSWFT(i,k+1) = ZSWFT_i(i,klev+1-k) |
---|
1050 | ZFLUP(i,k+1) = ZFLUX_i(i,1,k+1) |
---|
1051 | ZFLDN(i,k+1) = ZFLUX_i(i,2,k+1) |
---|
1052 | ZFLUP0(i,k+1) = ZFLUC_i(i,1,k+1) |
---|
1053 | ZFLDN0(i,k+1) = ZFLUC_i(i,2,k+1) |
---|
1054 | ZFSDN(i,k+1) = ZFSDWN_i(i,k+1)*fract(i) |
---|
1055 | ZFSDN0(i,k+1) = ZFCDWN_i(i,k+1)*fract(i) |
---|
1056 | ZFSDNC0(i,k+1)= ZFCCDWN_i(i,k+1)*fract(i) |
---|
1057 | ZFSUP (i,k+1) = ZFSUP_i(i,k+1)*fract(i) |
---|
1058 | ZFSUP0(i,k+1) = ZFCUP_i(i,k+1)*fract(i) |
---|
1059 | ZFSUPC0(i,k+1)= ZFCCUP_i(i,k+1)*fract(i) |
---|
1060 | ZFLDNC0(i,k+1)= ZFLCCDWN_i(i,k+1) |
---|
1061 | ZFLUPC0(i,k+1)= ZFLCCUP_i(i,k+1) |
---|
1062 | IF (ok_volcan) THEN |
---|
1063 | ZSWADAERO(i,k+1)=ZSWADAERO(i,k+1)*fract(i) !--NL |
---|
1064 | ENDIF |
---|
1065 | |
---|
1066 | ! Nouveau calcul car visiblement ZSWFT et ZSWFC sont nuls dans RRTM cy32 |
---|
1067 | ! en sortie de radlsw.F90 - MPL 7.01.09 |
---|
1068 | ZSWFT(i,k+1) = (ZFSDWN_i(i,k+1)-ZFSUP_i(i,k+1))*fract(i) |
---|
1069 | ZSWFT0_i(i,k+1) = (ZFCDWN_i(i,k+1)-ZFCUP_i(i,k+1))*fract(i) |
---|
1070 | ! WRITE(*,'("FSDN FSUP FCDN FCUP: ",4E12.5)') ZFSDWN_i(i,k+1),& |
---|
1071 | ! ZFSUP_i(i,k+1),ZFCDWN_i(i,k+1),ZFCUP_i(i,k+1) |
---|
1072 | ZLWFT(i,k+1) =-ZFLUX_i(i,2,k+1)-ZFLUX_i(i,1,k+1) |
---|
1073 | ZLWFT0_i(i,k+1)=-ZFLUC_i(i,2,k+1)-ZFLUC_i(i,1,k+1) |
---|
1074 | ! print *,'FLUX2 FLUX1 FLUC2 FLUC1',ZFLUX_i(i,2,k+1),& |
---|
1075 | ! & ZFLUX_i(i,1,k+1),ZFLUC_i(i,2,k+1),ZFLUC_i(i,1,k+1) |
---|
1076 | ENDDO |
---|
1077 | ENDDO |
---|
1078 | |
---|
1079 | !--ajout OB |
---|
1080 | ZTOPSWADAERO(:) =ZTOPSWADAERO(:) *fract(:) |
---|
1081 | ZSOLSWADAERO(:) =ZSOLSWADAERO(:) *fract(:) |
---|
1082 | ZTOPSWAD0AERO(:)=ZTOPSWAD0AERO(:)*fract(:) |
---|
1083 | ZSOLSWAD0AERO(:)=ZSOLSWAD0AERO(:)*fract(:) |
---|
1084 | ZTOPSWAIAERO(:) =ZTOPSWAIAERO(:) *fract(:) |
---|
1085 | ZSOLSWAIAERO(:) =ZSOLSWAIAERO(:) *fract(:) |
---|
1086 | ZTOPSWCF_AERO(:,1)=ZTOPSWCF_AERO(:,1)*fract(:) |
---|
1087 | ZTOPSWCF_AERO(:,2)=ZTOPSWCF_AERO(:,2)*fract(:) |
---|
1088 | ZTOPSWCF_AERO(:,3)=ZTOPSWCF_AERO(:,3)*fract(:) |
---|
1089 | ZSOLSWCF_AERO(:,1)=ZSOLSWCF_AERO(:,1)*fract(:) |
---|
1090 | ZSOLSWCF_AERO(:,2)=ZSOLSWCF_AERO(:,2)*fract(:) |
---|
1091 | ZSOLSWCF_AERO(:,3)=ZSOLSWCF_AERO(:,3)*fract(:) |
---|
1092 | |
---|
1093 | ! print*,'SW_RRTM ZFSDN0 1 , klev:',ZFSDN0(1:klon,1),ZFSDN0(1:klon,klev) |
---|
1094 | ! print*,'SW_RRTM ZFSUP0 1 , klev:',ZFSUP0(1:klon,1),ZFSUP0(1:klon,klev) |
---|
1095 | ! print*,'SW_RRTM ZFSDN 1 , klev:',ZFSDN(1:klon,1),ZFSDN(1:klon,klev) |
---|
1096 | ! print*,'SW_RRTM ZFSUP 1 , klev:',ZFSUP(1:klon,1),ZFSUP(1:klon,klev) |
---|
1097 | ! print*,'OK1' |
---|
1098 | ! --------- |
---|
1099 | ! --------- |
---|
1100 | ! On renseigne les champs LMDz, pour avoir la meme chose qu'en sortie de |
---|
1101 | ! LW_LMDAR4 et SW_LMDAR4 |
---|
1102 | |
---|
1103 | !--fraction of diffuse radiation in surface SW downward radiation |
---|
1104 | DO i = 1, kdlon |
---|
1105 | IF (fract(i).GT.0.0) THEN |
---|
1106 | zdir=SUM(PSFSWDIR(i,:)) |
---|
1107 | zdif=SUM(PSFSWDIF(i,:)) |
---|
1108 | zsolswfdiff(i) = zdif/(zdir+zdif) |
---|
1109 | ELSE !--night |
---|
1110 | zsolswfdiff(i) = 1.0 |
---|
1111 | ENDIF |
---|
1112 | ENDDO |
---|
1113 | ! |
---|
1114 | DO i = 1, kdlon |
---|
1115 | zsolsw(i) = ZSWFT(i,1) |
---|
1116 | zsolsw0(i) = ZSWFT0_i(i,1) |
---|
1117 | ! zsolsw0(i) = ZFSDN0(i,1) -ZFSUP0(i,1) |
---|
1118 | ztopsw(i) = ZSWFT(i,klev+1) |
---|
1119 | ztopsw0(i) = ZSWFT0_i(i,klev+1) |
---|
1120 | ! ztopsw0(i) = ZFSDN0(i,klev+1)-ZFSUP0(i,klev+1) |
---|
1121 | ! |
---|
1122 | ! zsollw(i) = ZFLDN(i,1) -ZFLUP(i,1) |
---|
1123 | ! zsollw0(i) = ZFLDN0(i,1) -ZFLUP0(i,1) |
---|
1124 | ! ztoplw(i) = ZFLDN(i,klev+1) -ZFLUP(i,klev+1) |
---|
1125 | ! ztoplw0(i) = ZFLDN0(i,klev+1)-ZFLUP0(i,klev+1) |
---|
1126 | zsollw(i) = ZLWFT(i,1) |
---|
1127 | zsollw0(i) = ZLWFT0_i(i,1) |
---|
1128 | ztoplw(i) = ZLWFT(i,klev+1)*(-1) |
---|
1129 | ztoplw0(i) = ZLWFT0_i(i,klev+1)*(-1) |
---|
1130 | ! |
---|
1131 | IF (fract(i) == 0.) THEN |
---|
1132 | !!!!! A REVOIR MPL (20090630) ca n a pas de sens quand fract=0 |
---|
1133 | ! pas plus que dans le sw_AR4 |
---|
1134 | zalbpla(i) = 1.0e+39 |
---|
1135 | ELSE |
---|
1136 | zalbpla(i) = ZFSUP(i,klev+1)/ZFSDN(i,klev+1) |
---|
1137 | ENDIF |
---|
1138 | !!! 5 juin 2015 |
---|
1139 | !!! Correction MP bug RRTM |
---|
1140 | zsollwdown(i)= -1.*ZFLDN(i,1) |
---|
1141 | ENDDO |
---|
1142 | ! print*,'OK2' |
---|
1143 | |
---|
1144 | ! extrait de SW_AR4 |
---|
1145 | ! DO k = 1, KFLEV |
---|
1146 | ! kpl1 = k+1 |
---|
1147 | ! DO i = 1, KDLON |
---|
1148 | ! PHEAT(i,k) = -(ZFSUP(i,kpl1)-ZFSUP(i,k)) -(ZFSDN(i,k)-ZFSDN(i,kpl1)) |
---|
1149 | ! PHEAT(i,k) = PHEAT(i,k) * RDAY*RG/RCPD / PDP(i,k) |
---|
1150 | ! ZLWFT(klon,k),ZSWFT |
---|
1151 | |
---|
1152 | DO k=1,kflev |
---|
1153 | DO i=1,kdlon |
---|
1154 | zheat(i,k)=(ZSWFT(i,k+1)-ZSWFT(i,k))*RDAY*RG/RCPD/PDP(i,k) |
---|
1155 | zheat0(i,k)=(ZSWFT0_i(i,k+1)-ZSWFT0_i(i,k))*RDAY*RG/RCPD/PDP(i,k) |
---|
1156 | zcool(i,k)=(ZLWFT(i,k)-ZLWFT(i,k+1))*RDAY*RG/RCPD/PDP(i,k) |
---|
1157 | zcool0(i,k)=(ZLWFT0_i(i,k)-ZLWFT0_i(i,k+1))*RDAY*RG/RCPD/PDP(i,k) |
---|
1158 | IF (ok_volcan) THEN |
---|
1159 | zheat_volc(i,k)=(ZSWADAERO(i,k+1)-ZSWADAERO(i,k))*RG/RCPD/PDP(i,k) !NL |
---|
1160 | zcool_volc(i,k)=(ZLWADAERO(i,k)-ZLWADAERO(i,k+1))*RG/RCPD/PDP(i,k) !NL |
---|
1161 | ENDIF |
---|
1162 | ! print *,'heat cool heat0 cool0 ',zheat(i,k),zcool(i,k),zheat0(i,k),zcool0(i,k) |
---|
1163 | ! ZFLUCUP_i(i,k)=ZFLUC_i(i,1,k) |
---|
1164 | ! ZFLUCDWN_i(i,k)=ZFLUC_i(i,2,k) |
---|
1165 | ENDDO |
---|
1166 | ENDDO |
---|
1167 | #else |
---|
1168 | abort_message="You should compile with -rrtm if running with iflag_rrtm=1" |
---|
1169 | call abort_physic(modname, abort_message, 1) |
---|
1170 | #endif |
---|
1171 | !====================================================================== |
---|
1172 | ! AI fev 2021 |
---|
1173 | ELSE IF(iflag_rrtm == 2) THEN |
---|
1174 | print*,'Traitement cas iflag_rrtm = ',iflag_rrtm |
---|
1175 | ! print*,'Mise a zero des flux ' |
---|
1176 | #ifdef CPP_ECRAD |
---|
1177 | DO k = 1, kflev+1 |
---|
1178 | DO i = 1, kdlon |
---|
1179 | ZEMTD_i(i,k)=0. |
---|
1180 | ZEMTU_i(i,k)=0. |
---|
1181 | ZTRSO_i(i,k)=0. |
---|
1182 | ZTH_i(i,k)=0. |
---|
1183 | ZLWFT_i(i,k)=0. |
---|
1184 | ZSWFT_i(i,k)=0. |
---|
1185 | ZFLUX_i(i,1,k)=0. |
---|
1186 | ZFLUX_i(i,2,k)=0. |
---|
1187 | ZFLUC_i(i,1,k)=0. |
---|
1188 | ZFLUC_i(i,2,k)=0. |
---|
1189 | ZFSDWN_i(i,k)=0. |
---|
1190 | ZFCDWN_i(i,k)=0. |
---|
1191 | ZFCCDWN_i(i,k)=0. |
---|
1192 | ZFSUP_i(i,k)=0. |
---|
1193 | ZFCUP_i(i,k)=0. |
---|
1194 | ZFCCUP_i(i,k)=0. |
---|
1195 | ZFLCCDWN_i(i,k)=0. |
---|
1196 | ZFLCCUP_i(i,k)=0. |
---|
1197 | ENDDO |
---|
1198 | ENDDO |
---|
1199 | ! |
---|
1200 | ! Aerosols A REVOIR |
---|
1201 | ! DO i = 1, kdlon |
---|
1202 | ! DO k = 1, kflev |
---|
1203 | ! DO kk=1, NSW |
---|
1204 | ! |
---|
1205 | ! PTAU_TOT(i,kflev+1-k,kk)=tau_aero_sw_rrtm(i,k,2,kk) |
---|
1206 | ! PPIZA_TOT(i,kflev+1-k,kk)=piz_aero_sw_rrtm(i,k,2,kk) |
---|
1207 | ! PCGA_TOT(i,kflev+1-k,kk)=cg_aero_sw_rrtm(i,k,2,kk) |
---|
1208 | ! |
---|
1209 | ! PTAU_NAT(i,kflev+1-k,kk)=tau_aero_sw_rrtm(i,k,1,kk) |
---|
1210 | ! PPIZA_NAT(i,kflev+1-k,kk)=piz_aero_sw_rrtm(i,k,1,kk) |
---|
1211 | ! PCGA_NAT(i,kflev+1-k,kk)=cg_aero_sw_rrtm(i,k,1,kk) |
---|
1212 | ! |
---|
1213 | ! ENDDO |
---|
1214 | ! ENDDO |
---|
1215 | ! ENDDO |
---|
1216 | !-end OB |
---|
1217 | ! |
---|
1218 | ! DO i = 1, kdlon |
---|
1219 | ! DO k = 1, kflev |
---|
1220 | ! DO kk=1, NLW |
---|
1221 | ! |
---|
1222 | ! PTAU_LW_TOT(i,kflev+1-k,kk)=tau_aero_lw_rrtm(i,k,2,kk) |
---|
1223 | ! PTAU_LW_NAT(i,kflev+1-k,kk)=tau_aero_lw_rrtm(i,k,1,kk) |
---|
1224 | ! |
---|
1225 | ! ENDDO |
---|
1226 | ! ENDDO |
---|
1227 | ! ENDDO |
---|
1228 | !-end C. Kleinschmitt |
---|
1229 | ! |
---|
1230 | DO i = 1, kdlon |
---|
1231 | ZCTRSO(i,1)=0. |
---|
1232 | ZCTRSO(i,2)=0. |
---|
1233 | ZCEMTR(i,1)=0. |
---|
1234 | ZCEMTR(i,2)=0. |
---|
1235 | ZTRSOD(i)=0. |
---|
1236 | ZLWFC(i,1)=0. |
---|
1237 | ZLWFC(i,2)=0. |
---|
1238 | ZSWFC(i,1)=0. |
---|
1239 | ZSWFC(i,2)=0. |
---|
1240 | PFSDNN(i)=0. |
---|
1241 | PFSDNV(i)=0. |
---|
1242 | DO kk = 1, NSW |
---|
1243 | PSFSWDIR(i,kk)=0. |
---|
1244 | PSFSWDIF(i,kk)=0. |
---|
1245 | ENDDO |
---|
1246 | ENDDO |
---|
1247 | !----- Fin des mises a zero des tableaux output ------------------- |
---|
1248 | |
---|
1249 | ! On met les donnees dans l'ordre des niveaux ecrad |
---|
1250 | ! print*,'On inverse sur la verticale ' |
---|
1251 | paprs_i(:,1)=paprs(:,klev+1) |
---|
1252 | DO k=1,klev |
---|
1253 | paprs_i(1:klon,k+1) =paprs(1:klon,klev+1-k) |
---|
1254 | pplay_i(1:klon,k) =pplay(1:klon,klev+1-k) |
---|
1255 | cldfra_i(1:klon,k) =cldfra(1:klon,klev+1-k) |
---|
1256 | PDP_i(1:klon,k) =PDP(1:klon,klev+1-k) |
---|
1257 | t_i(1:klon,k) =t(1:klon,klev+1-k) |
---|
1258 | q_i(1:klon,k) =q(1:klon,klev+1-k) |
---|
1259 | qsat_i(1:klon,k) =qsat(1:klon,klev+1-k) |
---|
1260 | flwc_i(1:klon,k) =flwc(1:klon,klev+1-k) |
---|
1261 | fiwc_i(1:klon,k) =fiwc(1:klon,klev+1-k) |
---|
1262 | ref_liq_i(1:klon,k) =ref_liq(1:klon,klev+1-k) |
---|
1263 | ref_ice_i(1:klon,k) =ref_ice(1:klon,klev+1-k) |
---|
1264 | !-OB |
---|
1265 | ref_liq_pi_i(1:klon,k) =ref_liq_pi(1:klon,klev+1-k) |
---|
1266 | ref_ice_pi_i(1:klon,k) =ref_ice_pi(1:klon,klev+1-k) |
---|
1267 | ENDDO |
---|
1268 | DO k=1,kflev |
---|
1269 | ZO3_DP_i(1:klon,k)=ZO3_DP(1:klon,kflev+1-k) |
---|
1270 | DO i=1,6 |
---|
1271 | PAER_i(1:klon,k,i)=PAER(1:klon,kflev+1-k,i) |
---|
1272 | ENDDO |
---|
1273 | ENDDO |
---|
1274 | ! AI 02.2021 |
---|
1275 | ! Calcul of ZTH_i |
---|
1276 | DO K=2,KLEV |
---|
1277 | ZTH_i(:,K)=& |
---|
1278 | & (t_i(:,K-1)*pplay_i(:,K-1)*(pplay_i(:,K)-paprs_i(:,K))& |
---|
1279 | & +t_i(:,K)*pplay_i(:,K)*(paprs_i(:,K)-pplay_i(:,K-1)))& |
---|
1280 | & *(1.0/(paprs_i(:,K)*(pplay_i(:,K)-pplay_i(:,K-1)))) |
---|
1281 | ENDDO |
---|
1282 | ZTH_i(:,KLEV+1)=tsol(:) |
---|
1283 | ZTH_i(:,1)=t_i(:,1)-pplay_i(:,1)*(t_i(:,1)-ZTH_i(:,2))& |
---|
1284 | & /(pplay_i(:,1)-paprs_i(:,2)) |
---|
1285 | |
---|
1286 | print *,'RADLWSW: avant RADIATION_SCHEME ' |
---|
1287 | IF (lldebug) THEN |
---|
1288 | CALL writefield_phy('rmu0',rmu0,1) |
---|
1289 | CALL writefield_phy('tsol',tsol,1) |
---|
1290 | CALL writefield_phy('emissiv_out',ZEMIS,1) |
---|
1291 | CALL writefield_phy('emissiv_in',ZEMISW,1) |
---|
1292 | CALL writefield_phy('pctsrf_ter',pctsrf(:,is_ter),1) |
---|
1293 | CALL writefield_phy('pctsrf_oce',pctsrf(:,is_oce),1) |
---|
1294 | CALL writefield_phy('ZGELAM',ZGELAM,1) |
---|
1295 | CALL writefield_phy('ZGEMU',ZGEMU,1) |
---|
1296 | CALL writefield_phy('zmasq',zmasq,1) |
---|
1297 | CALL writefield_phy('paprs_i',paprs_i,klev+1) |
---|
1298 | CALL writefield_phy('pplay_i',pplay_i,klev) |
---|
1299 | CALL writefield_phy('t_i',t_i,klev) |
---|
1300 | CALL writefield_phy('ZTH_i',ZTH_i,klev+1) |
---|
1301 | CALL writefield_phy('cldfra_i',cldfra_i,klev) |
---|
1302 | CALL writefield_phy('paer_i',PAER_i,klev) |
---|
1303 | CALL writefield_phy('q_i',q_i,klev) |
---|
1304 | CALL writefield_phy('fiwc_i',fiwc_i,klev) |
---|
1305 | CALL writefield_phy('flwc_i',flwc_i,klev) |
---|
1306 | CALL writefield_phy('palbd_new',PALBD_NEW,NSW) |
---|
1307 | CALL writefield_phy('palbp_new',PALBP_NEW,NSW) |
---|
1308 | CALL writefield_phy('ZO3_DP',ZO3_DP,klev) |
---|
1309 | ENDIF |
---|
1310 | |
---|
1311 | CALL RADIATION_SCHEME & |
---|
1312 | & (ist, iend, klon, klev, naero_tot, NSW, & |
---|
1313 | ! ??? naero_tot |
---|
1314 | & day_cur, current_time, & |
---|
1315 | & solaire, & |
---|
1316 | & rmu0, tsol, PALBD_NEW,PALBP_NEW, & |
---|
1317 | ! PEMIS_WINDOW (???), & |
---|
1318 | & ZEMIS, ZEMISW, & |
---|
1319 | ! PCCN_LAND, PCCN_SEA, & ??? |
---|
1320 | & pctsrf(:,is_ter), pctsrf(:,is_oce), & |
---|
1321 | ! longitude(rad), sin(latitude), PMASQ_ ??? |
---|
1322 | & ZGELAM, ZGEMU, zmasq, & |
---|
1323 | ! pression et temp aux milieux |
---|
1324 | & pplay_i, t_i, & |
---|
1325 | ! PTEMPERATURE_H ?, |
---|
1326 | & paprs_i, ZTH_i, q_i, qsat_i, & |
---|
1327 | ! Gas |
---|
1328 | & ZCO2, ZCH4, ZN2O, ZNO2, ZCFC11, ZCFC12, ZHCFC22, ZCCL4, ZO3_DP_i, & |
---|
1329 | ! |
---|
1330 | & cldfra_i, flwc_i, fiwc_i, ZQ_RAIN, ZQ_SNOW, & |
---|
1331 | & ref_liq_i, ref_ice_i, & |
---|
1332 | ! aerosols |
---|
1333 | & ZAEROSOL_OLD, ZAEROSOL, & |
---|
1334 | ! Outputs |
---|
1335 | ! Net flux |
---|
1336 | & ZSWFT_i, ZLWFT_i, ZSWFT0_i, ZLWFT0_i, & |
---|
1337 | ! DN flux |
---|
1338 | & ZFSDWN_i, ZFLUX_i(:,2,:), ZFCDWN_i, ZFLUC_i(:,2,:), & |
---|
1339 | ! UP flux |
---|
1340 | & ZFSUP_i, ZFLUX_i(:,1,:), ZFCUP_i, ZFLUC_i(:,1,:), & |
---|
1341 | ! Surf Direct flux |
---|
1342 | & ZFLUX_DIR, ZFLUX_DIR_CLEAR, ZFLUX_DIR_INTO_SUN, & |
---|
1343 | ! UV and para flux |
---|
1344 | & ZFLUX_UV, ZFLUX_PAR, ZFLUX_PAR_CLEAR, & |
---|
1345 | ! & ZFLUX_SW_DN_TOA, |
---|
1346 | & ZEMIS_OUT, ZLWDERIVATIVE, & |
---|
1347 | & PSFSWDIF, PSFSWDIR) |
---|
1348 | |
---|
1349 | print *,'========= RADLWSW: apres RADIATION_SCHEME ==================== ' |
---|
1350 | IF (lldebug) THEN |
---|
1351 | if (0.eq.0) then |
---|
1352 | print *,' Net Flux ' |
---|
1353 | print *,'ZSWFT_i =', ZSWFT_i |
---|
1354 | print *,'ZLWFT_i =', ZLWFT_i |
---|
1355 | print *,'ZSWFT0_i =', ZSWFT0_i |
---|
1356 | print*,'ZLWFT0_i =', ZLWFT0_i |
---|
1357 | |
---|
1358 | print*,'DN Flux ' |
---|
1359 | print*,'ZFSDWN_i =', ZFSDWN_i |
---|
1360 | print*,'ZFLUX_i(:,2,:)', ZFLUX_i(:,2,:) |
---|
1361 | print*,'ZFCDWN_i =', ZFCDWN_i |
---|
1362 | print*,'ZFLUC_i(:,2,:) =', ZFLUC_i(:,2,:) |
---|
1363 | |
---|
1364 | print*,'UP Flux ' |
---|
1365 | print*,'ZFSUP_i =', ZFSUP_i |
---|
1366 | print*,'ZFLUX_i(:,1,:) =', ZFLUX_i(:,1,:) |
---|
1367 | print*,'ZFCUP_i =', ZFCUP_i |
---|
1368 | print*,'ZFLUC_i(:,1,:) =', ZFLUC_i(:,1,:) |
---|
1369 | |
---|
1370 | print*,'UV and para flux ' |
---|
1371 | print*,'ZFLUX_DIR =', ZFLUX_DIR |
---|
1372 | print*,'ZFLUX_DIR_CLEAR', ZFLUX_DIR_CLEAR |
---|
1373 | print*,'ZFLUX_DIR_INTO_SUN', ZFLUX_DIR_INTO_SUN |
---|
1374 | endif |
---|
1375 | ENDIF |
---|
1376 | |
---|
1377 | IF (lldebug) THEN |
---|
1378 | CALL writefield_phy('zlwft_i',ZLWFT_i,klev+1) |
---|
1379 | CALL writefield_phy('zlwft0_i',ZLWFT0_i,klev+1) |
---|
1380 | CALL writefield_phy('zswft_i',ZSWFT_i,klev+1) |
---|
1381 | CALL writefield_phy('zswft0_i',ZSWFT0_i,klev+1) |
---|
1382 | CALL writefield_phy('psfswdir',PSFSWDIR,6) |
---|
1383 | CALL writefield_phy('psfswdif',PSFSWDIF,6) |
---|
1384 | CALL writefield_phy('zflux_i',ZFLUX_i,klev+1) |
---|
1385 | CALL writefield_phy('zfluc_i',ZFLUC_i,klev+1) |
---|
1386 | CALL writefield_phy('zfsdwn_i',ZFSDWN_i,klev+1) |
---|
1387 | CALL writefield_phy('zfsup_i',ZFSUP_i,klev+1) |
---|
1388 | CALL writefield_phy('zfcdwn_i',ZFCDWN_i,klev+1) |
---|
1389 | CALL writefield_phy('zfcup_i',ZFCUP_i,klev+1) |
---|
1390 | ENDIF |
---|
1391 | ! --------- |
---|
1392 | ! On retablit l'ordre des niveaux lmd pour les tableaux de sortie |
---|
1393 | ! D autre part, on multiplie les resultats SW par fract pour etre coherent |
---|
1394 | ! avec l ancien rayonnement AR4. Si nuit, fract=0 donc pas de |
---|
1395 | ! rayonnement SW. (MPL 260609) |
---|
1396 | print*,'On retablit ordre des niveaux verticaux' |
---|
1397 | print*,'On multiplie les flux SW par fract ?' |
---|
1398 | DO k=0,klev |
---|
1399 | DO i=1,klon |
---|
1400 | ZEMTD(i,k+1) = ZEMTD_i(i,klev+1-k) |
---|
1401 | ZEMTU(i,k+1) = ZEMTU_i(i,klev+1-k) |
---|
1402 | ZTRSO(i,k+1) = ZTRSO_i(i,klev+1-k) |
---|
1403 | ! ZTH(i,k+1) = ZTH_i(i,klev+1-k) |
---|
1404 | ! AI ATTENTION |
---|
1405 | ZLWFT(i,k+1) = ZLWFT_i(i,klev+1-k) |
---|
1406 | ZSWFT(i,k+1) = ZSWFT_i(i,klev+1-k)*fract(i) |
---|
1407 | ZSWFT0_i(i,k+1) = ZSWFT0_i(i,klev+1-k)*fract(i) |
---|
1408 | ! |
---|
1409 | ZFLUP(i,k+1) = ZFLUX_i(i,1,klev+1-k) |
---|
1410 | ZFLDN(i,k+1) = ZFLUX_i(i,2,klev+1-k) |
---|
1411 | ZFLUP0(i,k+1) = ZFLUC_i(i,1,klev+1-k) |
---|
1412 | ZFLDN0(i,k+1) = ZFLUC_i(i,2,klev+1-k) |
---|
1413 | ZFSDN(i,k+1) = ZFSDWN_i(i,klev+1-k)*fract(i) |
---|
1414 | ZFSDN0(i,k+1) = ZFCDWN_i(i,klev+1-k)*fract(i) |
---|
1415 | ZFSDNC0(i,k+1)= ZFCCDWN_i(i,klev+1-k)*fract(i) |
---|
1416 | ZFSUP (i,k+1) = ZFSUP_i(i,klev+1-k)*fract(i) |
---|
1417 | ZFSUP0(i,k+1) = ZFCUP_i(i,klev+1-k)*fract(i) |
---|
1418 | ZFSUPC0(i,k+1)= ZFCCUP_i(i,klev+1-k)*fract(i) |
---|
1419 | ZFLDNC0(i,k+1)= ZFLCCDWN_i(i,klev+1-k) |
---|
1420 | ZFLUPC0(i,k+1)= ZFLCCUP_i(i,klev+1-k) |
---|
1421 | IF (ok_volcan) THEN |
---|
1422 | ZSWADAERO(i,k+1)=ZSWADAERO(i,klev+1-k)*fract(i) !--NL |
---|
1423 | ENDIF |
---|
1424 | |
---|
1425 | ! Nouveau calcul car visiblement ZSWFT et ZSWFC sont nuls dans RRTM cy32 |
---|
1426 | ! en sortie de radlsw.F90 - MPL 7.01.09 |
---|
1427 | ! AI ATTENTION |
---|
1428 | ! ZSWFT(i,k+1) = (ZFSDWN_i(i,k+1)-ZFSUP_i(i,k+1))*fract(i) |
---|
1429 | ! ZSWFT0_i(i,k+1) = (ZFCDWN_i(i,k+1)-ZFCUP_i(i,k+1))*fract(i) |
---|
1430 | ! ZLWFT(i,k+1) =-ZFLUX_i(i,2,k+1)-ZFLUX_i(i,1,k+1) |
---|
1431 | ! ZLWFT0_i(i,k+1)=-ZFLUC_i(i,2,k+1)-ZFLUC_i(i,1,k+1) |
---|
1432 | ENDDO |
---|
1433 | ENDDO |
---|
1434 | |
---|
1435 | !--ajout OB |
---|
1436 | ZTOPSWADAERO(:) =ZTOPSWADAERO(:) *fract(:) |
---|
1437 | ZSOLSWADAERO(:) =ZSOLSWADAERO(:) *fract(:) |
---|
1438 | ZTOPSWAD0AERO(:)=ZTOPSWAD0AERO(:)*fract(:) |
---|
1439 | ZSOLSWAD0AERO(:)=ZSOLSWAD0AERO(:)*fract(:) |
---|
1440 | ZTOPSWAIAERO(:) =ZTOPSWAIAERO(:) *fract(:) |
---|
1441 | ZSOLSWAIAERO(:) =ZSOLSWAIAERO(:) *fract(:) |
---|
1442 | ZTOPSWCF_AERO(:,1)=ZTOPSWCF_AERO(:,1)*fract(:) |
---|
1443 | ZTOPSWCF_AERO(:,2)=ZTOPSWCF_AERO(:,2)*fract(:) |
---|
1444 | ZTOPSWCF_AERO(:,3)=ZTOPSWCF_AERO(:,3)*fract(:) |
---|
1445 | ZSOLSWCF_AERO(:,1)=ZSOLSWCF_AERO(:,1)*fract(:) |
---|
1446 | ZSOLSWCF_AERO(:,2)=ZSOLSWCF_AERO(:,2)*fract(:) |
---|
1447 | ZSOLSWCF_AERO(:,3)=ZSOLSWCF_AERO(:,3)*fract(:) |
---|
1448 | |
---|
1449 | ! --------- |
---|
1450 | ! On renseigne les champs LMDz, pour avoir la meme chose qu'en sortie de |
---|
1451 | ! LW_LMDAR4 et SW_LMDAR4 |
---|
1452 | |
---|
1453 | !--fraction of diffuse radiation in surface SW downward radiation |
---|
1454 | DO i = 1, kdlon |
---|
1455 | IF (fract(i).GT.0.0) THEN |
---|
1456 | zdir=SUM(PSFSWDIR(i,:)) |
---|
1457 | zdif=SUM(PSFSWDIF(i,:)) |
---|
1458 | zsolswfdiff(i) = zdif/(zdir+zdif) |
---|
1459 | ELSE !--night |
---|
1460 | zsolswfdiff(i) = 1.0 |
---|
1461 | ENDIF |
---|
1462 | ENDDO |
---|
1463 | ! |
---|
1464 | DO i = 1, kdlon |
---|
1465 | zsolsw(i) = ZSWFT(i,1) |
---|
1466 | zsolsw0(i) = ZSWFT0_i(i,1) |
---|
1467 | ztopsw(i) = ZSWFT(i,klev+1) |
---|
1468 | ztopsw0(i) = ZSWFT0_i(i,klev+1) |
---|
1469 | zsollw(i) = ZLWFT(i,1) |
---|
1470 | zsollw0(i) = ZLWFT0_i(i,1) |
---|
1471 | ztoplw(i) = ZLWFT(i,klev+1)*(-1) |
---|
1472 | ztoplw0(i) = ZLWFT0_i(i,klev+1)*(-1) |
---|
1473 | ! |
---|
1474 | zsollwdown(i)= -1.*ZFLDN(i,1) |
---|
1475 | ENDDO |
---|
1476 | |
---|
1477 | DO k=1,kflev |
---|
1478 | DO i=1,kdlon |
---|
1479 | zheat(i,k)=(ZSWFT(i,k+1)-ZSWFT(i,k))*RDAY*RG/RCPD/PDP(i,k) |
---|
1480 | zheat0(i,k)=(ZSWFT0_i(i,k+1)-ZSWFT0_i(i,k))*RDAY*RG/RCPD/PDP(i,k) |
---|
1481 | zcool(i,k)=(ZLWFT(i,k)-ZLWFT(i,k+1))*RDAY*RG/RCPD/PDP(i,k) |
---|
1482 | zcool0(i,k)=(ZLWFT0_i(i,k)-ZLWFT0_i(i,k+1))*RDAY*RG/RCPD/PDP(i,k) |
---|
1483 | IF (ok_volcan) THEN |
---|
1484 | zheat_volc(i,k)=(ZSWADAERO(i,k+1)-ZSWADAERO(i,k))*RG/RCPD/PDP(i,k) !NL |
---|
1485 | zcool_volc(i,k)=(ZLWADAERO(i,k)-ZLWADAERO(i,k+1))*RG/RCPD/PDP(i,k) !NL |
---|
1486 | ENDIF |
---|
1487 | ENDDO |
---|
1488 | ENDDO |
---|
1489 | #endif |
---|
1490 | print*,'Fin traitement ECRAD' |
---|
1491 | ! Fin ECRAD |
---|
1492 | ENDIF ! iflag_rrtm |
---|
1493 | ! ecrad |
---|
1494 | !====================================================================== |
---|
1495 | |
---|
1496 | DO i = 1, kdlon |
---|
1497 | topsw(iof+i) = ztopsw(i) |
---|
1498 | toplw(iof+i) = ztoplw(i) |
---|
1499 | solsw(iof+i) = zsolsw(i) |
---|
1500 | solswfdiff(iof+i) = zsolswfdiff(i) |
---|
1501 | sollw(iof+i) = zsollw(i) |
---|
1502 | sollwdown(iof+i) = zsollwdown(i) |
---|
1503 | DO k = 1, kflev+1 |
---|
1504 | lwdn0 ( iof+i,k) = ZFLDN0 ( i,k) |
---|
1505 | lwdn ( iof+i,k) = ZFLDN ( i,k) |
---|
1506 | lwup0 ( iof+i,k) = ZFLUP0 ( i,k) |
---|
1507 | lwup ( iof+i,k) = ZFLUP ( i,k) |
---|
1508 | ENDDO |
---|
1509 | topsw0(iof+i) = ztopsw0(i) |
---|
1510 | toplw0(iof+i) = ztoplw0(i) |
---|
1511 | solsw0(iof+i) = zsolsw0(i) |
---|
1512 | sollw0(iof+i) = zsollw0(i) |
---|
1513 | albpla(iof+i) = zalbpla(i) |
---|
1514 | |
---|
1515 | DO k = 1, kflev+1 |
---|
1516 | swdnc0( iof+i,k) = ZFSDNC0( i,k) |
---|
1517 | swdn0 ( iof+i,k) = ZFSDN0 ( i,k) |
---|
1518 | swdn ( iof+i,k) = ZFSDN ( i,k) |
---|
1519 | swupc0( iof+i,k) = ZFSUPC0( i,k) |
---|
1520 | swup0 ( iof+i,k) = ZFSUP0 ( i,k) |
---|
1521 | swup ( iof+i,k) = ZFSUP ( i,k) |
---|
1522 | lwdnc0( iof+i,k) = ZFLDNC0( i,k) |
---|
1523 | lwupc0( iof+i,k) = ZFLUPC0( i,k) |
---|
1524 | ENDDO |
---|
1525 | ENDDO |
---|
1526 | !-transform the aerosol forcings, if they have |
---|
1527 | ! to be calculated |
---|
1528 | IF (ok_ade) THEN |
---|
1529 | DO i = 1, kdlon |
---|
1530 | topswad_aero(iof+i) = ztopswadaero(i) |
---|
1531 | topswad0_aero(iof+i) = ztopswad0aero(i) |
---|
1532 | solswad_aero(iof+i) = zsolswadaero(i) |
---|
1533 | solswad0_aero(iof+i) = zsolswad0aero(i) |
---|
1534 | topsw_aero(iof+i,:) = ztopsw_aero(i,:) |
---|
1535 | topsw0_aero(iof+i,:) = ztopsw0_aero(i,:) |
---|
1536 | solsw_aero(iof+i,:) = zsolsw_aero(i,:) |
---|
1537 | solsw0_aero(iof+i,:) = zsolsw0_aero(i,:) |
---|
1538 | topswcf_aero(iof+i,:) = ztopswcf_aero(i,:) |
---|
1539 | solswcf_aero(iof+i,:) = zsolswcf_aero(i,:) |
---|
1540 | !-LW |
---|
1541 | toplwad_aero(iof+i) = ztoplwadaero(i) |
---|
1542 | toplwad0_aero(iof+i) = ztoplwad0aero(i) |
---|
1543 | sollwad_aero(iof+i) = zsollwadaero(i) |
---|
1544 | sollwad0_aero(iof+i) = zsollwad0aero(i) |
---|
1545 | ENDDO |
---|
1546 | ELSE |
---|
1547 | DO i = 1, kdlon |
---|
1548 | topswad_aero(iof+i) = 0.0 |
---|
1549 | solswad_aero(iof+i) = 0.0 |
---|
1550 | topswad0_aero(iof+i) = 0.0 |
---|
1551 | solswad0_aero(iof+i) = 0.0 |
---|
1552 | topsw_aero(iof+i,:) = 0. |
---|
1553 | topsw0_aero(iof+i,:) =0. |
---|
1554 | solsw_aero(iof+i,:) = 0. |
---|
1555 | solsw0_aero(iof+i,:) = 0. |
---|
1556 | !-LW |
---|
1557 | toplwad_aero(iof+i) = 0.0 |
---|
1558 | sollwad_aero(iof+i) = 0.0 |
---|
1559 | toplwad0_aero(iof+i) = 0.0 |
---|
1560 | sollwad0_aero(iof+i) = 0.0 |
---|
1561 | ENDDO |
---|
1562 | ENDIF |
---|
1563 | IF (ok_aie) THEN |
---|
1564 | DO i = 1, kdlon |
---|
1565 | topswai_aero(iof+i) = ztopswaiaero(i) |
---|
1566 | solswai_aero(iof+i) = zsolswaiaero(i) |
---|
1567 | !-LW |
---|
1568 | toplwai_aero(iof+i) = ztoplwaiaero(i) |
---|
1569 | sollwai_aero(iof+i) = zsollwaiaero(i) |
---|
1570 | ENDDO |
---|
1571 | ELSE |
---|
1572 | DO i = 1, kdlon |
---|
1573 | topswai_aero(iof+i) = 0.0 |
---|
1574 | solswai_aero(iof+i) = 0.0 |
---|
1575 | !-LW |
---|
1576 | toplwai_aero(iof+i) = 0.0 |
---|
1577 | sollwai_aero(iof+i) = 0.0 |
---|
1578 | ENDDO |
---|
1579 | ENDIF |
---|
1580 | DO k = 1, kflev |
---|
1581 | DO i = 1, kdlon |
---|
1582 | ! scale factor to take into account the difference between |
---|
1583 | ! dry air and watter vapour scpecifi! heat capacity |
---|
1584 | zznormcp=1.0+RVTMP2*PWV(i,k) |
---|
1585 | heat(iof+i,k) = zheat(i,k)/zznormcp |
---|
1586 | cool(iof+i,k) = zcool(i,k)/zznormcp |
---|
1587 | heat0(iof+i,k) = zheat0(i,k)/zznormcp |
---|
1588 | cool0(iof+i,k) = zcool0(i,k)/zznormcp |
---|
1589 | IF(ok_volcan) THEN !NL |
---|
1590 | heat_volc(iof+i,k) = zheat_volc(i,k)/zznormcp |
---|
1591 | cool_volc(iof+i,k) = zcool_volc(i,k)/zznormcp |
---|
1592 | ENDIF |
---|
1593 | ENDDO |
---|
1594 | ENDDO |
---|
1595 | |
---|
1596 | ENDDO ! j = 1, nb_gr |
---|
1597 | |
---|
1598 | !IF (lldebug) THEN |
---|
1599 | ! print*,'================== Sortie de radlw =================' |
---|
1600 | ! print*,'cool = ', cool |
---|
1601 | ! print*,'heat = ', heat |
---|
1602 | ! print*,'topsw = ', topsw |
---|
1603 | ! print*,'toplw = ', toplw |
---|
1604 | ! print*,'sollw = ', sollw |
---|
1605 | ! print*,'solsw = ', solsw |
---|
1606 | ! print*,'lwdn = ', lwdn |
---|
1607 | ! print*,'lwup = ', lwup |
---|
1608 | ! print*,'swdn = ', swdn |
---|
1609 | ! print*,'swup =', swup |
---|
1610 | !ENDIF |
---|
1611 | |
---|
1612 | END SUBROUTINE radlwsw |
---|
1613 | |
---|
1614 | end module radlwsw_m |
---|