source: branches/jerome/src_flexwrf_v3.1/getvdep_nests.f90 @ 16

Last change on this file since 16 was 16, checked in by jebri, 11 years ago

sources for flexwrf v3.1

File size: 7.3 KB
Line 
1!**********************************************************************
2! Copyright 1998,1999,2000,2001,2002,2005,2007,2008,2009,2010         *
3! Andreas Stohl, Petra Seibert, A. Frank, Gerhard Wotawa,             *
4! Caroline Forster, Sabine Eckhardt, John Burkhart, Harald Sodemann   *
5!                                                                     *
6! This file is part of FLEXPART.                                      *
7!                                                                     *
8! FLEXPART is free software: you can redistribute it and/or modify    *
9! it under the terms of the GNU General Public License as published by*
10! the Free Software Foundation, either version 3 of the License, or   *
11! (at your option) any later version.                                 *
12!                                                                     *
13! FLEXPART is distributed in the hope that it will be useful,         *
14! but WITHOUT ANY WARRANTY; without even the implied warranty of      *
15! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the       *
16! GNU General Public License for more details.                        *
17!                                                                     *
18! You should have received a copy of the GNU General Public License   *
19! along with FLEXPART.  If not, see <http://www.gnu.org/licenses/>.   *
20!**********************************************************************
21
22subroutine getvdep_nests(n,ix,jy,ust,temp,pa, &
23       L,gr,rh,rr,vdepo,lnest)
24  !                   i i  i   i   i   i  i i  i  i    i o i
25  !*****************************************************************************
26  !                                                                            *
27  !  This routine calculates the dry deposition velocities.                    *
28  !                                                                            *
29  !     Author: A. Stohl                                                       *
30  !                                                                            *
31  !     20 December 1996                                                       *
32  !     Sabine Eckhardt, Jan 07                                                *
33  !     if the latitude is negative: add half a year to the julian day         *
34  !                                                                            *
35  !*****************************************************************************
36  !                                                                            *
37  ! Variables:                                                                 *
38  ! gr [W/m2]         global radiation                                         *
39  ! L [m]             Obukhov length                                           *
40  ! nyl               kinematic viscosity                                      *
41  ! pa [Pa]           surface air pressure                                     *
42  ! ra [s/m]          aerodynamic resistance                                   *
43  ! raquer [s/m]      average aerodynamic resistance                           *
44  ! rh [0-1]          relative humidity                                        *
45  ! rhoa              density of the air                                       *
46  ! rr [mm/h]         precipitation rate                                       *
47  ! temp [K]          2m temperature                                           *
48  ! tc [C]            2m temperature                                           *
49  ! ust [m/s]         friction velocity                                        *
50  ! snow [m of water equivalent] snow depth                                    *
51  ! xlanduse          fractions of numclasS landuses for each model grid point *
52  !                                                                            *
53  !*****************************************************************************
54
55  use par_mod
56  use com_mod
57
58  implicit none
59
60  integer :: yyyymmdd,hhmmss,yyyy,mmdd,n,lseason,i,j,ix,jy,lnest
61  real :: vdepo(maxspec),vd,rb(maxspec),rc(maxspec),raquer,ylat
62  real :: raerod,ra,ust,temp,tc,pa,L,gr,rh,rr,myl,nyl,rhoa,diffh2o,snow
63  real :: slanduse(numclass)
64  real,parameter :: eps=1.e-5
65  real(kind=dp) :: jul
66
67  snow=0.
68  ! Calculate month and determine the seasonal category
69  !****************************************************
70
71  jul=bdate+real(wftime(n),kind=dp)/86400._dp
72
73  ylat=jy*dy+ylat0
74  if (ylat.lt.0) then
75      jul=jul+365/2
76  endif
77
78
79  call caldate(jul,yyyymmdd,hhmmss)
80  yyyy=yyyymmdd/10000
81  mmdd=yyyymmdd-10000*yyyy
82
83  if ((ylat.gt.-20).and.(ylat.lt.20)) then
84     mmdd=600 ! summer
85  endif
86
87  if ((mmdd.ge.1201).or.(mmdd.le.301)) then
88    lseason=4
89  else if ((mmdd.ge.1101).or.(mmdd.le.331)) then
90    lseason=3
91  else if ((mmdd.ge.401).and.(mmdd.le.515)) then
92    lseason=5
93  else if ((mmdd.ge.516).and.(mmdd.le.915)) then
94    lseason=1
95  else
96    lseason=2
97  endif
98
99  ! Calculate diffusivity of water vapor
100  !************************************
101  diffh2o=2.11e-5*(temp/273.15)**1.94*(101325/pa)
102
103  ! Conversion of temperature from K to C
104  !**************************************
105
106  tc=temp-273.15
107
108  ! Calculate dynamic viscosity
109  !****************************
110
111  if (tc.lt.0) then
112    myl=(1.718+0.0049*tc-1.2e-05*tc**2)*1.e-05
113  else
114    myl=(1.718+0.0049*tc)*1.e-05
115  endif
116
117  ! Calculate kinematic viscosity
118  !******************************
119
120  rhoa=pa/(287.*temp)
121  nyl=myl/rhoa
122
123
124  ! 0. Set all deposition velocities zero
125  !**************************************
126
127  do i=1,nspec
128    vdepo(i)=0.
129  end do
130
131
132  ! 1. Compute surface layer resistances rb
133  !****************************************
134
135  call getrb(nspec,ust,nyl,diffh2o,reldiff,rb)
136
137  ! change for snow
138  do j=1,numclass
139    if (snow.gt.0.001) then ! 10 mm
140       if (j.eq.12) then
141         slanduse(j)=1.
142       else
143         slanduse(j)=0.
144       endif
145    else
146       slanduse(j)=xlandusen(ix,jy,j,lnest)
147    endif
148  end do
149
150  raquer=0.
151  do j=1,numclass            ! loop over all landuse classes
152
153    if (slanduse(j).gt.eps)  then
154
155  ! 2. Calculate aerodynamic resistance ra
156  !***************************************
157
158      ra=raerod(L,ust,z0(j))
159      raquer=raquer+ra*slanduse(j)
160
161  ! 3. Calculate surface resistance for gases
162  !******************************************
163
164      call getrc(nspec,lseason,j,tc,gr,rh,rr,rc)
165
166  ! 4. Calculate deposition velocities for gases and ...
167  ! 5. ... sum deposition velocities for all landuse classes
168  !*********************************************************
169
170      do i=1,nspec
171        if (reldiff(i).gt.0.) then
172          if ((ra+rb(i)+rc(i)).gt.0.) then
173            vd=1./(ra+rb(i)+rc(i))
174  ! XXXXXXXXXXXXXXXXXXXXXXXXXX TEST
175  !         vd=1./rc(i)
176  ! XXXXXXXXXXXXXXXXXXXXXXXXXX TEST
177          else
178            vd=9.999
179          endif
180          vdepo(i)=vdepo(i)+vd*slanduse(j)
181        endif
182      end do
183    endif
184  end do
185
186
187  ! 6. Calculate deposition velocities for particles
188  !*************************************************
189
190  call partdep(nspec,density,fract,schmi,vset,raquer,ust,nyl,vdepo)
191
192
193  ! 7. If no detailed parameterization available, take constant deposition
194  !    velocity if that is available
195  !***********************************************************************
196
197  do i=1,nspec
198    if ((reldiff(i).lt.0.).and.(density(i).lt.0.).and. &
199         (dryvel(i).gt.0.)) then
200      vdepo(i)=dryvel(i)
201    endif
202  end do
203
204
205end subroutine getvdep_nests
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG