Skip to content

Commit

Permalink
Remove nemsio support (#1255)
Browse files Browse the repository at this point in the history
Removes remaining nemsio support from scripts. Now-unnecessary variables will be removed in a follow-up PR.

Refs: #601
  • Loading branch information
lgannoaa committed Jan 19, 2023
1 parent 62944fb commit 78509d6
Show file tree
Hide file tree
Showing 19 changed files with 43 additions and 150 deletions.
9 changes: 2 additions & 7 deletions jobs/JGLOBAL_ATMOS_ANALYSIS
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,8 @@ fi


# Get LEVS
if [ ${GSUFFIX} = ".nc" ]; then
export LEVS=$(${NCLEN} ${ATMGES} pfull)
status=$?
else
export LEVS=$(${NEMSIOGET} ${ATMGES} dimz | awk '{print $2}')
status=$?
fi
export LEVS=$(${NCLEN} ${ATMGES} pfull)
status=$?
[[ ${status} -ne 0 ]] && exit ${status}


Expand Down
9 changes: 2 additions & 7 deletions jobs/JGLOBAL_ATMOS_ANALYSIS_CALC
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,8 @@ fi


# Get LEVS
if [ ${GSUFFIX} = ".nc" ]; then
export LEVS=$(${NCLEN} ${ATMGES} pfull)
status=$?
else
export LEVS=$(${NEMSIOGET} ${ATMGES} dimz | awk '{print $2}')
status=$?
fi
export LEVS=$(${NCLEN} ${ATMGES} pfull)
status=$?
[[ ${status} -ne 0 ]] && exit ${status}


Expand Down
5 changes: 0 additions & 5 deletions parm/config/config.anal
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ fi
export lobsdiag_forenkf=".false." # anal does not need to write out jacobians
# set to .true. in config.eobs and config.eupd

if [ $OUTPUT_FILE = "nemsio" ]; then
export DO_CALC_INCREMENT="YES"
export DO_CALC_ANALYSIS="NO"
fi

# Do not process the following datasets
export GSNDBF=${GSNDBF:-/dev/null}
export AMSREBF=${AMSREBF:-/dev/null}
Expand Down
22 changes: 5 additions & 17 deletions parm/config/config.base.emc.dyn
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ export VERBOSE="YES"
export KEEPDATA="NO"
export CHGRP_RSTPROD="@CHGRP_RSTPROD@"
export CHGRP_CMD="@CHGRP_CMD@"
export NEMSIOGET="$HOMEgfs/exec/nemsio_get"
export NCDUMP="$NETCDF/bin/ncdump"
export NCLEN="$HOMEgfs/ush/getncdimlen"

Expand Down Expand Up @@ -271,8 +270,8 @@ export ILPOST=1 # gempak output frequency up to F120
export restart_interval_gfs=0

# I/O QUILTING, true--use Write Component; false--use GFDL FMS
# if quilting=true, choose OUTPUT_GRID as cubed_sphere_grid in netcdf or gaussian_grid
# if gaussian_grid, set OUTPUT_FILE for nemsio or netcdf
# if quilting=true, choose OUTPUT_GRID as cubed_sphere_grid in netcdf
# if gaussian_grid, set OUTPUT_FILE for netcdf
# WRITE_DOPOST=true, use inline POST
export QUILTING=".true."
export OUTPUT_GRID="gaussian_grid"
Expand All @@ -281,15 +280,9 @@ export WRITE_DOPOST=".true."
export WRITE_NSFLIP=".true."

# suffix options depending on file format
if [ $OUTPUT_FILE = "netcdf" ]; then
export SUFFIX=".nc"
export NEMSIO_IN=".false."
export NETCDF_IN=".true."
else
export SUFFIX=".nemsio"
export NEMSIO_IN=".true."
export NETCDF_IN=".false."
fi
export SUFFIX=".nc"
export NEMSIO_IN=".false."
export NETCDF_IN=".true."

# IAU related parameters
export DOIAU="YES" # Enable 4DIAU for control with 3 increments
Expand Down Expand Up @@ -378,11 +371,6 @@ export MAKE_ACFTBUFR="@MAKE_ACFTBUFR@"
# Analysis increments to zero in CALCINCEXEC
export INCREMENTS_TO_ZERO="'liq_wat_inc','icmr_inc'"

if [ $OUTPUT_FILE = "nemsio" ]; then
export DO_CALC_INCREMENT="YES"
export DO_CALC_ANALYSIS="NO"
fi

# Stratospheric increments to zero
export INCVARS_ZERO_STRAT="'sphum_inc','liq_wat_inc','icmr_inc'"
export INCVARS_EFOLD="5"
Expand Down
8 changes: 1 addition & 7 deletions parm/config/config.post
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,10 @@ echo "BEGIN: config.post"
# Get task specific resources
. $EXPDIR/config.resources post

# Convert nemsio files to grib files using post job
#-------------------------------------------

# No. of concurrent post jobs [0 implies sequential]
export NPOSTGRP=42
export OUTTYP=4
export MODEL_OUT_FORM=binarynemsiompiio
if [ $OUTPUT_FILE = "netcdf" ]; then
export MODEL_OUT_FORM=netcdfpara
fi
export MODEL_OUT_FORM=netcdfpara

# Post driver job that calls gfs_post.sh and downstream jobs
export POSTJJOBSH="$HOMEpost/jobs/JGLOBAL_POST"
Expand Down
4 changes: 0 additions & 4 deletions parm/config/config.resources
Original file line number Diff line number Diff line change
Expand Up @@ -764,10 +764,6 @@ elif [ ${step} = "postsnd" ]; then
export npe_node_postsnd=10
export npe_postsndcfp=9
export npe_node_postsndcfp=1
if [ ${OUTPUT_FILE} == "nemsio" ]; then
export npe_postsnd=13
export npe_node_postsnd=4
fi
if [[ "$(echo "${npe_node_postsnd} * ${nth_postsnd}" | bc)" -gt "${npe_node_max}" ]]; then
export npe_node_postsnd=$(echo "${npe_node_max} / ${nth_postsnd}" | bc)
fi
Expand Down
10 changes: 3 additions & 7 deletions scripts/exgdas_atmos_post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,11 @@ export JO=${LATB:-721}
# specify default model output format: 3 for sigio and 4
# for nemsio
export OUTTYP=${OUTTYP:-4}
export OUTPUT_FILE=${OUTPUT_FILE:-"nemsio"}
export OUTPUT_FILE=${OUTPUT_FILE:-"netcdf"}
export TCYC=${TCYC:-".t${cyc}z."}
export PREFIX=${PREFIX:-${RUN}${TCYC}}
if (( OUTTYP == 4 )) ; then
if [[ "${OUTPUT_FILE}" = "netcdf" ]]; then
export SUFFIX=".nc"
else
export SUFFIX=".nemsio"
fi
export SUFFIX=".nc"
else
export SUFFIX=
fi
Expand Down Expand Up @@ -202,7 +198,7 @@ else ## not_anl if_stimes
# period and error exit
###############################
if (( ic == SLEEP_LOOP_MAX )); then
echo " *** FATAL ERROR: No model output in nemsio for f${fhr} "
echo " *** FATAL ERROR: No model output for f${fhr} "
export err=9
err_chk
fi
Expand Down
1 change: 0 additions & 1 deletion scripts/exgdas_enkf_sfc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ ntiles=${ntiles:-6}
# Utilities
NCP=${NCP:-"/bin/cp -p"}
NLN=${NLN:-"/bin/ln -sf"}
NEMSIOGET=${NEMSIOGET:-${NWPROD}/exec/nemsio_get}
NCLEN=${NCLEN:-$HOMEgfs/ush/getncdimlen}

# Scripts
Expand Down
32 changes: 10 additions & 22 deletions scripts/exgdas_enkf_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pwd=$(pwd)
# Utilities
NCP=${NCP:-"/bin/cp -p"}
NLN=${NLN:-"/bin/ln -sf"}
NEMSIOGET=${NEMSIOGET:-$NWPROD/utils/exec/nemsio_get}
NCLEN=${NCLEN:-$HOMEgfs/ush/getncdimlen}
USE_CFP=${USE_CFP:-"NO"}
CFP_MP=${CFP_MP:-"NO"}
Expand Down Expand Up @@ -89,30 +88,20 @@ INCREMENTS_TO_ZERO=${INCREMENTS_TO_ZERO:-"'NONE'"}

################################################################################
ATMGES_ENSMEAN=$COMIN_GES_ENS/${GPREFIX}atmf006.ensmean${GSUFFIX}
if [ $SUFFIX = ".nc" ]; then
LONB_ENKF=${LONB_ENKF:-$($NCLEN $ATMGES_ENSMEAN grid_xt)} # get LONB_ENKF
LATB_ENKF=${LATB_ENKF:-$($NCLEN $ATMGES_ENSMEAN grid_yt)} # get LATB_ENFK
LEVS_ENKF=${LEVS_ENKF:-$($NCLEN $ATMGES_ENSMEAN pfull)} # get LEVS_ENFK
use_gfs_ncio=".true."
use_gfs_nemsio=".false."
paranc=${paranc:-".true."}
if [ $DO_CALC_INCREMENT = "YES" ]; then
write_fv3_incr=".false."
else
write_fv3_incr=".true."
WRITE_INCR_ZERO="incvars_to_zero= $INCREMENTS_TO_ZERO,"
fi
LONB_ENKF=${LONB_ENKF:-$($NCLEN $ATMGES_ENSMEAN grid_xt)} # get LONB_ENKF
LATB_ENKF=${LATB_ENKF:-$($NCLEN $ATMGES_ENSMEAN grid_yt)} # get LATB_ENFK
LEVS_ENKF=${LEVS_ENKF:-$($NCLEN $ATMGES_ENSMEAN pfull)} # get LEVS_ENFK
use_gfs_ncio=".true."
use_gfs_nemsio=".false."
paranc=${paranc:-".true."}
if [ $DO_CALC_INCREMENT = "YES" ]; then
write_fv3_incr=".false."
else
LEVS_ENKF=${LEVS_ENKF:-$($NEMSIOGET $ATMGES_ENSMEAN dimz | awk '{print $2}')}
LATB_ENKF=${LATB_ENKF:-$($NEMSIOGET $ATMGES_ENSMEAN dimy | awk '{print $2}')}
LONB_ENKF=${LONB_ENKF:-$($NEMSIOGET $ATMGES_ENSMEAN dimx | awk '{print $2}')}
use_gfs_ncio=".false."
use_gfs_nemsio=".true."
paranc=${paranc:-".false."}
write_fv3_incr=".true."
WRITE_INCR_ZERO="incvars_to_zero= $INCREMENTS_TO_ZERO,"
fi
LATA_ENKF=${LATA_ENKF:-$LATB_ENKF}
LONA_ENKF=${LONA_ENKF:-$LONB_ENKF}

SATANGL=${SATANGL:-${FIXgsi}/global_satangbias.txt}
SATINFO=${SATINFO:-${FIXgsi}/global_satinfo.txt}
CONVINFO=${CONVINFO:-${FIXgsi}/global_convinfo.txt}
Expand All @@ -121,7 +110,6 @@ SCANINFO=${SCANINFO:-${FIXgsi}/global_scaninfo.txt}
HYBENSINFO=${HYBENSINFO:-${FIXgsi}/global_hybens_info.l${LEVS_ENKF}.txt}
ANAVINFO=${ANAVINFO:-${FIXgsi}/global_anavinfo.l${LEVS_ENKF}.txt}
VLOCALEIG=${VLOCALEIG:-${FIXgsi}/vlocal_eig_l${LEVS_ENKF}.dat}

ENKF_SUFFIX="s"
[[ $SMOOTH_ENKF = "NO" ]] && ENKF_SUFFIX=""

Expand Down
11 changes: 3 additions & 8 deletions scripts/exgfs_atmos_post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ source "${HOMEgfs}/ush/preamble.sh"

cd "${DATA}" || exit 1

# specify model output format type: 4 for nemsio, 3 for sigio
export POSTGPSH=${POSTGPSH:-${USHgfs}/gfs_post.sh}
export GFSDOWNSH=${GFSDOWNSH:-${USHgfs}/fv3gfs_downstream_nems.sh}
export GFSDOWNSHF=${GFSDOWNSHF:-${USHgfs}/inter_flux.sh}
Expand All @@ -66,14 +65,10 @@ export GOESF=${GOESF:-"YES"}
export WAFSF=${WAFSF:-"NO"}
export PGBF=${PGBF:-"YES"}
export TCYC=${TCYC:-".t${cyc}z."}
export OUTPUT_FILE=${OUTPUT_FILE:-"nemsio"}
export OUTPUT_FILE=${OUTPUT_FILE:-"netcdf"}
export PREFIX=${PREFIX:-${RUN}${TCYC}}
if (( OUTTYP == 4 )); then
if [[ "${OUTPUT_FILE}" = "netcdf" ]]; then
export SUFFIX=".nc"
else
export SUFFIX=".nemsio"
fi
export SUFFIX=".nc"
else
export SUFFIX=
fi
Expand Down Expand Up @@ -256,7 +251,7 @@ else ## not_anl if_stime
# period and error exit
###############################
if (( ic == SLEEP_LOOP_MAX )); then
echo " *** FATAL ERROR: No model output in nemsio for f${fhr} "
echo " *** FATAL ERROR: No model output for f${fhr} "
export err=9
err_chk
fi
Expand Down
32 changes: 7 additions & 25 deletions scripts/exgfs_atmos_postsnd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,38 +36,20 @@ export INCREMENT=12
export MAKEBUFR=NO
export F00FLAG=YES
export fformat=${OUTPUT_FILE:-netcdf}
if [ $fformat == "netcdf" ]
then
export atmfm="nc"
export logfm="txt"
else
export atmfm="nemsio"
export logfm="nemsio"
fi

export NINT1=${FHOUT_HF_GFS:-1}
export NEND1=${FHMAX_HF_GFS:-120}
export NINT3=${FHOUT_GFS:-3}
export NINT1=${FHOUT_HF_GFS:-1}
export NEND1=${FHMAX_HF_GFS:-120}
export NINT3=${FHOUT_GFS:-3}

rm -f -r ${COMOUT}/bufr.${cycle}
mkdir -p ${COMOUT}/bufr.${cycle}

if [ -f $HOMEgfs/ush/getncdimlen ]
then
GETDIM=$HOMEgfs/ush/getncdimlen
else
GETDIM=$EXECbufrsnd/getncdimlen
fi
if [ $fformat == "netcdf" ]
then
export LEVS=$($GETDIM $COMIN/${RUN}.${cycle}.atmf000.${atmfm} pfull)
if [ -f $HOMEgfs/ush/getncdimlen ]; then
GETDIM=$HOMEgfs/ush/getncdimlen
else
# Extract number of vertical levels from $STARTHOUR atmospheric file
export NEMSIOGET=${NEMSIOGET:-$EXECbufrsnd/nemsio_get}
fhr3=$(printf %03i $STARTHOUR)
ATMFCS=$COMIN/${RUN}.${cycle}.atmf${fhr3}.nemsio
export LEVS=$($NEMSIOGET $ATMFCS dimz | awk '{print $2}')
GETDIM=$EXECbufrsnd/getncdimlen
fi
export LEVS=$($GETDIM $COMIN/${RUN}.${cycle}.atmf000.${atmfm} pfull)

### Loop for the hour and wait for the sigma and surface flux file:
export FSTART=$STARTHOUR
Expand Down
7 changes: 1 addition & 6 deletions scripts/exglobal_archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ fi
# CURRENT CYCLE
APREFIX="${CDUMP}.t${cyc}z."
ASUFFIX=${ASUFFIX:-${SUFFIX}}

if [ "${ASUFFIX}" = ".nc" ]; then
format="netcdf"
else
format="nemsio"
fi
format="netcdf"

# Realtime parallels run GFS MOS on 1 day delay
# If realtime parallel, back up CDATE_MOS one day
Expand Down
1 change: 0 additions & 1 deletion scripts/exglobal_atmos_analysis_calc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export NCP=${NCP:-"/bin/cp"}
export NMV=${NMV:-"/bin/mv"}
export NLN=${NLN:-"/bin/ln -sf"}
export CHGRP_CMD=${CHGRP_CMD:-"chgrp ${group_name:-rstprod}"}
export NEMSIOGET=${NEMSIOGET:-${NWPROD}/exec/nemsio_get}
export NCLEN=${NCLEN:-$HOMEgfs/ush/getncdimlen}
COMPRESS=${COMPRESS:-gzip}
UNCOMPRESS=${UNCOMPRESS:-gunzip}
Expand Down
1 change: 0 additions & 1 deletion scripts/exglobal_diag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export NCP=${NCP:-"/bin/cp"}
export NMV=${NMV:-"/bin/mv"}
export NLN=${NLN:-"/bin/ln -sf"}
export CHGRP_CMD=${CHGRP_CMD:-"chgrp ${group_name:-rstprod}"}
export NEMSIOGET=${NEMSIOGET:-${NWPROD}/exec/nemsio_get}
export NCLEN=${NCLEN:-$HOMEgfs/ush/getncdimlen}
export CATEXEC=${CATEXEC:-$ncdiag_ROOT/bin/ncdiag_cat_serial.x}
COMPRESS=${COMPRESS:-gzip}
Expand Down
6 changes: 0 additions & 6 deletions ush/forecast_postdet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -501,14 +501,8 @@ EOF
JCAP_STP=${JCAP_STP:-$JCAP_CASE}
LONB_STP=${LONB_STP:-$LONB_CASE}
LATB_STP=${LATB_STP:-$LATB_CASE}

cd $DATA

affix="nc"
if [ "$OUTPUT_FILE" = "nemsio" ]; then
affix="nemsio"
fi

if [ $QUILTING = ".true." -a $OUTPUT_GRID = "gaussian_grid" ]; then
fhr=$FHMIN
for fhr in $OUTPUT_FH; do
Expand Down
5 changes: 2 additions & 3 deletions ush/forecast_predet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,10 @@ FV3_GFS_predet(){

QUILTING=${QUILTING:-".true."}
OUTPUT_GRID=${OUTPUT_GRID:-"gaussian_grid"}
OUTPUT_FILE=${OUTPUT_FILE:-"nemsio"}
OUTPUT_FILE=${OUTPUT_FILE:-"netcdf"}
WRITE_NEMSIOFLIP=${WRITE_NEMSIOFLIP:-".true."}
WRITE_FSYNCFLAG=${WRITE_FSYNCFLAG:-".true."}
affix="nemsio"
[[ "$OUTPUT_FILE" = "netcdf" ]] && affix="nc"
affix="nc"

rCDUMP=${rCDUMP:-$CDUMP}

Expand Down
9 changes: 2 additions & 7 deletions ush/gaussian_sfcanl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,8 @@ LATB_SFC=${LATB_SFC:-$LATB_CASE}
DONST=${DONST:-"NO"}
LEVS=${LEVS:-64}
LEVSP1=$(($LEVS+1))
OUTPUT_FILE=${OUTPUT_FILE:-"nemsio"}
if [ $OUTPUT_FILE = "netcdf" ]; then
export NETCDF_OUT=".true."
else
export NETCDF_OUT=".false."
fi

OUTPUT_FILE=${OUTPUT_FILE:-"netcdf"}
export NETCDF_OUT=".true."
# Directories.
gfs_ver=${gfs_ver:-v16.3.0}
BASEDIR=${BASEDIR:-${PACKAGEROOT:-/lfs/h1/ops/prod/packages}}
Expand Down
15 changes: 4 additions & 11 deletions ush/gfs_post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,7 @@ 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 OUTPUT_FILE=${OUTPUT_FILE:-"nemsio"}
export OUTPUT_FILE=${OUTPUT_FILE:-"netcdf"}
export GRIBVERSION=${GRIBVERSION:-'grib1'}
# Other variables.
export POSTGPVARS=${POSTGPVARS}
Expand Down Expand Up @@ -260,16 +259,10 @@ fi
export SIGHDR=${SIGHDR:-${NWPROD}/exec/global_sighdr}
export IDRT=${IDRT:-4}

# run post to read nemsio file if OUTTYP=4
# run post to read file if OUTTYP=4
if (( OUTTYP == 4 )) ; then
if [ "${OUTPUT_FILE}" = "netcdf" ]; then
export MODEL_OUT_FORM=${MODEL_OUT_FORM:-netcdfpara}
elif [ "${OUTPUT_FILE}" = "nemsio" ]; then
export MODEL_OUT_FORM=${MODEL_OUT_FORM:-binarynemsiompiio}
else
export MODEL_OUT_FORM=${MODEL_OUT_FORM:-binarynemsiompiio}
fi
export GFSOUT=${NEMSINP}
export MODEL_OUT_FORM=${MODEL_OUT_FORM:-netcdfpara}
export GFSOUT=${NEMSINP}
fi

# allow threads to use threading in Jim's sp lib
Expand Down
Loading

0 comments on commit 78509d6

Please sign in to comment.