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