From 8d274ab443f628c63982bcebed5878ce0e94f570 Mon Sep 17 00:00:00 2001 From: kayee Date: Mon, 4 Oct 2021 10:02:02 -0600 Subject: [PATCH 01/12] Created formal fortran namelist for itag. --- scripts/run_upp | 16 +++--- sorc/ncep_post.fd/WRFPOST.f | 101 +++++++++++++++++++----------------- ush/gfs_nceppost.sh | 16 +++--- ush/global_nceppost.sh | 16 +++--- 4 files changed, 80 insertions(+), 69 deletions(-) diff --git a/scripts/run_upp b/scripts/run_upp index a9589391f..7aadc3cc5 100755 --- a/scripts/run_upp +++ b/scripts/run_upp @@ -323,13 +323,15 @@ fi if [[ ${outFormat} == "grib2" ]]; then if [[ ${model} == "GFS" || ${model} == "LAM" ]]; then cat > itag < 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 @@ -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 +!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. @@ -380,13 +385,13 @@ PROGRAM WRFPOST 116 continue !set control file name fileNameFlat='postxconfig-NT.txt' - 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 diff --git a/ush/gfs_nceppost.sh b/ush/gfs_nceppost.sh index b904e4ba5..d533868d9 100755 --- a/ush/gfs_nceppost.sh +++ b/ush/gfs_nceppost.sh @@ -311,13 +311,15 @@ export DD=`echo $VDATE | cut -c7-8` export HH=`echo $VDATE | cut -c9-10` cat > itag <> itag diff --git a/ush/global_nceppost.sh b/ush/global_nceppost.sh index 65fde56cf..45583e03b 100755 --- a/ush/global_nceppost.sh +++ b/ush/global_nceppost.sh @@ -350,13 +350,15 @@ export DD=`echo $VDATE | cut -c7-8` export HH=`echo $VDATE | cut -c9-10` cat > itag <> itag From ef156a4fd71dd0dce0d205386ea06112311f8a17 Mon Sep 17 00:00:00 2001 From: kayee Date: Wed, 20 Oct 2021 21:59:58 -0600 Subject: [PATCH 02/12] This is a legacy script. No updates are needed. --- ush/global_nceppost.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/ush/global_nceppost.sh b/ush/global_nceppost.sh index 45583e03b..65fde56cf 100755 --- a/ush/global_nceppost.sh +++ b/ush/global_nceppost.sh @@ -350,15 +350,13 @@ export DD=`echo $VDATE | cut -c7-8` export HH=`echo $VDATE | cut -c9-10` cat > itag <> itag From b4cab21222de0d210997fc2a603f245948209e4a Mon Sep 17 00:00:00 2001 From: kayee Date: Thu, 21 Oct 2021 14:24:06 -0600 Subject: [PATCH 03/12] Further code refinement from Wen. --- scripts/run_upp | 2 +- sorc/ncep_post.fd/WRFPOST.f | 23 ++++++++++------------- ush/gfs_nceppost.sh | 2 +- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/scripts/run_upp b/scripts/run_upp index 7aadc3cc5..9854ed2a6 100755 --- a/scripts/run_upp +++ b/scripts/run_upp @@ -323,7 +323,7 @@ fi if [[ ${outFormat} == "grib2" ]]; then if [[ ${model} == "GFS" || ${model} == "LAM" ]]; then cat > itag < Date: Fri, 22 Oct 2021 09:35:34 -0600 Subject: [PATCH 04/12] Added a change log. --- sorc/ncep_post.fd/WRFPOST.f | 1 + 1 file changed, 1 insertion(+) diff --git a/sorc/ncep_post.fd/WRFPOST.f b/sorc/ncep_post.fd/WRFPOST.f index c34a2dca4..f0e57f501 100644 --- a/sorc/ncep_post.fd/WRFPOST.f +++ b/sorc/ncep_post.fd/WRFPOST.f @@ -42,6 +42,7 @@ !! add gocart_on,d3d_on and popascal to namelist !! 20-03-25 J MENG - remove grib1 !! 21-06-20 W Meng - remove reading grib1 and gfsio lib +!! 21-10-22 KaYee Wong - created formal fortran namelist for itag !! !! USAGE: WRFPOST !! INPUT ARGUMENT LIST: From cdf2f87cb08dc6ac31369336c690d296992d303c Mon Sep 17 00:00:00 2001 From: kayee Date: Mon, 25 Oct 2021 13:15:58 -0600 Subject: [PATCH 05/12] Replace replace "fullmodelname" with "modelname, submodelname" in "model_inputs". --- sorc/ncep_post.fd/WRFPOST.f | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sorc/ncep_post.fd/WRFPOST.f b/sorc/ncep_post.fd/WRFPOST.f index f0e57f501..349111f4a 100644 --- a/sorc/ncep_post.fd/WRFPOST.f +++ b/sorc/ncep_post.fd/WRFPOST.f @@ -177,8 +177,8 @@ PROGRAM WRFPOST namelist/nampgb/kpo,po,kth,th,kpv,pv,fileNameAER,d3d_on,gocart_on,popascal & ,hyb_sigp,rdaod,aqfcmaq_on,vtimeunits integer :: itag_ierr - namelist/model_inputs/fileName,IOFORM,grib,DateStr,FULLMODELNAME,fileNameFlux & - ,fileNameD3D + namelist/model_inputs/fileName,IOFORM,grib,DateStr,MODELNAME,SUBMODELNAME & + ,fileNameFlux,fileNameD3D character startdate*19,SysDepInfo*80,IOWRFNAME*3,post_fname*255 character cgar*1,cdum*4,line*10 @@ -241,9 +241,11 @@ PROGRAM WRFPOST !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 (me==0) print*,'MODELNAME= ',MODELNAME + if (me==0) print*,'SUBMODELNAME= ',SUBMODELNAME + FULLMODELNAME=MODELNAME+SUBMODELNAME +! MODELNAME=FULLMODELNAME(1:4) +! SUBMODELNAME=FULLMODELNAME(5:) IF(len_trim(FULLMODELNAME)<5) THEN SUBMODELNAME='NONE' ENDIF From 0c23dc7eb6fdcbad1d6e8de1ddf5ecf27af86238 Mon Sep 17 00:00:00 2001 From: kayee Date: Mon, 25 Oct 2021 13:43:44 -0600 Subject: [PATCH 06/12] bug fix --- sorc/ncep_post.fd/WRFPOST.f | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sorc/ncep_post.fd/WRFPOST.f b/sorc/ncep_post.fd/WRFPOST.f index 349111f4a..8f953bf22 100644 --- a/sorc/ncep_post.fd/WRFPOST.f +++ b/sorc/ncep_post.fd/WRFPOST.f @@ -243,7 +243,7 @@ PROGRAM WRFPOST if (me==0) print*,'DateStr= ',DateStr if (me==0) print*,'MODELNAME= ',MODELNAME if (me==0) print*,'SUBMODELNAME= ',SUBMODELNAME - FULLMODELNAME=MODELNAME+SUBMODELNAME + FULLMODELNAME=MODELNAME//SUBMODELNAME ! MODELNAME=FULLMODELNAME(1:4) ! SUBMODELNAME=FULLMODELNAME(5:) IF(len_trim(FULLMODELNAME)<5) THEN From a6c004d350b016d553218bb64839b229c04c8842 Mon Sep 17 00:00:00 2001 From: kayee Date: Mon, 25 Oct 2021 18:05:13 -0600 Subject: [PATCH 07/12] Replace FULLMODELNAME to MODELNAME. --- scripts/run_upp | 2 +- ush/gfs_nceppost.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/run_upp b/scripts/run_upp index 9854ed2a6..9515de84b 100755 --- a/scripts/run_upp +++ b/scripts/run_upp @@ -328,7 +328,7 @@ fileName='${inFileName}' IOFORM='${inFormat}' grib='${outFormat}' DateStr='${YY}-${MM}-${DD}_${HH}:00:00' -FULLMODELNAME='${tag}' +MODELNAME='${tag}' fileNameFlux='${flxFileName}' fileNameD3D='postxconfig-NT.txt' / diff --git a/ush/gfs_nceppost.sh b/ush/gfs_nceppost.sh index e3553d31f..206b627e5 100755 --- a/ush/gfs_nceppost.sh +++ b/ush/gfs_nceppost.sh @@ -316,7 +316,7 @@ fileName='${GFSOUT}' IOFORM='${MODEL_OUT_FORM}' grib='${GRIBVERSION}' DateStr='${YY}-${MM}-${DD}_${HH}:00:00' -FULLMODELNAME='GFS' +MODELNAME='GFS' fileNameFlux='${FLXINP}' fileNameD3D='${D3DINP}' / From 9d0c2b8398eb5f08a66d2a5e13ac7f7b4995271c Mon Sep 17 00:00:00 2001 From: kayee Date: Mon, 25 Oct 2021 19:13:05 -0600 Subject: [PATCH 08/12] Further clean up for FULLMODELNAME. --- sorc/ncep_post.fd/WRFPOST.f | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/sorc/ncep_post.fd/WRFPOST.f b/sorc/ncep_post.fd/WRFPOST.f index 8f953bf22..342c0fbef 100644 --- a/sorc/ncep_post.fd/WRFPOST.f +++ b/sorc/ncep_post.fd/WRFPOST.f @@ -220,14 +220,6 @@ PROGRAM WRFPOST ! !************************************************************************** !KaYee: Read itag in Fortran Namelist format -!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) @@ -243,25 +235,17 @@ PROGRAM WRFPOST if (me==0) print*,'DateStr= ',DateStr if (me==0) print*,'MODELNAME= ',MODELNAME if (me==0) print*,'SUBMODELNAME= ',SUBMODELNAME - FULLMODELNAME=MODELNAME//SUBMODELNAME -! MODELNAME=FULLMODELNAME(1:4) -! SUBMODELNAME=FULLMODELNAME(5:) - IF(len_trim(FULLMODELNAME)<5) THEN - SUBMODELNAME='NONE' - ENDIF ! if(MODELNAME == 'NMM')then ! read(5,1114) VTIMEUNITS ! 1114 format(a4) ! if (me==0) print*,'VALID TIME UNITS = ', VTIMEUNITS ! endif ! - 303 format('FULLMODELNAME="',A,'" MODELNAME="',A,'" & - SUBMODELNAME="',A,'"') + 303 format('MODELNAME="',A,'" SUBMODELNAME="',A,'"') - write(0,*)'FULLMODELNAME: ', FULLMODELNAME -! MODELNAME, SUBMODELNAME + write(0,*)'MODELNAME: ', MODELNAME, SUBMODELNAME - if (me==0) print 303,FULLMODELNAME,MODELNAME,SUBMODELNAME + if (me==0) print 303,MODELNAME,SUBMODELNAME ! assume for now that the first date in the stdin file is the start date read(DateStr,300) iyear,imn,iday,ihrst,imin if (me==0) write(*,*) 'in WRFPOST iyear,imn,iday,ihrst,imin', & From 9a20b25a866b9f86347c9fc2e39498aff2acae91 Mon Sep 17 00:00:00 2001 From: kayee Date: Tue, 26 Oct 2021 12:26:00 -0600 Subject: [PATCH 09/12] Further code refinement from Wen. --- sorc/ncep_post.fd/WRFPOST.f | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sorc/ncep_post.fd/WRFPOST.f b/sorc/ncep_post.fd/WRFPOST.f index 342c0fbef..865d9c997 100644 --- a/sorc/ncep_post.fd/WRFPOST.f +++ b/sorc/ncep_post.fd/WRFPOST.f @@ -220,6 +220,8 @@ PROGRAM WRFPOST ! !************************************************************************** !KaYee: Read itag in Fortran Namelist format +!Set default + SUBMODELNAME='NONE' !open namelist open(5,file='itag') read(5,nml=model_inputs,iostat=itag_ierr,err=888) @@ -270,7 +272,6 @@ PROGRAM WRFPOST if(MODELNAME == 'GFS' .OR. MODELNAME == 'FV3R') then if (me == 0) print*,'first two file names in GFS or FV3= ' & ,trim(fileName),trim(fileNameFlux) - if (me == 0) print*,'D3D names in GFS= ',trim(fileNameD3D) end if ! From a03767cbd590394595748c0b480fbd9389b01cce Mon Sep 17 00:00:00 2001 From: kayee Date: Wed, 27 Oct 2021 12:14:24 -0600 Subject: [PATCH 10/12] Rename control file variable name. --- scripts/run_upp | 2 +- sorc/ncep_post.fd/WRFPOST.f | 2 +- ush/gfs_nceppost.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/run_upp b/scripts/run_upp index 9515de84b..ee2c04e37 100755 --- a/scripts/run_upp +++ b/scripts/run_upp @@ -330,7 +330,7 @@ grib='${outFormat}' DateStr='${YY}-${MM}-${DD}_${HH}:00:00' MODELNAME='${tag}' fileNameFlux='${flxFileName}' -fileNameD3D='postxconfig-NT.txt' +fileNameFlat='postxconfig-NT.txt' / EOF fi diff --git a/sorc/ncep_post.fd/WRFPOST.f b/sorc/ncep_post.fd/WRFPOST.f index 865d9c997..2d7b226aa 100644 --- a/sorc/ncep_post.fd/WRFPOST.f +++ b/sorc/ncep_post.fd/WRFPOST.f @@ -178,7 +178,7 @@ PROGRAM WRFPOST ,hyb_sigp,rdaod,aqfcmaq_on,vtimeunits integer :: itag_ierr namelist/model_inputs/fileName,IOFORM,grib,DateStr,MODELNAME,SUBMODELNAME & - ,fileNameFlux,fileNameD3D + ,fileNameFlux,fileNameFlat character startdate*19,SysDepInfo*80,IOWRFNAME*3,post_fname*255 character cgar*1,cdum*4,line*10 diff --git a/ush/gfs_nceppost.sh b/ush/gfs_nceppost.sh index 206b627e5..df850b566 100755 --- a/ush/gfs_nceppost.sh +++ b/ush/gfs_nceppost.sh @@ -318,7 +318,7 @@ grib='${GRIBVERSION}' DateStr='${YY}-${MM}-${DD}_${HH}:00:00' MODELNAME='GFS' fileNameFlux='${FLXINP}' -fileNameD3D='${D3DINP}' +fileNameFlat='${D3DINP}' / EOF From c2c022f4672d9ec104e955e2c4959da726c498ab Mon Sep 17 00:00:00 2001 From: kayee Date: Wed, 27 Oct 2021 12:25:37 -0600 Subject: [PATCH 11/12] Removed fileNameFlat in gfs itag. --- ush/gfs_nceppost.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ush/gfs_nceppost.sh b/ush/gfs_nceppost.sh index df850b566..975bdc6a6 100755 --- a/ush/gfs_nceppost.sh +++ b/ush/gfs_nceppost.sh @@ -318,7 +318,6 @@ grib='${GRIBVERSION}' DateStr='${YY}-${MM}-${DD}_${HH}:00:00' MODELNAME='GFS' fileNameFlux='${FLXINP}' -fileNameFlat='${D3DINP}' / EOF From 9a4a1230b6ad5953f6e61e7bf420f958999dcddf Mon Sep 17 00:00:00 2001 From: kayee Date: Wed, 27 Oct 2021 12:35:04 -0600 Subject: [PATCH 12/12] Further code refinement from Wen. --- sorc/ncep_post.fd/WRFPOST.f | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sorc/ncep_post.fd/WRFPOST.f b/sorc/ncep_post.fd/WRFPOST.f index 2d7b226aa..26fface7d 100644 --- a/sorc/ncep_post.fd/WRFPOST.f +++ b/sorc/ncep_post.fd/WRFPOST.f @@ -302,6 +302,8 @@ PROGRAM WRFPOST ! gocart_on = .true. ! d3d_on = .true. +!set control file name + fileNameFlat='postxconfig-NT.txt' !KaYee if(MODELNAME == 'RAPR') then !KaYee read(5,*,iostat=iret,end=119) kpo !KaYee else @@ -368,8 +370,6 @@ PROGRAM WRFPOST end if 115 format(f7.1) 116 continue -!set control file name - fileNameFlat='postxconfig-NT.txt' !KaYee if(MODELNAME == 'GFS') then ! read(5,*) line !KaYee read(5,111,end=125) fileNameFlat