source: flexpart.git/src/wetdepokernel.f90 @ 2bec33e

10.4.1_peseiGFS_025bugfixes+enhancementsdevrelease-10release-10.4.1scaling-bugunivie
Last change on this file since 2bec33e was 2bec33e, checked in by Sabine <sabine.eckhardt@…>, 7 years ago

resolved kernel merge: removed all uskernel

  • Property mode set to 100644
File size: 5.1 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 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  ! Changes:
43  ! eso 10/2016: Added option to disregard kernel
44  !
45  !*****************************************************************************
46
47  use unc_mod
48  use par_mod
49  use com_mod
50
51  implicit none
52
53  real :: x,y,deposit(maxspec),ddx,ddy,xl,yl,wx,wy,w
54  integer :: ix,jy,ixp,jyp,nunc,nage,ks,kp
55
56  xl=(x*dx+xoutshift)/dxout
57  yl=(y*dy+youtshift)/dyout
58  ix=int(xl)
59  jy=int(yl)
60  ddx=xl-real(ix)                   ! distance to left cell border
61  ddy=yl-real(jy)                   ! distance to lower cell border
62
63  if (ddx.gt.0.5) then
64    ixp=ix+1
65    wx=1.5-ddx
66  else
67    ixp=ix-1
68    wx=0.5+ddx
69  endif
70
71  if (ddy.gt.0.5) then
72    jyp=jy+1
73    wy=1.5-ddy
74  else
75    jyp=jy-1
76    wy=0.5+ddy
77  endif
78
79  ! If no kernel is used, direct attribution to grid cell
80  !******************************************************
81
82  if (lnokernel) then
83    do ks=1,nspec
84      if ((ix.ge.0).and.(jy.ge.0).and.(ix.le.numxgrid-1).and. &
85           (jy.le.numygrid-1)) then
86        wetgridunc(ix,jy,ks,kp,nunc,nage)= &
87             wetgridunc(ix,jy,ks,kp,nunc,nage)+deposit(ks)
88      end if
89    end do
90  else ! use kernel
91   
92  ! Determine mass fractions for four grid points
93  !**********************************************
94
95  do ks=1,nspec
96
97    if ((ix.ge.0).and.(jy.ge.0).and.(ix.le.numxgrid-1).and. &
98       (jy.le.numygrid-1)) then
99      w=wx*wy
100      wetgridunc(ix,jy,ks,kp,nunc,nage)= &
101           wetgridunc(ix,jy,ks,kp,nunc,nage)+deposit(ks)*w
102    endif
103
104    if ((ixp.ge.0).and.(jyp.ge.0).and.(ixp.le.numxgrid-1).and. &
105       (jyp.le.numygrid-1)) then
106      w=(1.-wx)*(1.-wy)
107      wetgridunc(ixp,jyp,ks,kp,nunc,nage)= &
108           wetgridunc(ixp,jyp,ks,kp,nunc,nage)+deposit(ks)*w
109    endif
110
111    if ((ixp.ge.0).and.(jy.ge.0).and.(ixp.le.numxgrid-1).and. &
112       (jy.le.numygrid-1)) then
113      w=(1.-wx)*wy
114      wetgridunc(ixp,jy,ks,kp,nunc,nage)= &
115           wetgridunc(ixp,jy,ks,kp,nunc,nage)+deposit(ks)*w
116    endif
117
118    if ((ix.ge.0).and.(jyp.ge.0).and.(ix.le.numxgrid-1).and. &
119       (jyp.le.numygrid-1)) then
120      w=wx*(1.-wy)
121      wetgridunc(ix,jyp,ks,kp,nunc,nage)= &
122           wetgridunc(ix,jyp,ks,kp,nunc,nage)+deposit(ks)*w
123    endif
124
125  end do
126  end if
127
128end subroutine wetdepokernel
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG