source: flexpart.git/src/wetdepo.f90

10.4.1_peseiGFS_025bugfixes+enhancementsdevrelease-10release-10.4.1scaling-bug
Last change on this file was 92fab65, checked in by Ignacio Pisso <ip@…>, 4 years ago

add SPDX-License-Identifier to all .f90 files

  • Property mode set to 100644
File size: 6.3 KB
RevLine 
[92fab65]1! SPDX-FileCopyrightText: FLEXPART 1998-2019, see flexpart_license.txt
2! SPDX-License-Identifier: GPL-3.0-or-later
[332fbbd]3
[e200b7a]4subroutine wetdepo(itime,ltsample,loutnext)
[db712a8]5!                  i      i        i
6!*****************************************************************************
7!                                                                            *
8! Calculation of wet deposition using the concept of scavenging coefficients.*
9! For lack of detailed information, washout and rainout are jointly treated. *
10! It is assumed that precipitation does not occur uniformly within the whole *
11! grid cell, but that only a fraction of the grid cell experiences rainfall. *
12! This fraction is parameterized from total cloud cover and rates of large   *
13! scale and convective precipitation.                                        *
14!                                                                            *
15!    Author: A. Stohl                                                        *
16!                                                                            *
17!    1 December 1996                                                         *
18!                                                                            *
19! Correction by Petra Seibert, Sept 2002:                                    *
20! use centred precipitation data for integration                             *
21! Code may not be correct for decay of deposition!                           *
22!                                                                            *
23!*****************************************************************************
24!                                                                            *
25! Variables:                                                                 *
26! ix,jy              indices of output grid cell for each particle           *
27! itime [s]          actual simulation time [s]                              *
28! jpart              particle index                                          *
29! ldeltat [s]        interval since radioactive decay was computed           *
30! loutnext [s]       time for which gridded deposition is next output        *
31! loutstep [s]       interval at which gridded deposition is output          *
32! ltsample [s]       interval over which mass is deposited                   *
33! wetdeposit         mass that is wet deposited                              *
34! wetgrid            accumulated deposited mass on output grid               *
35! wetscav            scavenging coefficient                                  *
36!                                                                            *
37! Constants:                                                                 *
38!                                                                            *
39!*****************************************************************************
[e200b7a]40
41  use point_mod
42  use par_mod
43  use com_mod
44
45  implicit none
46
[db375cc]47  integer :: jpart,itime,ltsample,loutnext,ldeltat
48  integer :: itage,nage
[4fbe7a5]49  integer :: ks, kp
[6985a98]50  integer(selected_int_kind(16)), dimension(nspec) :: blc_count, inc_count
[c9cf570]51  real :: grfraction(3),wetscav
[e200b7a]52  real :: wetdeposit(maxspec),restmass
53  real,parameter :: smallnum = tiny(0.0) ! smallest number that can be handled
[8a65cb0]54
[db712a8]55! Compute interval since radioactive decay of deposited mass was computed
56!************************************************************************
[e200b7a]57
58  if (itime.le.loutnext) then
59    ldeltat=itime-(loutnext-loutstep)
60  else                                  ! first half of next interval
61    ldeltat=itime-loutnext
62  endif
63
[db712a8]64! Loop over all particles
65!************************
[e200b7a]66
[c8fc724]67  blc_count(:)=0
68  inc_count(:)=0
[8a65cb0]69
[e200b7a]70  do jpart=1,numpart
[4fbe7a5]71
[e200b7a]72    if (itra1(jpart).eq.-999999999) goto 20
73    if(ldirect.eq.1)then
74      if (itra1(jpart).gt.itime) goto 20
75    else
76      if (itra1(jpart).lt.itime) goto 20
77    endif
[8a65cb0]78
[c9cf570]79! Determine age class of the particle - nage is used for the kernel
[341f4b7]80!******************************************************************
[c9cf570]81     itage=abs(itra1(jpart)-itramem(jpart))
82     do nage=1,nageclass
83       if (itage.lt.lage(nage)) goto 33
84     end do
85 33  continue
[d6a0977]86
[92a74b2]87    do ks=1,nspec      ! loop over species
[8a65cb0]88
[6985a98]89      if (WETDEPSPEC(ks).eqv..false.) cycle
[db712a8]90
91!**************************************************
92! CALCULATE DEPOSITION
93!**************************************************
[0539b8f]94!       wetscav=0.
[0e085a8]95       
[7919911]96!        write(*,*) ks,dquer(ks), crain_aero(ks),csnow_aero(ks)
[0e085a8]97!       if (((dquer(ks).le.0.).and.(weta_gas(ks).gt.0..or.wetb_gas(ks).gt.0.)) &
98!          .or. &
99!          ((dquer(ks).gt.0.).and.(crain_aero(ks).gt.0..or.csnow_aero(ks).gt.0.).or. &
100!            (ccn_aero(ks).gt0) .or. (in_aero(ks).gt.0) .or. (henry(ks).gt.0)))  then
[585a533]101
[92a74b2]102      call get_wetscav(itime,ltsample,loutnext,jpart,ks,grfraction,inc_count,blc_count,wetscav)
[0e085a8]103     
[e200b7a]104
[4fbe7a5]105      if (wetscav.gt.0.) then
[e200b7a]106        wetdeposit(ks)=xmass1(jpart,ks)* &
[5f9d14a]107             (1.-exp(-wetscav*abs(ltsample)))*grfraction(1)  ! wet deposition
[4fbe7a5]108      else ! if no scavenging
109        wetdeposit(ks)=0.
110      endif
[c9cf570]111 
[4fbe7a5]112      restmass = xmass1(jpart,ks)-wetdeposit(ks)
113      if (ioutputforeachrelease.eq.1) then
114        kp=npoint(jpart)
115      else
116        kp=1
117      endif
118      if (restmass .gt. smallnum) then
119        xmass1(jpart,ks)=restmass
[db712a8]120!   depostatistic
121!   wetdepo_sum(ks,kp)=wetdepo_sum(ks,kp)+wetdeposit(ks)
122!   depostatistic
[4fbe7a5]123      else
124        xmass1(jpart,ks)=0.
125      endif
[db712a8]126!   Correct deposited mass to the last time step when radioactive decay of
127!   gridded deposited mass was calculated
[4fbe7a5]128      if (decay(ks).gt.0.) then
129        wetdeposit(ks)=wetdeposit(ks)*exp(abs(ldeltat)*decay(ks))
130      endif
[f13406c]131
[7919911]132!    endif ! no deposition
[92a74b2]133    end do ! loop over species
[e200b7a]134
[db712a8]135! Sabine Eckhardt, June 2008 create deposition runs only for forward runs
136! Add the wet deposition to accumulated amount on output grid and nested output grid
137!*****************************************************************************
[e200b7a]138
[4fbe7a5]139    if (ldirect.eq.1) then
140      call wetdepokernel(nclass(jpart),wetdeposit,real(xtra1(jpart)), &
[5f9d14a]141           real(ytra1(jpart)),nage,kp)
[4fbe7a5]142      if (nested_output.eq.1) call wetdepokernel_nest(nclass(jpart), &
[5f9d14a]143           wetdeposit,real(xtra1(jpart)),real(ytra1(jpart)),nage,kp)
[4fbe7a5]144    endif
[e200b7a]145
14620  continue
[4fbe7a5]147  end do ! all particles
[e200b7a]148
[db712a8]149! count the total number of below-cloud and in-cloud occurences:
[c8fc724]150  tot_blc_count(1:nspec)=tot_blc_count(1:nspec)+blc_count(1:nspec)
151  tot_inc_count(1:nspec)=tot_inc_count(1:nspec)+inc_count(1:nspec)
[8a65cb0]152
[e200b7a]153end subroutine wetdepo
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG