Skip to content
Snippets Groups Projects
Commit 91c374e6 authored by ronesy's avatar ronesy
Browse files

Small bug fix to prep_flexpart for using FPv11 when there are no reactive species

parent ea35c372
No related branches found
No related tags found
No related merge requests found
......@@ -183,7 +183,7 @@ module mod_prep_command
lturbulence = 1
lturbulence_meso = 0
lnetcdfout = 0
nxshift = 1
nxshift = 0
maxthreadgrid = 1
maxfilesize = 10000
logvertinterp = 0
......
......@@ -84,7 +84,7 @@ subroutine prep_outgrid(settings, jd, nr)
if ( settings%windfield.eq.'oper' ) then
outlon0 = -179.
else if ( settings%windfield.eq.'era5' ) then
outlon0 = -179.
outlon0 = -179.5
else
write(*,*) 'ERROR: prep_outgrid: unknown windfield type'
stop
......
......@@ -121,7 +121,7 @@ subroutine prep_releases(settings, jd, nr, nobs, obs)
if ( settings%FPversion.eq.10 ) then
inquire(file=trim(settings%path_flexpart)//'options/SPECIES/spec_overview',exist=lexist)
if ( .not.lexist ) then
write(*,*) 'ERROR: cannot find file /options/SPECIES/spec_overview'
write(*,*) 'ERROR: cannot find file '//trim(settings%path_flexpart)//'options/SPECIES/spec_overview'
stop
endif
open(100,file=trim(settings%path_flexpart)//'options/SPECIES/spec_overview',status='old',action='read',iostat=ierr)
......@@ -138,29 +138,32 @@ subroutine prep_releases(settings, jd, nr, nobs, obs)
inquire(file=trim(settings%path_flexpart)//'options/SPECIES/SPECIES_'//to_upper(trim(settings%species)),&
exist=lexist)
if ( .not.lexist ) then
write(*,*) 'ERROR: cannot find file /options/SPECIES/SPECIES_'//to_upper(trim(settings%species))
write(*,*) 'ERROR: cannot find file '&
//trim(settings%path_flexpart)//'options/SPECIES/SPECIES_'//to_upper(trim(settings%species))
stop
endif
write(aspec,fmt='(I3.3)') spec
call system('cp '//trim(settings%path_flexpart)//'options/SPECIES/SPECIES_'//to_upper(trim(settings%species))//&
' '//trim(settings%path_flexpart)//'options/SPECIES/SPECIES_'//aspec)
write(aspec,fmt='(I3.3)') spec
! read SPECIES file for reagents info
allocate(preactions(nreagent))
allocate(pcconst(nreagent))
allocate(pdconst(nreagent))
allocate(pnconst(nreagent))
open(100,file=trim(settings%path_flexpart)//'options/SPECIES/SPECIES_'//to_upper(trim(settings%species)),&
action='read',iostat=ierr)
read(100,species_params,iostat=ierr)
if ( ierr.ne.0 ) then
write(*,*) 'ERROR: reading SPECIES_'//to_upper(trim(settings%species))
stop
endif
write(*,*) 'Chemical reactions: ',preactions
if (any(preactions.ne."")) then
! write reagents file
call prep_reagents(settings,preactions,nr,jd)
if (nreagent.gt.0) then
! read SPECIES file for reagents info
allocate(preactions(nreagent))
allocate(pcconst(nreagent))
allocate(pdconst(nreagent))
allocate(pnconst(nreagent))
open(100,file=trim(settings%path_flexpart)//'options/SPECIES/SPECIES_'//to_upper(trim(settings%species)),&
action='read',iostat=ierr)
read(100,species_params,iostat=ierr)
if ( ierr.ne.0 ) then
write(*,*) 'ERROR: reading SPECIES_'//to_upper(trim(settings%species))
stop
endif
write(*,*) 'Chemical reactions: ',preactions
if (any(preactions.ne."")) then
! write reagents file
call prep_reagents(settings,preactions,nr,jd)
endif
endif
endif
......
......@@ -130,7 +130,7 @@ subroutine prep_releases_reg(settings, jd, nr)
if ( settings%FPversion.eq.10 ) then
inquire(file=trim(settings%path_flexpart)//'options/SPECIES/spec_overview',exist=lexist)
if ( .not.lexist ) then
write(*,*) 'ERROR: cannot fine file /options/SPECIES/spec_overview'
write(*,*) 'ERROR: cannot find file '//trim(settings%path_flexpart)//'options/SPECIES/spec_overview'
stop
endif
open(100,file=trim(settings%path_flexpart)//'options/SPECIES/spec_overview',status='old',action='read',iostat=ierr)
......@@ -147,29 +147,32 @@ subroutine prep_releases_reg(settings, jd, nr)
inquire(file=trim(settings%path_flexpart)//'options/SPECIES/SPECIES_'//to_upper(trim(settings%species)),&
exist=lexist)
if ( .not.lexist ) then
write(*,*) 'ERROR: cannot find file /options/SPECIES/SPECIES_'//to_upper(trim(settings%species))
write(*,*) 'ERROR: cannot find file '&
//trim(settings%path_flexpart)//'options/SPECIES/SPECIES_'//to_upper(trim(settings%species))
stop
endif
write(aspec,fmt='(I3.3)') spec
call system('cp '//trim(settings%path_flexpart)//'options/SPECIES/SPECIES_'//to_upper(trim(settings%species))//&
' '//trim(settings%path_flexpart)//'options/SPECIES/SPECIES_'//aspec)
write(aspec,fmt='(I3.3)') spec
! read SPECIES file for reagents info
allocate(preactions(nreagent))
allocate(pcconst(nreagent))
allocate(pdconst(nreagent))
allocate(pnconst(nreagent))
open(100,file=trim(settings%path_flexpart)//'options/SPECIES/SPECIES_'//to_upper(trim(settings%species)),&
action='read',iostat=ierr)
read(100,species_params,iostat=ierr)
if ( ierr.ne.0 ) then
write(*,*) 'ERROR: reading SPECIES_'//to_upper(trim(settings%species))
stop
endif
write(*,*) 'Chemical reactions: ',preactions
if (any(preactions.ne."")) then
! write reagents file
call prep_reagents(settings,preactions,nr,jd)
if (nreagent.gt.0) then
! read SPECIES file for reagents info
allocate(preactions(nreagent))
allocate(pcconst(nreagent))
allocate(pdconst(nreagent))
allocate(pnconst(nreagent))
open(100,file=trim(settings%path_flexpart)//'options/SPECIES/SPECIES_'//to_upper(trim(settings%species)),&
action='read',iostat=ierr)
read(100,species_params,iostat=ierr)
if ( ierr.ne.0 ) then
write(*,*) 'ERROR: reading SPECIES_'//to_upper(trim(settings%species))
stop
endif
write(*,*) 'Chemical reactions: ',preactions
if (any(preactions.ne."")) then
! write reagents file
call prep_reagents(settings,preactions,nr,jd)
endif
endif
endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment