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

Move Fit2Obs to stand-alone job #1456

Merged
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ff95dff
Fit2Obs updates for vrfy.sh and config.vrfy
KateFriedman-NOAA Mar 1, 2023
80bab15
Merge branch 'NOAA-EMC:develop' into feature/fit2obs
KateFriedman-NOAA Mar 1, 2023
db33ff1
Merge branch 'NOAA-EMC:develop' into feature/fit2obs
KateFriedman-NOAA Mar 2, 2023
b241552
Merge branch 'NOAA-EMC:develop' into feature/fit2obs
KateFriedman-NOAA Mar 14, 2023
576d155
Merge branch 'NOAA-EMC:develop' into feature/fit2obs
KateFriedman-NOAA Mar 16, 2023
484994e
Merge branch 'NOAA-EMC:develop' into feature/fit2obs
KateFriedman-NOAA Mar 17, 2023
3602ae1
Merge branch 'NOAA-EMC:develop' into feature/fit2obs
KateFriedman-NOAA Mar 23, 2023
b7f82f1
Remove fit2obs from vrfy job
KateFriedman-NOAA Mar 24, 2023
e72698f
Add DO_FIT2OBS switch to config.base
KateFriedman-NOAA Mar 24, 2023
b2d4ab0
Add fit2obs job to config.resources
KateFriedman-NOAA Mar 24, 2023
7e324fb
Add new fit2obs job to workflow setup scripts
KateFriedman-NOAA Mar 24, 2023
2a70883
Create config.fit2obs for new fit2obs job
KateFriedman-NOAA Mar 24, 2023
5653ef2
Create new rocoto job script for fit2obs job
KateFriedman-NOAA Mar 24, 2023
bef3165
Create JJOB script for new fit2obs job
KateFriedman-NOAA Mar 24, 2023
a12499b
Merge branch 'NOAA-EMC:develop' into feature/fit2obs
KateFriedman-NOAA Mar 27, 2023
df432f6
Add fit2obs job to env files
KateFriedman-NOAA Mar 28, 2023
3a5df0f
Merge branch 'NOAA-EMC:develop' into feature/fit2obs
KateFriedman-NOAA Mar 28, 2023
c8dfaa9
Add fit2obs to gdas_half but don't run until xdate>=SDATE
KateFriedman-NOAA Mar 28, 2023
0899ea1
Update path settings in config.fit2obs and remove CDUMPFCST
KateFriedman-NOAA Mar 29, 2023
96e8dad
Updates to JGDAS_FIT2OBS for functioning
KateFriedman-NOAA Mar 29, 2023
085f6e2
Remove "/install" from EXECcfs and USHcfs paths
KateFriedman-NOAA Apr 3, 2023
5a98866
Merge branch 'NOAA-EMC:develop' into feature/fit2obs
KateFriedman-NOAA Apr 3, 2023
f71b226
Merge branch 'NOAA-EMC:develop' into feature/fit2obs
KateFriedman-NOAA Apr 12, 2023
7069ab1
Merge branch 'NOAA-EMC:develop' into feature/fit2obs
KateFriedman-NOAA Apr 12, 2023
a2430e5
Update config.fit2obs for new wflow.1.0 Fit2Obs tag
KateFriedman-NOAA Apr 12, 2023
d4147f0
Address SC2250 and SC2292 shellcheck in config.fit2obs
KateFriedman-NOAA Apr 12, 2023
67ecad1
Address SC2086 and SC2292 shellcheck in JGDAS_FIT2OBS
KateFriedman-NOAA Apr 12, 2023
dc3fbce
Update jobs/JGDAS_FIT2OBS
KateFriedman-NOAA Apr 12, 2023
992ccad
Update jobs/JGDAS_FIT2OBS
KateFriedman-NOAA Apr 12, 2023
4cac72a
Update jobs/JGDAS_FIT2OBS
KateFriedman-NOAA Apr 12, 2023
4ac1d68
Update jobs/JGDAS_FIT2OBS
KateFriedman-NOAA Apr 12, 2023
bb7471f
Updates to jobs/JGDAS_FIT2OBS
KateFriedman-NOAA Apr 12, 2023
efccd41
Update jobs/JGDAS_FIT2OBS
KateFriedman-NOAA Apr 12, 2023
5146de6
Update jobs/JGDAS_FIT2OBS
KateFriedman-NOAA Apr 12, 2023
f963cb2
Resolve SC2155, SC2086, SC2248 and ignore SC2153
KateFriedman-NOAA Apr 12, 2023
3b48ae1
Remove use of xdate
KateFriedman-NOAA Apr 12, 2023
eebcc98
Remove exports of vday and vcyc; used locally
KateFriedman-NOAA Apr 12, 2023
b146289
Merge branch 'NOAA-EMC:develop' into feature/fit2obs
KateFriedman-NOAA Apr 12, 2023
e059513
Resolve SC2086 and SC2292 for fit2obs section of config.resources
KateFriedman-NOAA Apr 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}"
KateFriedman-NOAA marked this conversation as resolved.
Show resolved Hide resolved

fi
8 changes: 8 additions & 0 deletions env/JET.env
Original file line number Diff line number Diff line change
Expand Up @@ -212,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 @@ -290,4 +290,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
84 changes: 84 additions & 0 deletions jobs/JGDAS_FIT2OBS
KateFriedman-NOAA marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#! /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}

export xdate=$(${NDATE} -"${VBACKUP_FITS}" "${CDATE}")
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
KateFriedman-NOAA marked this conversation as resolved.
Show resolved Hide resolved
export CDATE=${xdate} # set CDATE to xdate for use in fit2obs package
export vday=$(echo "${xdate}" | cut -c1-8)
Fixed Show fixed Hide fixed
export vcyc=$(echo "${xdate}" | cut -c9-10)
Fixed Show fixed Hide fixed

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'
KateFriedman-NOAA marked this conversation as resolved.
Show resolved Hide resolved
KateFriedman-NOAA marked this conversation as resolved.
Show resolved Hide resolved
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
##############################################

if [[ ${xdate} -gt ${SDATE} ]]; then
Fixed Show fixed Hide fixed
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."

KateFriedman-NOAA marked this conversation as resolved.
Show resolved Hide resolved
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
Fixed Show fixed Hide fixed
status=$?
[[ ${status} -ne 0 ]] && exit ${status}
Fixed Show fixed Hide fixed

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

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

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


###############################################################
echo
echo "=============== START TO RUN FIT2OBS VERIFICATION ==============="
if [ ${VRFYFITS} = "YES" -a ${CDUMP} = ${CDFNL} -a ${CDATE} != ${SDATE} ]; then

export CDUMPFCST=${VDUMP}
export TMPDIR="${RUNDIR}/${CDATE}/${CDUMP}"
[[ ! -d ${TMPDIR} ]] && mkdir -p ${TMPDIR}

xdate=$(${NDATE} -${VBACKUP_FITS} ${CDATE})

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
1 change: 1 addition & 0 deletions parm/config/config.base.emc.dyn
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ export binary_diag=".false."

# Verification options
export DO_METP="YES" # Run METPLUS jobs - set METPLUS settings in config.metp
export DO_FIT2OBS="YES" # 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
Fixed Show fixed Hide fixed

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

export HOMEcfs=${fitdir}
export EXECcfs=${HOMEcfs}/exec
export USHcfs=${HOMEcfs}/ush
aerorahul marked this conversation as resolved.
Show resolved Hide resolved

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"
10 changes: 9 additions & 1 deletion 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 @@ -623,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
KateFriedman-NOAA marked this conversation as resolved.
Show resolved Hide resolved

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="YES" # 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
6 changes: 5 additions & 1 deletion workflow/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def __init__(self, conf: Configuration) -> None:
self.do_awips = _base.get('DO_AWIPS', False)
self.do_wafs = _base.get('WAFSF', False)
self.do_vrfy = _base.get('DO_VRFY', True)
self.do_fit2obs = _base.get('DO_FIT2OBS', True)
self.do_metp = _base.get('DO_METP', False)
self.do_jedivar = _base.get('DO_JEDIVAR', False)
self.do_jediens = _base.get('DO_JEDIENS', False)
Expand Down Expand Up @@ -186,7 +187,7 @@ def _cycled_configs(self):
if self.do_ocean:
configs += ['ocnpost']

configs += ['sfcanl', 'analcalc', 'fcst', 'post', 'vrfy', 'arch']
configs += ['sfcanl', 'analcalc', 'fcst', 'post', 'vrfy', 'fit2obs', 'arch']

if self.do_gldas:
configs += ['gldas']
Expand Down Expand Up @@ -401,6 +402,9 @@ def _get_cycled_task_names(self):
gdas_tasks += wave_bndpnt_tasks
gdas_tasks += wave_post_tasks

if self.do_fit2obs:
gdas_tasks += ['fit2obs']

gdas_tasks += gdas_gfs_common_cleanup_tasks

# Collect "gfs" cycle tasks
Expand Down
17 changes: 17 additions & 0 deletions workflow/rocoto/workflow_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,20 @@ def vrfy(self):

return task

def fit2obs(self):
deps = []
dep_dict = {'type': 'metatask', 'name': f'{self.cdump}post'}
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep=deps)

cycledef = 'gdas_half,gdas' if self.cdump in ['gdas'] else self.cdump

resources = self.get_resource('fit2obs')
task = create_wf_task('fit2obs', resources, cdump=self.cdump, envar=self.envars, dependency=dependencies,
cycledef=cycledef)

return task

def metp(self):
deps = []
dep_dict = {'type': 'metatask', 'name': f'{self.cdump}post'}
Expand Down Expand Up @@ -1020,6 +1034,9 @@ def arch(self):
if self.app_config.do_vrfy:
dep_dict = {'type': 'task', 'name': f'{self.cdump}vrfy'}
deps.append(rocoto.add_dependency(dep_dict))
if self.app_config.do_fit2obs and self.cdump in ['gdas']:
dep_dict = {'type': 'task', 'name': f'{self.cdump}fit2obs'}
deps.append(rocoto.add_dependency(dep_dict))
KateFriedman-NOAA marked this conversation as resolved.
Show resolved Hide resolved
if self.app_config.do_metp and self.cdump in ['gfs']:
dep_dict = {'type': 'metatask', 'name': f'{self.cdump}metp'}
deps.append(rocoto.add_dependency(dep_dict))
Expand Down