Commit 3015fe3d authored by Sabine's avatar Sabine
Browse files

added lines which were commented out to be optional run with WATERCYCLE

parent 6abf6464
......@@ -79,14 +79,16 @@ subroutine boundcond_domainfill(itime,loutend)
!********************************************************************
do i=1,numpart
! if (itra1(i).eq.itime) then
! if ((ytra1(i).gt.real(ny_sn(2))).or. &
! (ytra1(i).lt.real(ny_sn(1)))) itra1(i)=-999999999
! if (((.not.xglobal).or.(nx_we(2).ne.(nx-2))).and. &
! ((xtra1(i).lt.real(nx_we(1))).or. &
! (xtra1(i).gt.real(nx_we(2))))) itra1(i)=-999999999
! endif
if (itra1(i).ne.-999999999) numactiveparticles= &
if (WATERCYCLE.eqv..FALSE.) then
if (itra1(i).eq.itime) then
if ((ytra1(i).gt.real(ny_sn(2))).or. &
(ytra1(i).lt.real(ny_sn(1)))) itra1(i)=-999999999
if (((.not.xglobal).or.(nx_we(2).ne.(nx-2))).and. &
((xtra1(i).lt.real(nx_we(1))).or. &
(xtra1(i).gt.real(nx_we(2))))) itra1(i)=-999999999
endif
endif
if (itra1(i).ne.-999999999) numactiveparticles= &
numactiveparticles+1
end do
......
......@@ -19,7 +19,7 @@
! along with FLEXPART. If not, see <http://www.gnu.org/licenses/>. *
!**********************************************************************
subroutine calculate_watercycle(partnumber,itime,watersynctime)
subroutine calculate_watercycle(partnumber,itime)
!*****************************************************************************
! *
......@@ -47,6 +47,9 @@ subroutine calculate_watercycle(partnumber,itime,watersynctime)
integer ixr,jyr,idumx,idumy,istep, watersynctime
watersynctime=3600*6 ! was loutstep before, but for monthly run not possible
! watersynctime=loutstep
! Some variables needed for temporal interpolation
!*************************************************
......@@ -224,7 +227,8 @@ subroutine calculate_watercycle(partnumber,itime,watersynctime)
! e_minus_pi=precip_reference(ix+1,jy-90+2)*(-24.)
! First timestep and criteria fullfilled, keep it or throw it?
if ( ((diff.ge.0).or.((e_minus_pi/24).gt.-2.0)) .and. (status_q(i).eq.1) ) then
if ( ((diff.ge.0).or.((e_minus_pi/24).gt.-1.0)) .and. (status_q(i).eq.1) ) then
! if ( ((diff.ge.0).or.((e_minus_pi/24).gt.-2.0)) .and. (status_q(i).eq.1) ) then
! if ( ((diff.ge.0)) .and. (status_q(i).eq.1) ) then
! if (status_q(i).eq.-100) then ! never! all trajectories.
! write(*,*) 'terminated: ',i,diff,e_minus_pi,itage,itramem(i),status_q(i),qvi,val_q(i),xmass1(i,1)
......
......@@ -595,10 +595,10 @@ subroutine readreleases
endif
endif
!!! CHANGE WATERCYCLE
if (WATERCYCLE) then
ireleasestart(numpoint)=int((jul1-bdate)*86400.)
ireleaseend(numpoint)=int((jul2-bdate)*86400.)
endif
! Determine the release rate (particles per second) and total number
......
......@@ -120,18 +120,12 @@ subroutine timemanager(metdata_format)
real :: xold,yold,zold,xmassfract
real :: grfraction(3)
real, parameter :: e_inv = 1.0/exp(1.0)
integer :: watersynctime
!double precision xm(maxspec,maxpointspec_act),
! + xm_depw(maxspec,maxpointspec_act),
! + xm_depd(maxspec,maxpointspec_act)
watersynctime=loutstep
! watersynctime=3600*3 ! was loutstep before, but for monthly run not possible
write(*,*) 'Watersynctime: ',watersynctime
open(89,file=path(2)(1:length(2))//'budget.dat')
open(90,file=path(2)(1:length(2))//'budget_nest.dat')
......@@ -383,7 +377,7 @@ subroutine timemanager(metdata_format)
(ldirect*itime.le.ldirect*loutend)) then ! add to grid
if (mod(itime-loutstart,loutsample).eq.0) then
if (WATERCYCLE) &
call calculate_watercycle(-1,itime,watersynctime)
call calculate_watercycle(-1,itime)
! If we are exactly at the start or end of the concentration averaging interval,
! give only half the weight to this sample
......@@ -758,7 +752,7 @@ subroutine timemanager(metdata_format)
if (ipout.eq.2) call partoutput_short(itime) ! dump particle positions
if (WATERCYCLE) then
call calculate_watercycle(-1,itime,watersynctime)
call calculate_watercycle(-1,itime)
write (*,*) 'last watercycle'
endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment