[7062fab] | 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 | |
---|
[92a74b2] | 22 | subroutine get_vdep_prob(itime,xt,yt,zt,prob) |
---|
[7062fab] | 23 | ! i i i i o |
---|
| 24 | !***************************************************************************** |
---|
| 25 | ! * |
---|
[92a74b2] | 26 | ! Calculation of the probability for dyr deposition * |
---|
[7062fab] | 27 | ! * |
---|
[92a74b2] | 28 | ! Particle positions are read in - prob returned * |
---|
[7062fab] | 29 | ! * |
---|
| 30 | !***************************************************************************** |
---|
| 31 | ! * |
---|
| 32 | ! Variables: * |
---|
| 33 | ! itime [s] time at which this subroutine is entered * |
---|
| 34 | ! itimec [s] actual time, which is incremented in this subroutine * |
---|
| 35 | ! href [m] height for which dry deposition velocity is calculated * |
---|
| 36 | ! ldirect 1 forward, -1 backward * |
---|
| 37 | ! ldt [s] Time step for the next integration * |
---|
| 38 | ! lsynctime [s] Synchronisation interval of FLEXPART * |
---|
| 39 | ! ngrid index which grid is to be used * |
---|
| 40 | ! prob probability of absorption due to dry deposition * |
---|
| 41 | ! vdepo Deposition velocities for all species * |
---|
| 42 | ! xt,yt,zt Particle position * |
---|
| 43 | ! * |
---|
| 44 | !***************************************************************************** |
---|
| 45 | |
---|
| 46 | use point_mod |
---|
| 47 | use par_mod |
---|
| 48 | use com_mod |
---|
| 49 | use interpol_mod |
---|
| 50 | |
---|
| 51 | implicit none |
---|
| 52 | |
---|
| 53 | real(kind=dp) :: xt,yt |
---|
| 54 | real :: zt,xtn,ytn |
---|
| 55 | integer :: itime,i,j,k,memindnext |
---|
| 56 | integer :: nix,njy,ks |
---|
| 57 | real :: prob(maxspec),vdepo(maxspec) |
---|
| 58 | real,parameter :: eps=nxmax/3.e5 |
---|
| 59 | |
---|
| 60 | if (DRYDEP) then ! reset probability for deposition |
---|
| 61 | do ks=1,nspec |
---|
| 62 | depoindicator(ks)=.true. |
---|
| 63 | prob(ks)=0. |
---|
| 64 | end do |
---|
| 65 | endif |
---|
| 66 | |
---|
| 67 | |
---|
| 68 | ! Determine whether lat/long grid or polarstereographic projection |
---|
| 69 | ! is to be used |
---|
| 70 | ! Furthermore, determine which nesting level to be used |
---|
| 71 | !***************************************************************** |
---|
| 72 | |
---|
| 73 | if (nglobal.and.(yt.gt.switchnorthg)) then |
---|
| 74 | ngrid=-1 |
---|
| 75 | else if (sglobal.and.(yt.lt.switchsouthg)) then |
---|
| 76 | ngrid=-2 |
---|
| 77 | else |
---|
| 78 | ngrid=0 |
---|
| 79 | do j=numbnests,1,-1 |
---|
| 80 | if ((xt.gt.xln(j)+eps).and.(xt.lt.xrn(j)-eps).and. & |
---|
| 81 | (yt.gt.yln(j)+eps).and.(yt.lt.yrn(j)-eps)) then |
---|
| 82 | ngrid=j |
---|
| 83 | goto 23 |
---|
| 84 | endif |
---|
| 85 | end do |
---|
| 86 | 23 continue |
---|
| 87 | endif |
---|
| 88 | |
---|
| 89 | |
---|
| 90 | !*************************** |
---|
| 91 | ! Interpolate necessary data |
---|
| 92 | !*************************** |
---|
| 93 | |
---|
| 94 | if (abs(itime-memtime(1)).lt.abs(itime-memtime(2))) then |
---|
| 95 | memindnext=1 |
---|
| 96 | else |
---|
| 97 | memindnext=2 |
---|
| 98 | endif |
---|
| 99 | |
---|
| 100 | ! Determine nested grid coordinates |
---|
| 101 | !********************************** |
---|
| 102 | |
---|
| 103 | if (ngrid.gt.0) then |
---|
| 104 | xtn=(xt-xln(ngrid))*xresoln(ngrid) |
---|
| 105 | ytn=(yt-yln(ngrid))*yresoln(ngrid) |
---|
| 106 | ix=int(xtn) |
---|
| 107 | jy=int(ytn) |
---|
| 108 | nix=nint(xtn) |
---|
| 109 | njy=nint(ytn) |
---|
| 110 | else |
---|
| 111 | ix=int(xt) |
---|
| 112 | jy=int(yt) |
---|
| 113 | nix=nint(xt) |
---|
| 114 | njy=nint(yt) |
---|
| 115 | endif |
---|
| 116 | ixp=ix+1 |
---|
| 117 | jyp=jy+1 |
---|
| 118 | |
---|
| 119 | |
---|
| 120 | ! Determine probability of deposition |
---|
| 121 | !************************************ |
---|
| 122 | |
---|
| 123 | if ((DRYDEP).and.(zt.lt.2.*href)) then |
---|
| 124 | do ks=1,nspec |
---|
| 125 | if (DRYDEPSPEC(ks)) then |
---|
| 126 | if (depoindicator(ks)) then |
---|
| 127 | if (ngrid.le.0) then |
---|
| 128 | call interpol_vdep(ks,vdepo(ks)) |
---|
| 129 | else |
---|
| 130 | call interpol_vdep_nests(ks,vdepo(ks)) |
---|
| 131 | endif |
---|
| 132 | endif |
---|
| 133 | ! correction by Petra Seibert, 10 April 2001 |
---|
| 134 | ! this formulation means that prob(n) = 1 - f(0)*...*f(n) |
---|
| 135 | ! where f(n) is the exponential term |
---|
| 136 | prob(ks)=vdepo(ks) |
---|
| 137 | ! prob(ks)=vdepo(ks)/2./href |
---|
| 138 | ! instead of prob - return vdepo -> result kg/m2/s |
---|
| 139 | endif |
---|
| 140 | end do |
---|
| 141 | endif |
---|
| 142 | |
---|
| 143 | |
---|
[92a74b2] | 144 | end subroutine get_vdep_prob |
---|
[7062fab] | 145 | |
---|