source: flexpart.git/src/drydepokernel_nest.f90 @ 02095e3

10.4.1_peseiGFS_025bugfixes+enhancementsdevrelease-10release-10.4.1scaling-bugunivie
Last change on this file since 02095e3 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: 4.9 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 drydepokernel_nest(nunc,deposit,x,y,nage,kp)
23  !                               i      i    i i  i
24  !*****************************************************************************
25  !                                                                            *
26  !     Attribution of the deposition from an individual particle to the       *
27  !     nested deposition fields using a uniform kernel with bandwidths        *
28  !     dxoutn and dyoutn.                                                     *
29  !                                                                            *
30  !     Author: A. Stohl                                                       *
31  !                                                                            *
32  !     26 December 1996                                                       *
33  !                                                                            *
34  !      2 September 2004: Adaptation from drydepokernel.                      *
35  !                                                                            *
36  !*****************************************************************************
37  !                                                                            *
38  ! Variables:                                                                 *
39  !                                                                            *
40  ! nunc             uncertainty class of the respective particle              *
41  ! nage             age class of the respective particle                      *
42  ! deposit          amount (kg) to be deposited                               *
43  !                                                                            *
44  !*****************************************************************************
45
46  use unc_mod
47  use par_mod
48  use com_mod
49
50  implicit none
51
52  real(dep_prec), dimension(maxspec) :: deposit
53  real :: x,y,ddx,ddy,xl,yl,wx,wy,w
54  integer :: ix,jy,ixp,jyp,ks,kp,nunc,nage
55
56
57
58  xl=(x*dx+xoutshiftn)/dxoutn
59  yl=(y*dy+youtshiftn)/dyoutn
60  ix=int(xl)
61  jy=int(yl)
62  ddx=xl-real(ix)                   ! distance to left cell border
63  ddy=yl-real(jy)                   ! distance to lower cell border
64
65  if (ddx.gt.0.5) then
66    ixp=ix+1
67    wx=1.5-ddx
68  else
69    ixp=ix-1
70    wx=0.5+ddx
71  endif
72
73  if (ddy.gt.0.5) then
74    jyp=jy+1
75    wy=1.5-ddy
76  else
77    jyp=jy-1
78    wy=0.5+ddy
79  endif
80
81
82  ! Determine mass fractions for four grid points
83  !**********************************************
84    do ks=1,nspec
85
86  if (DRYDEPSPEC(ks).and.(abs(deposit(ks)).gt.0)) then
87
88  if ((ix.ge.0).and.(jy.ge.0).and.(ix.le.numxgridn-1).and. &
89       (jy.le.numygridn-1)) then
90    w=wx*wy
91      drygriduncn(ix,jy,ks,kp,nunc,nage)= &
92           drygriduncn(ix,jy,ks,kp,nunc,nage)+deposit(ks)*w
93  endif
94
95  if ((ixp.ge.0).and.(jyp.ge.0).and.(ixp.le.numxgridn-1).and. &
96       (jyp.le.numygridn-1)) then
97    w=(1.-wx)*(1.-wy)
98      drygriduncn(ixp,jyp,ks,kp,nunc,nage)= &
99           drygriduncn(ixp,jyp,ks,kp,nunc,nage)+deposit(ks)*w
100  endif
101
102  if ((ixp.ge.0).and.(jy.ge.0).and.(ixp.le.numxgridn-1).and. &
103       (jy.le.numygridn-1)) then
104    w=(1.-wx)*wy
105      drygriduncn(ixp,jy,ks,kp,nunc,nage)= &
106           drygriduncn(ixp,jy,ks,kp,nunc,nage)+deposit(ks)*w
107  endif
108
109  if ((ix.ge.0).and.(jyp.ge.0).and.(ix.le.numxgridn-1).and. &
110       (jyp.le.numygridn-1)) then
111    w=wx*(1.-wy)
112      drygriduncn(ix,jyp,ks,kp,nunc,nage)= &
113           drygriduncn(ix,jyp,ks,kp,nunc,nage)+deposit(ks)*w
114  endif
115
116  endif
117
118    end do
119end subroutine drydepokernel_nest
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG