From a94369b5c204f751910e6b686f8ff85a3f9b9b4c Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Tue, 27 Sep 2022 09:44:56 +0000 Subject: [PATCH] Rename post scripts Rename post scripts to remove the unnecessary "ncep" qualifier. --- ...OBAL_ATMOS_NCEPPOST => JGLOBAL_ATMOS_POST} | 2 +- jobs/rocoto/post.sh | 2 +- parm/config/config.post | 8 +- ...atmos_nceppost.sh => exgdas_atmos_post.sh} | 2 +- ..._atmos_nceppost.sh => exgfs_atmos_post.sh} | 2 +- sorc/link_workflow.sh | 4 +- ush/{gfs_nceppost.sh => gfs_post.sh} | 16 +- ush/global_nceppost.sh | 484 ------------------ 8 files changed, 18 insertions(+), 502 deletions(-) rename jobs/{JGLOBAL_ATMOS_NCEPPOST => JGLOBAL_ATMOS_POST} (99%) rename scripts/{exgdas_atmos_nceppost.sh => exgdas_atmos_post.sh} (99%) rename scripts/{exgfs_atmos_nceppost.sh => exgfs_atmos_post.sh} (99%) rename ush/{gfs_nceppost.sh => gfs_post.sh} (96%) delete mode 100755 ush/global_nceppost.sh diff --git a/jobs/JGLOBAL_ATMOS_NCEPPOST b/jobs/JGLOBAL_ATMOS_POST similarity index 99% rename from jobs/JGLOBAL_ATMOS_NCEPPOST rename to jobs/JGLOBAL_ATMOS_POST index 4014ebf5e6c..52d184f732b 100755 --- a/jobs/JGLOBAL_ATMOS_NCEPPOST +++ b/jobs/JGLOBAL_ATMOS_POST @@ -117,7 +117,7 @@ export SLEEP_INT=5 ############################################################### # Run relevant exglobal script -$SCRgfs/ex${RUN}_atmos_nceppost.sh +$SCRgfs/ex${RUN}_atmos_post.sh status=$? [[ $status -ne 0 ]] && exit $status diff --git a/jobs/rocoto/post.sh b/jobs/rocoto/post.sh index b32e8c511d7..a6dfb0fbaf4 100755 --- a/jobs/rocoto/post.sh +++ b/jobs/rocoto/post.sh @@ -27,7 +27,7 @@ fi #--------------------------------------------------------------- for fhr in $fhrlst; do export post_times=$fhr - $HOMEgfs/jobs/JGLOBAL_ATMOS_NCEPPOST + $HOMEgfs/jobs/JGLOBAL_ATMOS_POST status=$? [[ $status -ne 0 ]] && exit $status done diff --git a/parm/config/config.post b/parm/config/config.post index a545f0fafcf..cdea64e2a31 100755 --- a/parm/config/config.post +++ b/parm/config/config.post @@ -19,13 +19,13 @@ if [ $OUTPUT_FILE = "netcdf" ]; then export MODEL_OUT_FORM=netcdfpara fi -# Post driver job that calls gfs_nceppost.sh and downstream jobs -export POSTJJOBSH="$HOMEpost/jobs/JGLOBAL_NCEPPOST" +# Post driver job that calls gfs_post.sh and downstream jobs +export POSTJJOBSH="$HOMEpost/jobs/JGLOBAL_POST" export GFSDOWNSH="$HOMEpost/ush/fv3gfs_downstream_nems.sh" export GFSDWNSH="$HOMEpost/ush/fv3gfs_dwn_nems.sh" -export POSTGPSH="$HOMEpost/ush/gfs_nceppost.sh" -export POSTGPEXEC="$HOMEpost/exec/gfs_ncep_post" +export POSTGPSH="$HOMEpost/ush/gfs_post.sh" +export POSTGPEXEC="$HOMEpost/exec/upp.x" export GOESF=NO # goes image export FLXF=YES # grib2 flux file written by post diff --git a/scripts/exgdas_atmos_nceppost.sh b/scripts/exgdas_atmos_post.sh similarity index 99% rename from scripts/exgdas_atmos_nceppost.sh rename to scripts/exgdas_atmos_post.sh index 005911db6ae..4de4ffaf717 100755 --- a/scripts/exgdas_atmos_nceppost.sh +++ b/scripts/exgdas_atmos_post.sh @@ -28,7 +28,7 @@ source "$HOMEgfs/ush/preamble.sh" cd $DATA -export POSTGPSH=${POSTGPSH:-$USHgfs/gfs_nceppost.sh} +export POSTGPSH=${POSTGPSH:-$USHgfs/gfs_post.sh} export GFSDOWNSH=${GFSDOWNSH:-$USHgfs/fv3gfs_downstream_nems.sh} export GFSDWNSH=${GFSDWNSH:-$USHgfs/fv3gfs_dwn_nems.sh} export TRIMRH=${TRIMRH:-$USHgfs/trim_rh.sh} diff --git a/scripts/exgfs_atmos_nceppost.sh b/scripts/exgfs_atmos_post.sh similarity index 99% rename from scripts/exgfs_atmos_nceppost.sh rename to scripts/exgfs_atmos_post.sh index ae94472aeba..92bb8b5463a 100755 --- a/scripts/exgfs_atmos_nceppost.sh +++ b/scripts/exgfs_atmos_post.sh @@ -41,7 +41,7 @@ source "$HOMEgfs/ush/preamble.sh" cd $DATA # specify model output format type: 4 for nemsio, 3 for sigio -export POSTGPSH=${POSTGPSH:-$USHgfs/gfs_nceppost.sh} +export POSTGPSH=${POSTGPSH:-$USHgfs/gfs_post.sh} export GFSDOWNSH=${GFSDOWNSH:-$USHgfs/fv3gfs_downstream_nems.sh} export GFSDOWNSHF=${GFSDOWNSHF:-$USHgfs/inter_flux.sh} export GFSDWNSH=${GFSDWNSH:-$USHgfs/fv3gfs_dwn_nems.sh} diff --git a/sorc/link_workflow.sh b/sorc/link_workflow.sh index ff770122284..1a94fa48c2b 100755 --- a/sorc/link_workflow.sh +++ b/sorc/link_workflow.sh @@ -215,8 +215,8 @@ done [[ -s ufs_model.x ]] && rm -f ufs_model.x $LINK ../sorc/ufs_model.fd/tests/ufs_model.x . -[[ -s gfs_ncep_post ]] && rm -f gfs_ncep_post -$LINK ../sorc/upp.fd/exec/upp.x gfs_ncep_post +[[ -s upp.x ]] && rm -f upp.x +$LINK ../sorc/upp.fd/exec/upp.x . if [ -d ${pwd}/gfs_wafs.fd ]; then for wafsexe in \ diff --git a/ush/gfs_nceppost.sh b/ush/gfs_post.sh similarity index 96% rename from ush/gfs_nceppost.sh rename to ush/gfs_post.sh index a8bee62d4d7..c38edfe4ec2 100755 --- a/ush/gfs_nceppost.sh +++ b/ush/gfs_post.sh @@ -3,7 +3,7 @@ ################################################################################ #### UNIX Script Documentation Block # . . -# Script name: gfs_nceppost.sh +# Script name: gfs_post.sh # Script description: Posts the global pressure GRIB file # # Author: Mark Iredell Org: NP23 Date: 1999-05-01 @@ -19,8 +19,8 @@ # 2012-06-04 Jun Wang: add grib2 option # 2015-03-20 Lin Gan: add Perl for Post XML performance upgrade # 2016-02-08 Lin Gan: Modify to use Vertical Structure -# 2018-02-05 Wen Meng: For EE2 standard, create gfs_nceppost.sh based -# global_nceppost.sh and change EXECglobal to EXECgfs; +# 2018-02-05 Wen Meng: For EE2 standard, create gfs_post.sh based +# global_post.sh and change EXECglobal to EXECgfs; # Remove legacy setting for reading non-nemsio model output # and generating grib1 data # 2019-06-02 Wen Meng: Remove the links of gfs fix files. @@ -63,7 +63,7 @@ # default to to ${USHglobal}/global_chgres.sh # SIGLEVEL optional: the coordinate text file # default to to /nwprod/fix/global_hyblev.l${LEVS}.txt -##### Chuang: Add new imported Shell Variable for ncep post +##### Chuang: Add new imported Shell Variable for post # OUTTYP Output file type read in by post # 1: if user has a sigma file and needs post to run chgres to convert to gfs io file # 2: if user already has a gfs io file @@ -71,7 +71,7 @@ # 0: if user wishes to generate both gfsio and sigma files # 4: if user uses post to read nemsio file directly # VDATE Verifying date 10 digits yyyymmddhh -# GFSOUT Optional, output file name from chgres which is input file name to nceppost +# GFSOUT Optional, output file name from chgres which is input file name to post # if model already runs gfs io, make sure GFSOUT is linked to the gfsio file # CTLFILE Optional, Your version of control file if not using operational one # OVERPARMEXEC Optional, the executable for changing Grib KPDS ID @@ -106,7 +106,7 @@ # XC Suffix to add to executables # defaults to none # POSTGPEXEC Global post executable -# defaults to ${EXECglobal}/ncep_post +# defaults to ${EXECglobal}/upp.x # GRBINDEX GRIB index maker # defaults to ${EXECUTIL}/grbindex$XC # POSTGPLIST File containing further namelist inputs @@ -210,7 +210,7 @@ export DATA=${DATA:-$(pwd)} # Filenames. export MP=${MP:-$([[ ${LOADL_STEP_TYPE:-SERIAL} = PARALLEL ]]&&echo "p"||echo "s")} export XC=${XC:-} -export POSTGPEXEC=${POSTGPEXEC:-${EXECgfs}/gfs_ncep_post} +export POSTGPEXEC=${POSTGPEXEC:-${EXECgfs}/upp.x} export OVERPARMEXEC=${OVERPARMEXEC:-${EXECgfs}/overparm_grib} export POSTGPLIST=${POSTGPLIST:-/dev/null} export INISCRIPT=${INISCRIPT:-} @@ -340,7 +340,7 @@ export CTL=$(basename $CTLFILE) ln -sf griddef.out fort.110 cp ${PARMpost}/nam_micro_lookup.dat ./eta_micro_lookup.dat -echo "gfs_nceppost.sh OMP_NUM_THREADS= $OMP_NUM_THREADS" +echo "gfs_post.sh OMP_NUM_THREADS= $OMP_NUM_THREADS" ${APRUN:-mpirun.lsf} $POSTGPEXEC < itag > outpost_gfs_${VDATE}_${CTL} export ERR=$? diff --git a/ush/global_nceppost.sh b/ush/global_nceppost.sh deleted file mode 100755 index 45aebe8e4f0..00000000000 --- a/ush/global_nceppost.sh +++ /dev/null @@ -1,484 +0,0 @@ -#! /usr/bin/env bash - -################################################################################ -#### UNIX Script Documentation Block -# . . -# Script name: global_nceppost.sh -# Script description: Posts the global pressure GRIB file -# -# Author: Mark Iredell Org: NP23 Date: 1999-05-01 -# -# Abstract: This script reads a single global GFS IO file and (optionally) -# a global flux file and creates a global pressure GRIB file. -# The resolution and generating code of the output GRIB file can also -# be set in the argument list. -# -# Script history log: -# 1999-05-01 Mark Iredell -# 2007-04-04 Huiya Chuang: Modify the script to run unified post -# 2012-06-04 Jun Wang: add grib2 option -# 2015-03-20 Lin Gan: add Perl for Post XML performance upgrade -# 2016-02-08 Lin Gan: Modify to use Vertical Structure -# -# Usage: global_postgp.sh SIGINP FLXINP FLXIOUT PGBOUT PGIOUT IGEN -# -# Input script positional parameters: -# 1 Input sigma file -# defaults to $SIGINP -# 2 Input flux file -# defaults to $FLXINP -# 3 Output flux index file -# defaults to $FLXIOUT -# 4 Output pressure GRIB file -# defaults to $PGBOUT -# 5 Output pressure GRIB index file -# defaults to $PGIOUT, then to none -# 8 Model generating code, -# defaults to $IGEN, then to input sigma generating code -# -# Imported Shell Variables: -# SIGINP Input sigma file -# overridden by $1 -# FLXINP Input flux file -# overridden by $2 -# FLXIOUT Output flux index file -# overridden by $3 -# PGBOUT Output pressure GRIB file -# overridden by $4. If not defined, -# post will use the filename specified in -# the control file -# PGIOUT Output pressure GRIB index file -# overridden by $5; defaults to none -# IGEN Model generating code -# overridden by $8; defaults to input sigma generating code -##### Moorthi: Add new imported shell variable for running chgres -# CHGRESSH optional: the script to run chgres -# default to to ${USHglobal}/global_chgres.sh -# SIGLEVEL optional: the coordinate text file -# default to to /nwprod/fix/global_hyblev.l${LEVS}.txt -##### Chuang: Add new imported Shell Variable for ncep post -# OUTTYP Output file type read in by post -# 1: if user has a sigma file and needs post to run chgres to convert to gfs io file -# 2: if user already has a gfs io file -# 3: if user uses post to read sigma file directly -# 0: if user wishes to generate both gfsio and sigma files -# 4: if user uses post to read nemsio file directly -# VDATE Verifying date 10 digits yyyymmddhh -# GFSOUT Optional, output file name from chgres which is input file name to nceppost -# if model already runs gfs io, make sure GFSOUT is linked to the gfsio file -# CTLFILE Optional, Your version of control file if not using operational one -# OVERPARMEXEC Optional, the executable for changing Grib KPDS ID -# default to to ${EXECglobal}/overparm_grib -# CHGRESTHREAD Optional, speed up chgres by using multiple threads -# default to 1 -# FILTER Optional, set to 1 to filter SLP and 500 mb height using copygb -# D3DINP Optional, Inout D3D file, if not defined, post will run -# without processing D3D file -# D3DOUT Optional, output D3D file, if not defined, post will -# use the file name specified in the control file -# IPVOUT Optional, output IPV file, if not defined, post will -# use the file name specified in the control file -# GENPSICHI Optional, set to YES will generate psi and chi and -# append it to the end of PGBOUT. Default to NO -# GENPSICHIEXE Optional, specify where executable is for generating -# psi and chi. -######################################################################## -# EXECUTIL Directory for utility executables -# defaults to /nwprod/util/exec -# USHUTIL Directory for utility scripts -# defaults to /nwprod/util/ush -# EXECglobal Directory for global executables -# defaults to /nwprod/exec -# USHglobal Directory for global scripts -# defaults to /nwprod/ush -# DATA working directory -# (if nonexistent will be made, used and deleted) -# defaults to current working directory -# MP Multi-processing type ("p" or "s") -# defaults to "p", or "s" if LOADL_STEP_TYPE is not PARALLEL -# XC Suffix to add to executables -# defaults to none -# POSTGPEXEC Global post executable -# defaults to ${EXECglobal}/ncep_post -# GRBINDEX GRIB index maker -# defaults to ${EXECUTIL}/grbindex$XC -# ANOMCATSH Global anomaly GRIB script -# defaults to ${USHglobal/global_anomcat.sh -# POSTGPLIST File containing further namelist inputs -# defaults to /dev/null -# INISCRIPT Preprocessing script -# defaults to none -# LOGSCRIPT Log posting script -# defaults to none -# ERRSCRIPT Error processing script -# defaults to 'eval [[ $err = 0 ]]' -# ENDSCRIPT Postprocessing script -# defaults to none -# POSTGPVARS Other namelist inputs to the global post executable -# such as IDRT,KO,PO,KTT,KT,PT,KZZ,ZZ, -# NCPUS,MXBIT,IDS,POB,POT,MOO,MOOA,MOW,MOWA, -# ICEN,ICEN2,IENST,IENSI -# defaults to none set -# NTHREADS Number of threads -# defaults to 1 -# NTHSTACK Size of stack per thread -# defaults to 64000000 -# VERBOSE Verbose flag (YES or NO) -# defaults to NO -# PGMOUT Executable standard output -# defaults to $pgmout, then to '&1' -# PGMERR Executable standard error -# defaults to $pgmerr, then to '&1' -# pgmout Executable standard output default -# pgmerr Executable standard error default -# REDOUT standard output redirect ('1>' or '1>>') -# defaults to '1>', or to '1>>' to append if $PGMOUT is a file -# REDERR standard error redirect ('2>' or '2>>') -# defaults to '2>', or to '2>>' to append if $PGMERR is a file -# -# Exported Shell Variables: -# PGM Current program name -# pgm -# ERR Last return code -# err -# -# Modules and files referenced: -# scripts : $INISCRIPT -# $LOGSCRIPT -# $ERRSCRIPT -# $ENDSCRIPT -# $ANOMCATSH -# -# programs : $POSTGPEXEC -# $GRBINDEX -# -# input data : $1 or $SIGINP -# $2 or $SFCINP -# $POSTGPLIST -# -# output data: $3 or $FLXIOUT -# $4 or $PGBOUT -# $5 or $PGIOUT -# $PGMOUT -# $PGMERR -# -# scratch : ${DATA}/postgp.inp.sig -# ${DATA}/postgp.inp.flx -# ${DATA}/postgp.out.pgb -# -# Remarks: -# -# Condition codes -# 0 - no problem encountered -# >0 - some problem encountered -# -# Control variable resolution priority -# 1 Command line argument. -# 2 Environment variable. -# 3 Inline default. -# -# Attributes: -# Language: POSIX shell -# Machine: IBM SP -# -#### -################################################################################ -# Set environment. -source "$HOMEgfs/ush/preamble.sh" - -# Command line arguments. -export SIGINP=${1:-${SIGINP}} -export FLXINP=${2:-${FLXINP}} -export FLXIOUT=${3:-${FLXIOUT}} -export PGBOUT=${4:-${PGBOUT}} -#export PGIOUT=${5:-${PGIOUT}} -export PGIOUT=${PGIOUT:-pgb.idx} -export IO=${6:-${IO:-0}} -export JO=${7:-${JO:-0}} -export IGEN=${8:-${IGEN:-0}} -# Directories. -export NWPROD=${NWPROD:-/nwprod} -#export EXECUTIL=${EXECUTIL:-$NWPROD/util/exec} -export USHUTIL=${USHUTIL:-$NWPROD/util/ush} -export EXECglobal=${EXECglobal:-$NWPROD/exec} -export USHglobal=${USHglobal:-$NWPROD/ush} -export DATA=${DATA:-$(pwd)} -# Filenames. -export MP=${MP:-$([[ $LOADL_STEP_TYPE = PARALLEL ]]&&echo "p"||echo "s")} -export XC=${XC} -export POSTGPEXEC=${POSTGPEXEC:-${EXECglobal}/ncep_post} -export OVERPARMEXEC=${OVERPARMEXEC:-${EXECglobal}/overparm_grib} -export ANOMCATSH=${ANOMCATSH:-${USHglobal}/global_anomcat.sh} -export CHGRESSH=${CHGRESSH:-${USHglobal}/global_chgres.sh} -export POSTGPLIST=${POSTGPLIST:-/dev/null} -export INISCRIPT=${INISCRIPT} -export ERRSCRIPT=${ERRSCRIPT:-'eval [[ $err = 0 ]]'} -export LOGSCRIPT=${LOGSCRIPT} -export ENDSCRIPT=${ENDSCRIPT} -export GFSOUT=${GFSOUT:-gfsout} -export CTLFILE=${CTLFILE:-$NWPROD/parm/gfs_cntrl.parm} -export MODEL_OUT_FORM=${MODEL_OUT_FORM:-binarynemsiompiio} -export GRIBVERSION=${GRIBVERSION:-'grib1'} -# Other variables. -export POSTGPVARS=${POSTGPVARS} -export NTHREADS=${NTHREADS:-1} -export NTHSTACK=${NTHSTACK:-64000000} -export PGMOUT=${PGMOUT:-${pgmout:-'&1'}} -export PGMERR=${PGMERR:-${pgmerr:-'&2'}} -export CHGRESTHREAD=${CHGRESTHREAD:-1} -export FILTER=${FILTER:-1} -export GENPSICHI=${GENPSICHI:-NO} -export GENPSICHIEXE=${GENPSICHIEXE:-${EXECglobal}/genpsiandchi} -export ens=${ens:-NO} -#export D3DINP=${D3DINP:-/dev/null} -l=$(echo $PGMOUT | xargs | cut -c1) -[[ $l = '&' ]]&&a=''||a='>' -export REDOUT=${REDOUT:-'1>'$a} -l=$(echo $PGMERR | xargs | cut -c1) -[[ $l = '&' ]]&&a=''||a='>' -export REDERR=${REDERR:-'2>'$a} -################################################################################ - -# Chuang: Run chgres if OUTTYP=1 or 0 - -export APRUN=${APRUNP:-${APRUN:-""}} - -# exit if SIGINP does not exist -if [ ${OUTTYP} -le 3 ] ; then - if [ ! -s $SIGINP ] ; then - echo "sigma file not found, exitting" - exit 111 - fi -fi - -export SIGHDR=${SIGHDR:-$NWPROD/exec/global_sighdr} -export IDRT=${IDRT:-4} - -if [ ${OUTTYP} -le 1 ] ; then - export JCAP=${JCAP:-$(echo jcap|$SIGHDR ${SIGINP})} - export LEVS=${LEVS:-$(echo levs|$SIGHDR ${SIGINP})} - export IDVC=${IDVC:-$(echo idvc|$SIGHDR ${SIGINP})} - export IDVM=${IDVM:-$(echo idvm|$SIGHDR ${SIGINP})} - export NVCOORD=${NVCOORD:-$(echo nvcoord|$SIGHDR ${SIGINP})} - export IVSSIG=${IVSSIG:-$(echo ivs|$SIGHDR ${SIGINP})} - export LATCH=${LATCH:-8} - if [ ${OUTTYP} -eq 1 ] ; then - export CHGRESVARS="IDVC=$IDVC,IDVM=$IDVM,NVCOORD=$NVCOORD,IVSSIG=$IVSSIG,LATCH=$LATCH," - elif [ ${OUTTYP} -eq 0 ] ; then - export CHGRESVARS="LATCH=$LATCH,$CHGRESVARS" - fi - #export SIGLEVEL=${SIGLEVEL:-""} - export SIGLEVEL=${SIGLEVEL:-"$NWPROD/fix/global_hyblev.l${LEVS}.txt"} - # specify threads for running chgres - export OMP_NUM_THREADS=$CHGRESTHREAD - export NTHREADS=$OMP_NUM_THREADS - if [ ${JCAP} -eq 574 -a ${IDRT} -eq 4 ]; then - export NTHSTACK=1024000000 - fi - export XLSMPOPTS="parthds=$NTHREADS:stack=$NTHSTACK" - - $CHGRESSH - - export ERR=$? - export err=$ERR - $ERRSCRIPT||exit 1 - -# run post to read sigma file directly if OUTTYP=3 -elif [ ${OUTTYP} -eq 3 ] ; then - export LONB=${LONB:-$(echo lonb|$SIGHDR ${SIGINP})} - export LATB=${LATB:-$(echo latb|$SIGHDR ${SIGINP})} - export MODEL_OUT_FORM=sigio - export GFSOUT=${SIGINP} - -# run post to read nemsio file if OUTTYP=4 -elif [ ${OUTTYP} -eq 4 ] ; then - export nemsioget=${nemsioget:-$EXECglobal/nemsio_get} - export LONB=${LONB:-$($nemsioget $NEMSINP dimx | awk '{print $2}')} - export LATB=${LATB:-$($nemsioget $NEMSINP dimy | awk '{print $2}')} - export JCAP=${JCAP:-$(expr $LATB - 2)} - # export LONB=${LONB:-$($nemsioget $NEMSINP lonf |grep -i "lonf" |awk -F"= " '{print $2}' |awk -F" " '{print $1}')} - # export LATB=${LATB:-$($nemsioget $NEMSINP latg |grep -i "latg" |awk -F"= " '{print $2}' |awk -F" " '{print $1}')} - # export JCAP=${JCAP:-$($nemsioget $NEMSINP jcap |grep -i "jcap" |awk -F"= " '{print $2}' |awk -F" " '{print $1}')} - - export MODEL_OUT_FORM=${MODEL_OUT_FORM:-binarynemsiompiio} - export GFSOUT=${NEMSINP} - ln -sf $FIXglobal/fix_am/global_lonsperlat.t${JCAP}.${LONB}.${LATB}.txt ./lonsperlat.dat - ln -sf $FIXglobal/fix_am/global_hyblev.l${LEVS}.txt ./global_hyblev.txt -fi - -# allow threads to use threading in Jim's sp lib -# but set default to 1 -export OMP_NUM_THREADS=${OMP_NUM_THREADS:-1} - -pwd=$(pwd) -if [[ -d $DATA ]]; then - mkdata=NO -else - mkdir -p $DATA - mkdata=YES -fi -cd $DATA||exit 99 -################################################################################ -# Post GRIB -export PGM=$POSTGPEXEC -export pgm=$PGM -$LOGSCRIPT -cat <<-EOF >postgp.inp.nml$$ - &NAMPGB - $POSTGPVARS -EOF - -cat <<-EOF >>postgp.inp.nml$$ - / -EOF - -if [[ "$VERBOSE" = "YES" ]]; then - cat postgp.inp.nml$$ -fi - -# making the time stamp format for ncep post -export YY=$(echo $VDATE | cut -c1-4) -export MM=$(echo $VDATE | cut -c5-6) -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 -EOF - -cat postgp.inp.nml$$ >> itag - -cat itag - -rm -f fort.* - -#ln -sf $SIGINP postgp.inp.sig$$ -#ln -sf $FLXINP postgp.inp.flx$$ -#ln -sf $PGBOUT postgp.out.pgb$$ - -# change model generating Grib number -if [ ${GRIBVERSION} = grib1 ]; then - if [ ${IGEN} -le 9 ] ; then - cat ${CTLFILE}|sed s:00082:0000${IGEN}:>./gfs_cntrl.parm - elif [ ${IGEN} -le 99 ] ; then - cat ${CTLFILE}|sed s:00082:000${IGEN}:>./gfs_cntrl.parm - elif [ ${IGEN} -le 999 ] ; then - cat ${CTLFILE}|sed s:00082:00${IGEN}:>./gfs_cntrl.parm - else - ln -sf ${CTLFILE} ./gfs_cntrl.parm - fi - ln -sf ./gfs_cntrl.parm fort.14 -elif [ ${GRIBVERSION} = grib2 ]; then - cp ${POSTGRB2TBL} . - cp ${PostFlatFile} ./postxconfig-NT.txt - if [ ${ens} = "YES" ] ; then - sed < ${PostFlatFile} -e "s#negatively_pert_fcst#${ens_pert_type}#" > ./postxconfig-NT.txt - fi - # cp ${CTLFILE} postcntrl.xml -fi -export CTL=$(basename $CTLFILE) - -ln -sf griddef.out fort.110 -cp ${PARMglobal}/nam_micro_lookup.dat ./eta_micro_lookup.dat - -${APRUN:-mpirun.lsf} $POSTGPEXEC < itag > outpost_gfs_${VDATE}_${CTL} - -export ERR=$? -export err=$ERR -$ERRSCRIPT||exit 2 - -if [ $FILTER = "1" ] ; then - # Filter SLP and 500 mb height using copygb, change GRIB ID, and then - # cat the filtered fields to the pressure GRIB file, from Iredell - - if [ $GRIBVERSION = grib1 ]; then - $COPYGB -x -i'4,0,80' -k'4*-1,1,102' $PGBOUT tfile - ln -s -f tfile fort.11 - ln -s -f prmsl fort.51 - echo 0 2|$OVERPARMEXEC - $COPYGB -x -i'4,1,5' -k'4*-1,7,100,500' $PGBOUT tfile - ln -s -f tfile fort.11 - ln -s -f h5wav fort.51 - echo 0 222|$OVERPARMEXEC - - #cat $PGBOUT prmsl h5wav >> $PGBOUT - cat prmsl h5wav >> $PGBOUT - elif [ $GRIBVERSION = grib2 ]; then - if [ ${ens} = YES ] ; then - $COPYGB2 -x -i'4,0,80' -k'1 3 0 7*-9999 101 0 0' $PGBOUT tfile - else - $COPYGB2 -x -i'4,0,80' -k'0 3 0 7*-9999 101 0 0' $PGBOUT tfile - fi - $WGRIB2 tfile -set_byte 4 11 1 -grib prmsl - if [ ${ens} = YES ] ; then - $COPYGB2 -x -i'4,1,5' -k'1 3 5 7*-9999 100 0 50000' $PGBOUT tfile - else - $COPYGB2 -x -i'4,1,5' -k'0 3 5 7*-9999 100 0 50000' $PGBOUT tfile - fi - $WGRIB2 tfile -set_byte 4 11 193 -grib h5wav - - #cat $PGBOUT prmsl h5wav >> $PGBOUT - - cat prmsl h5wav >> $PGBOUT - fi -fi - -################################################################################ -# Anomaly concatenation -# for now just do anomaly concentration for grib1 -if [ $GRIBVERSION = grib1 ]; then - if [[ -x $ANOMCATSH ]]; then - if [[ -n $PGIOUT ]]; then - $GRBINDEX $PGBOUT $PGIOUT - fi - export PGM=$ANOMCATSH - export pgm=$PGM - $LOGSCRIPT - - eval $ANOMCATSH $PGBOUT $PGIOUT - - export ERR=$? - export err=$ERR - $ERRSCRIPT||exit 3 - fi -fi -################################################################################ -# Make GRIB index file -if [[ -n $PGIOUT ]]; then - if [ $GRIBVERSION = grib2 ]; then - # JY $GRBINDEX2 $PGBOUT $PGIOUT - $GRB2INDEX $PGBOUT $PGIOUT - else - $GRBINDEX $PGBOUT $PGIOUT - fi -fi -if [[ -r $FLXINP && -n $FLXIOUT && $OUTTYP -le 3 ]]; then - $GRBINDEX $FLXINP $FLXIOUT -fi -################################################################################ -# generate psi and chi -echo "GENPSICHI= " $GENPSICHI -if [ $GENPSICHI = YES ] ; then - #echo "PGBOUT PGIOUT=" $PGBOUT $PGIOUT - #echo "YY MM=" $YY $MM - export psichifile=./psichi.grb - $GENPSICHIEXE < postgp.inp.nml$$ - rc=$? - if [[ $rc -ne 0 ]] ; then - echo 'Nonzero return code rc= '$rc - exit 3 - fi - cat ./psichi.grb >> $PGBOUT -fi -################################################################################ -# Postprocessing -cd $pwd -[[ $mkdata = YES ]]&&rmdir $DATA - -exit $err