1 | !$Id: phytrac_mod.F90 5117 2024-07-24 14:23:34Z 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 | USE lmdz_abort_physic, ONLY: abort_physic |
---|
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 lmdz_strings, 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 lmdz_print_control, 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 | ccntrAA_3d(:, :) = ccntrAA(it) |
---|
686 | ccntrENV_3d(:, :) = ccntrENV(it) |
---|
687 | coefcoli_3d(:, :) = coefcoli(it) |
---|
688 | |
---|
689 | !--beware this interface is a bit weird because it is called for each tracer |
---|
690 | !--with the full array tr_seri even if only item it is processed |
---|
691 | |
---|
692 | CALL cvltr_scav(pdtphys, da, phi, phi2, d1a, dam, mp, ep, & |
---|
693 | sigd, sij, wght_cvfd, clw, elij, epmlmMm, eplaMm, & |
---|
694 | pmflxr, pmflxs, evap, t_seri, wdtrainA, wdtrainM, & |
---|
695 | paprs, it, tr_seri, upwd, dnwd, itop_con, ibas_con, & |
---|
696 | ccntrAA_3d, ccntrENV_3d, coefcoli_3d, & |
---|
697 | d_tr_cv, d_tr_trsp, d_tr_sscav, d_tr_sat, d_tr_uscav, qDi, qPr, & |
---|
698 | qPa, qMel, qTrdi, dtrcvMA, Mint, & |
---|
699 | zmfd1a, zmfphi2, zmfdam) |
---|
700 | |
---|
701 | ELSE !---flag_cvltr(it).EQ.FALSE |
---|
702 | !--nouveau transport convectif de Emanuel mais pas de lessivage convectif |
---|
703 | |
---|
704 | !--beware this interface is a bit weird because it is called for each tracer |
---|
705 | !--with the full array tr_seri even if only item it is processed |
---|
706 | |
---|
707 | CALL cvltr_noscav(it, pdtphys, da, phi, mp, wght_cvfd, paprs, pplay, & !jyg |
---|
708 | tr_seri, upwd, dnwd, d_tr_cv) !jyg |
---|
709 | |
---|
710 | ENDIF |
---|
711 | |
---|
712 | ENDIF !--iflag |
---|
713 | |
---|
714 | !--on ajoute les tendances |
---|
715 | |
---|
716 | DO k = 1, klev |
---|
717 | DO i = 1, klon |
---|
718 | tr_seri(i, k, it) = tr_seri(i, k, it) + d_tr_cv(i, k, it) |
---|
719 | ENDDO |
---|
720 | ENDDO |
---|
721 | |
---|
722 | CALL minmaxqfi(tr_seri(:, :, it), 0., 1.e33, 'convection it = ' // TRIM(int2str(it))) |
---|
723 | |
---|
724 | ENDDO ! nbtr |
---|
725 | |
---|
726 | IF (CPPKEY_STRATAER) THEN |
---|
727 | IF (type_trac=='coag') THEN |
---|
728 | ! initialize wet deposition flux of sulfur |
---|
729 | budg_dep_wet_ocs(:) = 0.0 |
---|
730 | budg_dep_wet_so2(:) = 0.0 |
---|
731 | budg_dep_wet_h2so4(:) = 0.0 |
---|
732 | budg_dep_wet_part(:) = 0.0 |
---|
733 | ! compute wet deposition flux of sulfur (sum over gases and particles) |
---|
734 | ! and convert to kg(S)/m2/s |
---|
735 | DO i = 1, klon |
---|
736 | DO k = 1, klev |
---|
737 | DO it = 1, nbtr |
---|
738 | !do not include SO2 because most of it comes trom the troposphere |
---|
739 | IF (it==id_OCS_strat) THEN |
---|
740 | budg_dep_wet_ocs(i) = budg_dep_wet_ocs(i) + d_tr_cv(i, k, it) * (mSatom / mOCSmol) & |
---|
741 | * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys |
---|
742 | ELSEIF (it==id_SO2_strat) THEN |
---|
743 | budg_dep_wet_so2(i) = budg_dep_wet_so2(i) + d_tr_cv(i, k, it) * (mSatom / mSO2mol) & |
---|
744 | * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys |
---|
745 | ELSEIF (it==id_H2SO4_strat) THEN |
---|
746 | budg_dep_wet_h2so4(i) = budg_dep_wet_h2so4(i) + d_tr_cv(i, k, it) * (mSatom / mH2SO4mol) & |
---|
747 | * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys |
---|
748 | ELSEIF (it>nbtr_sulgas) THEN |
---|
749 | budg_dep_wet_part(i) = budg_dep_wet_part(i) + d_tr_cv(i, k, it) * (mSatom / mH2SO4mol) & |
---|
750 | * dens_aer_dry * 4. / 3. * RPI * (mdw(it - nbtr_sulgas) / 2.)**3 & |
---|
751 | * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys |
---|
752 | ENDIF |
---|
753 | ENDDO |
---|
754 | ENDDO |
---|
755 | ENDDO |
---|
756 | ENDIF |
---|
757 | END IF |
---|
758 | |
---|
759 | ENDIF ! convection |
---|
760 | |
---|
761 | !====================================================================== |
---|
762 | ! -- Calcul de l'effet des thermiques -- |
---|
763 | !====================================================================== |
---|
764 | |
---|
765 | DO it = 1, nbtr |
---|
766 | DO k = 1, klev |
---|
767 | DO i = 1, klon |
---|
768 | d_tr_th(i, k, it) = 0. |
---|
769 | tr_seri(i, k, it) = MAX(tr_seri(i, k, it), 0.) |
---|
770 | ! the next safeguard causes some problem for stratospheric aerosol tracers (particle number) |
---|
771 | ! and there is little justification for it so it is commented out (4 December 2017) by OB |
---|
772 | ! if reinstated please keep the ifndef CPP_StratAer |
---|
773 | !#ifndef CPP_StratAer |
---|
774 | ! tr_seri(i,k,it)=MIN(tr_seri(i,k,it),1.e10) |
---|
775 | !#endif |
---|
776 | ENDDO |
---|
777 | ENDDO |
---|
778 | ENDDO |
---|
779 | |
---|
780 | IF (iflag_thermals>0.AND.iflag_the_trac>0) THEN |
---|
781 | |
---|
782 | DO it = 1, nbtr |
---|
783 | |
---|
784 | CALL thermcell_dq(klon, klev, 1, pdtphys, fm_therm, entr_therm, & |
---|
785 | zmasse, tr_seri(1:klon, 1:klev, it), & |
---|
786 | d_tr_th(1:klon, 1:klev, it), ztra_th, 0) |
---|
787 | |
---|
788 | DO k = 1, klev |
---|
789 | DO i = 1, klon |
---|
790 | d_tr_th(i, k, it) = pdtphys * d_tr_th(i, k, it) |
---|
791 | tr_seri(i, k, it) = MAX(tr_seri(i, k, it) + d_tr_th(i, k, it), 0.) |
---|
792 | ENDDO |
---|
793 | ENDDO |
---|
794 | |
---|
795 | ENDDO ! it |
---|
796 | |
---|
797 | ENDIF ! Thermiques |
---|
798 | |
---|
799 | !====================================================================== |
---|
800 | ! -- Calcul de l'effet de la couche limite -- |
---|
801 | !====================================================================== |
---|
802 | |
---|
803 | IF (iflag_vdf_trac==1) THEN |
---|
804 | |
---|
805 | ! Injection during BL mixing |
---|
806 | |
---|
807 | IF (CPPKEY_STRATAER) THEN |
---|
808 | IF (type_trac=='coag') THEN |
---|
809 | |
---|
810 | ! initialize dry deposition flux of sulfur |
---|
811 | budg_dep_dry_ocs(:) = 0.0 |
---|
812 | budg_dep_dry_so2(:) = 0.0 |
---|
813 | budg_dep_dry_h2so4(:) = 0.0 |
---|
814 | budg_dep_dry_part(:) = 0.0 |
---|
815 | |
---|
816 | ! compute dry deposition velocity as function of surface type (numbers |
---|
817 | ! from IPSL note 23, 2002) |
---|
818 | v_dep_dry(:) = pctsrf(:, is_ter) * 2.5e-3 & |
---|
819 | + pctsrf(:, is_oce) * 0.5e-3 & |
---|
820 | + pctsrf(:, is_lic) * 2.5e-3 & |
---|
821 | + pctsrf(:, is_sic) * 2.5e-3 |
---|
822 | |
---|
823 | ! compute surface dry deposition flux |
---|
824 | zrho(:, 1) = pplay(:, 1) / t_seri(:, 1) / RD |
---|
825 | |
---|
826 | DO it = 1, nbtr |
---|
827 | source(:, it) = - v_dep_dry(:) * tr_seri(:, 1, it) * zrho(:, 1) |
---|
828 | ENDDO |
---|
829 | |
---|
830 | ENDIF |
---|
831 | END IF |
---|
832 | |
---|
833 | DO it = 1, nbtr |
---|
834 | |
---|
835 | IF (pbl_flg(it) /= 0) THEN |
---|
836 | |
---|
837 | CALL cltrac(pdtphys, coefh, t_seri, & |
---|
838 | tr_seri(:, :, it), source(:, it), & |
---|
839 | paprs, pplay, delp, & |
---|
840 | d_tr_cl(:, :, it), d_tr_dry(:, it), flux_tr_dry(:, it)) |
---|
841 | |
---|
842 | tr_seri(:, :, it) = tr_seri(:, :, it) + d_tr_cl(:, :, it) |
---|
843 | |
---|
844 | IF (CPPKEY_STRATAER) THEN |
---|
845 | IF (type_trac=='coag') THEN |
---|
846 | ! compute dry deposition flux of sulfur (sum over gases and particles) |
---|
847 | IF (it==id_OCS_strat) THEN |
---|
848 | budg_dep_dry_ocs(:) = budg_dep_dry_ocs(:) - source(:, it) * (mSatom / mOCSmol) |
---|
849 | ELSEIF (it==id_SO2_strat) THEN |
---|
850 | budg_dep_dry_so2(:) = budg_dep_dry_so2(:) - source(:, it) * (mSatom / mSO2mol) |
---|
851 | ELSEIF (it==id_H2SO4_strat) THEN |
---|
852 | budg_dep_dry_h2so4(:) = budg_dep_dry_h2so4(:) - source(:, it) * (mSatom / mH2SO4mol) |
---|
853 | ELSEIF (it>nbtr_sulgas) THEN |
---|
854 | budg_dep_dry_part(:) = budg_dep_dry_part(:) - source(:, it) * (mSatom / mH2SO4mol) * dens_aer_dry & |
---|
855 | * 4. / 3. * RPI * (mdw(it - nbtr_sulgas) / 2.)**3 |
---|
856 | ENDIF |
---|
857 | ENDIF |
---|
858 | END IF |
---|
859 | |
---|
860 | ENDIF |
---|
861 | |
---|
862 | ENDDO |
---|
863 | |
---|
864 | ELSE IF (iflag_vdf_trac==0) THEN |
---|
865 | |
---|
866 | ! Injection of source in the first model layer |
---|
867 | |
---|
868 | DO it = 1, nbtr |
---|
869 | d_tr_cl(:, 1, it) = source(:, it) * RG / delp(:, 1) * pdtphys |
---|
870 | tr_seri(:, 1, it) = tr_seri(:, 1, it) + d_tr_cl(:, 1, it) |
---|
871 | ENDDO |
---|
872 | d_tr_cl(:, 2:klev, 1:nbtr) = 0. |
---|
873 | |
---|
874 | ELSE IF (iflag_vdf_trac==-1) THEN |
---|
875 | |
---|
876 | ! Nothing happens |
---|
877 | d_tr_cl = 0. |
---|
878 | |
---|
879 | ELSE |
---|
880 | |
---|
881 | CALL abort_physic('iflag_vdf_trac', 'cas non prevu', 1) |
---|
882 | |
---|
883 | ENDIF ! couche limite |
---|
884 | |
---|
885 | !====================================================================== |
---|
886 | ! Calcul de l'effet de la precipitation grande echelle |
---|
887 | ! POUR INCA le lessivage est fait directement dans INCA |
---|
888 | !====================================================================== |
---|
889 | |
---|
890 | IF (lessivage) THEN |
---|
891 | |
---|
892 | ql_incloud_ref = 10.e-4 |
---|
893 | ql_incloud_ref = 5.e-4 |
---|
894 | |
---|
895 | |
---|
896 | ! calcul du contenu en eau liquide au sein du nuage |
---|
897 | ql_incl = ql_incloud_ref |
---|
898 | ! choix du lessivage |
---|
899 | |
---|
900 | IF (iflag_lscav == 3 .OR. iflag_lscav == 4) THEN |
---|
901 | ! ******** Olivier Boucher version (3) possibly with modified ql_incl (4) |
---|
902 | |
---|
903 | DO it = 1, nbtr |
---|
904 | |
---|
905 | IF (aerosol(it)) THEN |
---|
906 | ! incloud scavenging and removal by large scale rain ! orig : ql_incl was replaced by 0.5e-3 kg/kg |
---|
907 | ! the value 0.5e-3 kg/kg is from Giorgi and Chameides (1986), JGR |
---|
908 | ! Liu (2001) proposed to use 1.5e-3 kg/kg |
---|
909 | |
---|
910 | CALL lsc_scav(pdtphys, it, iflag_lscav, aerosol, ql_incl, prfl, psfl, rneb, beta_fisrt, & |
---|
911 | beta_v1, pplay, paprs, t_seri, tr_seri, d_tr_insc, d_tr_bcscav, d_tr_evapls, qPrls) |
---|
912 | |
---|
913 | !large scale scavenging tendency |
---|
914 | DO k = 1, klev |
---|
915 | DO i = 1, klon |
---|
916 | d_tr_ls(i, k, it) = d_tr_insc(i, k, it) + d_tr_bcscav(i, k, it) + d_tr_evapls(i, k, it) |
---|
917 | tr_seri(i, k, it) = tr_seri(i, k, it) + d_tr_ls(i, k, it) |
---|
918 | ENDDO |
---|
919 | ENDDO |
---|
920 | CALL minmaxqfi(tr_seri(:, :, it), 0., 1.e33, 'lsc scav it = ' // TRIM(int2str(it))) |
---|
921 | ENDIF |
---|
922 | |
---|
923 | ENDDO !tr |
---|
924 | |
---|
925 | IF (CPPKEY_STRATAER) THEN |
---|
926 | IF (type_trac=='coag') THEN |
---|
927 | ! compute wet deposition flux of sulfur (sum over gases and |
---|
928 | ! particles) and convert to kg(S)/m2/s |
---|
929 | ! adding contribution of d_tr_ls to d_tr_cv (above) |
---|
930 | DO i = 1, klon |
---|
931 | DO k = 1, klev |
---|
932 | DO it = 1, nbtr |
---|
933 | IF (it==id_OCS_strat) THEN |
---|
934 | budg_dep_wet_ocs(i) = budg_dep_wet_ocs(i) + d_tr_ls(i, k, it) * (mSatom / mOCSmol) & |
---|
935 | * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys |
---|
936 | ELSEIF (it==id_SO2_strat) THEN |
---|
937 | budg_dep_wet_so2(i) = budg_dep_wet_so2(i) + d_tr_ls(i, k, it) * (mSatom / mSO2mol) & |
---|
938 | * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys |
---|
939 | ELSEIF (it==id_H2SO4_strat) THEN |
---|
940 | budg_dep_wet_h2so4(i) = budg_dep_wet_h2so4(i) + d_tr_ls(i, k, it) * (mSatom / mH2SO4mol) & |
---|
941 | * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys |
---|
942 | ELSEIF (it>nbtr_sulgas) THEN |
---|
943 | budg_dep_wet_part(i) = budg_dep_wet_part(i) + d_tr_ls(i, k, it) * (mSatom / mH2SO4mol) & |
---|
944 | * dens_aer_dry * 4. / 3. * RPI * (mdw(it - nbtr_sulgas) / 2.)**3 & |
---|
945 | * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys |
---|
946 | ENDIF |
---|
947 | ENDDO |
---|
948 | ENDDO |
---|
949 | ENDDO |
---|
950 | ENDIF |
---|
951 | END IF |
---|
952 | |
---|
953 | ELSE IF (iflag_lscav == 2) THEN ! frac_impa, frac_nucl |
---|
954 | ! ********* modified old version |
---|
955 | |
---|
956 | d_tr_lessi_nucl(:, :, :) = 0. |
---|
957 | d_tr_lessi_impa(:, :, :) = 0. |
---|
958 | flestottr(:, :, :) = 0. |
---|
959 | ! Tendance des aerosols nuclees et impactes |
---|
960 | DO it = 1, nbtr |
---|
961 | IF (aerosol(it)) THEN |
---|
962 | his_dh(:) = 0. |
---|
963 | DO k = 1, klev |
---|
964 | DO i = 1, klon |
---|
965 | !PhH |
---|
966 | zrho(i, k) = pplay(i, k) / t_seri(i, k) / RD |
---|
967 | zdz(i, k) = (paprs(i, k) - paprs(i, k + 1)) / zrho(i, k) / RG |
---|
968 | |
---|
969 | ENDDO |
---|
970 | ENDDO |
---|
971 | |
---|
972 | DO k = klev - 1, 1, -1 |
---|
973 | DO i = 1, klon |
---|
974 | ! d_tr_ls(i,k,it)=tr_seri(i,k,it)*(frac_impa(i,k)*frac_nucl(i,k)-1.) |
---|
975 | dx = d_tr_ls(i, k, it) |
---|
976 | his_dh(i) = his_dh(i) - dx * zrho(i, k) * zdz(i, k) / pdtphys ! kg/m2/s |
---|
977 | evaplsc = prfl(i, k) - prfl(i, k + 1) + psfl(i, k) - psfl(i, k + 1) |
---|
978 | ! Evaporation Partielle -> Liberation Partielle 0.5*evap |
---|
979 | IF (evaplsc <0..and.abs(prfl(i, k + 1) + psfl(i, k + 1))>1.e-10) THEN |
---|
980 | evaplsc = (-evaplsc) / (prfl(i, k + 1) + psfl(i, k + 1)) |
---|
981 | ! evaplsc est donc positif, his_dh(i) est positif |
---|
982 | !-------------- |
---|
983 | d_tr_evapls(i, k, it) = 0.5 * evaplsc * (d_tr_lessi_nucl(i, k + 1, it) & |
---|
984 | + d_tr_lessi_impa(i, k + 1, it)) |
---|
985 | !------------- d_tr_evapls(i,k,it)=-0.5*evaplsc*(d_tr_lsc(i,k+1,it)) |
---|
986 | beta = 0.5 * evaplsc |
---|
987 | IF ((prfl(i, k) + psfl(i, k))<1.e-10) THEN |
---|
988 | beta = 1.0 * evaplsc |
---|
989 | endif |
---|
990 | dx = beta * his_dh(i) / zrho(i, k) / zdz(i, k) * pdtphys |
---|
991 | his_dh(i) = (1. - beta) * his_dh(i) ! tracer from |
---|
992 | d_tr_evapls(i, k, it) = dx |
---|
993 | ENDIF |
---|
994 | d_tr_ls(i, k, it) = tr_seri(i, k, it) * (frac_impa(i, k) * frac_nucl(i, k) - 1.) & |
---|
995 | + d_tr_evapls(i, k, it) |
---|
996 | |
---|
997 | !-------------- |
---|
998 | d_tr_lessi_nucl(i, k, it) = d_tr_lessi_nucl(i, k, it) + & |
---|
999 | (1 - frac_nucl(i, k)) * tr_seri(i, k, it) |
---|
1000 | d_tr_lessi_impa(i, k, it) = d_tr_lessi_impa(i, k, it) + & |
---|
1001 | (1 - frac_impa(i, k)) * tr_seri(i, k, it) |
---|
1002 | |
---|
1003 | ! Flux lessivage total |
---|
1004 | flestottr(i, k, it) = flestottr(i, k, it) - & |
---|
1005 | (d_tr_lessi_nucl(i, k, it) + & |
---|
1006 | d_tr_lessi_impa(i, k, it)) * & |
---|
1007 | (paprs(i, k) - paprs(i, k + 1)) / & |
---|
1008 | (RG * pdtphys) |
---|
1009 | !! Mise a jour des traceurs due a l'impaction,nucleation |
---|
1010 | ! tr_seri(i,k,it)=tr_seri(i,k,it)*frac_impa(i,k)*frac_nucl(i,k) |
---|
1011 | !! calcul de la tendance liee au lessivage stratiforme |
---|
1012 | ! d_tr_ls(i,k,it)=tr_seri(i,k,it)*& |
---|
1013 | ! (1.-1./(frac_impa(i,k)*frac_nucl(i,k))) |
---|
1014 | !-------------- |
---|
1015 | ENDDO |
---|
1016 | ENDDO |
---|
1017 | ENDIF |
---|
1018 | ENDDO |
---|
1019 | ! ********* end modified old version |
---|
1020 | |
---|
1021 | ELSE IF (iflag_lscav == 1) THEN ! frac_impa, frac_nucl |
---|
1022 | ! ********* old version |
---|
1023 | |
---|
1024 | d_tr_lessi_nucl(:, :, :) = 0. |
---|
1025 | d_tr_lessi_impa(:, :, :) = 0. |
---|
1026 | flestottr(:, :, :) = 0. |
---|
1027 | !========================= |
---|
1028 | ! LESSIVAGE LARGE SCALE : |
---|
1029 | !========================= |
---|
1030 | |
---|
1031 | ! Tendance des aerosols nuclees et impactes |
---|
1032 | ! ----------------------------------------- |
---|
1033 | DO it = 1, nbtr |
---|
1034 | IF (aerosol(it)) THEN |
---|
1035 | DO k = 1, klev |
---|
1036 | DO i = 1, klon |
---|
1037 | d_tr_lessi_nucl(i, k, it) = d_tr_lessi_nucl(i, k, it) + & |
---|
1038 | (1 - frac_nucl(i, k)) * tr_seri(i, k, it) |
---|
1039 | d_tr_lessi_impa(i, k, it) = d_tr_lessi_impa(i, k, it) + & |
---|
1040 | (1 - frac_impa(i, k)) * tr_seri(i, k, it) |
---|
1041 | |
---|
1042 | ! Flux lessivage total |
---|
1043 | ! ------------------------------------------------------------ |
---|
1044 | flestottr(i, k, it) = flestottr(i, k, it) - & |
---|
1045 | (d_tr_lessi_nucl(i, k, it) + & |
---|
1046 | d_tr_lessi_impa(i, k, it)) * & |
---|
1047 | (paprs(i, k) - paprs(i, k + 1)) / & |
---|
1048 | (RG * pdtphys) |
---|
1049 | |
---|
1050 | ! Mise a jour des traceurs due a l'impaction,nucleation |
---|
1051 | ! ---------------------------------------------------------------------- |
---|
1052 | tr_seri(i, k, it) = tr_seri(i, k, it) * frac_impa(i, k) * frac_nucl(i, k) |
---|
1053 | ENDDO |
---|
1054 | ENDDO |
---|
1055 | ENDIF |
---|
1056 | ENDDO |
---|
1057 | |
---|
1058 | ! ********* end old version |
---|
1059 | ENDIF ! iflag_lscav .EQ. 1, 2, 3 or 4 |
---|
1060 | |
---|
1061 | ENDIF ! lessivage |
---|
1062 | |
---|
1063 | |
---|
1064 | ! -- CHIMIE INCA config_inca = aero or chem -- |
---|
1065 | IF (ANY(type_trac == ['inca', 'inco'])) THEN ! ModThL |
---|
1066 | |
---|
1067 | CALL tracinca(& |
---|
1068 | nstep, julien, gmtime, lafin, & |
---|
1069 | pdtphys, t_seri, paprs, pplay, & |
---|
1070 | pmfu, upwd, ftsol, pctsrf, pphis, & |
---|
1071 | pphi, albsol, sh, ch, rh, & |
---|
1072 | cldfra, rneb, diafra, cldliq, & |
---|
1073 | itop_con, ibas_con, pmflxr, pmflxs, & |
---|
1074 | prfl, psfl, aerosol_couple, flxmass_w, & |
---|
1075 | tau_aero, piz_aero, cg_aero, ccm, & |
---|
1076 | rfname, & |
---|
1077 | tr_seri(:, :, 1 + nqCO2:nbtr), source(:, 1 + nqCO2:nbtr)) ! ModThL |
---|
1078 | ENDIF |
---|
1079 | |
---|
1080 | END SUBROUTINE phytrac |
---|
1081 | |
---|
1082 | END MODULE |
---|