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