source: branches/petra/src/wetdepokernel.f90 @ 37

Last change on this file since 37 was 37, checked in by pesei, 9 years ago

Wet dep quick fix and other small changes. Wet depo quick fix not final yet.

File size: 5.1 KB
Line 
1!**********************************************************************
2! Copyright 1998-2015                                                 *
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,itage,nage,kp)
23  !                          i      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         *
28  !     and dyout.                                                             *
29  !                                                                            *
30  !     Author: A. Stohl                                                       *
31  !                                                                            *
32  !     26 December 1996                                                       *
33  !
34  !  PS, 2/2015: do not use kernel for itage < 3 h
35  !   same as for concentration in conccalc.f90
36  !                                                                            *
37  !*****************************************************************************
38  !                                                                            *
39  ! Variables:                                                                 *
40  !                                                                            *
41  ! nunc             uncertainty class of the respective particle              *
42  ! nage             age class of the respective particle                      *
43  ! deposit          amount (kg) to be deposited                               *
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,itage
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
80  if (itage .lt. itagekernmin) then
81    ! no kernel, direct attribution to grid cell
82   
83    do ks=1,nspec
84      if (ix.ge.0 .and. jy.ge.0 .and. &
85          ix.le.numxgrid-1 .and. jy.le.numygrid-1) &
86        wetgridunc(ix,jy,ks,kp,nunc,nage)= &
87          wetgridunc(ix,jy,ks,kp,nunc,nage)+deposit(ks)
88    enddo
89       
90  else
91    ! Determine mass fractions for four grid points & distribute
92
93    do ks=1,nspec
94
95      if (ix.ge.0 .and. jy.ge.0 .and. &
96          ix.le.numxgrid-1 .and. jy.le.numygrid-1) then
97        w=wx*wy
98        wetgridunc(ix,jy,ks,kp,nunc,nage)= &
99          wetgridunc(ix,jy,ks,kp,nunc,nage)+deposit(ks)*w
100      endif
101
102      if ((ixp.ge.0).and.(jyp.ge.0).and.&
103         (ixp.le.numxgrid-1).and. (jyp.le.numygrid-1)) then
104        w=(1.-wx)*(1.-wy)
105        wetgridunc(ixp,jyp,ks,kp,nunc,nage)= &
106          wetgridunc(ixp,jyp,ks,kp,nunc,nage)+deposit(ks)*w
107      endif
108
109      if ((ixp.ge.0).and.(jy.ge.0).and. &
110          (ixp.le.numxgrid-1).and.(jy.le.numygrid-1)) then
111        w=(1.-wx)*wy
112        wetgridunc(ixp,jy,ks,kp,nunc,nage)= &
113           wetgridunc(ixp,jy,ks,kp,nunc,nage)+deposit(ks)*w
114      endif
115
116      if ((ix.ge.0).and.(jyp.ge.0).and. &
117          (ix.le.numxgrid-1).and.(jyp.le.numygrid-1)) then
118        w=wx*(1.-wy)
119        wetgridunc(ix,jyp,ks,kp,nunc,nage)= &
120          wetgridunc(ix,jyp,ks,kp,nunc,nage)+deposit(ks)*w
121      endif
122
123    end do
124
125  endif
126
127end subroutine wetdepokernel
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG