Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created formal fortran namelist for itag. #402

Merged
merged 13 commits into from
Oct 27, 2021
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
&read_itag
fileName='${inFileName}'
IOFORM='${inFormat}'
grib='${outFormat}'
DateStr='${YY}-${MM}-${DD}_${HH}:00:00'
FULLMODELNAME='${tag}'
fileNameFlux='${flxFileName}'
fileNameD3D='postxconfig-NT.txt'
hertneky marked this conversation as resolved.
Show resolved Hide resolved
/
EOF
fi
fi
Expand Down
101 changes: 53 additions & 48 deletions sorc/ncep_post.fd/WRFPOST.f
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ PROGRAM WRFPOST
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
integer :: itag_ierr
namelist/read_itag/fileName,IOFORM,grib,DateStr,FULLMODELNAME,fileNameFlux &
kayeekayee marked this conversation as resolved.
Show resolved Hide resolved
,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,42 @@ 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
kayeekayee marked this conversation as resolved.
Show resolved Hide 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'
kayeekayee marked this conversation as resolved.
Show resolved Hide resolved
!open namelist
open(5,file='itag')
read(5,nml=read_itag,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(index(grib,"grib") == 0) then
! grib='grib1'
! endif
kayeekayee marked this conversation as resolved.
Show resolved Hide resolved
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
kayeekayee marked this conversation as resolved.
Show resolved Hide resolved
! 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 +281,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)
kayeekayee marked this conversation as resolved.
Show resolved Hide resolved
118 continue

end if

!
Expand Down Expand Up @@ -312,11 +317,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 +347,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
kayeekayee marked this conversation as resolved.
Show resolved Hide 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 +385,13 @@ PROGRAM WRFPOST
116 continue
!set control file name
fileNameFlat='postxconfig-NT.txt'
kayeekayee marked this conversation as resolved.
Show resolved Hide resolved
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
&read_itag
fileName='${GFSOUT}'
IOFORM='${MODEL_OUT_FORM}'
grib='${GRIBVERSION}'
DateStr='${YY}-${MM}-${DD}_${HH}:00:00'
FULLMODELNAME='GFS'
kayeekayee marked this conversation as resolved.
Show resolved Hide resolved
fileNameFlux='${FLXINP}'
fileNameD3D='${D3DINP}'
/
EOF

cat postgp.inp.nml$$ >> itag
Expand Down
16 changes: 9 additions & 7 deletions ush/global_nceppost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,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
&read_itag
WenMeng-NOAA marked this conversation as resolved.
Show resolved Hide resolved
fileName='${GFSOUT}'
IOFORM='${MODEL_OUT_FORM}'
grib='${GRIBVERSION}'
DateStr='${YY}-${MM}-${DD}_${HH}:00:00'
FULLMODELNAME='GFS'
fileNameFlux='${FLXINP}'
fileNameD3D='${D3DINP}'
/
EOF

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