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

Last change on this file since 16 was 16, checked in by jebri, 10 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(n,ix,jy,ust,temp,pa,L,gr,rh,rr,vdepo)
23  !                   i i  i   i   i   i  i i  i  i    o
24  !*****************************************************************************
25  !                                                                            *
26  !  This routine calculates the dry deposition velocities.                    *
27  !                                                                            *
28  !     Author: A. Stohl                                                       *
29  !                                                                            *
30  !     20 December 1996                                                       *
31  !     Sabine Eckhardt, Jan 07                                                *
32  !     if the latitude is negative: add half a year to the julian day         *
33  !                                                                            *
34  !*****************************************************************************
35  !                                                                            *
36  ! Variables:                                                                 *
37  ! gr [W/m2]         global radiation                                         *
38  ! L [m]             Obukhov length                                           *
39  ! nyl               kinematic viscosity                                      *
40  ! pa [Pa]           surface air pressure                                     *
41  ! ra [s/m]          aerodynamic resistance                                   *
42  ! raquer [s/m]      average aerodynamic resistance                           *
43  ! rh [0-1]          relative humidity                                        *
44  ! rhoa              density of the air                                       *
45  ! rr [mm/h]         precipitation rate                                       *
46  ! temp [K]          2m temperature                                           *
47  ! tc [C]            2m temperature                                           *
48  ! ust [m/s]         friction velocity                                        *
49  ! snow [m of water equivalent] snow depth                                    *
50  ! xlanduse          fractions of numclasS landuses for each model grid point *
51  !                                                                            *
52  !*****************************************************************************
53
54  use par_mod
55  use com_mod
56
57  implicit none
58
59  integer :: yyyymmdd,hhmmss,yyyy,mmdd,n,lseason,i,j,ix,jy
60  real :: vdepo(maxspec),vd,rb(maxspec),rc(maxspec),raquer,ylat
61  real :: raerod,ra,ust,temp,tc,pa,L,gr,rh,rr,myl,nyl,rhoa,diffh2o,snow
62  real :: slanduse(numclass)
63  real,parameter :: eps=1.e-5
64  real(kind=dp) :: jul
65
66!JB: assume no snow input from WRF
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)=xlanduse(ix,jy,j)
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
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG