CTBTO FLEXPART WO4 (2015-10-15)
 All Classes Files Functions Variables
drydepokernel_nest.f90
Go to the documentation of this file.
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 
22 subroutine 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 :: x,y,deposit(maxspec),ddx,ddy,xl,yl,wx,wy,w
53  integer :: ix,jy,ixp,jyp,ks,kp,nunc,nage
54 
55 
56 
57  xl=(x*dx+xoutshiftn)/dxoutn
58  yl=(y*dy+youtshiftn)/dyoutn
59  ix=int(xl)
60  jy=int(yl)
61  ddx=xl-real(ix) ! distance to left cell border
62  ddy=yl-real(jy) ! distance to lower cell border
63 
64  if (ddx.gt.0.5) then
65  ixp=ix+1
66  wx=1.5-ddx
67  else
68  ixp=ix-1
69  wx=0.5+ddx
70  endif
71 
72  if (ddy.gt.0.5) then
73  jyp=jy+1
74  wy=1.5-ddy
75  else
76  jyp=jy-1
77  wy=0.5+ddy
78  endif
79 
80 
81  ! Determine mass fractions for four grid points
82  !**********************************************
83  do ks=1,nspec
84 
85  if (drydepspec(ks).and.(abs(deposit(ks)).gt.0)) then
86 
87  if ((ix.ge.0).and.(jy.ge.0).and.(ix.le.numxgridn-1).and. &
88  (jy.le.numygridn-1)) then
89  w=wx*wy
90  drygriduncn(ix,jy,ks,kp,nunc,nage)= &
91  drygriduncn(ix,jy,ks,kp,nunc,nage)+deposit(ks)*w
92  endif
93 
94  if ((ixp.ge.0).and.(jyp.ge.0).and.(ixp.le.numxgridn-1).and. &
95  (jyp.le.numygridn-1)) then
96  w=(1.-wx)*(1.-wy)
97  drygriduncn(ixp,jyp,ks,kp,nunc,nage)= &
98  drygriduncn(ixp,jyp,ks,kp,nunc,nage)+deposit(ks)*w
99  endif
100 
101  if ((ixp.ge.0).and.(jy.ge.0).and.(ixp.le.numxgridn-1).and. &
102  (jy.le.numygridn-1)) then
103  w=(1.-wx)*wy
104  drygriduncn(ixp,jy,ks,kp,nunc,nage)= &
105  drygriduncn(ixp,jy,ks,kp,nunc,nage)+deposit(ks)*w
106  endif
107 
108  if ((ix.ge.0).and.(jyp.ge.0).and.(ix.le.numxgridn-1).and. &
109  (jyp.le.numygridn-1)) then
110  w=wx*(1.-wy)
111  drygriduncn(ix,jyp,ks,kp,nunc,nage)= &
112  drygriduncn(ix,jyp,ks,kp,nunc,nage)+deposit(ks)*w
113  endif
114 
115  endif
116 
117  end do
118 end subroutine drydepokernel_nest
subroutine drydepokernel_nest(nunc, deposit, x, y, nage, kp)