[2188] | 1 | subroutine phytrac_chimie ( |
---|
| 2 | $ debutphy, |
---|
| 3 | $ gmtime, |
---|
| 4 | $ nqmax, |
---|
[2193] | 5 | $ nlon, |
---|
[2188] | 6 | $ lat, |
---|
| 7 | $ lon, |
---|
[2780] | 8 | $ zzlay, |
---|
[2193] | 9 | $ nlev, |
---|
[2188] | 10 | $ pdtphys, |
---|
| 11 | $ temp, |
---|
| 12 | $ pplay, |
---|
[2193] | 13 | $ trac, |
---|
| 14 | $ d_tr_chem, |
---|
[2580] | 15 | $ iter, |
---|
| 16 | $ prod_tr, |
---|
[2795] | 17 | $ loss_tr, |
---|
| 18 | $ no_emi, |
---|
| 19 | $ o2_emi) |
---|
[2188] | 20 | |
---|
| 21 | use chemparam_mod |
---|
[2464] | 22 | use conc, only: mmean,rnew |
---|
[2836] | 23 | use photolysis_mod, only: init_photolysis, nphot |
---|
| 24 | use iono_h, only: temp_elect |
---|
[2580] | 25 | #ifdef CPP_XIOS |
---|
| 26 | use xios_output_mod, only: send_xios_field |
---|
| 27 | #endif |
---|
[2188] | 28 | |
---|
| 29 | implicit none |
---|
[1305] | 30 | |
---|
| 31 | #include "clesphys.h" |
---|
| 32 | #include "YOMCST.h" |
---|
| 33 | |
---|
[2188] | 34 | !=================================================================== |
---|
| 35 | ! input |
---|
| 36 | !=================================================================== |
---|
[1442] | 37 | |
---|
[2193] | 38 | integer :: nlon, nlev ! number of gridpoints and levels |
---|
| 39 | integer :: nqmax ! number of tracers |
---|
[1442] | 40 | |
---|
[2193] | 41 | real :: gmtime ! day fraction |
---|
| 42 | real :: pdtphys ! phytrac_chimie timestep (s) |
---|
| 43 | real, dimension(nlon,nlev) :: temp ! temperature (k) |
---|
| 44 | real, dimension(nlon,nlev) :: pplay ! pressure (pa) |
---|
[2780] | 45 | real, dimension(nlon,nlev) :: zzlay ! altitude (m) |
---|
[2193] | 46 | real, dimension(nlon,nlev,nqmax) :: trac ! tracer mass mixing ratio |
---|
[1305] | 47 | |
---|
[2193] | 48 | logical :: debutphy ! first call flag |
---|
[1305] | 49 | |
---|
[2188] | 50 | !=================================================================== |
---|
| 51 | ! output |
---|
| 52 | !=================================================================== |
---|
[1305] | 53 | |
---|
[2795] | 54 | integer, dimension(nlon,nlev) :: iter ! chemical iterations |
---|
| 55 | real, dimension(nlon,nlev,nqmax) :: d_tr_chem ! chemical tendency for each tracer |
---|
| 56 | real, dimension(nlon,nlev,nqmax) :: prod_tr, loss_tr ! production and loss terms (for info) |
---|
| 57 | real, dimension(nlon,nlev) :: no_emi ! no emission |
---|
| 58 | real, dimension(nlon,nlev) :: o2_emi ! o2 emission |
---|
[1305] | 59 | |
---|
[2188] | 60 | !=================================================================== |
---|
| 61 | ! local |
---|
| 62 | !=================================================================== |
---|
| 63 | |
---|
[2780] | 64 | real :: sza_local ! solar zenith angle (deg) |
---|
[2188] | 65 | real :: lon_sun |
---|
[2780] | 66 | real :: zlocal(nlev) ! altitude for photochem (km) |
---|
[2836] | 67 | real :: t_elec(nlev) ! electron temperature [K] |
---|
| 68 | |
---|
| 69 | integer, parameter :: t_elec_origin=2 |
---|
| 70 | !Electronic temperature. Index 1 -> Theis et al. 1980 - model data ; Index 2-> Theis et al. 1984 - model data |
---|
| 71 | |
---|
[2188] | 72 | integer :: i, iq |
---|
| 73 | integer :: ilon, ilev |
---|
| 74 | |
---|
[2193] | 75 | real lat(nlon), lat_local(nlon) |
---|
| 76 | real lon(nlon), lon_local(nlon) |
---|
[2188] | 77 | |
---|
[2193] | 78 | real, dimension(nlon,nlev) :: mrtwv, mrtsa ! total water and total sulfuric acid |
---|
| 79 | real, dimension(nlon,nlev) :: mrwv, mrsa ! gas-phase water and gas-phase sulfuric acid |
---|
| 80 | real, dimension(nlon,nlev) :: trac_sum |
---|
| 81 | real, dimension(nlon,nlev,nqmax) :: ztrac ! local tracer mixing ratio |
---|
[2795] | 82 | real, dimension(nlev) :: no_em |
---|
| 83 | real, dimension(nlev) :: o2_em |
---|
[2836] | 84 | |
---|
| 85 | integer, save :: nb_reaction_3_max ! number of quadratic reactions |
---|
| 86 | integer, save :: nb_reaction_4_max ! number of bimolecular reactions |
---|
| 87 | integer, save :: nquench ! number of quenching + heterogeneous reactions |
---|
| 88 | integer, save :: nphotion ! number of photoionizations |
---|
| 89 | integer, save :: nb_reaction_4_ion ! quadratic reactions for ionosphere |
---|
| 90 | ! integer, save :: nb_reaction_4_deut ! quadratic reactions for deuterium chem |
---|
| 91 | integer, save :: nb_phot_max ! total number of photolysis+photoionizations+quenching reactions |
---|
| 92 | |
---|
| 93 | ! tracer indexes for the EUV heating: |
---|
| 94 | !!! ATTENTION. These values have to be identical to those in euvheat.F90 |
---|
| 95 | !!! If the values are changed there, the same has to be done here !!! |
---|
| 96 | |
---|
| 97 | ! integer,parameter :: i_co2=1 |
---|
| 98 | ! integer,parameter :: i_n2=13 |
---|
| 99 | ! integer,parameter :: i_n=14 |
---|
| 100 | ! integer,parameter :: i_o=3 |
---|
| 101 | ! integer,parameter :: i_co=4 |
---|
| 102 | |
---|
| 103 | integer,parameter :: ix_co2 = 1 |
---|
| 104 | integer,parameter :: ix_co = 2 |
---|
| 105 | integer,parameter :: ix_o = 3 |
---|
| 106 | integer,parameter :: ix_o1d = 4 |
---|
| 107 | integer,parameter :: ix_o2 = 5 |
---|
| 108 | integer,parameter :: ix_o3 = 6 |
---|
| 109 | integer,parameter :: ix_h = 7 |
---|
| 110 | integer,parameter :: ix_h2 = 8 |
---|
| 111 | integer,parameter :: ix_oh = 9 |
---|
| 112 | integer,parameter :: ix_ho2 = 10 |
---|
| 113 | integer,parameter :: ix_h2o2 = 11 |
---|
| 114 | integer,parameter :: ix_h2o = 12 |
---|
| 115 | integer,parameter :: ix_n = 13 |
---|
| 116 | integer,parameter :: ix_n2d = 14 |
---|
| 117 | integer,parameter :: ix_no = 15 |
---|
| 118 | integer,parameter :: ix_no2 = 16 |
---|
| 119 | integer,parameter :: ix_n2 = 17 |
---|
| 120 | |
---|
| 121 | ! NEED TO BE THE SAME THAN IN EUVHEAT.F90 |
---|
| 122 | integer,parameter :: nespeuv=17 ! Number of species considered (11, 12 or 17 (with nitrogen)) |
---|
| 123 | |
---|
| 124 | real :: vmr_dens_euv(nlon,nlev,nespeuv) ! local species density for EUV heating |
---|
| 125 | |
---|
[2188] | 126 | !=================================================================== |
---|
| 127 | ! first call : initialisations |
---|
| 128 | !=================================================================== |
---|
| 129 | |
---|
[1305] | 130 | if (debutphy) then |
---|
| 131 | |
---|
[2622] | 132 | !--- Adjustment of Helium amount |
---|
| 133 | ! if (i_he/=0) then |
---|
| 134 | ! trac(:,:,i_he)=trac(:,:,i_he)/2. |
---|
| 135 | ! endif |
---|
| 136 | !--- |
---|
[2523] | 137 | |
---|
[2188] | 138 | !------------------------------------------------------------------- |
---|
[2836] | 139 | ! Determination of chemistry reaction number |
---|
| 140 | !------------------------------------------------------------------- |
---|
| 141 | |
---|
| 142 | if (ok_chem) then |
---|
| 143 | ! set number of reactions, depending on ion chemistry or not |
---|
| 144 | nb_reaction_4_ion = 64 |
---|
| 145 | !nb_reaction_4_deut = 35 |
---|
| 146 | |
---|
| 147 | !Default numbers if no ion and no deuterium chemistry included |
---|
| 148 | |
---|
| 149 | nb_reaction_4_max = 98 ! set number of bimolecular reactions |
---|
| 150 | nb_reaction_3_max = 12 ! set number of quadratic reactions |
---|
| 151 | nquench = 13 ! set number of quenching + heterogeneous |
---|
| 152 | nphotion = 0 ! set number of photoionizations |
---|
| 153 | |
---|
| 154 | if (ok_ionchem) then |
---|
| 155 | nb_reaction_4_max = nb_reaction_4_max+nb_reaction_4_ion |
---|
| 156 | nphotion = 18 ! set number of photoionizations |
---|
| 157 | endif |
---|
| 158 | !if(deutchem) then |
---|
| 159 | ! nb_reaction_4_max = nb_reaction_4_max + nb_reaction_4_deut |
---|
| 160 | !end if |
---|
| 161 | |
---|
| 162 | !nb_phot_max is the total number of processes that are treated |
---|
| 163 | !numerically as a photolysis: |
---|
| 164 | |
---|
| 165 | nb_phot_max = nphot + nphotion + nquench |
---|
| 166 | |
---|
| 167 | !------------------------------------------------------------------- |
---|
[2188] | 168 | ! case of tracers re-initialisation with chemistry |
---|
| 169 | !------------------------------------------------------------------- |
---|
[2836] | 170 | |
---|
| 171 | if (reinit_trac .and. ok_chem) then |
---|
| 172 | |
---|
| 173 | !!! in this reinitialisation, trac is VOLUME mixing ratio |
---|
| 174 | ! ONLY SO2!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 175 | ! convert mass to volume mixing ratio |
---|
| 176 | do iq = 1,nqmax - nmicro |
---|
| 177 | trac(:,:,iq) = trac(:,:,iq)*mmean(:,:)/m_tr(iq) |
---|
| 178 | end do |
---|
| 179 | print*, "SO2 is re-initialised" |
---|
| 180 | if (i_so2 /= 0) then |
---|
| 181 | trac(:,1:22,i_so2) = 10.e-6 |
---|
| 182 | |
---|
| 183 | ! AL TRACERS!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 184 | ! print*, "Tracers are re-initialised" |
---|
| 185 | ! trac(:,:,:) = 1.0e-30 |
---|
| 186 | |
---|
| 187 | ! if ((i_ocs /= 0) .and. (i_co /= 0) .and. (i_hcl /= 0) |
---|
| 188 | ! $ .and. (i_so2 /= 0) .and. (i_h2o /= 0) |
---|
| 189 | ! $ .and. (i_n2 /= 0) .and. (i_co2 /= 0)) then |
---|
| 190 | |
---|
| 191 | ! trac(:,1:22,i_ocs) = 3.e-6 |
---|
| 192 | ! trac(:,1:22,i_co) = 25.e-6 |
---|
| 193 | ! trac(:,:,i_hcl) = 0.4e-6 |
---|
| 194 | ! trac(:,1:22,i_so2) = 7.e-6 |
---|
| 195 | ! trac(:,1:22,i_h2o) = 30.e-6 |
---|
| 196 | ! trac(:,:,i_n2) = 0.35e-1 |
---|
| 197 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 198 | |
---|
| 199 | ! ensure that sum of mixing ratios = 1 |
---|
| 200 | |
---|
| 201 | trac_sum(:,:) = 0. |
---|
| 202 | |
---|
| 203 | do iq = 1,nqmax - nmicro |
---|
| 204 | if (iq /= i_co2) then |
---|
| 205 | trac_sum(:,:) = trac_sum(:,:) + trac(:,:,iq) |
---|
| 206 | end if |
---|
| 207 | end do |
---|
| 208 | |
---|
| 209 | ! initialise co2 |
---|
| 210 | |
---|
| 211 | trac(:,:,i_co2) = 1. - trac_sum(:,:) |
---|
| 212 | |
---|
| 213 | else |
---|
| 214 | write(*,*) "at least one tracer is missing : stop" |
---|
| 215 | stop |
---|
| 216 | end if |
---|
| 217 | |
---|
| 218 | ! update mmean |
---|
| 219 | |
---|
| 220 | mmean(:,:) = 0. |
---|
| 221 | do iq = 1,nqmax - nmicro |
---|
| 222 | mmean(:,:) = mmean(:,:)+trac(:,:,iq)*m_tr(iq) |
---|
| 223 | enddo |
---|
| 224 | rnew(:,:) = 8.314/mmean(:,:)*1.e3 ! J/kg K |
---|
| 225 | |
---|
| 226 | ! convert volume to mass mixing ratio |
---|
| 227 | |
---|
| 228 | do iq = 1,nqmax - nmicro |
---|
| 229 | trac(:,:,iq) = trac(:,:,iq)*m_tr(iq)/mmean(:,:) |
---|
| 230 | end do |
---|
| 231 | |
---|
| 232 | end if ! reinit_trac |
---|
[2780] | 233 | |
---|
[2836] | 234 | end if ! ok_chem |
---|
[1661] | 235 | |
---|
[2188] | 236 | !------------------------------------------------------------------- |
---|
| 237 | ! case of detailed microphysics without chemistry |
---|
| 238 | !------------------------------------------------------------------- |
---|
[2780] | 239 | |
---|
[2193] | 240 | if (.not. ok_chem .and. ok_cloud .and. cl_scheme == 2) then |
---|
[1661] | 241 | |
---|
[2188] | 242 | ! convert mass to volume mixing ratio |
---|
| 243 | |
---|
| 244 | do iq = 1,nqmax - nmicro |
---|
[2193] | 245 | ztrac(:,:,iq) = trac(:,:,iq)*mmean(:,:)/m_tr(iq) |
---|
[2188] | 246 | end do |
---|
[1661] | 247 | |
---|
[2188] | 248 | ! initialise microphysics |
---|
| 249 | |
---|
[2193] | 250 | call vapors4muphy_ini(nlon,nlev,ztrac) |
---|
[1661] | 251 | |
---|
[2188] | 252 | ! convert volume to mass mixing ratio |
---|
| 253 | |
---|
| 254 | do iq = 1,nqmax - nmicro |
---|
[2193] | 255 | trac(:,:,iq) = ztrac(:,:,iq)*m_tr(iq)/mmean(:,:) |
---|
[2188] | 256 | end do |
---|
[1661] | 257 | |
---|
[2188] | 258 | end if |
---|
[1442] | 259 | |
---|
[2188] | 260 | end if ! debutphy |
---|
[1305] | 261 | |
---|
[2188] | 262 | !=================================================================== |
---|
| 263 | ! convert mass to volume mixing ratio : gas phase |
---|
| 264 | !=================================================================== |
---|
[1305] | 265 | |
---|
[2188] | 266 | do iq = 1,nqmax - nmicro |
---|
[2193] | 267 | ztrac(:,:,iq) = max(trac(:,:,iq)*mmean(:,:)/m_tr(iq), 1.e-30) |
---|
[2188] | 268 | end do |
---|
[1305] | 269 | |
---|
[2188] | 270 | !=================================================================== |
---|
| 271 | ! microphysics: simplified scheme (phd aurelien stolzenbach) |
---|
| 272 | !=================================================================== |
---|
[1305] | 273 | |
---|
[2188] | 274 | if (ok_cloud .and. cl_scheme == 1) then |
---|
[1661] | 275 | |
---|
[2188] | 276 | ! convert mass to volume mixing ratio : liquid phase |
---|
| 277 | |
---|
[2193] | 278 | ztrac(:,:,i_h2so4liq) = max(trac(:,:,i_h2so4liq) |
---|
| 279 | $ *mmean(:,:)/m_tr(i_h2so4liq), 1.e-30) |
---|
| 280 | ztrac(:,:,i_h2oliq) = max(trac(:,:,i_h2oliq) |
---|
| 281 | $ *mmean(:,:)/m_tr(i_h2oliq), 1.e-30) |
---|
[1661] | 282 | |
---|
[2188] | 283 | ! total water and sulfuric acid (gas + liquid) |
---|
[1305] | 284 | |
---|
[2193] | 285 | mrtwv(:,:) = ztrac(:,:,i_h2o) + ztrac(:,:,i_h2oliq) |
---|
| 286 | mrtsa(:,:) = ztrac(:,:,i_h2so4) + ztrac(:,:,i_h2so4liq) |
---|
[1305] | 287 | |
---|
[2188] | 288 | ! all water and sulfuric acid is put in the gas-phase |
---|
[1305] | 289 | |
---|
[2188] | 290 | mrwv(:,:) = mrtwv(:,:) |
---|
| 291 | mrsa(:,:) = mrtsa(:,:) |
---|
| 292 | |
---|
| 293 | ! call microphysics |
---|
| 294 | |
---|
[2193] | 295 | call new_cloud_venus(nlev, nlon, temp, pplay, |
---|
[2188] | 296 | $ mrtwv, mrtsa, mrwv, mrsa) |
---|
| 297 | |
---|
| 298 | ! update water vapour and sulfuric acid |
---|
| 299 | |
---|
[2193] | 300 | ztrac(:,:,i_h2o) = mrwv(:,:) |
---|
| 301 | ztrac(:,:,i_h2oliq) = mrtwv(:,:) - ztrac(:,:,i_h2o) |
---|
[1305] | 302 | |
---|
[2193] | 303 | ztrac(:,:,i_h2so4) = mrsa(:,:) |
---|
| 304 | ztrac(:,:,i_h2so4liq) = mrtsa(:,:) - ztrac(:,:,i_h2so4) |
---|
[1305] | 305 | |
---|
[2188] | 306 | end if ! simplified scheme |
---|
[1661] | 307 | |
---|
[2188] | 308 | !=================================================================== |
---|
| 309 | ! microphysics: detailed scheme (phd sabrina guilbon) |
---|
[2197] | 310 | ! !!! to be confirmed whether mad_muphy expects mmr or vmr for h2o and h2so4 |
---|
[2188] | 311 | !=================================================================== |
---|
[1661] | 312 | |
---|
[2188] | 313 | if (ok_cloud .and. cl_scheme == 2) then |
---|
[1661] | 314 | |
---|
[2197] | 315 | do iq = nqmax-nmicro+1,nqmax |
---|
| 316 | ztrac(:,:,iq) = trac(:,:,iq) |
---|
| 317 | end do |
---|
| 318 | |
---|
[2193] | 319 | do ilon = 1,nlon |
---|
| 320 | do ilev = 1, nlev |
---|
| 321 | if (temp(ilon,ilev) < 500.) then |
---|
| 322 | call mad_muphy(pdtphys, ! timestep |
---|
| 323 | $ temp(ilon,ilev),pplay(ilon,ilev), ! temperature and pressure |
---|
| 324 | $ ztrac(ilon,ilev,i_h2o), |
---|
| 325 | $ ztrac(ilon,ilev,i_h2so4), |
---|
| 326 | $ ztrac(ilon,ilev,i_m0_aer), |
---|
| 327 | $ ztrac(ilon,ilev,i_m3_aer), |
---|
| 328 | $ ztrac(ilon,ilev,i_m0_mode1drop), |
---|
| 329 | $ ztrac(ilon,ilev,i_m0_mode1ccn), |
---|
| 330 | $ ztrac(ilon,ilev,i_m3_mode1sa), |
---|
| 331 | $ ztrac(ilon,ilev,i_m3_mode1w), |
---|
| 332 | $ ztrac(ilon,ilev,i_m3_mode1ccn), |
---|
| 333 | $ ztrac(ilon,ilev,i_m0_mode2drop), |
---|
| 334 | $ ztrac(ilon,ilev,i_m0_mode2ccn), |
---|
| 335 | $ ztrac(ilon,ilev,i_m3_mode2sa), |
---|
| 336 | $ ztrac(ilon,ilev,i_m3_mode2w), |
---|
| 337 | $ ztrac(ilon,ilev,i_m3_mode2ccn)) |
---|
| 338 | else |
---|
| 339 | ztrac(ilon,ilev,i_m0_aer) = 0. |
---|
| 340 | ztrac(ilon,ilev,i_m3_aer) = 0. |
---|
| 341 | ztrac(ilon,ilev,i_m0_mode1drop) = 0. |
---|
| 342 | ztrac(ilon,ilev,i_m0_mode1ccn) = 0. |
---|
| 343 | ztrac(ilon,ilev,i_m3_mode1sa) = 0. |
---|
| 344 | ztrac(ilon,ilev,i_m3_mode1w) = 0. |
---|
| 345 | ztrac(ilon,ilev,i_m3_mode1ccn) = 0. |
---|
| 346 | ztrac(ilon,ilev,i_m0_mode2drop) = 0. |
---|
| 347 | ztrac(ilon,ilev,i_m0_mode2ccn) = 0. |
---|
| 348 | ztrac(ilon,ilev,i_m3_mode2sa) = 0. |
---|
| 349 | ztrac(ilon,ilev,i_m3_mode2w) = 0. |
---|
| 350 | ztrac(ilon,ilev,i_m3_mode2ccn) = 0. |
---|
| 351 | end if |
---|
| 352 | end do |
---|
| 353 | end do |
---|
[1661] | 354 | |
---|
[2188] | 355 | end if ! detailed scheme |
---|
| 356 | |
---|
| 357 | !=================================================================== |
---|
| 358 | ! photochemistry |
---|
| 359 | !=================================================================== |
---|
[1661] | 360 | |
---|
[2188] | 361 | if (ok_chem) then |
---|
[1661] | 362 | |
---|
[2188] | 363 | lon_sun = (0.5 - gmtime)*2.*rpi |
---|
| 364 | lon_local(:) = lon(:)*rpi/180. |
---|
| 365 | lat_local(:) = lat(:)*rpi/180. |
---|
[2836] | 366 | |
---|
| 367 | if (ok_ionchem) then |
---|
| 368 | |
---|
| 369 | vmr_dens_euv(:,:,ix_co2) = ztrac(:,:,i_co2) ! CO2 |
---|
| 370 | vmr_dens_euv(:,:,ix_co) = ztrac(:,:,i_co) ! CO |
---|
| 371 | vmr_dens_euv(:,:,ix_o) = ztrac(:,:,i_o) ! O |
---|
| 372 | vmr_dens_euv(:,:,ix_o1d) = ztrac(:,:,i_o1d) ! O(1D) |
---|
| 373 | vmr_dens_euv(:,:,ix_o2) = ztrac(:,:,i_o2) ! O2 |
---|
| 374 | vmr_dens_euv(:,:,ix_o3) = ztrac(:,:,i_o3) ! O3 |
---|
| 375 | vmr_dens_euv(:,:,ix_h) = ztrac(:,:,i_h) ! H |
---|
| 376 | vmr_dens_euv(:,:,ix_h2) = ztrac(:,:,i_h2) ! H2 |
---|
| 377 | vmr_dens_euv(:,:,ix_oh) = ztrac(:,:,i_oh) ! OH |
---|
| 378 | vmr_dens_euv(:,:,ix_ho2) = ztrac(:,:,i_ho2) ! HO2 |
---|
| 379 | vmr_dens_euv(:,:,ix_h2o2)= ztrac(:,:,i_h2o2) ! H2O2 |
---|
| 380 | vmr_dens_euv(:,:,ix_h2o) = ztrac(:,:,i_h2o) ! H2O |
---|
| 381 | vmr_dens_euv(:,:,ix_n) = ztrac(:,:,i_n) ! N |
---|
| 382 | vmr_dens_euv(:,:,ix_n2d) = ztrac(:,:,i_n2d) ! N(2D) |
---|
| 383 | vmr_dens_euv(:,:,ix_no) = ztrac(:,:,i_no) ! NO |
---|
| 384 | vmr_dens_euv(:,:,ix_no2) = ztrac(:,:,i_no2) ! NO2 |
---|
| 385 | vmr_dens_euv(:,:,ix_n2) = ztrac(:,:,i_n2) ! N2 |
---|
| 386 | |
---|
| 387 | end if |
---|
| 388 | |
---|
[2193] | 389 | do ilon = 1,nlon |
---|
[2780] | 390 | zlocal(:)=zzlay(ilon,:)/1000. |
---|
[2836] | 391 | |
---|
[2188] | 392 | ! solar zenith angle |
---|
[3035] | 393 | ! sza_local = acos(cos(lat_local(ilon))*cos(lon_local(ilon)) |
---|
| 394 | ! $ *cos(lon_sun) + cos(lat_local(ilon)) |
---|
| 395 | ! $ *sin(lon_local(ilon))*sin(lon_sun))*180./rpi |
---|
[1442] | 396 | |
---|
[3035] | 397 | sza_local = cos(lat_local(ilon))*cos(lon_local(ilon)) |
---|
[2188] | 398 | $ *cos(lon_sun) + cos(lat_local(ilon)) |
---|
[3035] | 399 | $ *sin(lon_local(ilon))*sin(lon_sun) |
---|
[2780] | 400 | |
---|
[3035] | 401 | ! Security - Handle rare cases where |sza_local| > 1 |
---|
| 402 | sza_local = min(sza_local,1.) |
---|
| 403 | sza_local = max(-1.,sza_local) |
---|
| 404 | sza_local = acos(sza_local)*180./rpi |
---|
| 405 | |
---|
[2836] | 406 | ! electron temperature |
---|
| 407 | do ilev = 1, nlev |
---|
| 408 | t_elec(ilev) = temp_elect(zlocal(ilev),temp(ilon,ilev), |
---|
| 409 | $ sza_local,t_elec_origin) |
---|
| 410 | end do |
---|
| 411 | |
---|
[2780] | 412 | call photochemistry_venus(nlev, nlon, zlocal, pdtphys, |
---|
[2836] | 413 | $ ok_jonline,ok_ionchem,tuneupperatm, |
---|
| 414 | $ nb_reaction_3_max,nb_reaction_4_max, |
---|
| 415 | $ nb_phot_max,nphotion,ilon, |
---|
| 416 | $ pplay(ilon,:)/100., |
---|
| 417 | $ temp(ilon,:), t_elec(:), |
---|
| 418 | $ ztrac(ilon,:,:),vmr_dens_euv(ilon,:,:), |
---|
| 419 | $ mmean(ilon,:), |
---|
| 420 | $ sza_local, |
---|
| 421 | $ lon(ilon), lat(ilon), |
---|
| 422 | $ nqmax, nespeuv, iter(ilon,:), |
---|
| 423 | $ prod_tr(ilon,:,:), |
---|
| 424 | $ loss_tr(ilon,:,:), |
---|
| 425 | $ no_em, o2_em) |
---|
[1661] | 426 | |
---|
[2795] | 427 | no_emi(ilon,:) = no_em(:) |
---|
| 428 | o2_emi(ilon,:) = o2_em(:) |
---|
| 429 | |
---|
[2580] | 430 | end do |
---|
[2188] | 431 | end if ! ok_chem |
---|
[1442] | 432 | |
---|
[2188] | 433 | !=================================================================== |
---|
[2193] | 434 | ! compute tendencies |
---|
[2188] | 435 | !=================================================================== |
---|
[1661] | 436 | |
---|
[2780] | 437 | ! update mmean |
---|
[2464] | 438 | |
---|
[2780] | 439 | mmean(:,:) = 0. |
---|
| 440 | do iq = 1,nqmax - nmicro |
---|
| 441 | mmean(:,:) = mmean(:,:)+ztrac(:,:,iq)*m_tr(iq) |
---|
| 442 | end do |
---|
| 443 | rnew(:,:) = 8.314/mmean(:,:)*1.e3 ! J/kg K |
---|
| 444 | |
---|
[2622] | 445 | !=================================================================== |
---|
| 446 | ! convert volume to mass mixing ratio / then tendencies in mmr |
---|
| 447 | !=================================================================== |
---|
[2780] | 448 | |
---|
[2188] | 449 | ! gas phase |
---|
| 450 | |
---|
| 451 | do iq = 1,nqmax - nmicro |
---|
[2200] | 452 | ztrac(:,:,iq) = max(ztrac(:,:,iq)*m_tr(iq)/mmean(:,:), |
---|
| 453 | $ 1.e-30) |
---|
[2193] | 454 | d_tr_chem(:,:,iq) = (ztrac(:,:,iq) - trac(:,:,iq))/pdtphys |
---|
[2188] | 455 | end do |
---|
| 456 | |
---|
[2194] | 457 | ! liquid phase or moments |
---|
[2188] | 458 | |
---|
| 459 | if (ok_cloud .and. cl_scheme == 1) then |
---|
[2200] | 460 | ztrac(:,:,i_h2so4liq) = max(ztrac(:,:,i_h2so4liq) |
---|
| 461 | $ *m_tr(i_h2so4liq)/mmean(:,:), |
---|
| 462 | $ 1.e-30) |
---|
| 463 | ztrac(:,:,i_h2oliq) = max(ztrac(:,:,i_h2oliq) |
---|
| 464 | $ *m_tr(i_h2oliq)/mmean(:,:), |
---|
| 465 | $ 1.e-30) |
---|
[2193] | 466 | d_tr_chem(:,:,i_h2so4liq) = (ztrac(:,:,i_h2so4liq) |
---|
| 467 | $ - trac(:,:,i_h2so4liq))/pdtphys |
---|
| 468 | d_tr_chem(:,:,i_h2oliq) = (ztrac(:,:,i_h2oliq) |
---|
| 469 | $ - trac(:,:,i_h2oliq))/pdtphys |
---|
[2188] | 470 | end if |
---|
[2193] | 471 | |
---|
[2194] | 472 | |
---|
| 473 | if (ok_cloud .and. cl_scheme == 2) then |
---|
| 474 | do iq = nqmax-nmicro+1,nqmax |
---|
| 475 | d_tr_chem(:,:,iq) = (ztrac(:,:,iq) - trac(:,:,iq))/pdtphys |
---|
| 476 | end do |
---|
| 477 | end if |
---|
| 478 | |
---|
[2188] | 479 | end subroutine phytrac_chimie |
---|