Changeset 3009
- Timestamp:
- Jul 24, 2023, 3:09:24 AM (16 months ago)
- Location:
- trunk/LMDZ.GENERIC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/README
r2960 r3009 1817 1817 Minor follow-up to r2957, since H2O aerosol variance is uniform in space 1818 1818 and time, no need to compute or print its min/max at each radiative time step. 1819 1820 == 23/07/2023 == YJ 1821 Chemistry: correction in photolysis online with level instead of layer -
trunk/LMDZ.GENERIC/libf/aeronostd/photolysis_online.F
r2553 r3009 2 2 3 3 subroutine photolysis_online(nlayer, alt, press, temp, 4 $ zmmean, rm,4 $ mmean, rm, 5 5 $ tau, sza, dist_sol, v_phot, e_phot, ig, ngrid, 6 6 $ nreact) … … 31 31 integer, intent(in) :: ngrid ! number of atmospheric columns 32 32 33 real, intent(in), dimension(nlayer) :: press, temp, zmmean! pressure (hpa)/temperature (k)/mean molecular mass (g.mol-1)33 real, intent(in), dimension(nlayer) :: press, temp, mmean ! pressure (hpa)/temperature (k)/mean molecular mass (g.mol-1) 34 34 real, intent(in), dimension(nlayer) :: alt ! altitude (km) 35 35 real, intent(in), dimension(nlayer,nesp) :: rm ! mixing ratios … … 52 52 ! atmosphere 53 53 54 real, dimension(nw) :: albedo_chim ! Surface albedo calculated on chemistry wavelenght grid 55 real, dimension(nlayer) :: colinc ! air column increment (molecule.cm-2) 56 real, dimension(nlayer) :: airlev ! air density at each specified altitude (molec/cc) 57 real, dimension(nlayer) :: edir, edn, eup ! normalised irradiances 58 real, dimension(nlayer) :: fdir, fdn, fup ! normalised actinic fluxes 59 real, dimension(nlayer) :: saflux ! total actinic flux 60 real, dimension(nlayer,nw) :: dtrl ! rayleigh optical depth 61 real, dimension(nlayer,nw) :: dtaer ! aerosol optical depth 62 real, dimension(nlayer,nw) :: omaer ! aerosol single scattering albedo 63 real, dimension(nlayer,nw) :: gaer ! aerosol asymmetry parameter 64 real, dimension(nlayer,nw) :: dtcld ! cloud optical depth 65 real, dimension(nlayer,nw) :: omcld ! cloud single scattering albedo 66 real, dimension(nlayer,nw) :: gcld ! cloud asymmetry parameter 67 real, dimension(nlayer,nw) :: dagas ! total gas optical depth 68 real, dimension(nlayer,nw,nabs) :: dtgas ! optical depth for each gas 69 70 integer, dimension(0:nlayer) :: nid 71 real, dimension(0:nlayer,nlayer) :: dsdh 54 real, dimension(nw) :: albedo_chim ! Surface albedo calculated on chemistry wavelenght grid 55 real, dimension(nlayer+1) :: colinc ! air column increment (molecule.cm-2) 56 real, dimension(nlayer+1) :: airlev ! air density at each specified altitude (molec/cc) 57 real, dimension(nlayer+1) :: edir, edn, eup ! normalised irradiances 58 real, dimension(nlayer+1) :: fdir, fdn, fup ! normalised actinic fluxes 59 real, dimension(nlayer+1) :: saflux ! total actinic flux 60 real, dimension(nlayer+1,nw) :: dtrl ! rayleigh optical depth 61 real, dimension(nlayer+1,nw) :: dtaer ! aerosol optical depth 62 real, dimension(nlayer+1,nw) :: omaer ! aerosol single scattering albedo 63 real, dimension(nlayer+1,nw) :: gaer ! aerosol asymmetry parameter 64 real, dimension(nlayer+1,nw) :: dtcld ! cloud optical depth 65 real, dimension(nlayer+1,nw) :: omcld ! cloud single scattering albedo 66 real, dimension(nlayer+1,nw) :: gcld ! cloud asymmetry parameter 67 real, dimension(nlayer+1,nw) :: dagas ! total gas optical depth 68 real, dimension(nlayer+1,nw,nabs) :: dtgas ! optical depth for each gas 69 real, dimension(nlayer+1) :: zpress ! pressure (hpa)/altitude (km)/temperature (k)/mean molecular mass (g.mol-1) 70 real, dimension(nlayer+1) :: zalt ! pressure (hpa)/altitude (km)/temperature (k)/mean molecular mass (g.mol-1) 71 real, dimension(nlayer+1) :: ztemp ! pressure (hpa)/altitude (km)/temperature (k)/mean molecular mass (g.mol-1) 72 real, dimension(nlayer+1) :: zmmean ! pressure (hpa)/altitude (km)/temperature (k)/mean molecular mass (g.mol-1) 73 74 integer, dimension(0:nlayer+1) :: nid 75 real, dimension(0:nlayer+1,nlayer+1) :: dsdh 72 76 73 77 integer :: i, ilay, iw, ialt, iphot, ispe, ij, igas, ireact 78 integer :: ilev, nlev 74 79 real :: deltaj 75 80 81 !==== define working vertical grid for the uv radiative code 82 83 nlev = nlayer + 1 84 85 do ilev = 1,nlev-1 86 zpress(ilev) = press(ilev) 87 zalt(ilev) = alt(ilev) 88 ztemp(ilev) = temp(ilev) 89 zmmean(ilev) = mmean(ilev) 90 end do 91 92 zpress(nlev) = 0. ! top of the atmosphere 93 zalt(nlev) = zalt(nlev-1) + (zalt(nlev-1) - zalt(nlev-2)) 94 ztemp(nlev) = ztemp(nlev-1) 95 zmmean(nlev) = zmmean(nlev-1) 96 76 97 !==== air column increments and rayleigh optical depth 77 98 78 call setair(nl ayer, nw, wl, wc, press,temp, zmmean, colinc, dtrl,99 call setair(nlev, nw, wl, wc, zpress, ztemp, zmmean, colinc, dtrl, 79 100 $ airlev) 80 101 … … 89 110 igas = 0 90 111 ireact = 0 112 dtgas(:,:,:) = 0. 91 113 92 114 do while(iphot<nb_phot_hv_max) … … 166 188 !==== set aerosol properties and optical depth 167 189 168 call setaer(nl ayer,alt,tau,nw,dtaer,omaer,gaer)190 call setaer(nlev,zalt,tau,nw,dtaer,omaer,gaer) 169 191 170 192 !==== set cloud properties and optical depth 171 193 172 call setcld(nl ayer,nw,dtcld,omcld,gcld)194 call setcld(nlev,nw,dtcld,omcld,gcld) 173 195 174 196 !==== slant path lengths in spherical geometry 175 197 176 call sphers(nl ayer,alt,sza,dsdh,nid)198 call sphers(nlev,zalt,sza,dsdh,nid) 177 199 178 200 !==== solar flux at mars … … 198 220 ! dir = direct beam, dn = down-welling diffuse, up = up-welling diffuse 199 221 200 call rtlink(nl ayer, nw, iw, albedo_chim(iw),222 call rtlink(nlev, nw, iw, albedo_chim(iw), 201 223 $ sza, dsdh, nid, dtrl, 202 224 $ dagas, dtcld, omcld, gcld, dtaer, omaer, gaer, … … 276 298 colinc(ilev) = avocado*0.1*dp/(zmmean(ilev)*g) 277 299 end do 278 colinc(nlev) = avocado*0.1*press(nlev)*100./(zmmean(nlev)*g)300 colinc(nlev) = 0.0 279 301 280 302 do iw = 1, nw - 1 … … 308 330 !============================================================================== 309 331 310 subroutine setaer(nl ayer,alt,tau,nw,dtaer,omaer,gaer)332 subroutine setaer(nlev,zalt,tau,nw,dtaer,omaer,gaer) 311 333 312 334 !-----------------------------------------------------------------------------* … … 320 342 ! input 321 343 322 integer :: nl ayer! number of vertical layers323 integer :: nw 324 real, dimension(nl ayer) :: alt! altitude (km)325 real :: tau 344 integer :: nlev ! number of vertical layers 345 integer :: nw ! number of wavelength grid points 346 real, dimension(nlev) :: zalt ! altitude (km) 347 real :: tau ! integrated aerosol optical depth at the surface 326 348 327 349 ! output 328 350 329 real, dimension(nl ayer,nw) :: dtaer ! aerosol optical depth330 real, dimension(nl ayer,nw) :: omaer ! aerosol single scattering albedo331 real, dimension(nl ayer,nw) :: gaer ! aerosol asymmetry parameter351 real, dimension(nlev,nw) :: dtaer ! aerosol optical depth 352 real, dimension(nlev,nw) :: omaer ! aerosol single scattering albedo 353 real, dimension(nlev,nw) :: gaer ! aerosol asymmetry parameter 332 354 333 355 ! local 334 356 335 integer :: il ay, iw336 real, dimension(nl ayer) :: aer! dust extinction357 integer :: ilev, iw 358 real, dimension(nlev) :: aer ! dust extinction 337 359 real :: omega, g, scaleh, gamma 338 360 real :: dz, tautot, q0 … … 350 372 351 373 tautot = 0. 352 do il ay = 1, nlayer-1353 dz = alt(ilay+1) - alt(ilay)354 tautot = tautot + exp(gamma*(1. - exp( alt(ilay)/scaleh)))*dz374 do ilev = 1, nlev-1 375 dz = zalt(ilev+1) - zalt(ilev) 376 tautot = tautot + exp(gamma*(1. - exp(zalt(ilev)/scaleh)))*dz 355 377 end do 356 378 357 379 q0 = tau/tautot 358 do il ay = 1, nlayer-1359 dz = alt(ilay+1) - alt(ilay)360 dtaer(il ay,:) = q0*exp(gamma*(1. - exp(alt(ilay)/scaleh)))*dz361 omaer(il ay,:) = omega362 gaer(il ay,:) = g380 do ilev = 1, nlev-1 381 dz = zalt(ilev+1) - zalt(ilev) 382 dtaer(ilev,:) = q0*exp(gamma*(1. - exp(zalt(ilev)/scaleh)))*dz 383 omaer(ilev,:) = omega 384 gaer(ilev,:) = g 363 385 end do 364 386 … … 367 389 !============================================================================== 368 390 369 subroutine setcld(nl ayer,nw,dtcld,omcld,gcld)391 subroutine setcld(nlev,nw,dtcld,omcld,gcld) 370 392 371 393 !-----------------------------------------------------------------------------* … … 379 401 ! input 380 402 381 integer :: nl ayer! number of vertical layers382 integer :: nw 403 integer :: nlev ! number of vertical layers 404 integer :: nw ! number of wavelength grid points 383 405 384 406 ! output 385 407 386 real, dimension(nl ayer,nw) :: dtcld ! cloud optical depth387 real, dimension(nl ayer,nw) :: omcld ! cloud single scattering albedo388 real, dimension(nl ayer,nw) :: gcld ! cloud asymmetry parameter408 real, dimension(nlev,nw) :: dtcld ! cloud optical depth 409 real, dimension(nlev,nw) :: omcld ! cloud single scattering albedo 410 real, dimension(nlev,nw) :: gcld ! cloud asymmetry parameter 389 411 390 412 ! local 391 413 392 integer :: il ay, iw414 integer :: ilev, iw 393 415 394 416 ! dtcld : optical depth … … 396 418 ! gcld : asymmetry factor 397 419 398 do il ay = 1, nlayer- 1420 do ilev = 1, nlev - 1 399 421 do iw = 1, nw - 1 400 dtcld(il ay,iw) = 0. ! no clouds for the moment401 omcld(il ay,iw) = 0.99402 gcld(il ay,iw) = 0.85422 dtcld(ilev,iw) = 0. ! no clouds for the moment 423 omcld(ilev,iw) = 0.99 424 gcld(ilev,iw) = 0.85 403 425 end do 404 426 end do … … 1150 1172 1151 1173 use chimiedata_h, only: albedo_snow_chim, albedo_co2_ice_chim 1152 use slab_ice_h, only: h_alb_ice, alb_ice_min, alb_ice_max 1174 use slab_ice_h, only: alb_ocean, h_alb_ice, 1175 & alb_ice_min, alb_ice_max 1153 1176 use tracer_h, only: igcm_h2o_ice, igcm_co2_ice 1154 use callkeys_mod, only: ok_slab_ocean, co2cond , alb_ocean1177 use callkeys_mod, only: ok_slab_ocean, co2cond 1155 1178 use phys_state_var_mod, only: albedo_bareground, 1156 1179 & rnat, qsurf, sea_ice,
Note: See TracChangeset
for help on using the changeset viewer.