source: flexpart.git/src/drydepokernel.f90 @ 4c64400

10.4.1_peseiGFS_025bugfixes+enhancementsdevrelease-10release-10.4.1scaling-bugunivie
Last change on this file since 4c64400 was 4c64400, checked in by Espen Sollum ATMOS <eso@…>, 7 years ago

Bugfix for double precision dry deposition calculation. Added (hardcoded) option to not use output kernel. Version/date string updated.

  • Property mode set to 100644
File size: 5.3 KB
RevLine 
[e200b7a]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 drydepokernel(nunc,deposit,x,y,nage,kp)
23  !                          i      i    i i  i
24  !*****************************************************************************
25  !                                                                            *
26  !     Attribution of the deposition to the grid using a uniform kernel with  *
27  !     bandwidths dx and dy.                                                  *
28  !                                                                            *
29  !     Author: A. Stohl                                                       *
30  !                                                                            *
31  !     26 December 1996                                                       *
32  !                                                                            *
33  !*****************************************************************************
34  !                                                                            *
35  ! Variables:                                                                 *
36  !                                                                            *
37  ! nunc             uncertainty class of the respective particle              *
38  ! nage             age class of the respective particle                      *
39  ! deposit          amount (kg) to be deposited                               *
40  !                                                                            *
41  !*****************************************************************************
[4c64400]42  ! Changes:
43  ! eso 10/2016: Added option to disregard kernel
44  !
45  !*****************************************************************************
46
[e200b7a]47
48  use unc_mod
49  use par_mod
50  use com_mod
51
52  implicit none
53
[4c64400]54  real(dep_prec), dimension(maxspec) :: deposit
55  real :: x,y,ddx,ddy,xl,yl,wx,wy,w
[e200b7a]56  integer :: ix,jy,ixp,jyp,ks,nunc,nage,kp
57
58
59  xl=(x*dx+xoutshift)/dxout
60  yl=(y*dy+youtshift)/dyout
61  ix=int(xl)
62  jy=int(yl)
63  ddx=xl-real(ix)                   ! distance to left cell border
64  ddy=yl-real(jy)                   ! distance to lower cell border
65
66  if (ddx.gt.0.5) then
67    ixp=ix+1
68    wx=1.5-ddx
69  else
70    ixp=ix-1
71    wx=0.5+ddx
72  endif
73
74  if (ddy.gt.0.5) then
75    jyp=jy+1
76    wy=1.5-ddy
77  else
78    jyp=jy-1
79    wy=0.5+ddy
80  endif
81
[4c64400]82  ! If no kernel is used, direct attribution to grid cell
83  !******************************************************
84
85  if (lnokernel) then
86    do ks=1,nspec
87      if ((abs(deposit(ks)).gt.0).and.DRYDEPSPEC(ks)) then
88        if ((ix.ge.0).and.(jy.ge.0).and.(ix.le.numxgrid-1).and. &
89             (jy.le.numygrid-1)) then
90          drygridunc(ix,jy,ks,kp,nunc,nage)= &
91               drygridunc(ix,jy,ks,kp,nunc,nage)+deposit(ks)
92        end if
93      end if
94    end do
95  else ! use kernel
96
[e200b7a]97
98  ! Determine mass fractions for four grid points
99  !**********************************************
[4c64400]100  do ks=1,nspec
[e200b7a]101
[4c64400]102   if ((abs(deposit(ks)).gt.0).and.DRYDEPSPEC(ks)) then
[e200b7a]103
104   if ((ix.ge.0).and.(jy.ge.0).and.(ix.le.numxgrid-1).and. &
105        (jy.le.numygrid-1)) then
[4c64400]106     w=wx*wy
107     drygridunc(ix,jy,ks,kp,nunc,nage)= &
108          drygridunc(ix,jy,ks,kp,nunc,nage)+deposit(ks)*w
109     continue
110   endif
[e200b7a]111
112  if ((ixp.ge.0).and.(jyp.ge.0).and.(ixp.le.numxgrid-1).and. &
113       (jyp.le.numygrid-1)) then
114    w=(1.-wx)*(1.-wy)
115      drygridunc(ixp,jyp,ks,kp,nunc,nage)= &
116           drygridunc(ixp,jyp,ks,kp,nunc,nage)+deposit(ks)*w
117  endif
118
119  if ((ixp.ge.0).and.(jy.ge.0).and.(ixp.le.numxgrid-1).and. &
120       (jy.le.numygrid-1)) then
121    w=(1.-wx)*wy
122      drygridunc(ixp,jy,ks,kp,nunc,nage)= &
123           drygridunc(ixp,jy,ks,kp,nunc,nage)+deposit(ks)*w
124  endif
125
126  if ((ix.ge.0).and.(jyp.ge.0).and.(ix.le.numxgrid-1).and. &
127       (jyp.le.numygrid-1)) then
128    w=wx*(1.-wy)
129      drygridunc(ix,jyp,ks,kp,nunc,nage)= &
130           drygridunc(ix,jyp,ks,kp,nunc,nage)+deposit(ks)*w
131  endif
132
133  endif
134
[4c64400]135  end do
136end if
[e200b7a]137
138end subroutine drydepokernel
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG