Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions scripts/run_upp
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,15 @@ fi
if [[ ${outFormat} == "grib2" ]]; then
if [[ ${model} == "GFS" || ${model} == "LAM" ]]; then
cat > itag <<EOF
${inFileName}
${inFormat}
${outFormat}
${YY}-${MM}-${DD}_${HH}:00:00
${tag}
${flxFileName}
postxconfig-NT.txt
&model_inputs
fileName='${inFileName}'
IOFORM='${inFormat}'
grib='${outFormat}'
DateStr='${YY}-${MM}-${DD}_${HH}:00:00'
FULLMODELNAME='${tag}'
fileNameFlux='${flxFileName}'
fileNameD3D='postxconfig-NT.txt'
Comment thread
hertneky marked this conversation as resolved.
Outdated
/
EOF
fi
fi
Expand Down
100 changes: 51 additions & 49 deletions sorc/ncep_post.fd/WRFPOST.f
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ PROGRAM WRFPOST
integer :: kpo,kth,kpv
real,dimension(komax) :: po,th,pv
namelist/nampgb/kpo,po,kth,th,kpv,pv,fileNameAER,d3d_on,gocart_on,popascal &
,hyb_sigp,rdaod,aqfcmaq_on
,hyb_sigp,rdaod,aqfcmaq_on,vtimeunits
Comment thread
kayeekayee marked this conversation as resolved.
integer :: itag_ierr
namelist/model_inputs/fileName,IOFORM,grib,DateStr,FULLMODELNAME,fileNameFlux &
,fileNameD3D

character startdate*19,SysDepInfo*80,IOWRFNAME*3,post_fname*255
character cgar*1,cdum*4,line*10
Expand Down Expand Up @@ -215,34 +218,39 @@ PROGRAM WRFPOST
spval = 9.9e10
!
!**************************************************************************
!read namelist
open(5,file='itag')
98 read(5,111,end=1000) fileName
if (me==0) print*,'fileName= ',fileName
read(5,113) IOFORM
if (me==0) print*,'IOFORM= ',IOFORM
read(5,120) grib
if (me==0) print*,'OUTFORM= ',grib
if(index(grib,"grib") == 0) then
! grib='grib1' !GRIB1 IS NOT SUPPORTED ANYMORE.
grib='grib2'
rewind(5,iostat=ierr)
read(5,111,end=1000) fileName
read(5,113) IOFORM
endif
if (me==0) print*,'OUTFORM2= ',grib
read(5,112) DateStr
read(5,114) FULLMODELNAME
MODELNAME=FULLMODELNAME(1:4)
SUBMODELNAME=FULLMODELNAME(5:)
IF(len_trim(FULLMODELNAME)<5) THEN
SUBMODELNAME='NONE'
ENDIF
! if(MODELNAME == 'NMM')then
!KaYee: Read itag in Fortran Namelist format
Comment thread
kayeekayee marked this conversation as resolved.
!Initialize the namelist variables
! fileName='gfs.t00z.atmf006.nc'
! IOFORM='netcdf'
! grib='grib2'
! DateStr='2020-02-04_00:00:00'
! FULLMODELNAME='GFS'
! fileNameFlux='gfs.t00z.sfcf006.nc'
! fileNameD3D='postxconfig-NT.txt'
!open namelist
open(5,file='itag')
read(5,nml=model_inputs,iostat=itag_ierr,err=888)
!print*,'itag_ierr=',itag_ierr
888 if (itag_ierr /= 0) then
print*,'Incorrect namelist variable(s) found in the itag file,stopping!'
stop
endif
if (me==0) print*,'fileName= ',fileName
if (me==0) print*,'IOFORM= ',IOFORM
!if (me==0) print*,'OUTFORM= ',grib
if (me==0) print*,'OUTFORM= ',grib
if (me==0) print*,'DateStr= ',DateStr
if (me==0) print*,'FULLMODELNAME= ',FULLMODELNAME
MODELNAME=FULLMODELNAME(1:4)
SUBMODELNAME=FULLMODELNAME(5:)
IF(len_trim(FULLMODELNAME)<5) THEN
SUBMODELNAME='NONE'
ENDIF
Comment thread
kayeekayee marked this conversation as resolved.
Outdated
! if(MODELNAME == 'NMM')then
! read(5,1114) VTIMEUNITS
! 1114 format(a4)
! if (me==0) print*,'VALID TIME UNITS = ', VTIMEUNITS
! endif
! endif
!
303 format('FULLMODELNAME="',A,'" MODELNAME="',A,'" &
SUBMODELNAME="',A,'"')
Expand Down Expand Up @@ -270,18 +278,12 @@ PROGRAM WRFPOST
120 format(a5)
121 format(a4)

!KaYee: Read in GFS/FV3 runs in Fortran Namelist Format.
if (me==0) print*,'MODELNAME= ',MODELNAME,'grib=',grib
!Chuang: If model is GFS, read in flux file name from unit5
if(MODELNAME == 'GFS' .OR. MODELNAME == 'FV3R') then
read(5,111,end=117) fileNameFlux
if (me == 0) print*,'first two file names in GFS or FV3= ' &
,trim(fileName),trim(fileNameFlux)
117 continue

read(5,111,end=118) fileNameD3D
if (me == 0) print*,'D3D names in GFS= ',trim(fileNameD3D)
Comment thread
kayeekayee marked this conversation as resolved.
Outdated
118 continue

end if

!
Expand Down Expand Up @@ -312,11 +314,11 @@ PROGRAM WRFPOST
! gocart_on = .true.
! d3d_on = .true.

if(MODELNAME == 'RAPR') then
read(5,*,iostat=iret,end=119) kpo
else
!KaYee if(MODELNAME == 'RAPR') then
!KaYee read(5,*,iostat=iret,end=119) kpo
!KaYee else
read(5,nampgb,iostat=iret,end=119)
endif
!KaYee endif
! if(kpo > komax)print*,'pressure levels cannot exceed ',komax; STOP
! if(kth > komax)print*,'isent levels cannot exceed ',komax; STOP
! if(kpv > komax)print*,'PV levels cannot exceed ',komax; STOP
Expand All @@ -342,15 +344,15 @@ PROGRAM WRFPOST
if(me == 0) then
print*,'using pressure levels from POSTGPVARS'
endif
if(MODELNAME == 'RAPR')then
read(5,*) (po(l),l=1,kpo)
!KaYee if(MODELNAME == 'RAPR')then
!KaYee read(5,*) (po(l),l=1,kpo)
! CRA READ VALID TIME UNITS
read(5,121) VTIMEUNITS
if(me == 0) then
print*,'VALID TIME UNITS = ', VTIMEUNITS
endif
!KaYee read(5,121) VTIMEUNITS
Comment thread
kayeekayee marked this conversation as resolved.
!KaYee if(me == 0) then
!KaYee print*,'VALID TIME UNITS = ', VTIMEUNITS
!KaYee endif
! CRA
endif
!KaYee endif
lsm = kpo
if( .not. popascal ) then
untcnvt = 100.
Expand Down Expand Up @@ -380,13 +382,13 @@ PROGRAM WRFPOST
116 continue
!set control file name
fileNameFlat='postxconfig-NT.txt'
Comment thread
kayeekayee marked this conversation as resolved.
Outdated
if(MODELNAME == 'GFS') then
!KaYee if(MODELNAME == 'GFS') then
! read(5,*) line
read(5,111,end=125) fileNameFlat
125 continue
!KaYee read(5,111,end=125) fileNameFlat
!KaYee 125 continue
! if(len_trim(fileNameFlat)<5) fileNameFlat = 'postxconfig-NT.txt'
if (me == 0) print*,'Post flat name in GFS= ',trim(fileNameFlat)
endif
!KaYee if (me == 0) print*,'Post flat name in GFS= ',trim(fileNameFlat)
!KaYee endif
! set PTHRESH for different models
if(MODELNAME == 'NMM')then
PTHRESH = 0.000004
Expand Down
16 changes: 9 additions & 7 deletions ush/gfs_nceppost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,15 @@ export DD=`echo $VDATE | cut -c7-8`
export HH=`echo $VDATE | cut -c9-10`

cat > itag <<EOF
$GFSOUT
${MODEL_OUT_FORM}
${GRIBVERSION}
${YY}-${MM}-${DD}_${HH}:00:00
GFS
$FLXINP
$D3DINP
&model_inputs
fileName='${GFSOUT}'
IOFORM='${MODEL_OUT_FORM}'
grib='${GRIBVERSION}'
DateStr='${YY}-${MM}-${DD}_${HH}:00:00'
FULLMODELNAME='GFS'
Comment thread
kayeekayee marked this conversation as resolved.
Outdated
fileNameFlux='${FLXINP}'
fileNameD3D='${D3DINP}'
/
EOF

cat postgp.inp.nml$$ >> itag
Expand Down