source: trunk/LMDZ.MARS/libf/aeronomars/deposition.F @ 3026

Last change on this file since 3026 was 1266, checked in by aslmd, 11 years ago

LMDZ.MARS
IMPORTANT CHANGE

  • Remove all reference/use of nlayermx and dimphys.h
  • Made use of automatic arrays whenever arrays are needed with dimension nlayer
  • Remove lots of obsolete reference to dimensions.h
  • Converted iono.h and param_v4.h into corresponding modules

(with embedded subroutine to allocate arrays)
(no arrays allocated if thermosphere not used)

  • Deleted param.h and put contents into module param_v4_h
  • Adapted testphys1d, newstart, etc...
  • Made DATA arrays in param_read to be initialized by subroutine

fill_data_thermos in module param_v4_h

  • Optimized computations in paramfoto_compact (twice less dlog10 calculations)
  • Checked consistency before/after modification in debug mode
  • Checked performance is not impacted (same as before)
File size: 5.9 KB
Line 
1      subroutine deposition(ngrid, nlayer, nq,
2     &                      ig, ig_vl1, pplay, pplev, zzlay, zzlev,
3     $                      zu, zv, zt, zycol, ptimestep, co2ice)
4cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
5c
6c     dry deposition of chemical species
7c
8cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
9c
10      use surfdat_h, only: z0 ! surface roughness
11      use conc_mod, only: rnew ! specific gas constant
12      implicit none
13c
14c
15c     input
16c
17      integer,intent(in) :: ngrid ! number of atmospheric columns
18      integer,intent(in) :: nlayer ! number of atmospheric layers
19      integer,intent(in) :: nq ! number of tracers
20      integer ig                     ! grid point index
21      integer ig_vl1                 ! viking 1 grid point
22      real    pplay(ngrid,nlayer)    ! pressure at the middle of the layers (pa)
23      real    pplev(ngrid,nlayer+1)  ! pressure at layer boundaries (pa)
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    zu(ngrid,nlayer)       ! u component of the wind (m.s-1)
27      real    zv(ngrid,nlayer)       ! v component of the wind (m.s-1)
28      real    zt(ngrid,nlayer)       ! temperature (k)
29      real    zycol(nlayer,nq)       ! composition (volume mixing ratio)
30      real    ptimestep              ! physical timestep (s)
31      real    co2ice(ngrid)          ! co2 ice surface layer (kg.m-2)
32c
33c     local
34c
35      real    ubar                       ! wind module (m.s-1)
36      real    ustar                      ! friction velocity (m.s-1)
37      real    karman                     ! von karman constant
38      real    ra                         ! aerodynamic resistance (s.m-1)
39      real    rb                         ! quasi-laminar layer resistance (s.m-1)
40      real    vd                         ! dry deposition velocity (cm.s-1)
41      real    deltaz                     ! thickness of first layer (m)
42      real    mu0                        ! dynamic viscosity of co2 at 293.15 k (pa.s)
43      real    mu                         ! dynamic viscosity of co2 (pa.s)
44      real    nu                         ! kinematic viscosity of co2 (cm2.s-1)
45      real    rho                        ! density
46      real    d                          ! molecular diffusivity of methane (cm2.s-1)
47      real    schmidt                    ! schmidt number
48      real    prandtl                    ! prandtl number
49      real    p0                         ! reference pressure (pa)
50      real    loss                       ! loss rate (s-1)                       
51      integer iq
52c
53      real    nuch4
54      real    tau
55      real    gravity
56      real    gam
57      real    dp
58      real    cd
59c
60      data    karman / 0.4 /
61      data    prandtl / 0.72 /
62      data    mu0 / 14.8e-6 /
63      data    p0 /1.e5/
64c
65c     deposition is only active on surface uncovered by ice
66c
67c     if ((.not. watercaptag(ig)) .and. (co2ice(ig) .eq. 0.)) then
68c
69c        wind module (m.s-1)
70c
71         ubar = (zu(ig,1)**2. + zv(ig,1)**2.)**0.5
72c
73c        friction velocity (m.s-1)
74c
75         ustar = ubar*karman/log(zzlay(ig,1)/z0(ig))
76c
77c        aerodynamic resistance (s.m-1)
78c
79         ra = 1./(karman*ustar)*log(zzlay(ig,1)/z0(ig))
80c
81c        molecular diffusivity of methane in *air*  (cm2.s-1)
82c        massman, atmospheric environment, 32, 1111-1127, 1998
83c
84         d = 0.1952*(p0/pplay(ig,1))*(zt(ig,1)/273.15)**1.81
85c
86c        dynamic viscosity: temperature dependance (pa.s)
87c        sutherland's formula
88c
89         mu = mu0*(293.15 + 240.)/(zt(ig,1) + 240.)
90     $           *(zt(ig,1)/293.15)**(3./2.)
91c
92c        density (kg.m-3)
93c
94         rho = pplay(ig,1)/(rnew(ig,1)*zt(ig,1))
95c
96c        kinematic viscosity (cm2.s-1)
97c
98         nu = mu/rho*1.e4
99c
100c        schmidt number
101c
102         schmidt = nu/d
103c
104c        quasi-laminar layer resistance (s.m-1)
105c
106         rb = (2./(karman*ustar))*(schmidt/prandtl)**2./3.
107c
108c        dry deposition velocity (m.s-1)
109c
110         vd = 1./(ra + rb)
111c
112c        thickness of first layer (m)
113c
114         deltaz = zzlev(ig,2) - zzlev(ig,1)
115c
116c        loss rate (s-1)
117c
118         loss = vd/deltaz
119c
120c        test
121c
122c        loss = 1./(3600.*6.)
123c        vd = loss*deltaz
124c
125         nuch4 = sqrt(8.*8.31*zt(ig,1)
126     $                /(3.1416*16.e-3))
127         tau = 6.*3600.
128         gravity = 3.7
129         dp = pplev(ig,1) - pplev(ig,2)
130         cd = (karman/log(zzlay(ig,1)/z0(ig)))**2.
131c
132         gam = (4./nuch4)*dp
133     $        /(tau*gravity*rho - 1./(cd*ubar))
134c
135c        methane index
136c
137         iq = 12
138c
139c        update methane in first layer
140c
141c        zycol(1,iq) = zycol(1,iq)*exp(-loss*ptimestep)
142c
143         if (ig .eq. ig_vl1) then
144            print*,'**** deposition ****'
145            print*,'z0     = ', z0(ig), 'm'
146            print*,'deltaz = ', deltaz, ' m'
147            print*,'deltap = ', dp, 'pa'
148            print*,'zzlay  = ', zzlay(ig, 1), ' m'
149            print*,'pplay  = ', pplay(ig, 1), ' pa'
150            print*,'t      = ', zt(ig,1), ' k'
151            print*,'u      = ', zu(ig,1), ' m.s-1'
152            print*,'v      = ', zv(ig,1), ' m.s-1'
153            print*,'rho    = ', rho, ' kg.m-3'
154            print*,'ubar   = ', ubar, ' m.s-1'
155            print*,'d      = ', d, ' cm2.s-1'
156            print*,'mu     = ', mu, ' pa.s'
157            print*,'nu     = ', nu, ' cm2.s-1'
158            print*,'schmi  = ', schmidt
159            print*,'Ra     = ', ra, ' s.m-1'
160            print*,'Rb     = ', rb, ' s.m-1'
161            print*,'vd     = ', vd*100., 'cm.s-1'
162            print*,'tau dep= ', 1./loss, 's'
163            print*,'R      = ', rnew(ig,1)
164            print*,'nuch4  = ', nuch4, 'm.s-1'
165            print*,'tau    = ', tau, ' s'
166            print*,'gamma  = ', gam
167            print*,'taugrho= ',tau*gravity*rho
168            print*,'1surcdu= ', 1./(cd*ubar)
169
170            print*,'********************'
171         end if
172c
173c     end if
174c
175      return
176      end
Note: See TracBrowser for help on using the repository browser.