Skip to content

Commit

Permalink
Merge branch 'develop' into feature/com_reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterKolczynski-NOAA committed Apr 13, 2023
2 parents e695ac0 + e496e39 commit 5972917
Show file tree
Hide file tree
Showing 19 changed files with 307 additions and 99 deletions.
11 changes: 11 additions & 0 deletions env/HERA.env
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then
export APRUN_GAUSFCANL="${launcher} -n ${npe_gausfcanl}"

elif [[ "${step}" = "sfcanl" ]]; then

nth_max=$((npe_node_max / npe_node_sfcanl))

export NTHREADS_CYCLE=${nth_sfcanl:-14}
Expand Down Expand Up @@ -291,4 +292,14 @@ elif [[ "${step}" = "gempak" ]]; then
export NTHREADS_GEMPAK=${nth_gempak:-1}
[[ ${NTHREADS_GEMPAK} -gt ${nth_max} ]] && export NTHREADS_GEMPAK=${nth_max}
export APRUN="${launcher} -n ${npe_gempak} ${mpmd_opt}"


elif [[ "${step}" = "fit2obs" ]]; then

nth_max=$((npe_node_max / npe_node_fit2obs))

export NTHREADS_FIT2OBS=${nth_fit2obs:-1}
[[ ${NTHREADS_FIT2OBS} -gt ${nth_max} ]] && export NTHREADS_FIT2OBS=${nth_max}
export MPIRUN="${launcher} -n ${npe_fit2obs}"

fi
18 changes: 17 additions & 1 deletion env/JET.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if [[ $# -ne 1 ]]; then

echo "Must specify an input argument to set runtime environment variables!"
echo "argument can be any one of the following:"
echo "atmanalrun atmensanalrun"
echo "atmanalrun atmensanalrun aeroanlrun"
echo "anal sfcanl fcst post vrfy metp"
echo "eobs eupd ecen efcs epos"
echo "postsnd awips gempak"
Expand Down Expand Up @@ -59,6 +59,14 @@ elif [[ "${step}" = "atmensanalrun" ]]; then
[[ ${NTHREADS_ATMENSANAL} -gt ${nth_max} ]] && export NTHREADS_ATMENSANAL=${nth_max}
export APRUN_ATMENSANAL="${launcher} ${npe_atmensanalrun}"

elif [[ "${step}" = "aeroanlrun" ]]; then

nth_max=$((npe_node_max / npe_node_aeroanlrun))

export NTHREADS_AEROANL=${nth_aeroanlrun:-${nth_max}}
[[ ${NTHREADS_AEROANL} -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max}
export APRUN_AEROANL="${launcher} ${npe_aeroanlrun}"

elif [[ "${step}" = "anal" ]]; then

nth_max=$((npe_node_max / npe_node_anal))
Expand Down Expand Up @@ -204,4 +212,12 @@ elif [[ "${step}" = "gempak" ]]; then

echo "WARNING: ${step} is not enabled on ${machine}!"

elif [[ "${step}" = "fit2obs" ]]; then

nth_max=$((npe_node_max / npe_node_fit2obs))

export NTHREADS_FIT2OBS=${nth_fit2obs:-1}
[[ ${NTHREADS_FIT2OBS} -gt ${nth_max} ]] && export NTHREADS_FIT2OBS=${nth_max}
export MPIRUN="${launcher} -n ${npe_fit2obs}"

fi
9 changes: 9 additions & 0 deletions env/ORION.env
Original file line number Diff line number Diff line change
Expand Up @@ -291,4 +291,13 @@ elif [[ "${step}" = "gempak" ]]; then
export NTHREADS_GEMPAK=${nth_gempak:-1}
[[ ${NTHREADS_GEMPAK} -gt ${nth_max} ]] && export NTHREADS_GEMPAK=${nth_max}
export APRUN="${launcher} -n ${npe_gempak} ${mpmd_opt}"

elif [[ "${step}" = "fit2obs" ]]; then

nth_max=$((npe_node_max / npe_node_fit2obs))

export NTHREADS_FIT2OBS=${nth_fit2obs:-1}
[[ ${NTHREADS_FIT2OBS} -gt ${nth_max} ]] && export NTHREADS_FIT2OBS=${nth_max}
export MPIRUN="${launcher} -n ${npe_fit2obs}"

fi
9 changes: 9 additions & 0 deletions env/S4.env
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,13 @@ elif [[ "${step}" = "awips" ]]; then
elif [[ "${step}" = "gempak" ]]; then

echo "WARNING: ${step} is not enabled on S4!"

elif [[ "${step}" = "fit2obs" ]]; then

nth_max=$((npe_node_max / npe_node_fit2obs))

export NTHREADS_FIT2OBS=${nth_fit2obs:-1}
[[ ${NTHREADS_FIT2OBS} -gt ${nth_max} ]] && export NTHREADS_FIT2OBS=${nth_max}
export MPIRUN="${launcher} -n ${npe_fit2obs}"

fi
8 changes: 8 additions & 0 deletions env/WCOSS2.env
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,14 @@ elif [[ "${step}" = "gempak" ]]; then
[[ ${NTHREADS_GEMPAK} -gt ${nth_max} ]] && export NTHREADS_GEMPAK=${nth_max}
export APRUN_GEMPAKCFP="${launcher} -np ${npe_gempak} ${mpmd_opt}"

elif [[ "${step}" = "fit2obs" ]]; then

nth_max=$((npe_node_max / npe_node_fit2obs))

export NTHREADS_FIT2OBS=${nth_fit2obs:-1}
[[ ${NTHREADS_FIT2OBS} -gt ${nth_max} ]] && export NTHREADS_FIT2OBS=${nth_max}
export MPIRUN="${launcher} -np ${npe_fit2obs}"

elif [[ "${step}" = "waveawipsbulls" ]]; then

unset PERL5LIB
Expand Down
88 changes: 88 additions & 0 deletions jobs/JGDAS_FIT2OBS
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#! /usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"
source "${HOMEgfs}/ush/jjob_header.sh" -e "fit2obs" -c "base fit2obs"


##############################################
# Set variables used in the script
##############################################

export CDUMP=${RUN/enkf}

# Ignore spelling warning; nothing is misspelled
# shellcheck disable=SC2153
CDATE=$(${NDATE} -"${VBACKUP_FITS}" "${PDY}${cyc}") # set CDATE to lookback cycle for use in fit2obs package
export CDATE
vday=${CDATE:0:8}
vcyc=${CDATE:8:2}

export COM_INA=${ROTDIR}/gdas.${vday}/${vcyc}/atmos
# We want to defer variable expansion, so ignore warning about single quotes
# shellcheck disable=SC2016
export COM_INF='$ROTDIR/vrfyarch/gfs.$fdy/$fzz'
export COM_PRP=${ROTDIR}/gdas.${vday}/${vcyc}/obs

export PRPI=${COM_PRP}/${RUN}.t${vcyc}z.prepbufr
export sig1=${COM_INA}/${RUN}.t${vcyc}z.atmanl.nc
export sfc1=${COM_INA}/${RUN}.t${vcyc}z.atmanl.nc
export CNVS=${COM_INA}/${RUN}.t${vcyc}z.cnvstat

export OUTPUT_FILETYPE=${OUTPUT_FILETYPE:-netcdf}

export FIT_DIR=${ARCDIR}/fits
[[ ! -d "${FIT_DIR}" ]] && mkdir -p "${FIT_DIR}"
export HORZ_DIR=${ARCDIR}/horiz
[[ ! -d "${HORZ_DIR}" ]] && mkdir -p "${HORZ_DIR}"
export COMLOX=${DATA}/fitx
[[ ! -d "${COMLOX}" ]] && mkdir -p "${COMLOX}"

echo "echo err_chk">"${DATA}"/err_chk; chmod 755 "${DATA}"/err_chk
echo "echo postmsg">"${DATA}"/postmsg; chmod 755 "${DATA}"/postmsg

##############################################
# Check spinup and available inputs
##############################################

# Ignore spelling warning; nothing is misspelled
# shellcheck disable=SC2153
if [[ ${CDATE} -gt ${SDATE} ]]; then
for file in ${PRPI} ${sig1} ${sfc1} ${CNVS}; do
if [[ ! -f "${file}" ]]; then
echo "FATAL ERROR: FILE MISSING: ${file}"
exit 1
fi
done

##############################################
# RUN FIT2OBS VERIFICATION
##############################################

"${fitdir}/batrun/excfs_gdas_vrfyfits.sh.ecf"
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"

##############################################
# End JOB SPECIFIC work
##############################################

##############################################
# Final processing
##############################################
if [[ -e "${pgmout}" ]] ; then
cat "${pgmout}"
fi

else

echo "Too early for FIT2OBS to run. Exiting."

fi

##########################################
# Remove the Temporary working directory
##########################################
cd "${DATAROOT}" || (echo "FATAL ERROR: ${DATAROOT} does not exist. ABORT!"; exit 1)
[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}"

exit 0
23 changes: 23 additions & 0 deletions jobs/rocoto/fit2obs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#! /usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"

###############################################################
echo
echo "=============== START TO SOURCE FV3GFS WORKFLOW MODULES ==============="
. "${HOMEgfs}/ush/load_fv3gfs_modules.sh"
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"

export job="fit2obs"
export jobid="${job}.$$"

###############################################################
echo
echo "=============== START TO RUN FIT2OBS ==============="
# Execute the JJOB
"${HOMEgfs}/jobs/JGDAS_FIT2OBS"
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"

exit 0
25 changes: 0 additions & 25 deletions jobs/rocoto/vrfy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,31 +59,6 @@ if [ ${RUNMOS} = "YES" -a ${CDUMP} = "gfs" ]; then
fi


###############################################################
echo
echo "=============== START TO RUN FIT2OBS VERIFICATION ==============="
if [[ ${VRFYFITS} == "YES" && "${CDUMP}" == "${CDFNL}" && "${PDY}${cyc}" != "${SDATE}" ]]; then


# Ignore possible spelling error (nothing is misspelled)
# shellcheck disable=SC2153
export CDUMPFCST=${VDUMP}
# shellcheck disable=
export TMPDIR="${RUNDIR}/${CDATE}/${RUN}"
[[ ! -d ${TMPDIR} ]] && mkdir -p ${TMPDIR}

xdate=$(${NDATE} -"${VBACKUP_FITS}" "${PDY}${cyc}")

export RUN_ENVIR_SAVE=${RUN_ENVIR}
export RUN_ENVIR="netcdf"

${PREPQFITSH} ${PSLOT} ${xdate} ${ROTDIR} ${ARCDIR} ${TMPDIR}

export RUN_ENVIR=${RUN_ENVIR_SAVE}

fi


###############################################################
echo
echo "=============== START TO RUN RADMON DATA EXTRACTION ==============="
Expand Down
2 changes: 1 addition & 1 deletion parm/config/config.aeroanl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ export io_layout_x=@IO_LAYOUT_X@
export io_layout_y=@IO_LAYOUT_Y@

export JEDIVAREXE=${HOMEgfs}/exec/fv3jedi_var.x
export CRTM_VER="2.3.0"
export crtm_VERSION="2.3.0"

echo "END: config.aeroanl"
1 change: 1 addition & 0 deletions parm/config/config.base.emc.dyn
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ export binary_diag=".false."

# Verification options
export DO_METP="YES" # Run METPLUS jobs - set METPLUS settings in config.metp
export DO_FIT2OBS="NO" # Run fit to observations package

# Archiving options
export HPSSARCH="@HPSSARCH@" # save data to HPSS archive
Expand Down
30 changes: 30 additions & 0 deletions parm/config/config.fit2obs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#! /usr/bin/env bash

########## config.fit2obs ##########
# Fit to Observations

echo "BEGIN: config.fit2obs"

# Get task specific resources
. "${EXPDIR}/config.resources" fit2obs

export fit_ver="wflow.1.0"
export fitdir="${BASE_GIT}/Fit2Obs/${fit_ver}"

export HOMEcfs=${fitdir}
export EXECcfs=${HOMEcfs}/exec
export USHcfs=${HOMEcfs}/ush

export PRVT=${HOMEgfs}/fix/gsi/prepobs_errtable.global
export HYBLEVS=${HOMEgfs}/fix/am/global_hyblev.l${LEVS}.txt

export VBACKUP_FITS=24
export OUTPUT_FILETYPE="netcdf"
export CONVNETC="YES"
export ACPROFit="YES"

if [[ ${netcdf_diag:-".false."} = ".true." ]]; then
export CONVNETC="YES"
fi

echo "END: config.fit2obs"
15 changes: 12 additions & 3 deletions parm/config/config.resources
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if [ $# -ne 1 ]; then
echo "atmanalprep atmanalrun atmanalpost"
echo "atmensanalprep atmensanalrun atmensanalpost"
echo "aeroanlinit aeroanlrun aeroanlfinal"
echo "anal sfcanl analcalc analdiag gldas fcst post vrfy metp arch echgres"
echo "anal sfcanl analcalc analdiag gldas fcst post vrfy fit2obs metp arch echgres"
echo "eobs ediag eomg eupd ecen esfc efcs epos earc"
echo "init_chem mom6ic ocnpost"
echo "waveinit waveprep wavepostsbs wavepostbndpnt wavepostbndpntbll wavepostpnt"
Expand Down Expand Up @@ -60,11 +60,12 @@ if [ ${step} = "prep" ]; then
export memory_prep="40G"
fi

elif [ ${step} = "aerosol_init" ]; then
elif [[ "${step}" = "aerosol_init" ]]; then
export wtime_aerosol_init="00:05:00"
export npe_aerosol_init=1
export nth_aerosol_init=1
export npe_node_aerosol_init=$(echo "${npe_node_max} / ${nth_aerosol_init}" | bc)
npe_node_aerosol_init=$(echo "${npe_node_max} / ${nth_aerosol_init}" | bc)
export npe_node_aerosol_init
export NTASKS=${npe_aerosol_init}
export memory_aerosol_init="6G"

Expand Down Expand Up @@ -622,6 +623,14 @@ elif [ ${step} = "vrfy" ]; then
fi
export is_exclusive=True

elif [[ "${step}" = "fit2obs" ]]; then

export wtime_fit2obs="00:20:00"
export npe_fit2obs=3
export nth_fit2obs=1
export npe_node_fit2obs=1
if [[ ${machine} == "WCOSS2" ]]; then export npe_node_fit2obs=3 ; fi

elif [ ${step} = "metp" ]; then

export nth_metp=1
Expand Down
36 changes: 0 additions & 36 deletions parm/config/config.vrfy
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@ echo "BEGIN: config.vrfy"
# Get task specific resources
. $EXPDIR/config.resources vrfy

export VDUMP="gfs" # Verifying dump
export CDUMPFCST="gdas" # Fit-to-obs with GDAS/GFS prepbufr
export CDFNL="gdas" # Scores verification against GDAS/GFS analysis

export MKPGB4PRCP="YES" # Make 0.25-deg pgb files in ARCDIR for precip verification
export VRFYFITS="NO" # Fit to observations
export VRFYRAD="YES" # Radiance data assimilation monitoring
export VRFYOZN="YES" # Ozone data assimilation monitoring
export VRFYMINMON="YES" # GSI minimization monitoring
Expand All @@ -22,38 +18,6 @@ export VRFYGENESIS="YES" # Cyclone genesis verification
export VRFYFSU="NO" # Cyclone genesis verification (FSU)
export RUNMOS="NO" # whether to run entire MOS package

#-------------------------------------------------
# Fit to Observations
#-------------------------------------------------

if [ $VRFYFITS = "YES" ]; then

export fit_ver="newm.1.3"
export fitdir="$BASE_GIT/verif/global/Fit2Obs/${fit_ver}/batrun"
export PRVT=$HOMEgfs/fix/gsi/prepobs_errtable.global
export HYBLEVS=$HOMEgfs/fix/am/global_hyblev.l${LEVS}.txt
export CUE2RUN=$QUEUE

export VBACKUP_FITS=24

export CONVNETC="NO"
if [ ${netcdf_diag:-".false."} = ".true." ]; then
export CONVNETC="YES"
fi

if [ $machine = "HERA" ]; then
export PREPQFITSH="$fitdir/subfits_hera_slurm"
elif [ $machine = "S4" ]; then
export PREPQFITSH="$fitdir/subfits_s4_slurm"
elif [ $machine = "ORION" ]; then
export PREPQFITSH="$fitdir/subfits_orion_netcdf"
else
echo "Fit2Obs NOT supported on this machine"
fi

fi


#----------------------------------------------------------
# Minimization, Radiance and Ozone Monitoring
#----------------------------------------------------------
Expand Down
Loading

0 comments on commit 5972917

Please sign in to comment.