Commit 1a1e546b authored by Sabine's avatar Sabine
Browse files

particle position in a netcdf file at the end of simulation

parent 8f52cb4e
......@@ -248,6 +248,7 @@ subroutine writeaveragepart_netcdf(adate,atime)
if (part_av_filled(i).gt.0) partused=partused+1
enddo
write(*,*) 'Part_average: ',partused,maxoutsteps
fname=path(2)(1:length(2))//'partposit_average_'//adate//atime//'.nc'
cache_size = 16 * partused
......@@ -255,7 +256,7 @@ subroutine writeaveragepart_netcdf(adate,atime)
cache_size = cache_size))
call nf90_err(nf90_def_dim(ncid, 'numpart', partused, npointDimID))
call nf90_err(nf90_def_dim(ncid, 'timesteps', 20, timestepsDimID))
call nf90_err(nf90_def_dim(ncid, 'timesteps', maxoutsteps, timestepsDimID))
call nf90_err(nf90_def_var(ncid, 'topo', nf90_float, (/ npointDimID,timestepsDimID /), topoID))
call nf90_err(nf90_def_var(ncid, 'z', nf90_float, (/ npointDimID,timestepsDimID /), zID))
......@@ -279,6 +280,7 @@ subroutine writeaveragepart_netcdf(adate,atime)
call nf90_err(nf90_put_var(ncid, qvID, part_av_qv(1:partused,1:maxoutsteps)))
call nf90_err(nf90_put_var(ncid, ttID, part_av_tt(1:partused,1:maxoutsteps)))
call nf90_err(nf90_put_var(ncid, uuID, part_av_uu(1:partused,1:maxoutsteps)))
call nf90_err(nf90_put_var(ncid, vvID, part_av_vv(1:partused,1:maxoutsteps)))
call nf90_err(nf90_put_var(ncid, rhoID, part_av_rho(1:partused,1:maxoutsteps)))
call nf90_err(nf90_put_var(ncid, troID, part_av_tro(1:partused,1:maxoutsteps)))
call nf90_err(nf90_put_var(ncid, hmixID, part_av_hmix(1:partused,1:maxoutsteps)))
......
......@@ -229,8 +229,8 @@ module par_mod
! Maximum number of particles, species, and similar
!**************************************************
integer,parameter :: maxoutsteps=20
integer,parameter :: maxpart=100000
integer,parameter :: maxoutsteps=44
integer,parameter :: maxpart=4000000
integer,parameter :: maxspec=1
real,parameter :: minmass=0.0001
......
......@@ -394,8 +394,9 @@ subroutine readcommand
! Check whether a valid options for particle dump has been chosen
!****************************************************************
if ((ipout.ne.0).and.(ipout.ne.1).and.(ipout.ne.2)) then
if ((ipout.ne.0).and.(ipout.ne.1).and.(ipout.ne.2).and.(ipout.ne.3)) then
write(*,*) ' #### FLEXPART MODEL ERROR! FILE COMMAND: #### '
write(*,*) ' #### IPOUT is: ',ipout,' ####'
write(*,*) ' #### IPOUT MUST BE 1, 2 OR 3! #### '
stop
endif
......
......@@ -333,7 +333,7 @@ subroutine timemanager
! if (ipout.ge.1) call partoutput(itime) ! dump particle positions
! if (ipout.ge.1) call partoutput_short(itime) ! dump particle positions in extremely compressed format
if (ipout.ge.1) then
if (mod(itime,345600).eq.0) call partoutput(itime) ! dump particle positions
! if (mod(itime,345600).eq.0) call partoutput(itime) ! dump particle positions
call partoutput_average(itime) ! dump particle positions
endif
......@@ -531,6 +531,11 @@ subroutine timemanager
end do
if (ipout.eq.3) then
call writeaveragepart_netcdf('aver_end','000000')
endif
! Complete the calculation of initial conditions for particles not yet terminated
!*****************************************************************************
......
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