Commit 34a485da authored by Ignacio Pisso's avatar Ignacio Pisso

Messages and comments in releaseparticles.f90. Change one standard output format in timemanager.f90

parent 4d0a334d
......@@ -50,7 +50,8 @@ subroutine releaseparticles(itime)
!save idummy,xmasssave
!data idummy/-7/,xmasssave/maxpoint*0./
integer :: verb_dbg=0
!verb_dbg=1
! Determine the actual date and time in Greenwich (i.e., UTC + correction for daylight savings time)
!*****************************************************************************
......@@ -65,11 +66,21 @@ subroutine releaseparticles(itime)
! For every release point, check whether we are in the release time interval
!***************************************************************************
if (verb_dbg.gt.0) print*,'releaseparticles.f90>>> START itime=', itime
minpart=1
do i=1,numpoint
if ((itime.ge.ireleasestart(i)).and. &! are we within release interval?
(itime.le.ireleaseend(i))) then
!if (verb_dbg.gt.0) print*,'releaseparticles.f90> i,numpoint=', i,numpoint
if (verb_dbg.gt.0) print*,'releaseparticles.f90> i=', i
if (verb_dbg.gt.0) print*,'ireleasestart(i),ireleaseend(i)=', ireleasestart(i), ireleaseend(i)
! Determine the local day and time
!*********************************
......@@ -105,6 +116,9 @@ subroutine releaseparticles(itime)
end do
average_timecorrect=average_timecorrect/real(nspec)
if (verb_dbg.gt.0) print*,'releaseparticles.f90> average_timecorrect=', average_timecorrect
! Determine number of particles to be released this time; at start and at end of release,
! only half the particles are released
!*****************************************************************************
......@@ -115,18 +129,25 @@ subroutine releaseparticles(itime)
if ((itime.eq.ireleasestart(i)).or. &
(itime.eq.ireleaseend(i))) rfraction=rfraction/2.
if (verb_dbg.gt.0) print*,'releaseparticles.f90> rfraction=', rfraction
! Take the species-average time correction factor in order to scale the
! number of particles released this time
!**********************************************************************
rfraction=rfraction*average_timecorrect
rfraction=rfraction*average_timecorrect !for time dependency of emissions
rfraction=rfraction+xmasssave(i) ! number to be released at this time
numrel=int(rfraction)
xmasssave(i)=rfraction-real(numrel)
if (verb_dbg.gt.0) print*,'releaseparticles.f90> xmasssave(i)=', xmasssave(i)
else
numrel=npart(i)
endif
if (verb_dbg.gt.0) print*,'releaseparticles.f90> numrel=', numrel
xaux=xpoint2(i)-xpoint1(i)
yaux=ypoint2(i)-ypoint1(i)
zaux=zpoint2(i)-zpoint1(i)
......@@ -361,18 +382,20 @@ subroutine releaseparticles(itime)
do k=1,nspec
xmass1(ipart,k)=xmass1(ipart,k)*rhoout
end do
endif
endif !ind_rel
numpart=max(numpart,ipart)
goto 34 ! Storage space has been found, stop searching
endif
end do ! i=1:numpoint
endif !(itra1(ipart).ne.itime) - If a free storage space is found,
end do ! ipart=minpart,maxpart - search for free storage space
if (ipart.gt.maxpart) goto 996
34 minpart=ipart+1
end do ! ipart=minpart,maxpart
endif ! j=1,numrel
end do
end do ! j=1,numrel ! loop over particles to be released this time
if (verb_dbg.gt.0) print*,'releaseparticles.f90> ipart=', ipart,'minpart=',minpart
endif ! itime.ge.ireleasestart(i) .and. itime.le.ireleaseend(i) (are we within release interval?)
end do !i=1:numpoint ! release locations
return
......
......@@ -450,7 +450,7 @@ subroutine timemanager(metdata_format)
!write(*,46) float(itime)/3600,itime,numpart
45 format(i13,' Seconds simulated: ',i13, ' Particles: Uncertainty: ',3f7.3)
46 format(' Simulated ',f7.1,' hours (',i13,' s), ',i13, ' particles')
46 format(' Simulated ',f7.2,' hours (',i13,' s), ',i13, ' particles')
if (ipout.ge.1) then
if (mod(itime,ipoutfac*loutstep).eq.0) call partoutput(itime) ! dump particle positions
if (ipout.eq.3) call partoutput_average(itime) ! dump particle positions
......
Markdown is supported
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