1 | !$Id: phytrac_mod.F90 5110 2024-07-24 09:19:08Z abarral $ |
---|
2 | MODULE phytrac_mod |
---|
3 | !================================================================================= |
---|
4 | ! Interface between the LMDZ physical package and tracer computation. |
---|
5 | ! Chemistry modules (INCA, Reprobus or the more specific traclmdz routine) |
---|
6 | ! are called from phytrac. |
---|
7 | |
---|
8 | !====================================================================== |
---|
9 | ! Auteur(s) FH |
---|
10 | ! Objet: Moniteur general des tendances traceurs |
---|
11 | |
---|
12 | ! iflag_vdf_trac : Options for activating transport by vertical diffusion : |
---|
13 | ! 1. notmal |
---|
14 | ! 0. emission is injected in the first layer only, without diffusion |
---|
15 | ! -1 no emission & no diffusion |
---|
16 | ! Modification 2013/07/22 : transformed into a module to pass tendencies to |
---|
17 | ! physics outputs. Additional keys for controling activation of sub processes. |
---|
18 | ! Modification R. Pilon 10 octobre 2012 large scale scavenging incloud_scav + bc_scav |
---|
19 | ! Modification R. Pilon 01 janvier 2012 transport+scavenging KE scheme : cvltr |
---|
20 | !================================================================================= |
---|
21 | |
---|
22 | ! Tracer tendencies, for outputs |
---|
23 | !------------------------------- |
---|
24 | REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_cl ! Td couche limite/traceur |
---|
25 | REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_dec !RomP |
---|
26 | REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_cv ! Td convection/traceur |
---|
27 | ! RomP >>> |
---|
28 | REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_insc |
---|
29 | REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_bcscav |
---|
30 | REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_evapls |
---|
31 | REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_ls |
---|
32 | REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_trsp |
---|
33 | REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_sscav |
---|
34 | REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_sat |
---|
35 | REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_uscav |
---|
36 | REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: qPr, qDi ! concentration tra dans pluie,air descente insaturee |
---|
37 | REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: qPa, qMel |
---|
38 | REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: qTrdi, dtrcvMA ! conc traceur descente air insaturee et td convective MA |
---|
39 | ! RomP <<< |
---|
40 | REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_th ! Td thermique |
---|
41 | REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_lessi_impa ! Td du lessivage par impaction |
---|
42 | REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_lessi_nucl ! Td du lessivage par nucleation |
---|
43 | REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: qPrls !jyg: concentration tra dans pluie LS a la surf. |
---|
44 | REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_dry ! Td depot sec/traceur (1st layer),ALLOCATABLE,SAVE jyg |
---|
45 | REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: flux_tr_dry ! depot sec/traceur (surface),ALLOCATABLE,SAVE jyg |
---|
46 | |
---|
47 | !$OMP THREADPRIVATE(qPa,qMel,qTrdi,dtrcvMA,d_tr_th,d_tr_lessi_impa,d_tr_lessi_nucl) |
---|
48 | !$OMP THREADPRIVATE(d_tr_trsp,d_tr_sscav,d_tr_sat,d_tr_uscav,qPr,qDi) |
---|
49 | !$OMP THREADPRIVATE(d_tr_insc,d_tr_bcscav,d_tr_evapls,d_tr_ls,qPrls) |
---|
50 | !$OMP THREADPRIVATE(d_tr_cl,d_tr_dry,flux_tr_dry,d_tr_dec,d_tr_cv) |
---|
51 | |
---|
52 | CONTAINS |
---|
53 | |
---|
54 | SUBROUTINE phytrac_init() |
---|
55 | |
---|
56 | USE dimphy |
---|
57 | USE infotrac_phy, ONLY: nbtr, type_trac |
---|
58 | USE tracco2i_mod, ONLY: tracco2i_init |
---|
59 | |
---|
60 | IMPLICIT NONE |
---|
61 | |
---|
62 | ALLOCATE(d_tr_cl(klon, klev, nbtr), d_tr_dry(klon, nbtr)) |
---|
63 | ALLOCATE(flux_tr_dry(klon, nbtr), d_tr_dec(klon, klev, nbtr), d_tr_cv(klon, klev, nbtr)) |
---|
64 | ALLOCATE(d_tr_insc(klon, klev, nbtr), d_tr_bcscav(klon, klev, nbtr)) |
---|
65 | ALLOCATE(d_tr_evapls(klon, klev, nbtr), d_tr_ls(klon, klev, nbtr)) |
---|
66 | ALLOCATE(qPrls(klon, nbtr), d_tr_trsp(klon, klev, nbtr)) |
---|
67 | ALLOCATE(d_tr_sscav(klon, klev, nbtr), d_tr_sat(klon, klev, nbtr)) |
---|
68 | ALLOCATE(d_tr_uscav(klon, klev, nbtr), qPr(klon, klev, nbtr), qDi(klon, klev, nbtr)) |
---|
69 | ALLOCATE(qPa(klon, klev, nbtr), qMel(klon, klev, nbtr)) |
---|
70 | ALLOCATE(qTrdi(klon, klev, nbtr), dtrcvMA(klon, klev, nbtr)) |
---|
71 | ALLOCATE(d_tr_th(klon, klev, nbtr)) |
---|
72 | ALLOCATE(d_tr_lessi_impa(klon, klev, nbtr), d_tr_lessi_nucl(klon, klev, nbtr)) |
---|
73 | |
---|
74 | !=============================================================================== |
---|
75 | ! -- Do specific treatment according to chemestry model or local LMDZ tracers |
---|
76 | |
---|
77 | !=============================================================================== |
---|
78 | ! -- CO2 interactif -- |
---|
79 | IF (ANY(type_trac == ['co2i', 'inco'])) CALL tracco2i_init() |
---|
80 | |
---|
81 | ! -- type_trac == 'co2i' ! PC |
---|
82 | ! -- CO2 interactif -- |
---|
83 | ! -- source is updated with FF and BB emissions |
---|
84 | ! -- and net fluxes from ocean and orchidee |
---|
85 | ! -- sign convention : positive into the atmosphere |
---|
86 | |
---|
87 | END SUBROUTINE phytrac_init |
---|
88 | |
---|
89 | SUBROUTINE phytrac(& |
---|
90 | nstep, julien, gmtime, debutphy, & |
---|
91 | lafin, pdtphys, u, v, t_seri, & |
---|
92 | paprs, pplay, pmfu, pmfd, & |
---|
93 | pen_u, pde_u, pen_d, pde_d, & |
---|
94 | cdragh, coefh, fm_therm, entr_therm, & |
---|
95 | yu1, yv1, ftsol, pctsrf, & |
---|
96 | ustar, u10m, v10m, & |
---|
97 | wstar, ale_bl, ale_wake, & |
---|
98 | xlat, xlon, & |
---|
99 | frac_impa, frac_nucl, beta_fisrt, beta_v1, & |
---|
100 | presnivs, pphis, pphi, albsol, & |
---|
101 | sh, ch, rh, cldfra, rneb, & |
---|
102 | diafra, cldliq, itop_con, ibas_con, & |
---|
103 | pmflxr, pmflxs, prfl, psfl, & |
---|
104 | da, phi, mp, upwd, & |
---|
105 | phi2, d1a, dam, sij, wght_cvfd, & ! RomP +RL |
---|
106 | wdtrainA, wdtrainM, sigd, clw, elij, & ! RomP |
---|
107 | evap, ep, epmlmMm, eplaMm, & ! RomP |
---|
108 | dnwd, aerosol_couple, flxmass_w, & |
---|
109 | tau_aero, piz_aero, cg_aero, ccm, & |
---|
110 | rfname, & |
---|
111 | d_tr_dyn, & ! RomP |
---|
112 | tr_seri, init_source) |
---|
113 | |
---|
114 | !====================================================================== |
---|
115 | ! Auteur(s) FH |
---|
116 | ! Objet: Moniteur general des tendances traceurs |
---|
117 | ! Modification R. Pilon 01 janvier 2012 transport+scavenging KE scheme : cvltr |
---|
118 | ! Modification R. Pilon 10 octobre 2012 large scale scavenging incloud_scav + bc_scav |
---|
119 | !====================================================================== |
---|
120 | |
---|
121 | USE ioipsl |
---|
122 | USE phys_cal_mod, ONLY: hour |
---|
123 | USE dimphy |
---|
124 | USE infotrac_phy, ONLY: nbtr, nqCO2, type_trac, conv_flg, pbl_flg |
---|
125 | USE strings_mod, ONLY: int2str |
---|
126 | USE lmdz_grid_phy |
---|
127 | USE lmdz_phys_para |
---|
128 | USE iophy |
---|
129 | USE traclmdz_mod |
---|
130 | USE tracinca_mod |
---|
131 | USE tracreprobus_mod |
---|
132 | USE indice_sol_mod |
---|
133 | USE lmdz_phys_mpi_data, ONLY: is_mpi_root |
---|
134 | USE print_control_mod, ONLY: lunout |
---|
135 | USE aero_mod, ONLY: naero_grp |
---|
136 | USE lmdz_thermcell_dq, ONLY: thermcell_dq |
---|
137 | |
---|
138 | USE tracco2i_mod |
---|
139 | |
---|
140 | USE traccoag_mod |
---|
141 | USE phys_local_var_mod, ONLY: mdw |
---|
142 | USE phys_local_var_mod, ONLY: budg_dep_dry_ocs, budg_dep_wet_ocs |
---|
143 | USE phys_local_var_mod, ONLY: budg_dep_dry_so2, budg_dep_wet_so2 |
---|
144 | USE phys_local_var_mod, ONLY: budg_dep_dry_h2so4, budg_dep_wet_h2so4 |
---|
145 | USE phys_local_var_mod, ONLY: budg_dep_dry_part, budg_dep_wet_part |
---|
146 | USE infotrac_phy, ONLY: nbtr_sulgas, id_OCS_strat, id_SO2_strat, id_H2SO4_strat |
---|
147 | USE strataer_nuc_mod, ONLY: tracstrataer_init |
---|
148 | USE aerophys |
---|
149 | USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_STRATAER |
---|
150 | USE lmdz_yomcst |
---|
151 | |
---|
152 | IMPLICIT NONE |
---|
153 | |
---|
154 | INCLUDE "clesphys.h" |
---|
155 | !========================================================================== |
---|
156 | ! -- ARGUMENT DESCRIPTION -- |
---|
157 | !========================================================================== |
---|
158 | |
---|
159 | ! Input arguments |
---|
160 | !---------------- |
---|
161 | !Configuration grille,temps: |
---|
162 | INTEGER, INTENT(IN) :: nstep ! Appel physique |
---|
163 | INTEGER, INTENT(IN) :: julien ! Jour julien |
---|
164 | REAL, INTENT(IN) :: gmtime ! Heure courante |
---|
165 | REAL, INTENT(IN) :: pdtphys ! Pas d'integration pour la physique (seconde) |
---|
166 | LOGICAL, INTENT(IN) :: debutphy ! le flag de l'initialisation de la physique |
---|
167 | LOGICAL, INTENT(IN) :: lafin ! le flag de la fin de la physique |
---|
168 | |
---|
169 | REAL, DIMENSION(klon), INTENT(IN) :: xlat ! latitudes pour chaque point |
---|
170 | REAL, DIMENSION(klon), INTENT(IN) :: xlon ! longitudes pour chaque point |
---|
171 | |
---|
172 | !Physique: |
---|
173 | !-------- |
---|
174 | REAL, DIMENSION(klon, klev), INTENT(IN) :: t_seri ! Temperature |
---|
175 | REAL, DIMENSION(klon, klev), INTENT(IN) :: u ! variable not used |
---|
176 | REAL, DIMENSION(klon, klev), INTENT(IN) :: v ! variable not used |
---|
177 | REAL, DIMENSION(klon, klev), INTENT(IN) :: sh ! humidite specifique |
---|
178 | REAL, DIMENSION(klon, klev), INTENT(IN) :: rh ! humidite relative |
---|
179 | REAL, DIMENSION(klon, klev), INTENT(IN) :: ch ! eau liquide (+ glace si le traceur existe) |
---|
180 | REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: paprs ! pression pour chaque inter-couche (en Pa) |
---|
181 | REAL, DIMENSION(klon, klev), INTENT(IN) :: pplay ! pression pour le mileu de chaque couche (en Pa) |
---|
182 | REAL, DIMENSION(klon, klev), INTENT(IN) :: pphi ! geopotentiel |
---|
183 | REAL, DIMENSION(klon), INTENT(IN) :: pphis |
---|
184 | REAL, DIMENSION(klev), INTENT(IN) :: presnivs |
---|
185 | REAL, DIMENSION(klon, klev), INTENT(IN) :: cldliq ! eau condensee totale |
---|
186 | REAL, DIMENSION(klon, klev), INTENT(IN) :: cldfra ! fraction nuageuse (tous les nuages) |
---|
187 | REAL, DIMENSION(klon, klev), INTENT(IN) :: diafra ! fraction nuageuse (convection ou stratus artificiels) |
---|
188 | REAL, DIMENSION(klon, klev), INTENT(IN) :: rneb ! fraction nuageuse (grande echelle) |
---|
189 | |
---|
190 | REAL :: ql_incl ! contenu en eau liquide nuageuse dans le nuage ! ql_incl=oliq/rneb |
---|
191 | REAL, DIMENSION(klon, klev), INTENT(IN) :: beta_fisrt ! taux de conversion de l'eau cond (de fisrtilp) |
---|
192 | REAL, DIMENSION(klon, klev), INTENT(out) :: beta_v1 ! -- (originale version) |
---|
193 | |
---|
194 | INTEGER, DIMENSION(klon), INTENT(IN) :: itop_con |
---|
195 | INTEGER, DIMENSION(klon), INTENT(IN) :: ibas_con |
---|
196 | REAL, DIMENSION(klon), INTENT(IN) :: albsol ! albedo surface |
---|
197 | |
---|
198 | !Dynamique |
---|
199 | !-------- |
---|
200 | REAL, DIMENSION(klon, klev, nbtr), INTENT(IN) :: d_tr_dyn |
---|
201 | |
---|
202 | !Convection: |
---|
203 | !---------- |
---|
204 | REAL, DIMENSION(klon, klev), INTENT(IN) :: pmfu ! flux de masse dans le panache montant |
---|
205 | REAL, DIMENSION(klon, klev), INTENT(IN) :: pmfd ! flux de masse dans le panache descendant |
---|
206 | REAL, DIMENSION(klon, klev), INTENT(IN) :: pen_u ! flux entraine dans le panache montant |
---|
207 | REAL, DIMENSION(klon, klev), INTENT(IN) :: pde_u ! flux detraine dans le panache montant |
---|
208 | REAL, DIMENSION(klon, klev), INTENT(IN) :: pen_d ! flux entraine dans le panache descendant |
---|
209 | REAL, DIMENSION(klon, klev), INTENT(IN) :: pde_d ! flux detraine dans le panache descendant |
---|
210 | |
---|
211 | !...Tiedke |
---|
212 | REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: pmflxr, pmflxs ! Flux precipitant de pluie, neige aux interfaces [convection] |
---|
213 | REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: prfl, psfl ! Flux precipitant de pluie, neige aux interfaces [large-scale] |
---|
214 | |
---|
215 | LOGICAL, INTENT(IN) :: aerosol_couple |
---|
216 | REAL, DIMENSION(klon, klev), INTENT(IN) :: flxmass_w |
---|
217 | REAL, DIMENSION(klon, klev, naero_grp, 2), INTENT(IN) :: tau_aero |
---|
218 | REAL, DIMENSION(klon, klev, naero_grp, 2), INTENT(IN) :: piz_aero |
---|
219 | REAL, DIMENSION(klon, klev, naero_grp, 2), INTENT(IN) :: cg_aero |
---|
220 | CHARACTER(len = 4), DIMENSION(naero_grp), INTENT(IN) :: rfname |
---|
221 | REAL, DIMENSION(klon, klev, 2), INTENT(IN) :: ccm |
---|
222 | !... K.Emanuel |
---|
223 | REAL, DIMENSION(klon, klev), INTENT(IN) :: da |
---|
224 | REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: phi |
---|
225 | ! RomP >>> |
---|
226 | REAL, DIMENSION(klon, klev), INTENT(IN) :: d1a, dam |
---|
227 | REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: phi2 |
---|
228 | |
---|
229 | REAL, DIMENSION(klon, klev), INTENT(IN) :: wdtrainA |
---|
230 | REAL, DIMENSION(klon, klev), INTENT(IN) :: wdtrainM |
---|
231 | REAL, DIMENSION(klon), INTENT(IN) :: sigd |
---|
232 | ! ---- RomP flux entraine, detraine et precipitant kerry Emanuel |
---|
233 | REAL, DIMENSION(klon, klev), INTENT(IN) :: evap |
---|
234 | REAL, DIMENSION(klon, klev), INTENT(IN) :: ep |
---|
235 | REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: sij |
---|
236 | REAL, DIMENSION(klon, klev), INTENT(IN) :: wght_cvfd !RL |
---|
237 | REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: elij |
---|
238 | REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: epmlmMm |
---|
239 | REAL, DIMENSION(klon, klev), INTENT(IN) :: eplaMm |
---|
240 | REAL, DIMENSION(klon, klev), INTENT(IN) :: clw |
---|
241 | ! RomP <<< |
---|
242 | |
---|
243 | REAL, DIMENSION(klon, klev), INTENT(IN) :: mp |
---|
244 | REAL, DIMENSION(klon, klev), INTENT(IN) :: upwd ! saturated updraft mass flux |
---|
245 | REAL, DIMENSION(klon, klev), INTENT(IN) :: dnwd ! saturated downdraft mass flux |
---|
246 | |
---|
247 | !Thermiques: |
---|
248 | !---------- |
---|
249 | REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: fm_therm |
---|
250 | REAL, DIMENSION(klon, klev), INTENT(INOUT) :: entr_therm |
---|
251 | |
---|
252 | !Couche limite: |
---|
253 | !-------------- |
---|
254 | |
---|
255 | REAL, DIMENSION(:), INTENT(IN) :: cdragh ! (klon) coeff drag pour T et Q |
---|
256 | REAL, DIMENSION(:, :), INTENT(IN) :: coefh ! (klon,klev) coeff melange CL (m**2/s) |
---|
257 | REAL, DIMENSION(:), INTENT(IN) :: ustar, u10m, v10m ! (klon) u* & vent a 10m (m/s) |
---|
258 | REAL, DIMENSION(:), INTENT(IN) :: wstar, ale_bl, ale_wake ! (klon) w* and Avail. Lifting Ener. |
---|
259 | REAL, DIMENSION(:), INTENT(IN) :: yu1 ! (klon) vents au premier niveau |
---|
260 | REAL, DIMENSION(:), INTENT(IN) :: yv1 ! (klon) vents au premier niveau |
---|
261 | |
---|
262 | !Lessivage: |
---|
263 | !---------- |
---|
264 | |
---|
265 | REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ccntrAA |
---|
266 | REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ccntrENV |
---|
267 | REAL, DIMENSION(:), ALLOCATABLE, SAVE :: coefcoli |
---|
268 | LOGICAL, DIMENSION(:), ALLOCATABLE, SAVE :: flag_cvltr |
---|
269 | !$OMP THREADPRIVATE(ccntrAA,ccntrENV,coefcoli,flag_cvltr) |
---|
270 | REAL, DIMENSION(klon, klev) :: ccntrAA_3d |
---|
271 | REAL, DIMENSION(klon, klev) :: ccntrENV_3d |
---|
272 | REAL, DIMENSION(klon, klev) :: coefcoli_3d |
---|
273 | |
---|
274 | ! pour le ON-LINE |
---|
275 | |
---|
276 | REAL, DIMENSION(klon, klev), INTENT(IN) :: frac_impa ! fraction d'aerosols non impactes |
---|
277 | REAL, DIMENSION(klon, klev), INTENT(IN) :: frac_nucl ! fraction d'aerosols non nuclees |
---|
278 | |
---|
279 | ! Arguments necessaires pour les sources et puits de traceur: |
---|
280 | REAL, DIMENSION(klon, nbsrf), INTENT(IN) :: ftsol ! Temperature du sol (surf)(Kelvin) |
---|
281 | REAL, DIMENSION(klon, nbsrf), INTENT(IN) :: pctsrf ! Pourcentage de sol (nature du sol) |
---|
282 | |
---|
283 | REAL, DIMENSION(klon) :: v_dep_dry !dry deposition velocity of stratospheric sulfate in m/s |
---|
284 | ! Output argument |
---|
285 | !---------------- |
---|
286 | REAL, DIMENSION(klon, klev, nbtr), INTENT(INOUT) :: tr_seri ! Concentration Traceur [U/KgA] |
---|
287 | REAL, DIMENSION(klon, klev) :: sourceBE |
---|
288 | REAL, DIMENSION(klon, nbtr), INTENT(IN) :: init_source |
---|
289 | |
---|
290 | !======================================================================================= |
---|
291 | ! -- LOCAL VARIABLES -- |
---|
292 | !======================================================================================= |
---|
293 | |
---|
294 | INTEGER :: i, k, it |
---|
295 | INTEGER :: nsplit |
---|
296 | |
---|
297 | !Sources et Reservoirs de traceurs (ex:Radon): |
---|
298 | !-------------------------------------------- |
---|
299 | |
---|
300 | REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: source ! a voir lorsque le flux de surface est prescrit |
---|
301 | !$OMP THREADPRIVATE(source) |
---|
302 | |
---|
303 | !Entrees/Sorties: |
---|
304 | !--------------- |
---|
305 | INTEGER :: iiq, ierr |
---|
306 | INTEGER :: nhori, nvert |
---|
307 | REAL :: zsto, zout, zjulian |
---|
308 | INTEGER, SAVE :: nid_tra ! pointe vers le fichier histrac.nc |
---|
309 | !$OMP THREADPRIVATE(nid_tra) |
---|
310 | REAL, DIMENSION(klon) :: zx_tmp_fi2d ! variable temporaire grille physique |
---|
311 | INTEGER :: itau_w ! pas de temps ecriture = nstep + itau_phy |
---|
312 | LOGICAL, PARAMETER :: ok_sync = .TRUE. |
---|
313 | |
---|
314 | ! Nature du traceur |
---|
315 | !------------------ |
---|
316 | LOGICAL, DIMENSION(:), ALLOCATABLE, SAVE :: aerosol ! aerosol(it) = true => aerosol => lessivage |
---|
317 | !$OMP THREADPRIVATE(aerosol) ! aerosol(it) = false => gaz |
---|
318 | REAL, DIMENSION(klon, klev) :: delp ! epaisseur de couche (Pa) |
---|
319 | |
---|
320 | ! Tendances de traceurs (Td) et flux de traceurs: |
---|
321 | !------------------------ |
---|
322 | REAL, DIMENSION(klon, klev) :: d_tr ! Td dans l'atmosphere |
---|
323 | REAL, DIMENSION(klon, klev) :: Mint |
---|
324 | REAL, DIMENSION(klon, klev, nbtr) :: zmfd1a |
---|
325 | REAL, DIMENSION(klon, klev, nbtr) :: zmfdam |
---|
326 | REAL, DIMENSION(klon, klev, nbtr) :: zmfphi2 |
---|
327 | ! Physique |
---|
328 | !---------- |
---|
329 | REAL, DIMENSION(klon, klev, nbtr) :: flestottr ! flux de lessivage dans chaque couche |
---|
330 | REAL, DIMENSION(klon, klev) :: zmasse ! densite atmospherique Kg/m2 |
---|
331 | REAL, DIMENSION(klon, klev) :: ztra_th |
---|
332 | !PhH |
---|
333 | REAL, DIMENSION(klon, klev) :: zrho |
---|
334 | REAL, DIMENSION(klon, klev) :: zdz |
---|
335 | REAL :: evaplsc, dx, beta ! variable pour lessivage Genthon |
---|
336 | REAL, DIMENSION(klon) :: his_dh ! --- |
---|
337 | ! in-cloud scav variables |
---|
338 | REAL :: ql_incloud_ref ! ref value of in-cloud condensed water content |
---|
339 | |
---|
340 | !Controles: |
---|
341 | !--------- |
---|
342 | INTEGER, SAVE :: iflag_vdf_trac, iflag_con_trac, iflag_the_trac |
---|
343 | INTEGER, SAVE :: iflag_con_trac_omp, iflag_vdf_trac_omp, iflag_the_trac_omp |
---|
344 | !$OMP THREADPRIVATE(iflag_vdf_trac,iflag_con_trac,iflag_the_trac) |
---|
345 | |
---|
346 | LOGICAL, SAVE :: lessivage |
---|
347 | !$OMP THREADPRIVATE(lessivage) |
---|
348 | |
---|
349 | !RomP >>> |
---|
350 | INTEGER, SAVE :: iflag_lscav_omp, iflag_lscav |
---|
351 | REAL, SAVE :: ccntrAA_in, ccntrAA_omp |
---|
352 | REAL, SAVE :: ccntrENV_in, ccntrENV_omp |
---|
353 | REAL, SAVE :: coefcoli_in, coefcoli_omp |
---|
354 | |
---|
355 | LOGICAL, SAVE :: convscav_omp, convscav |
---|
356 | !$OMP THREADPRIVATE(iflag_lscav) |
---|
357 | !$OMP THREADPRIVATE(ccntrAA_in,ccntrENV_in,coefcoli_in) |
---|
358 | !$OMP THREADPRIVATE(convscav) |
---|
359 | !RomP <<< |
---|
360 | !###################################################################### |
---|
361 | ! -- INITIALIZATION -- |
---|
362 | !###################################################################### |
---|
363 | |
---|
364 | DO k = 1, klev |
---|
365 | DO i = 1, klon |
---|
366 | sourceBE(i, k) = 0. |
---|
367 | Mint(i, k) = 0. |
---|
368 | zrho(i, k) = 0. |
---|
369 | zdz(i, k) = 0. |
---|
370 | ENDDO |
---|
371 | ENDDO |
---|
372 | |
---|
373 | DO it = 1, nbtr |
---|
374 | DO k = 1, klev |
---|
375 | DO i = 1, klon |
---|
376 | d_tr_insc(i, k, it) = 0. |
---|
377 | d_tr_bcscav(i, k, it) = 0. |
---|
378 | d_tr_evapls(i, k, it) = 0. |
---|
379 | d_tr_ls(i, k, it) = 0. |
---|
380 | d_tr_cv(i, k, it) = 0. |
---|
381 | d_tr_cl(i, k, it) = 0. |
---|
382 | d_tr_trsp(i, k, it) = 0. |
---|
383 | d_tr_sscav(i, k, it) = 0. |
---|
384 | d_tr_sat(i, k, it) = 0. |
---|
385 | d_tr_uscav(i, k, it) = 0. |
---|
386 | d_tr_lessi_impa(i, k, it) = 0. |
---|
387 | d_tr_lessi_nucl(i, k, it) = 0. |
---|
388 | qDi(i, k, it) = 0. |
---|
389 | qPr(i, k, it) = 0. |
---|
390 | qPa(i, k, it) = 0. |
---|
391 | qMel(i, k, it) = 0. |
---|
392 | qTrdi(i, k, it) = 0. |
---|
393 | dtrcvMA(i, k, it) = 0. |
---|
394 | zmfd1a(i, k, it) = 0. |
---|
395 | zmfdam(i, k, it) = 0. |
---|
396 | zmfphi2(i, k, it) = 0. |
---|
397 | ENDDO |
---|
398 | ENDDO |
---|
399 | ENDDO |
---|
400 | |
---|
401 | DO it = 1, nbtr |
---|
402 | DO i = 1, klon |
---|
403 | d_tr_dry(i, it) = 0. |
---|
404 | flux_tr_dry(i, it) = 0. |
---|
405 | ENDDO |
---|
406 | ENDDO |
---|
407 | |
---|
408 | DO k = 1, klev |
---|
409 | DO i = 1, klon |
---|
410 | delp(i, k) = paprs(i, k) - paprs(i, k + 1) |
---|
411 | ENDDO |
---|
412 | ENDDO |
---|
413 | |
---|
414 | IF (debutphy) THEN |
---|
415 | !!jyg |
---|
416 | !$OMP BARRIER |
---|
417 | ecrit_tra = 86400. ! frequence de stokage en dur |
---|
418 | ! obsolete car remplace par des ecritures dans phys_output_write |
---|
419 | !RomP >>> |
---|
420 | |
---|
421 | !Config Key = convscav |
---|
422 | !Config Desc = Convective scavenging switch: 0=off, 1=on. |
---|
423 | !Config Def = .FALSE. |
---|
424 | !Config Help = |
---|
425 | |
---|
426 | !$OMP MASTER |
---|
427 | convscav_omp = .FALSE. |
---|
428 | CALL getin('convscav', convscav_omp) |
---|
429 | iflag_vdf_trac_omp = 1 |
---|
430 | CALL getin('iflag_vdf_trac', iflag_vdf_trac_omp) |
---|
431 | iflag_con_trac_omp = 1 |
---|
432 | CALL getin('iflag_con_trac', iflag_con_trac_omp) |
---|
433 | iflag_the_trac_omp = 1 |
---|
434 | CALL getin('iflag_the_trac', iflag_the_trac_omp) |
---|
435 | !$OMP END MASTER |
---|
436 | !$OMP BARRIER |
---|
437 | convscav = convscav_omp |
---|
438 | iflag_vdf_trac = iflag_vdf_trac_omp |
---|
439 | iflag_con_trac = iflag_con_trac_omp |
---|
440 | iflag_the_trac = iflag_the_trac_omp |
---|
441 | write(lunout, *) 'phytrac passage dans routine conv avec lessivage', convscav |
---|
442 | |
---|
443 | !Config Key = iflag_lscav |
---|
444 | !Config Desc = Large scale scavenging parametrization: 0=none, 1=old(Genthon92), |
---|
445 | ! 2=1+PHeinrich, 3=Reddy_Boucher2004, 4=3+RPilon. |
---|
446 | !Config Def = 1 |
---|
447 | !Config Help = |
---|
448 | |
---|
449 | !$OMP MASTER |
---|
450 | iflag_lscav_omp = 1 |
---|
451 | CALL getin('iflag_lscav', iflag_lscav_omp) |
---|
452 | ccntrAA_omp = 1 |
---|
453 | ccntrENV_omp = 1. |
---|
454 | coefcoli_omp = 0.001 |
---|
455 | CALL getin('ccntrAA', ccntrAA_omp) |
---|
456 | CALL getin('ccntrENV', ccntrENV_omp) |
---|
457 | CALL getin('coefcoli', coefcoli_omp) |
---|
458 | !$OMP END MASTER |
---|
459 | !$OMP BARRIER |
---|
460 | iflag_lscav = iflag_lscav_omp |
---|
461 | ccntrAA_in = ccntrAA_omp |
---|
462 | ccntrENV_in = ccntrENV_omp |
---|
463 | coefcoli_in = coefcoli_omp |
---|
464 | |
---|
465 | SELECT CASE(iflag_lscav) |
---|
466 | CASE(0) |
---|
467 | WRITE(lunout, *) 'Large scale scavenging: none' |
---|
468 | CASE(1) |
---|
469 | WRITE(lunout, *) 'Large scale scavenging: C. Genthon, Tellus(1992), 44B, 371-389' |
---|
470 | CASE(2) |
---|
471 | WRITE(lunout, *) 'Large scale scavenging: C. Genthon, modified P. Heinrich' |
---|
472 | CASE(3) |
---|
473 | WRITE(lunout, *) 'Large scale scavenging: M. Shekkar Reddy and O. Boucher, JGR(2004), 109, D14202' |
---|
474 | CASE(4) |
---|
475 | WRITE(lunout, *) 'Large scale scavenging: Reddy and Boucher, modified R. Pilon' |
---|
476 | END SELECT |
---|
477 | !RomP <<< |
---|
478 | WRITE(*, *) 'FIRST TIME IN PHYTRAC : pdtphys(sec) = ', pdtphys, 'ecrit_tra (sec) = ', ecrit_tra |
---|
479 | ALLOCATE(source(klon, nbtr), stat = ierr) |
---|
480 | IF (ierr /= 0) CALL abort_physic('phytrac', 'pb in allocation 1', 1) |
---|
481 | |
---|
482 | ALLOCATE(aerosol(nbtr), stat = ierr) |
---|
483 | IF (ierr /= 0) CALL abort_physic('phytrac', 'pb in allocation 2', 1) |
---|
484 | |
---|
485 | |
---|
486 | ! Initialize module for specific tracers |
---|
487 | IF (type_trac == 'inca') THEN |
---|
488 | source(:, :) = init_source(:, :) |
---|
489 | CALL tracinca_init(aerosol, lessivage) |
---|
490 | ELSE IF (type_trac == 'repr') THEN |
---|
491 | source(:, :) = 0. |
---|
492 | ELSE IF (type_trac == 'co2i') THEN |
---|
493 | source(:, :) = 0. |
---|
494 | lessivage = .FALSE. |
---|
495 | aerosol(:) = .FALSE. |
---|
496 | pbl_flg(:) = 1 |
---|
497 | iflag_the_trac = 1 |
---|
498 | iflag_vdf_trac = 1 |
---|
499 | iflag_con_trac = 1 |
---|
500 | ELSE IF (type_trac == 'inco') THEN |
---|
501 | source(:, 1:nqCO2) = 0. ! from CO2i ModThL |
---|
502 | source(:, nqCO2 + 1:nbtr) = init_source(:, :) ! from INCA ModThL |
---|
503 | aerosol(1:nqCO2) = .FALSE. ! from CO2i ModThL |
---|
504 | CALL tracinca_init(aerosol(nqCO2 + 1:nbtr), lessivage) ! from INCA ModThL |
---|
505 | pbl_flg(1:nqCO2) = 1 ! From CO2i ModThL |
---|
506 | iflag_the_trac = 1 ! From CO2i |
---|
507 | iflag_vdf_trac = 1 ! From CO2i |
---|
508 | iflag_con_trac = 1 ! From CO2i |
---|
509 | ELSE IF (type_trac == 'coag' .AND. CPPKEY_STRATAER) THEN |
---|
510 | source(:, :) = 0. |
---|
511 | CALL tracstrataer_init(aerosol, lessivage) ! init aerosols and lessivage param |
---|
512 | ELSE IF (type_trac == 'lmdz') THEN |
---|
513 | CALL traclmdz_init(pctsrf, xlat, xlon, ftsol, tr_seri, t_seri, pplay, sh, pdtphys, aerosol, lessivage) |
---|
514 | ENDIF |
---|
515 | |
---|
516 | !--initialising coefficients for scavenging in the case of NP |
---|
517 | |
---|
518 | ALLOCATE(flag_cvltr(nbtr)) |
---|
519 | IF (iflag_con==3) THEN |
---|
520 | |
---|
521 | ALLOCATE(ccntrAA(nbtr)) |
---|
522 | ALLOCATE(ccntrENV(nbtr)) |
---|
523 | ALLOCATE(coefcoli(nbtr)) |
---|
524 | |
---|
525 | DO it = 1, nbtr |
---|
526 | IF (type_trac == 'repr') THEN |
---|
527 | flag_cvltr(it) = .FALSE. |
---|
528 | ELSE IF (type_trac == 'inca') THEN |
---|
529 | ! IF ((it.EQ.id_Rn222) .OR. ((it.GE.id_SO2) .AND. (it.LE.id_NH3)) ) THEN |
---|
530 | ! !--gas-phase species |
---|
531 | ! flag_cvltr(it)=.FALSE. |
---|
532 | |
---|
533 | ! ELSEIF ( (it.GE.id_CIDUSTM) .AND. (it.LE.id_AIN) ) THEN |
---|
534 | ! !--insoluble aerosol species |
---|
535 | ! flag_cvltr(it)=.TRUE. |
---|
536 | ! ccntrAA(it)=0.7 |
---|
537 | ! ccntrENV(it)=0.7 |
---|
538 | ! coefcoli(it)=0.001 |
---|
539 | ! ELSEIF ( (it.EQ.id_Pb210) .OR. ((it.GE.id_CSSSM) .AND. (it.LE.id_SSN))) THEN |
---|
540 | ! !--soluble aerosol species |
---|
541 | ! flag_cvltr(it)=.TRUE. |
---|
542 | ! ccntrAA(it)=0.9 |
---|
543 | ! ccntrENV(it)=0.9 |
---|
544 | ! coefcoli(it)=0.001 |
---|
545 | ! ELSE |
---|
546 | ! WRITE(lunout,*) 'pb it=', it |
---|
547 | ! CALL abort_physic('phytrac','pb it scavenging',1) |
---|
548 | ! ENDIF |
---|
549 | !--test OB |
---|
550 | !--for now we do not scavenge in cvltr |
---|
551 | flag_cvltr(it) = .FALSE. |
---|
552 | ELSE IF (type_trac == 'co2i') THEN |
---|
553 | !--co2 tracers are not scavenged |
---|
554 | flag_cvltr(it) = .FALSE. |
---|
555 | ELSE IF (type_trac == 'inco') THEN ! Add ThL |
---|
556 | flag_cvltr(it) = .FALSE. |
---|
557 | ELSE IF (type_trac == 'coag' .AND. CPPKEY_STRATAER) THEN |
---|
558 | IF (convscav.and.aerosol(it)) THEN |
---|
559 | flag_cvltr(it) = .TRUE. |
---|
560 | ccntrAA(it) = ccntrAA_in |
---|
561 | ccntrENV(it) = ccntrENV_in |
---|
562 | coefcoli(it) = coefcoli_in |
---|
563 | ELSE |
---|
564 | flag_cvltr(it) = .FALSE. |
---|
565 | ENDIF |
---|
566 | ELSE IF (type_trac == 'lmdz') THEN |
---|
567 | IF (convscav.and.aerosol(it)) THEN |
---|
568 | flag_cvltr(it) = .TRUE. |
---|
569 | ccntrAA(it) = ccntrAA_in !--a modifier par JYG a lire depuis fichier |
---|
570 | ccntrENV(it) = ccntrENV_in |
---|
571 | coefcoli(it) = coefcoli_in |
---|
572 | ELSE |
---|
573 | flag_cvltr(it) = .FALSE. |
---|
574 | ENDIF |
---|
575 | ENDIF |
---|
576 | ENDDO |
---|
577 | |
---|
578 | ELSE ! iflag_con .ne. 3 |
---|
579 | flag_cvltr(:) = .FALSE. |
---|
580 | ENDIF |
---|
581 | |
---|
582 | ! print out all tracer flags |
---|
583 | |
---|
584 | WRITE(lunout, *) 'print out all tracer flags' |
---|
585 | WRITE(lunout, *) 'type_trac =', type_trac |
---|
586 | WRITE(lunout, *) 'config_inca =', config_inca |
---|
587 | WRITE(lunout, *) 'iflag_con_trac =', iflag_con_trac |
---|
588 | WRITE(lunout, *) 'iflag_con =', iflag_con |
---|
589 | WRITE(lunout, *) 'convscav =', convscav |
---|
590 | WRITE(lunout, *) 'iflag_lscav =', iflag_lscav |
---|
591 | WRITE(lunout, *) 'aerosol =', aerosol |
---|
592 | WRITE(lunout, *) 'iflag_the_trac =', iflag_the_trac |
---|
593 | WRITE(lunout, *) 'iflag_thermals =', iflag_thermals |
---|
594 | WRITE(lunout, *) 'iflag_vdf_trac =', iflag_vdf_trac |
---|
595 | WRITE(lunout, *) 'pbl_flg =', pbl_flg |
---|
596 | WRITE(lunout, *) 'lessivage =', lessivage |
---|
597 | write(lunout, *) 'flag_cvltr = ', flag_cvltr |
---|
598 | |
---|
599 | IF (lessivage .AND. ANY(type_trac == ['inca', 'inco'])) & |
---|
600 | CALL abort_physic('phytrac', 'lessivage=T config_inca=inca impossible', 1) |
---|
601 | |
---|
602 | ENDIF ! of IF (debutphy) |
---|
603 | !############################################ END INITIALIZATION ####### |
---|
604 | |
---|
605 | DO k = 1, klev |
---|
606 | DO i = 1, klon |
---|
607 | zmasse(i, k) = (paprs(i, k) - paprs(i, k + 1)) / rg |
---|
608 | ENDDO |
---|
609 | ENDDO |
---|
610 | |
---|
611 | IF (id_be > 0) THEN |
---|
612 | DO k = 1, klev |
---|
613 | DO i = 1, klon |
---|
614 | sourceBE(i, k) = srcbe(i, k) !RomP -> pour sortie histrac |
---|
615 | ENDDO |
---|
616 | ENDDO |
---|
617 | ENDIF |
---|
618 | |
---|
619 | !=============================================================================== |
---|
620 | ! -- Do specific treatment according to chemestry model or local LMDZ tracers |
---|
621 | |
---|
622 | !=============================================================================== |
---|
623 | IF (type_trac == 'inca') THEN |
---|
624 | ! -- CHIMIE INCA config_inca = aero or chem -- |
---|
625 | ! Appel fait en fin de phytrac pour avoir les emissions modifiees par |
---|
626 | ! la couche limite et la convection avant le calcul de la chimie |
---|
627 | |
---|
628 | ELSE IF (type_trac == 'repr') THEN |
---|
629 | ! -- CHIMIE REPROBUS -- |
---|
630 | CALL tracreprobus(pdtphys, gmtime, debutphy, julien, & |
---|
631 | presnivs, xlat, xlon, pphis, pphi, & |
---|
632 | t_seri, pplay, paprs, sh, & |
---|
633 | tr_seri) |
---|
634 | |
---|
635 | ELSE IF (type_trac == 'co2i') THEN |
---|
636 | ! -- CO2 interactif -- |
---|
637 | ! -- source is updated with FF and BB emissions |
---|
638 | ! -- and net fluxes from ocean and orchidee |
---|
639 | ! -- sign convention : positive into the atmosphere |
---|
640 | |
---|
641 | CALL tracco2i(pdtphys, debutphy, & |
---|
642 | xlat, xlon, pphis, pphi, & |
---|
643 | t_seri, pplay, paprs, tr_seri, source) |
---|
644 | ELSE IF (type_trac == 'inco') THEN ! Add ThL |
---|
645 | CALL tracco2i(pdtphys, debutphy, & |
---|
646 | xlat, xlon, pphis, pphi, & |
---|
647 | t_seri, pplay, paprs, tr_seri, source) |
---|
648 | |
---|
649 | ELSE IF (type_trac == 'coag' .AND. CPPKEY_STRATAER) THEN |
---|
650 | ! --STRATOSPHERIC AER IN THE STRAT -- |
---|
651 | CALL traccoag(pdtphys, gmtime, debutphy, julien, & |
---|
652 | presnivs, xlat, xlon, pphis, pphi, & |
---|
653 | t_seri, pplay, paprs, sh, rh, & |
---|
654 | tr_seri) |
---|
655 | ELSE IF (type_trac == 'lmdz') THEN |
---|
656 | ! -- Traitement des traceurs avec traclmdz |
---|
657 | CALL traclmdz(nstep, julien, gmtime, pdtphys, t_seri, paprs, pplay, & |
---|
658 | cdragh, coefh, yu1, yv1, ftsol, pctsrf, xlat, xlon, iflag_vdf_trac>=0, sh, & |
---|
659 | rh, pphi, ustar, wstar, ale_bl, ale_wake, u10m, v10m, & |
---|
660 | tr_seri, source, d_tr_cl, d_tr_dec, zmasse) !RomP |
---|
661 | ENDIF |
---|
662 | !====================================================================== |
---|
663 | ! -- Calcul de l'effet de la convection -- |
---|
664 | !====================================================================== |
---|
665 | |
---|
666 | IF (iflag_con_trac==1) THEN |
---|
667 | |
---|
668 | DO it = 1, nbtr |
---|
669 | IF (conv_flg(it) == 0) CYCLE |
---|
670 | IF (iflag_con<2) THEN |
---|
671 | !--pas de transport convectif |
---|
672 | d_tr_cv(:, :, it) = 0. |
---|
673 | |
---|
674 | ELSE IF (iflag_con==2) THEN |
---|
675 | !--ancien transport convectif de Tiedtke |
---|
676 | |
---|
677 | CALL nflxtr(pdtphys, pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, & |
---|
678 | pplay, paprs, tr_seri(:, :, it), d_tr_cv(:, :, it)) |
---|
679 | ELSE |
---|
680 | !--nouveau transport convectif de Emanuel |
---|
681 | |
---|
682 | IF (flag_cvltr(it)) THEN |
---|
683 | !--nouveau transport convectif de Emanuel avec lessivage convectif |
---|
684 | |
---|
685 | |
---|
686 | ccntrAA_3d(:, :) = ccntrAA(it) |
---|
687 | ccntrENV_3d(:, :) = ccntrENV(it) |
---|
688 | coefcoli_3d(:, :) = coefcoli(it) |
---|
689 | |
---|
690 | !--beware this interface is a bit weird because it is called for each tracer |
---|
691 | !--with the full array tr_seri even if only item it is processed |
---|
692 | |
---|
693 | CALL cvltr_scav(pdtphys, da, phi, phi2, d1a, dam, mp, ep, & |
---|
694 | sigd, sij, wght_cvfd, clw, elij, epmlmMm, eplaMm, & |
---|
695 | pmflxr, pmflxs, evap, t_seri, wdtrainA, wdtrainM, & |
---|
696 | paprs, it, tr_seri, upwd, dnwd, itop_con, ibas_con, & |
---|
697 | ccntrAA_3d, ccntrENV_3d, coefcoli_3d, & |
---|
698 | d_tr_cv, d_tr_trsp, d_tr_sscav, d_tr_sat, d_tr_uscav, qDi, qPr, & |
---|
699 | qPa, qMel, qTrdi, dtrcvMA, Mint, & |
---|
700 | zmfd1a, zmfphi2, zmfdam) |
---|
701 | |
---|
702 | ELSE !---flag_cvltr(it).EQ.FALSE |
---|
703 | !--nouveau transport convectif de Emanuel mais pas de lessivage convectif |
---|
704 | |
---|
705 | !--beware this interface is a bit weird because it is called for each tracer |
---|
706 | !--with the full array tr_seri even if only item it is processed |
---|
707 | |
---|
708 | CALL cvltr_noscav(it, pdtphys, da, phi, mp, wght_cvfd, paprs, pplay, & !jyg |
---|
709 | tr_seri, upwd, dnwd, d_tr_cv) !jyg |
---|
710 | |
---|
711 | ENDIF |
---|
712 | |
---|
713 | ENDIF !--iflag |
---|
714 | |
---|
715 | !--on ajoute les tendances |
---|
716 | |
---|
717 | DO k = 1, klev |
---|
718 | DO i = 1, klon |
---|
719 | tr_seri(i, k, it) = tr_seri(i, k, it) + d_tr_cv(i, k, it) |
---|
720 | ENDDO |
---|
721 | ENDDO |
---|
722 | |
---|
723 | CALL minmaxqfi(tr_seri(:, :, it), 0., 1.e33, 'convection it = ' // TRIM(int2str(it))) |
---|
724 | |
---|
725 | ENDDO ! nbtr |
---|
726 | |
---|
727 | IF (CPPKEY_STRATAER) THEN |
---|
728 | IF (type_trac=='coag') THEN |
---|
729 | ! initialize wet deposition flux of sulfur |
---|
730 | budg_dep_wet_ocs(:) = 0.0 |
---|
731 | budg_dep_wet_so2(:) = 0.0 |
---|
732 | budg_dep_wet_h2so4(:) = 0.0 |
---|
733 | budg_dep_wet_part(:) = 0.0 |
---|
734 | ! compute wet deposition flux of sulfur (sum over gases and particles) |
---|
735 | ! and convert to kg(S)/m2/s |
---|
736 | DO i = 1, klon |
---|
737 | DO k = 1, klev |
---|
738 | DO it = 1, nbtr |
---|
739 | !do not include SO2 because most of it comes trom the troposphere |
---|
740 | IF (it==id_OCS_strat) THEN |
---|
741 | budg_dep_wet_ocs(i) = budg_dep_wet_ocs(i) + d_tr_cv(i, k, it) * (mSatom / mOCSmol) & |
---|
742 | * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys |
---|
743 | ELSEIF (it==id_SO2_strat) THEN |
---|
744 | budg_dep_wet_so2(i) = budg_dep_wet_so2(i) + d_tr_cv(i, k, it) * (mSatom / mSO2mol) & |
---|
745 | * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys |
---|
746 | ELSEIF (it==id_H2SO4_strat) THEN |
---|
747 | budg_dep_wet_h2so4(i) = budg_dep_wet_h2so4(i) + d_tr_cv(i, k, it) * (mSatom / mH2SO4mol) & |
---|
748 | * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys |
---|
749 | ELSEIF (it>nbtr_sulgas) THEN |
---|
750 | budg_dep_wet_part(i) = budg_dep_wet_part(i) + d_tr_cv(i, k, it) * (mSatom / mH2SO4mol) & |
---|
751 | * dens_aer_dry * 4. / 3. * RPI * (mdw(it - nbtr_sulgas) / 2.)**3 & |
---|
752 | * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys |
---|
753 | ENDIF |
---|
754 | ENDDO |
---|
755 | ENDDO |
---|
756 | ENDDO |
---|
757 | ENDIF |
---|
758 | END IF |
---|
759 | |
---|
760 | ENDIF ! convection |
---|
761 | |
---|
762 | !====================================================================== |
---|
763 | ! -- Calcul de l'effet des thermiques -- |
---|
764 | !====================================================================== |
---|
765 | |
---|
766 | DO it = 1, nbtr |
---|
767 | DO k = 1, klev |
---|
768 | DO i = 1, klon |
---|
769 | d_tr_th(i, k, it) = 0. |
---|
770 | tr_seri(i, k, it) = MAX(tr_seri(i, k, it), 0.) |
---|
771 | ! the next safeguard causes some problem for stratospheric aerosol tracers (particle number) |
---|
772 | ! and there is little justification for it so it is commented out (4 December 2017) by OB |
---|
773 | ! if reinstated please keep the ifndef CPP_StratAer |
---|
774 | !#ifndef CPP_StratAer |
---|
775 | ! tr_seri(i,k,it)=MIN(tr_seri(i,k,it),1.e10) |
---|
776 | !#endif |
---|
777 | ENDDO |
---|
778 | ENDDO |
---|
779 | ENDDO |
---|
780 | |
---|
781 | IF (iflag_thermals>0.AND.iflag_the_trac>0) THEN |
---|
782 | |
---|
783 | DO it = 1, nbtr |
---|
784 | |
---|
785 | CALL thermcell_dq(klon, klev, 1, pdtphys, fm_therm, entr_therm, & |
---|
786 | zmasse, tr_seri(1:klon, 1:klev, it), & |
---|
787 | d_tr_th(1:klon, 1:klev, it), ztra_th, 0) |
---|
788 | |
---|
789 | DO k = 1, klev |
---|
790 | DO i = 1, klon |
---|
791 | d_tr_th(i, k, it) = pdtphys * d_tr_th(i, k, it) |
---|
792 | tr_seri(i, k, it) = MAX(tr_seri(i, k, it) + d_tr_th(i, k, it), 0.) |
---|
793 | ENDDO |
---|
794 | ENDDO |
---|
795 | |
---|
796 | ENDDO ! it |
---|
797 | |
---|
798 | ENDIF ! Thermiques |
---|
799 | |
---|
800 | !====================================================================== |
---|
801 | ! -- Calcul de l'effet de la couche limite -- |
---|
802 | !====================================================================== |
---|
803 | |
---|
804 | IF (iflag_vdf_trac==1) THEN |
---|
805 | |
---|
806 | ! Injection during BL mixing |
---|
807 | |
---|
808 | IF (CPPKEY_STRATAER) THEN |
---|
809 | IF (type_trac=='coag') THEN |
---|
810 | |
---|
811 | ! initialize dry deposition flux of sulfur |
---|
812 | budg_dep_dry_ocs(:) = 0.0 |
---|
813 | budg_dep_dry_so2(:) = 0.0 |
---|
814 | budg_dep_dry_h2so4(:) = 0.0 |
---|
815 | budg_dep_dry_part(:) = 0.0 |
---|
816 | |
---|
817 | ! compute dry deposition velocity as function of surface type (numbers |
---|
818 | ! from IPSL note 23, 2002) |
---|
819 | v_dep_dry(:) = pctsrf(:, is_ter) * 2.5e-3 & |
---|
820 | + pctsrf(:, is_oce) * 0.5e-3 & |
---|
821 | + pctsrf(:, is_lic) * 2.5e-3 & |
---|
822 | + pctsrf(:, is_sic) * 2.5e-3 |
---|
823 | |
---|
824 | ! compute surface dry deposition flux |
---|
825 | zrho(:, 1) = pplay(:, 1) / t_seri(:, 1) / RD |
---|
826 | |
---|
827 | DO it = 1, nbtr |
---|
828 | source(:, it) = - v_dep_dry(:) * tr_seri(:, 1, it) * zrho(:, 1) |
---|
829 | ENDDO |
---|
830 | |
---|
831 | ENDIF |
---|
832 | END IF |
---|
833 | |
---|
834 | DO it = 1, nbtr |
---|
835 | |
---|
836 | IF (pbl_flg(it) /= 0) THEN |
---|
837 | |
---|
838 | CALL cltrac(pdtphys, coefh, t_seri, & |
---|
839 | tr_seri(:, :, it), source(:, it), & |
---|
840 | paprs, pplay, delp, & |
---|
841 | d_tr_cl(:, :, it), d_tr_dry(:, it), flux_tr_dry(:, it)) |
---|
842 | |
---|
843 | tr_seri(:, :, it) = tr_seri(:, :, it) + d_tr_cl(:, :, it) |
---|
844 | |
---|
845 | IF (CPPKEY_STRATAER) THEN |
---|
846 | IF (type_trac=='coag') THEN |
---|
847 | ! compute dry deposition flux of sulfur (sum over gases and particles) |
---|
848 | IF (it==id_OCS_strat) THEN |
---|
849 | budg_dep_dry_ocs(:) = budg_dep_dry_ocs(:) - source(:, it) * (mSatom / mOCSmol) |
---|
850 | ELSEIF (it==id_SO2_strat) THEN |
---|
851 | budg_dep_dry_so2(:) = budg_dep_dry_so2(:) - source(:, it) * (mSatom / mSO2mol) |
---|
852 | ELSEIF (it==id_H2SO4_strat) THEN |
---|
853 | budg_dep_dry_h2so4(:) = budg_dep_dry_h2so4(:) - source(:, it) * (mSatom / mH2SO4mol) |
---|
854 | ELSEIF (it>nbtr_sulgas) THEN |
---|
855 | budg_dep_dry_part(:) = budg_dep_dry_part(:) - source(:, it) * (mSatom / mH2SO4mol) * dens_aer_dry & |
---|
856 | * 4. / 3. * RPI * (mdw(it - nbtr_sulgas) / 2.)**3 |
---|
857 | ENDIF |
---|
858 | ENDIF |
---|
859 | END IF |
---|
860 | |
---|
861 | ENDIF |
---|
862 | |
---|
863 | ENDDO |
---|
864 | |
---|
865 | ELSE IF (iflag_vdf_trac==0) THEN |
---|
866 | |
---|
867 | ! Injection of source in the first model layer |
---|
868 | |
---|
869 | DO it = 1, nbtr |
---|
870 | d_tr_cl(:, 1, it) = source(:, it) * RG / delp(:, 1) * pdtphys |
---|
871 | tr_seri(:, 1, it) = tr_seri(:, 1, it) + d_tr_cl(:, 1, it) |
---|
872 | ENDDO |
---|
873 | d_tr_cl(:, 2:klev, 1:nbtr) = 0. |
---|
874 | |
---|
875 | ELSE IF (iflag_vdf_trac==-1) THEN |
---|
876 | |
---|
877 | ! Nothing happens |
---|
878 | d_tr_cl = 0. |
---|
879 | |
---|
880 | ELSE |
---|
881 | |
---|
882 | CALL abort_physic('iflag_vdf_trac', 'cas non prevu', 1) |
---|
883 | |
---|
884 | ENDIF ! couche limite |
---|
885 | |
---|
886 | !====================================================================== |
---|
887 | ! Calcul de l'effet de la precipitation grande echelle |
---|
888 | ! POUR INCA le lessivage est fait directement dans INCA |
---|
889 | !====================================================================== |
---|
890 | |
---|
891 | IF (lessivage) THEN |
---|
892 | |
---|
893 | ql_incloud_ref = 10.e-4 |
---|
894 | ql_incloud_ref = 5.e-4 |
---|
895 | |
---|
896 | |
---|
897 | ! calcul du contenu en eau liquide au sein du nuage |
---|
898 | ql_incl = ql_incloud_ref |
---|
899 | ! choix du lessivage |
---|
900 | |
---|
901 | IF (iflag_lscav == 3 .OR. iflag_lscav == 4) THEN |
---|
902 | ! ******** Olivier Boucher version (3) possibly with modified ql_incl (4) |
---|
903 | |
---|
904 | DO it = 1, nbtr |
---|
905 | |
---|
906 | IF (aerosol(it)) THEN |
---|
907 | ! incloud scavenging and removal by large scale rain ! orig : ql_incl was replaced by 0.5e-3 kg/kg |
---|
908 | ! the value 0.5e-3 kg/kg is from Giorgi and Chameides (1986), JGR |
---|
909 | ! Liu (2001) proposed to use 1.5e-3 kg/kg |
---|
910 | |
---|
911 | CALL lsc_scav(pdtphys, it, iflag_lscav, aerosol, ql_incl, prfl, psfl, rneb, beta_fisrt, & |
---|
912 | beta_v1, pplay, paprs, t_seri, tr_seri, d_tr_insc, d_tr_bcscav, d_tr_evapls, qPrls) |
---|
913 | |
---|
914 | !large scale scavenging tendency |
---|
915 | DO k = 1, klev |
---|
916 | DO i = 1, klon |
---|
917 | d_tr_ls(i, k, it) = d_tr_insc(i, k, it) + d_tr_bcscav(i, k, it) + d_tr_evapls(i, k, it) |
---|
918 | tr_seri(i, k, it) = tr_seri(i, k, it) + d_tr_ls(i, k, it) |
---|
919 | ENDDO |
---|
920 | ENDDO |
---|
921 | CALL minmaxqfi(tr_seri(:, :, it), 0., 1.e33, 'lsc scav it = ' // TRIM(int2str(it))) |
---|
922 | ENDIF |
---|
923 | |
---|
924 | ENDDO !tr |
---|
925 | |
---|
926 | IF (CPPKEY_STRATAER) THEN |
---|
927 | IF (type_trac=='coag') THEN |
---|
928 | ! compute wet deposition flux of sulfur (sum over gases and |
---|
929 | ! particles) and convert to kg(S)/m2/s |
---|
930 | ! adding contribution of d_tr_ls to d_tr_cv (above) |
---|
931 | DO i = 1, klon |
---|
932 | DO k = 1, klev |
---|
933 | DO it = 1, nbtr |
---|
934 | IF (it==id_OCS_strat) THEN |
---|
935 | budg_dep_wet_ocs(i) = budg_dep_wet_ocs(i) + d_tr_ls(i, k, it) * (mSatom / mOCSmol) & |
---|
936 | * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys |
---|
937 | ELSEIF (it==id_SO2_strat) THEN |
---|
938 | budg_dep_wet_so2(i) = budg_dep_wet_so2(i) + d_tr_ls(i, k, it) * (mSatom / mSO2mol) & |
---|
939 | * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys |
---|
940 | ELSEIF (it==id_H2SO4_strat) THEN |
---|
941 | budg_dep_wet_h2so4(i) = budg_dep_wet_h2so4(i) + d_tr_ls(i, k, it) * (mSatom / mH2SO4mol) & |
---|
942 | * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys |
---|
943 | ELSEIF (it>nbtr_sulgas) THEN |
---|
944 | budg_dep_wet_part(i) = budg_dep_wet_part(i) + d_tr_ls(i, k, it) * (mSatom / mH2SO4mol) & |
---|
945 | * dens_aer_dry * 4. / 3. * RPI * (mdw(it - nbtr_sulgas) / 2.)**3 & |
---|
946 | * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys |
---|
947 | ENDIF |
---|
948 | ENDDO |
---|
949 | ENDDO |
---|
950 | ENDDO |
---|
951 | ENDIF |
---|
952 | END IF |
---|
953 | |
---|
954 | ELSE IF (iflag_lscav == 2) THEN ! frac_impa, frac_nucl |
---|
955 | ! ********* modified old version |
---|
956 | |
---|
957 | d_tr_lessi_nucl(:, :, :) = 0. |
---|
958 | d_tr_lessi_impa(:, :, :) = 0. |
---|
959 | flestottr(:, :, :) = 0. |
---|
960 | ! Tendance des aerosols nuclees et impactes |
---|
961 | DO it = 1, nbtr |
---|
962 | IF (aerosol(it)) THEN |
---|
963 | his_dh(:) = 0. |
---|
964 | DO k = 1, klev |
---|
965 | DO i = 1, klon |
---|
966 | !PhH |
---|
967 | zrho(i, k) = pplay(i, k) / t_seri(i, k) / RD |
---|
968 | zdz(i, k) = (paprs(i, k) - paprs(i, k + 1)) / zrho(i, k) / RG |
---|
969 | |
---|
970 | ENDDO |
---|
971 | ENDDO |
---|
972 | |
---|
973 | DO k = klev - 1, 1, -1 |
---|
974 | DO i = 1, klon |
---|
975 | ! d_tr_ls(i,k,it)=tr_seri(i,k,it)*(frac_impa(i,k)*frac_nucl(i,k)-1.) |
---|
976 | dx = d_tr_ls(i, k, it) |
---|
977 | his_dh(i) = his_dh(i) - dx * zrho(i, k) * zdz(i, k) / pdtphys ! kg/m2/s |
---|
978 | evaplsc = prfl(i, k) - prfl(i, k + 1) + psfl(i, k) - psfl(i, k + 1) |
---|
979 | ! Evaporation Partielle -> Liberation Partielle 0.5*evap |
---|
980 | IF (evaplsc <0..and.abs(prfl(i, k + 1) + psfl(i, k + 1))>1.e-10) THEN |
---|
981 | evaplsc = (-evaplsc) / (prfl(i, k + 1) + psfl(i, k + 1)) |
---|
982 | ! evaplsc est donc positif, his_dh(i) est positif |
---|
983 | !-------------- |
---|
984 | d_tr_evapls(i, k, it) = 0.5 * evaplsc * (d_tr_lessi_nucl(i, k + 1, it) & |
---|
985 | + d_tr_lessi_impa(i, k + 1, it)) |
---|
986 | !------------- d_tr_evapls(i,k,it)=-0.5*evaplsc*(d_tr_lsc(i,k+1,it)) |
---|
987 | beta = 0.5 * evaplsc |
---|
988 | if ((prfl(i, k) + psfl(i, k))<1.e-10) THEN |
---|
989 | beta = 1.0 * evaplsc |
---|
990 | endif |
---|
991 | dx = beta * his_dh(i) / zrho(i, k) / zdz(i, k) * pdtphys |
---|
992 | his_dh(i) = (1. - beta) * his_dh(i) ! tracer from |
---|
993 | d_tr_evapls(i, k, it) = dx |
---|
994 | ENDIF |
---|
995 | d_tr_ls(i, k, it) = tr_seri(i, k, it) * (frac_impa(i, k) * frac_nucl(i, k) - 1.) & |
---|
996 | + d_tr_evapls(i, k, it) |
---|
997 | |
---|
998 | !-------------- |
---|
999 | d_tr_lessi_nucl(i, k, it) = d_tr_lessi_nucl(i, k, it) + & |
---|
1000 | (1 - frac_nucl(i, k)) * tr_seri(i, k, it) |
---|
1001 | d_tr_lessi_impa(i, k, it) = d_tr_lessi_impa(i, k, it) + & |
---|
1002 | (1 - frac_impa(i, k)) * tr_seri(i, k, it) |
---|
1003 | |
---|
1004 | ! Flux lessivage total |
---|
1005 | flestottr(i, k, it) = flestottr(i, k, it) - & |
---|
1006 | (d_tr_lessi_nucl(i, k, it) + & |
---|
1007 | d_tr_lessi_impa(i, k, it)) * & |
---|
1008 | (paprs(i, k) - paprs(i, k + 1)) / & |
---|
1009 | (RG * pdtphys) |
---|
1010 | !! Mise a jour des traceurs due a l'impaction,nucleation |
---|
1011 | ! tr_seri(i,k,it)=tr_seri(i,k,it)*frac_impa(i,k)*frac_nucl(i,k) |
---|
1012 | !! calcul de la tendance liee au lessivage stratiforme |
---|
1013 | ! d_tr_ls(i,k,it)=tr_seri(i,k,it)*& |
---|
1014 | ! (1.-1./(frac_impa(i,k)*frac_nucl(i,k))) |
---|
1015 | !-------------- |
---|
1016 | ENDDO |
---|
1017 | ENDDO |
---|
1018 | ENDIF |
---|
1019 | ENDDO |
---|
1020 | ! ********* end modified old version |
---|
1021 | |
---|
1022 | ELSE IF (iflag_lscav == 1) THEN ! frac_impa, frac_nucl |
---|
1023 | ! ********* old version |
---|
1024 | |
---|
1025 | d_tr_lessi_nucl(:, :, :) = 0. |
---|
1026 | d_tr_lessi_impa(:, :, :) = 0. |
---|
1027 | flestottr(:, :, :) = 0. |
---|
1028 | !========================= |
---|
1029 | ! LESSIVAGE LARGE SCALE : |
---|
1030 | !========================= |
---|
1031 | |
---|
1032 | ! Tendance des aerosols nuclees et impactes |
---|
1033 | ! ----------------------------------------- |
---|
1034 | DO it = 1, nbtr |
---|
1035 | IF (aerosol(it)) THEN |
---|
1036 | DO k = 1, klev |
---|
1037 | DO i = 1, klon |
---|
1038 | d_tr_lessi_nucl(i, k, it) = d_tr_lessi_nucl(i, k, it) + & |
---|
1039 | (1 - frac_nucl(i, k)) * tr_seri(i, k, it) |
---|
1040 | d_tr_lessi_impa(i, k, it) = d_tr_lessi_impa(i, k, it) + & |
---|
1041 | (1 - frac_impa(i, k)) * tr_seri(i, k, it) |
---|
1042 | |
---|
1043 | ! Flux lessivage total |
---|
1044 | ! ------------------------------------------------------------ |
---|
1045 | flestottr(i, k, it) = flestottr(i, k, it) - & |
---|
1046 | (d_tr_lessi_nucl(i, k, it) + & |
---|
1047 | d_tr_lessi_impa(i, k, it)) * & |
---|
1048 | (paprs(i, k) - paprs(i, k + 1)) / & |
---|
1049 | (RG * pdtphys) |
---|
1050 | |
---|
1051 | ! Mise a jour des traceurs due a l'impaction,nucleation |
---|
1052 | ! ---------------------------------------------------------------------- |
---|
1053 | tr_seri(i, k, it) = tr_seri(i, k, it) * frac_impa(i, k) * frac_nucl(i, k) |
---|
1054 | ENDDO |
---|
1055 | ENDDO |
---|
1056 | ENDIF |
---|
1057 | ENDDO |
---|
1058 | |
---|
1059 | ! ********* end old version |
---|
1060 | ENDIF ! iflag_lscav .EQ. 1, 2, 3 or 4 |
---|
1061 | |
---|
1062 | ENDIF ! lessivage |
---|
1063 | |
---|
1064 | |
---|
1065 | ! -- CHIMIE INCA config_inca = aero or chem -- |
---|
1066 | IF (ANY(type_trac == ['inca', 'inco'])) THEN ! ModThL |
---|
1067 | |
---|
1068 | CALL tracinca(& |
---|
1069 | nstep, julien, gmtime, lafin, & |
---|
1070 | pdtphys, t_seri, paprs, pplay, & |
---|
1071 | pmfu, upwd, ftsol, pctsrf, pphis, & |
---|
1072 | pphi, albsol, sh, ch, rh, & |
---|
1073 | cldfra, rneb, diafra, cldliq, & |
---|
1074 | itop_con, ibas_con, pmflxr, pmflxs, & |
---|
1075 | prfl, psfl, aerosol_couple, flxmass_w, & |
---|
1076 | tau_aero, piz_aero, cg_aero, ccm, & |
---|
1077 | rfname, & |
---|
1078 | tr_seri(:, :, 1 + nqCO2:nbtr), source(:, 1 + nqCO2:nbtr)) ! ModThL |
---|
1079 | ENDIF |
---|
1080 | |
---|
1081 | END SUBROUTINE phytrac |
---|
1082 | |
---|
1083 | END MODULE |
---|