source: trunk/LMDZ.GENERIC/libf/aeronostd/deposition_source.F90 @ 2595

Last change on this file since 2595 was 2542, checked in by aslmd, 3 years ago

Generic GCM:

Large update of the chemical modules

  • Read chemical network from input files
  • Init chemistry with ModernTrac?
  • Photolysis online calculation

YJ

File size: 3.2 KB
Line 
1      subroutine deposition_source(ngrid, nlayer, nq,   &
2                           ig, zzlay, zzlev,zdens,      &
3                           zycol, ptimestep)
4!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
5!
6!     dry deposition of chemical species
7!
8!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
9!
10      use chimiedata_h
11      use gases_h
12      use tracer_h, only: noms, nesp, mmol
13      use conc_mod, only: mmean ! mean molecular mass of the atmosphere
14
15      implicit none
16!
17!
18!     input
19!
20      integer,intent(in) :: ngrid    ! number of atmospheric columns
21      integer,intent(in) :: nlayer   ! number of atmospheric layers
22      integer,intent(in) :: nq       ! number of tracers
23      integer ig                     ! grid point index
24      real    zzlay(ngrid,nlayer)    ! altitude at the middle of the layers (m)
25      real    zzlev(ngrid,nlayer+1)  ! altitude at layer boundaries (m)
26      real    zdens(nlayer)          ! density (cm^-3)
27      real    zycol(nlayer,nesp)     ! composition (volume mixing ratio)
28      real    ptimestep              ! physical timestep (s)
29!
30!     local
31!
32      real    vd                         ! dry deposition velocity (cm.s-1)
33      real    deltaz                     ! thickness of first layer (m)
34      real    deltaznlay                 ! thickness of last layer (m)
35      real    loss                       ! loss rate (s-1)
36      real    prod                       ! production rate (s-1)
37      integer iq
38      logical, save :: firstcall = .true.
39
40
41      if (firstcall) then
42         print*,'photochemistry: initialize deposition/source'
43
44         ! You can set SF_mode/SF_value/prod_rate in traceur.def with #Moderntrac-v1
45         !! Cases SF_mode=1 (fixed mixing ratio)
46         !SF_mode(igcm_co2)=1
47         !SF_value(igcm_co2)=gfrac(igas_CO2)
48
49         !! Cases SF_mode=2 (production flux in molecules/m2/s)
50         !prod_rate(indexchim('co'))=3.0e13
51
52         firstcall=.false.
53      endif !firstcall
54
55      ! thickness of first layer (m)
56      deltaz = zzlev(ig,2) - zzlev(ig,1)
57      deltaznlay = zzlev(ig,nlayer) - zzlev(ig,nlayer-1)
58
59      ! hydrogen escape
60      !escape(ig,indexchim('h2'))=2.5e17*(zycol(nlayer,indexchim('h2'))+2*zycol(nlayer,indexchim('ch4'))+zycol(nlayer,indexchim('h2o_vap')))
61
62      do iq=1,nesp
63        if(SF_mode(iq).eq.1) then
64          surface_flux(ig,iq)=(SF_value(iq)-zycol(1,iq))/ptimestep*(zdens(1)*1e6*deltaz)
65          zycol(1,iq) = SF_value(iq)
66          !! Set mmr instead of vmr
67          !surface_flux(ig,iq)=(SF_value(iq)*mmean(ig,1)/mmol(iq+1)-zycol(1,iq))/ptimestep*(zdens(1)*1e6*deltaz)
68          !zycol(1,iq) = SF_value(iq)*mmean(ig,1)/mmol(iq+1)
69          zycol(nlayer,iq) = zycol(nlayer,iq)-ptimestep*escape(ig,iq)/(zdens(nlayer)*1e6*deltaznlay)
70        elseif(SF_mode(iq).eq.2) then ! loss/prod rate (s-1)
71          loss = 0.01*SF_value(iq)/deltaz
72          zycol(1,iq) = zycol(1,iq)*exp(-loss*ptimestep)+(prod_rate(iq)/(zdens(1)*1e6*deltaz))*ptimestep
73          zycol(nlayer,iq) = zycol(nlayer,iq)-ptimestep*escape(ig,iq)/(zdens(nlayer)*1e6*deltaznlay)
74          surface_flux(ig,iq)=-0.01*SF_value(iq)*zycol(1,iq)*(zdens(1)*1e6)+prod_rate(iq)
75        endif
76      enddo ! end nesp
77
78      return
79      end
Note: See TracBrowser for help on using the repository browser.