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 wetdepokernel(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 | ! deposition fields using a uniform kernel with bandwidths dxout and dyout.* |
---|
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 | !***************************************************************************** |
---|
42 | |
---|
43 | use unc_mod, only: wetgridunc |
---|
44 | use par_mod, only: maxspec |
---|
45 | use com_mod, only: xoutshift, youtshift, dx, dy, dxout, dyout, nspec, numxgrid, & |
---|
46 | numygrid |
---|
47 | |
---|
48 | implicit none |
---|
49 | |
---|
50 | real :: x,y,deposit(maxspec),ddx,ddy,xl,yl,wx,wy,w |
---|
51 | integer :: ix,jy,ixp,jyp,nunc,nage,ks,kp |
---|
52 | |
---|
53 | xl=(x*dx+xoutshift)/dxout |
---|
54 | yl=(y*dy+youtshift)/dyout |
---|
55 | ix=int(xl) |
---|
56 | jy=int(yl) |
---|
57 | ddx=xl-real(ix) ! distance to left cell border |
---|
58 | ddy=yl-real(jy) ! distance to lower cell border |
---|
59 | |
---|
60 | if (ddx.gt.0.5) then |
---|
61 | ixp=ix+1 |
---|
62 | wx=1.5-ddx |
---|
63 | else |
---|
64 | ixp=ix-1 |
---|
65 | wx=0.5+ddx |
---|
66 | endif |
---|
67 | |
---|
68 | if (ddy.gt.0.5) then |
---|
69 | jyp=jy+1 |
---|
70 | wy=1.5-ddy |
---|
71 | else |
---|
72 | jyp=jy-1 |
---|
73 | wy=0.5+ddy |
---|
74 | endif |
---|
75 | |
---|
76 | |
---|
77 | ! Determine mass fractions for four grid points |
---|
78 | !********************************************** |
---|
79 | |
---|
80 | do ks=1,nspec |
---|
81 | |
---|
82 | if ((ix.ge.0).and.(jy.ge.0).and.(ix.le.numxgrid-1).and. & |
---|
83 | (jy.le.numygrid-1)) then |
---|
84 | w=wx*wy |
---|
85 | wetgridunc(ix,jy,ks,kp,nunc,nage)= & |
---|
86 | wetgridunc(ix,jy,ks,kp,nunc,nage)+deposit(ks)*w |
---|
87 | endif |
---|
88 | |
---|
89 | if ((ixp.ge.0).and.(jyp.ge.0).and.(ixp.le.numxgrid-1).and. & |
---|
90 | (jyp.le.numygrid-1)) then |
---|
91 | w=(1.-wx)*(1.-wy) |
---|
92 | wetgridunc(ixp,jyp,ks,kp,nunc,nage)= & |
---|
93 | wetgridunc(ixp,jyp,ks,kp,nunc,nage)+deposit(ks)*w |
---|
94 | endif |
---|
95 | |
---|
96 | if ((ixp.ge.0).and.(jy.ge.0).and.(ixp.le.numxgrid-1).and. & |
---|
97 | (jy.le.numygrid-1)) then |
---|
98 | w=(1.-wx)*wy |
---|
99 | wetgridunc(ixp,jy,ks,kp,nunc,nage)= & |
---|
100 | wetgridunc(ixp,jy,ks,kp,nunc,nage)+deposit(ks)*w |
---|
101 | endif |
---|
102 | |
---|
103 | if ((ix.ge.0).and.(jyp.ge.0).and.(ix.le.numxgrid-1).and. & |
---|
104 | (jyp.le.numygrid-1)) then |
---|
105 | w=wx*(1.-wy) |
---|
106 | wetgridunc(ix,jyp,ks,kp,nunc,nage)= & |
---|
107 | wetgridunc(ix,jyp,ks,kp,nunc,nage)+deposit(ks)*w |
---|
108 | endif |
---|
109 | end do |
---|
110 | |
---|
111 | end subroutine wetdepokernel |
---|