Commit b4d29ce9 authored by Harald Sodemann's avatar Harald Sodemann
Browse files

* Implemented optional namelist input for COMMAND, RELEASES, SPECIES,

  AGECLASSES,OUTGRID,OUTGRID_NEST,RECEPTORS
* Implemented com_mod switch nmlout to write input files as namelist to
  the output directory (.true. by default)
* Proposed updated startup and runtime output (may change back to previous
  info if desired)


git-svn-id: http://flexpart.flexpart.eu:8088/svn/FlexPart90/trunk@27 ef8cc7e1-21b7-489e-abab-c1baa636049d
parent 87910afa
...@@ -59,9 +59,10 @@ program flexpart ...@@ -59,9 +59,10 @@ program flexpart
end do end do
call gasdev1(idummy,rannumb(maxrand),rannumb(maxrand-1)) call gasdev1(idummy,rannumb(maxrand),rannumb(maxrand-1))
! ! FLEXPART version string
flexversion='Version 9.2 beta (2014-05-23)' flexversion='Version 9.2 beta (2014-07-01)'
!verbosity=0 verbosity=0
! Read the pathnames where input/output files are stored ! Read the pathnames where input/output files are stored
!******************************************************* !*******************************************************
...@@ -75,50 +76,44 @@ program flexpart ...@@ -75,50 +76,44 @@ program flexpart
case (1) case (1)
call getarg(1,arg1) call getarg(1,arg1)
pathfile=arg1 pathfile=arg1
verbosity=0
if (arg1(1:1).eq.'-') then if (arg1(1:1).eq.'-') then
write(pathfile,'(a11)') './pathnames' write(pathfile,'(a11)') './pathnames'
inline_options=arg1 inline_options=arg1
endif endif
case (0) case (0)
write(pathfile,'(a11)') './pathnames' write(pathfile,'(a11)') './pathnames'
verbosity=0
end select end select
if (inline_options(1:1).eq.'-') then
print*, 'inline options=', inline_options
if (trim(inline_options).eq.'-v'.or.trim(inline_options).eq.'-v1') then
print*, 'verbose mode 1: additional information will be displayed'
verbosity=1
endif
if (trim(inline_options).eq.'-v2') then
print*, 'verbose mode 2: additional information will be displayed'
verbosity=2
endif
if (trim(inline_options).eq.'-i') then
print*, 'info mode: will provide run specific information and stop'
verbosity=1
info_flag=1
endif
if (trim(inline_options).eq.'-i2') then
print*, 'info mode: will provide run specific information and stop'
verbosity=2
info_flag=1
endif
endif
! Print the GPL License statement ! Print the GPL License statement
!******************************************************* !*******************************************************
print*,'Welcome to FLEXPART ', trim(flexversion) print*,'Welcome to FLEXPART ', trim(flexversion)
print*,'FLEXPART is free software released under the GNU Genera'// & print*,'FLEXPART is free software released under the GNU General Public License.'
'l Public License.'
if (inline_options(1:1).eq.'-') then
if (trim(inline_options).eq.'-v'.or.trim(inline_options).eq.'-v1') then
print*, 'Verbose mode 1: display detailed information during run'
verbosity=1
endif
if (trim(inline_options).eq.'-v2') then
print*, 'Verbose mode 2: display more detailed information during run'
verbosity=2
endif
if (trim(inline_options).eq.'-i') then
print*, 'Info mode: provide detailed run specific information and stop'
verbosity=1
info_flag=1
endif
if (trim(inline_options).eq.'-i2') then
print*, 'Info mode: provide more detailed run specific information and stop'
verbosity=2
info_flag=1
endif
endif
if (verbosity.gt.0) then if (verbosity.gt.0) then
WRITE(*,*) 'call readpaths' write(*,*) 'call readpaths'
endif endif
call readpaths(pathfile) call readpaths(pathfile)
if (verbosity.gt.1) then !show clock info if (verbosity.gt.1) then !show clock info
!print*,'length(4)',length(4) !print*,'length(4)',length(4)
...@@ -130,44 +125,40 @@ program flexpart ...@@ -130,44 +125,40 @@ program flexpart
!WRITE(*,*) 'SYSTEM_CLOCK, count_max', count_max !WRITE(*,*) 'SYSTEM_CLOCK, count_max', count_max
endif endif
! Read the user specifications for the current model run ! Read the user specifications for the current model run
!******************************************************* !*******************************************************
if (verbosity.gt.0) then if (verbosity.gt.0) then
WRITE(*,*) 'call readcommand' write(*,*) 'call readcommand'
endif endif
call readcommand call readcommand
if (verbosity.gt.0) then if (verbosity.gt.0) then
WRITE(*,*) ' ldirect=', ldirect write(*,*) ' ldirect=', ldirect
WRITE(*,*) ' ibdate,ibtime=',ibdate,ibtime write(*,*) ' ibdate,ibtime=',ibdate,ibtime
WRITE(*,*) ' iedate,ietime=', iedate,ietime write(*,*) ' iedate,ietime=', iedate,ietime
if (verbosity.gt.1) then if (verbosity.gt.1) then
CALL SYSTEM_CLOCK(count_clock, count_rate, count_max) CALL SYSTEM_CLOCK(count_clock, count_rate, count_max)
WRITE(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max write(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max
endif endif
endif endif
! Read the age classes to be used ! Read the age classes to be used
!******************************** !********************************
if (verbosity.gt.0) then if (verbosity.gt.0) then
WRITE(*,*) 'call readageclasses' write(*,*) 'call readageclasses'
endif endif
call readageclasses call readageclasses
if (verbosity.gt.1) then if (verbosity.gt.1) then
CALL SYSTEM_CLOCK(count_clock, count_rate, count_max) CALL SYSTEM_CLOCK(count_clock, count_rate, count_max)
WRITE(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max write(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max
endif endif
! Read, which wind fields are available within the modelling period ! Read, which wind fields are available within the modelling period
!****************************************************************** !******************************************************************
if (verbosity.gt.0) then if (verbosity.gt.0) then
WRITE(*,*) 'call readavailable' write(*,*) 'call readavailable'
endif endif
call readavailable call readavailable
...@@ -176,36 +167,34 @@ program flexpart ...@@ -176,36 +167,34 @@ program flexpart
!********************************************** !**********************************************
if (verbosity.gt.0) then if (verbosity.gt.0) then
WRITE(*,*) 'call gridcheck' write(*,*) 'call gridcheck'
endif endif
call gridcheck call gridcheck
if (verbosity.gt.1) then if (verbosity.gt.1) then
CALL SYSTEM_CLOCK(count_clock, count_rate, count_max) CALL SYSTEM_CLOCK(count_clock, count_rate, count_max)
WRITE(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max write(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max
endif endif
if (verbosity.gt.0) then if (verbosity.gt.0) then
WRITE(*,*) 'call gridcheck_nests' write(*,*) 'call gridcheck_nests'
endif endif
call gridcheck_nests call gridcheck_nests
! Read the output grid specifications ! Read the output grid specifications
!************************************ !************************************
if (verbosity.gt.0) then if (verbosity.gt.0) then
WRITE(*,*) 'call readoutgrid' write(*,*) 'call readoutgrid'
endif endif
call readoutgrid call readoutgrid
if (nested_output.eq.1) then if (nested_output.eq.1) then
call readoutgrid_nest call readoutgrid_nest
if (verbosity.gt.0) then if (verbosity.gt.0) then
WRITE(*,*) '# readoutgrid_nest' write(*,*) '# readoutgrid_nest'
endif endif
endif endif
...@@ -231,7 +220,6 @@ program flexpart ...@@ -231,7 +220,6 @@ program flexpart
endif endif
call readlanduse call readlanduse
! Assign fractional cover of landuse classes to each ECMWF grid point ! Assign fractional cover of landuse classes to each ECMWF grid point
!******************************************************************** !********************************************************************
...@@ -240,8 +228,6 @@ program flexpart ...@@ -240,8 +228,6 @@ program flexpart
endif endif
call assignland call assignland
! Read the coordinates of the release locations ! Read the coordinates of the release locations
!********************************************** !**********************************************
...@@ -250,7 +236,6 @@ program flexpart ...@@ -250,7 +236,6 @@ program flexpart
endif endif
call readreleases call readreleases
! Read and compute surface resistances to dry deposition of gases ! Read and compute surface resistances to dry deposition of gases
!**************************************************************** !****************************************************************
...@@ -267,7 +252,6 @@ program flexpart ...@@ -267,7 +252,6 @@ program flexpart
print*,'call coordtrafo' print*,'call coordtrafo'
endif endif
! Initialize all particles to non-existent ! Initialize all particles to non-existent
!***************************************** !*****************************************
...@@ -294,34 +278,30 @@ program flexpart ...@@ -294,34 +278,30 @@ program flexpart
numparticlecount=0 numparticlecount=0
endif endif
! Calculate volume, surface area, etc., of all output grid cells ! Calculate volume, surface area, etc., of all output grid cells
! Allocate fluxes and OHfield if necessary ! Allocate fluxes and OHfield if necessary
!*************************************************************** !***************************************************************
if (verbosity.gt.0) then if (verbosity.gt.0) then
print*,'call outgrid_init' print*,'call outgrid_init'
endif endif
call outgrid_init call outgrid_init
if (nested_output.eq.1) call outgrid_init_nest if (nested_output.eq.1) call outgrid_init_nest
! Read the OH field ! Read the OH field
!****************** !******************
if (OHREA.eqv..TRUE.) then if (OHREA.eqv..TRUE.) then
if (verbosity.gt.0) then if (verbosity.gt.0) then
print*,'call readOHfield' print*,'call readOHfield'
endif endif
call readOHfield call readOHfield
endif endif
! Write basic information on the simulation to a file "header" ! Write basic information on the simulation to a file "header"
! and open files that are to be kept open throughout the simulation ! and open files that are to be kept open throughout the simulation
!****************************************************************** !******************************************************************
if (verbosity.gt.0) then if (verbosity.gt.0) then
print*,'call writeheader' print*,'call writeheader'
endif endif
...@@ -331,12 +311,9 @@ program flexpart ...@@ -331,12 +311,9 @@ program flexpart
call writeheader_txt call writeheader_txt
!if (nested_output.eq.1) call writeheader_nest !if (nested_output.eq.1) call writeheader_nest
if (nested_output.eq.1.and.surf_only.ne.1) call writeheader_nest if (nested_output.eq.1.and.surf_only.ne.1) call writeheader_nest
if (nested_output.eq.1.and.surf_only.eq.1) call writeheader_nest_surf if (nested_output.eq.1.and.surf_only.eq.1) call writeheader_nest_surf
if (nested_output.ne.1.and.surf_only.eq.1) call writeheader_surf if (nested_output.ne.1.and.surf_only.eq.1) call writeheader_surf
!open(unitdates,file=path(2)(1:length(2))//'dates') !open(unitdates,file=path(2)(1:length(2))//'dates')
if (verbosity.gt.0) then if (verbosity.gt.0) then
...@@ -345,7 +322,6 @@ program flexpart ...@@ -345,7 +322,6 @@ program flexpart
call openreceptors call openreceptors
if ((iout.eq.4).or.(iout.eq.5)) call openouttraj if ((iout.eq.4).or.(iout.eq.5)) call openouttraj
! Releases can only start and end at discrete times (multiples of lsynctime) ! Releases can only start and end at discrete times (multiples of lsynctime)
!*************************************************************************** !***************************************************************************
...@@ -353,13 +329,10 @@ program flexpart ...@@ -353,13 +329,10 @@ program flexpart
print*,'discretize release times' print*,'discretize release times'
endif endif
do i=1,numpoint do i=1,numpoint
ireleasestart(i)=nint(real(ireleasestart(i))/ & ireleasestart(i)=nint(real(ireleasestart(i))/real(lsynctime))*lsynctime
real(lsynctime))*lsynctime ireleaseend(i)=nint(real(ireleaseend(i))/real(lsynctime))*lsynctime
ireleaseend(i)=nint(real(ireleaseend(i))/ &
real(lsynctime))*lsynctime
end do end do
! Initialize cloud-base mass fluxes for the convection scheme ! Initialize cloud-base mass fluxes for the convection scheme
!************************************************************ !************************************************************
...@@ -380,26 +353,23 @@ program flexpart ...@@ -380,26 +353,23 @@ program flexpart
end do end do
end do end do
! Calculate particle trajectories ! Calculate particle trajectories
!******************************** !********************************
if (verbosity.gt.0) then if (verbosity.gt.0) then
if (verbosity.gt.1) then if (verbosity.gt.1) then
CALL SYSTEM_CLOCK(count_clock, count_rate, count_max) CALL SYSTEM_CLOCK(count_clock, count_rate, count_max)
WRITE(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max write(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max
endif endif
if (info_flag.eq.1) then if (info_flag.eq.1) then
print*, 'info only mode (stop)' print*, 'info only mode (stop)'
stop stop
endif endif
print*,'call timemanager' print*,'call timemanager'
endif endif
call timemanager call timemanager
write(*,*) 'CONGRATULATIONS: YOU HAVE SUCCESSFULLY COMPLETED A FLEXPART MODEL RUN!'
write(*,*) 'CONGRATULATIONS: YOU HAVE SUCCESSFULLY COMPLETED A FLE&
&XPART MODEL RUN!'
end program flexpart end program flexpart
...@@ -681,11 +681,12 @@ module com_mod ...@@ -681,11 +681,12 @@ module com_mod
! rannumb field of normally distributed random numbers ! rannumb field of normally distributed random numbers
!******************** !********************
! Verbosity, testing flags ! Verbosity, testing flags, namelist I/O
!******************** !********************
integer :: verbosity=0 integer :: verbosity=0
integer :: info_flag=0 integer :: info_flag=0
INTEGER :: count_clock, count_clock0, count_rate, count_max integer :: count_clock, count_clock0, count_rate, count_max
logical :: nmlout=.true.
end module com_mod end module com_mod
...@@ -442,15 +442,13 @@ subroutine gridcheck ...@@ -442,15 +442,13 @@ subroutine gridcheck
! Output of grid info ! Output of grid info
!******************** !********************
write(*,*) write(*,'(a,2i7)') ' Vertical levels in ECMWF data: ', &
write(*,*)
write(*,'(a,2i7)') '# of vertical levels in ECMWF data: ', &
nuvz+1,nwz nuvz+1,nwz
write(*,*) write(*,*)
write(*,'(a)') 'Mother domain:' write(*,'(a)') ' Mother domain:'
write(*,'(a,f10.5,a,f10.5,a,f10.5)') ' Longitude range: ', & write(*,'(a,f10.5,a,f10.5,a,f10.5)') ' Longitude range: ', &
xlon0,' to ',xlon0+(nx-1)*dx,' Grid distance: ',dx xlon0,' to ',xlon0+(nx-1)*dx,' Grid distance: ',dx
write(*,'(a,f10.5,a,f10.5,a,f10.5)') ' Latitude range: ', & write(*,'(a,f10.5,a,f10.5,a,f10.5)') ' Latitude range : ', &
ylat0,' to ',ylat0+(ny-1)*dy,' Grid distance: ',dy ylat0,' to ',ylat0+(ny-1)*dy,' Grid distance: ',dy
write(*,*) write(*,*)
......
...@@ -422,13 +422,13 @@ subroutine gridcheck ...@@ -422,13 +422,13 @@ subroutine gridcheck
write(*,*) write(*,*)
write(*,*) write(*,*)
write(*,'(a,2i7)') '# of vertical levels in NCEP data: ', & write(*,'(a,2i7)') 'Vertical levels in NCEP data: ', &
nuvz,nwz nuvz,nwz
write(*,*) write(*,*)
write(*,'(a)') 'Mother domain:' write(*,'(a)') 'Mother domain:'
write(*,'(a,f10.2,a1,f10.2,a,f10.2)') ' Longitude range: ', & write(*,'(a,f10.2,a1,f10.2,a,f10.2)') ' Longitude range: ', &
xlon0,' to ',xlon0+(nx-1)*dx,' Grid distance: ',dx xlon0,' to ',xlon0+(nx-1)*dx,' Grid distance: ',dx
write(*,'(a,f10.2,a1,f10.2,a,f10.2)') ' Latitude range: ', & write(*,'(a,f10.2,a1,f10.2,a,f10.2)') ' Latitude range : ', &
ylat0,' to ',ylat0+(ny-1)*dy,' Grid distance: ',dy ylat0,' to ',ylat0+(ny-1)*dy,' Grid distance: ',dy
write(*,*) write(*,*)
......
...@@ -349,11 +349,11 @@ subroutine gridcheck_nests ...@@ -349,11 +349,11 @@ subroutine gridcheck_nests
! Output of grid info ! Output of grid info
!******************** !********************
write(*,'(a,i2)') 'Nested domain #: ',l write(*,'(a,i2,a)') ' Nested domain ',l,':'
write(*,'(a,f10.5,a,f10.5,a,f10.5)') ' Longitude range: ', & write(*,'(a,f10.5,a,f10.5,a,f10.5)') ' Longitude range: ', &
xlon0n(l),' to ',xlon0n(l)+(nxn(l)-1)*dxn(l), & xlon0n(l),' to ',xlon0n(l)+(nxn(l)-1)*dxn(l), &
' Grid distance: ',dxn(l) ' Grid distance: ',dxn(l)
write(*,'(a,f10.5,a,f10.5,a,f10.5)') ' Latitude range: ', & write(*,'(a,f10.5,a,f10.5,a,f10.5)') ' Latitude range : ', &
ylat0n(l),' to ',ylat0n(l)+(nyn(l)-1)*dyn(l), & ylat0n(l),' to ',ylat0n(l)+(nyn(l)-1)*dyn(l), &
' Grid distance: ',dyn(l) ' Grid distance: ',dyn(l)
write(*,*) write(*,*)
......
...@@ -224,8 +224,8 @@ subroutine outgrid_init ...@@ -224,8 +224,8 @@ subroutine outgrid_init
!write (*,*) 'Dimensions for fields', numxgrid,numygrid, & !write (*,*) 'Dimensions for fields', numxgrid,numygrid, &
! maxspec,maxpointspec_act,nclassunc,maxageclass ! maxspec,maxpointspec_act,nclassunc,maxageclass
write (*,*) ' Allocating fields for nested and global output (x,y): ', & write (*,*) 'Allocating fields for global output (x,y): ', numxgrid,numygrid
max(numxgrid,numxgridn),max(numygrid,numygridn) write (*,*) 'Allocating fields for nested output (x,y): ', numxgridn,numygridn
! allocate fields for concoutput with maximum dimension of outgrid ! allocate fields for concoutput with maximum dimension of outgrid
! and outgrid_nest ! and outgrid_nest
......
...@@ -121,8 +121,8 @@ module par_mod ...@@ -121,8 +121,8 @@ module par_mod
!********************************************* !*********************************************
!integer,parameter :: nxmax=361,nymax=181,nuvzmax=92,nwzmax=92,nzmax=92 !FNL XF !integer,parameter :: nxmax=361,nymax=181,nuvzmax=92,nwzmax=92,nzmax=92 !FNL XF
integer,parameter :: nxmax=361,nymax=181,nuvzmax=152,nwzmax=152,nzmax=152 !ECMWF new !integer,parameter :: nxmax=361,nymax=181,nuvzmax=152,nwzmax=152,nzmax=152 !ECMWF new
!integer,parameter :: nxmax=361,nymax=181,nuvzmax=92,nwzmax=92,nzmax=92 !ECMWF integer,parameter :: nxmax=361,nymax=181,nuvzmax=92,nwzmax=92,nzmax=92 !ECMWF
!integer,parameter :: nxmax=361,nymax=181,nuvzmax=26,nwzmax=26,nzmax=26 !integer,parameter :: nxmax=361,nymax=181,nuvzmax=26,nwzmax=26,nzmax=26
!integer,parameter :: nxmax=721,nymax=361,nuvzmax=64,nwzmax=64,nzmax=64 !integer,parameter :: nxmax=721,nymax=361,nuvzmax=64,nwzmax=64,nzmax=64
!integer,parameter :: nxmax=1201,nymax=235,nuvzmax=58,nwzmax=58,nzmax=58 !integer,parameter :: nxmax=1201,nymax=235,nuvzmax=58,nwzmax=58,nzmax=58
...@@ -197,7 +197,7 @@ module par_mod ...@@ -197,7 +197,7 @@ module par_mod
! Maximum number of particles, species, and similar ! Maximum number of particles, species, and similar
!************************************************** !**************************************************
integer,parameter :: maxpart=15000000 integer,parameter :: maxpart=150000
integer,parameter :: maxspec=4 integer,parameter :: maxspec=4
......
...@@ -27,8 +27,9 @@ subroutine readageclasses ...@@ -27,8 +27,9 @@ subroutine readageclasses
! run. * ! run. *
! * ! *
! Author: A. Stohl * ! Author: A. Stohl *
! *
! 20 March 2000 * ! 20 March 2000 *