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

Add the repair job for the reforecast #2838

Merged
merged 63 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
8181536
Add the repair job scripts
HongGuan-NOAA Aug 15, 2024
08f4f81
Merge remote-tracking branch 'EMC/develop' into repair
HongGuan-NOAA Aug 15, 2024
fbe4688
Correct warning errors
HongGuan-NOAA Aug 22, 2024
e8d7fa0
Correct warning errors.
HongGuan-NOAA Aug 22, 2024
225eab1
Correct warning errors.
HongGuan-NOAA Aug 22, 2024
e7b5e7f
Fix Python error
HongGuan-NOAA Aug 22, 2024
0afdfbe
Correct the errors
HongGuan-NOAA Aug 23, 2024
e7c3f9b
Correct error
HongGuan-NOAA Aug 23, 2024
c969dda
Correct the error
HongGuan-NOAA Aug 23, 2024
5e25361
Correct the error
HongGuan-NOAA Aug 23, 2024
3be3217
Correct the error
HongGuan-NOAA Aug 23, 2024
e447511
Add the Python code
HongGuan-NOAA Aug 23, 2024
092a787
Correct the Python code
HongGuan-NOAA Aug 23, 2024
8d03a14
Revert "Add the Python code"
HongGuan-NOAA Aug 23, 2024
9624baa
Correct the Python code
HongGuan-NOAA Aug 23, 2024
faf1c84
Add some corrections
EricSinsky-NOAA Aug 23, 2024
22792e3
Correct the config file
HongGuan-NOAA Aug 23, 2024
02d1cf5
Remove repair job in gefs_tasks.py
EricSinsky-NOAA Aug 23, 2024
bae7d72
Correct the Python code
HongGuan-NOAA Aug 23, 2024
5f307ca
Correct the scripts based on the suggestions of the workfloow team
HongGuan-NOAA Sep 10, 2024
8719f90
Make the corrections based on the suggestion of the workflow tearm
HongGuan-NOAA Sep 10, 2024
33391a9
Make the corrections based on the suggestions of the workflow team
HongGuan-NOAA Sep 10, 2024
3bde14c
Make the corrections based on the suggestions of the workflow team
HongGuan-NOAA Sep 10, 2024
d366fcd
Make the corrections based on the suggestion of the workflow team
HongGuan-NOAA Sep 10, 2024
ed47548
Make the corrections based on the suggestions of the workflow team
HongGuan-NOAA Sep 10, 2024
416e0bc
Make the corrections based on the suggestions of teh workflow team
HongGuan-NOAA Sep 10, 2024
e7f0141
Correct the Python code
HongGuan-NOAA Sep 10, 2024
9d89ef9
Make the correction for the warning errors
HongGuan-NOAA Sep 10, 2024
bb436b7
Make the xorrections for the errors
HongGuan-NOAA Sep 10, 2024
c119f81
Delete the old file
HongGuan-NOAA Sep 10, 2024
251410f
Delete more files
HongGuan-NOAA Sep 10, 2024
528a2e0
Add the parmlist which are in the PSL f03 reanalysis
HongGuan-NOAA Sep 11, 2024
9dda05a
Add the varlist for ave/acc/min/max variables in f06 master file
HongGuan-NOAA Sep 11, 2024
57d24c4
Change excutable name from gefs_6h_ave_1mem to gefs_6h_ave_1mem.x
HongGuan-NOAA Sep 11, 2024
b4387f9
Revert "Remove repair job in gefs_tasks.py"
EricSinsky-NOAA Sep 25, 2024
0ceaca9
Revert "Add some corrections"
EricSinsky-NOAA Sep 25, 2024
a43ab9b
Merge remote-tracking branch 'HG/repair' into repair_pr
EricSinsky-NOAA Sep 25, 2024
92bee3d
Update gfs_utils hash
EricSinsky-NOAA Sep 25, 2024
cfa75ec
Link new gfs_utils executable for repair task
EricSinsky-NOAA Sep 25, 2024
3ccacc9
Merge pull request #2 from EricSinsky-NOAA/repair_pr
HongGuan-NOAA Sep 25, 2024
7669667
Update the task name
HongGuan-NOAA Sep 25, 2024
d30fdc1
update the file
HongGuan-NOAA Sep 25, 2024
c8c5391
Update the defaults.yaml
HongGuan-NOAA Sep 25, 2024
7b416e0
Remove the two parm files here
HongGuan-NOAA Sep 26, 2024
dcc04e7
Modify the Python code
HongGuan-NOAA Sep 26, 2024
fef9dd6
Fix the python code error
HongGuan-NOAA Sep 26, 2024
f1cb9e7
Correct the Python code
HongGuan-NOAA Oct 3, 2024
732fb9c
Correct the parameters
HongGuan-NOAA Oct 3, 2024
bf9b792
Add a parameter file
HongGuan-NOAA Oct 4, 2024
b9f8024
Add a parameter file definition
HongGuan-NOAA Oct 4, 2024
574ecfe
Correct Python script
HongGuan-NOAA Oct 8, 2024
b523fdb
Make correction
HongGuan-NOAA Oct 8, 2024
913c4dd
Correct the script
HongGuan-NOAA Oct 8, 2024
d88ea83
Make the correction
HongGuan-NOAA Oct 8, 2024
126d854
Correct the script
HongGuan-NOAA Oct 8, 2024
02d144e
Correct the scripts
HongGuan-NOAA Oct 8, 2024
5bfe5e3
correct the script
HongGuan-NOAA Oct 8, 2024
611cabd
Correct the script
HongGuan-NOAA Oct 9, 2024
6d7d8e6
Correct the script
HongGuan-NOAA Oct 9, 2024
9b03433
Make correction
HongGuan-NOAA Oct 9, 2024
e759f89
Make the correction 1
HongGuan-NOAA Oct 9, 2024
1bb8f13
Correct the script 1
HongGuan-NOAA Oct 9, 2024
00b7a30
Correct script 2
HongGuan-NOAA Oct 9, 2024
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
28 changes: 28 additions & 0 deletions jobs/JGEFS_ATMOS_ACC
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#! /usr/bin/env bash
#
#
#####################################################################
source "${HOMEgfs}/ush/preamble.sh"
source "${HOMEgfs}/ush/jjob_header.sh" -e "repair_replay" -c "base repair_replay"

####################################
# Specify Execution Areas
####################################
#
# Construct COM variables from templates
YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \
COMIN_ATMOS_MASTER:COM_ATMOS_MASTER_TMPL \
COMOUT_ATMOS_MASTER:COM_ATMOS_MASTER_TMPL

export COMIN_03=${HOMEgfs}/anl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll still need to decide where we are going to store this reanalysis data. It might be stored somewhere outside the global-workflow.


########################################################
# Execute the acc script.
"${SCRgfs}/exgefs_atmos_repair_replay.sh"
export err=$?; err_chk
##############################
# Remove the Temporary working directory
##############################
if [[ "${KEEPDATA}" != "YES" ]] ; then
rm -fr "${DATA}"
Fixed Show fixed Hide fixed
fi
22 changes: 22 additions & 0 deletions jobs/rocoto/repair_replay.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#! /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="repair_replay"
export jobid="${job}.$$"

###############################################################
# Execute the JJOB
"${HOMEgfs}/jobs/JGEFS_ATMOS_ACC"
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"


exit 0
1 change: 1 addition & 0 deletions parm/config/gefs/config.base
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export DO_OCN="NO"
export DO_ICE="NO"
export DO_AERO="NO"
export DO_EXTRACTVARS="@DO_EXTRACTVARS@" # Option to process and extract a subset of products to save on disk
export DO_REPAIR_REPLAY="@DO_REPAIR_REPLAY@" # Option to repair ave/acc/min/max variabes for f03 and f06 when one uses reply initial condition
export AERO_FCST_RUN="" # When to run aerosol forecast: gdas, gfs, or both
export AERO_ANL_RUN="" # When to run aerosol analysis: gdas, gfs, or both
export WAVE_RUN="" # When to include wave suite: gdas, gfs, or both
Expand Down
15 changes: 15 additions & 0 deletions parm/config/gefs/config.repair_replay
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#! /usr/bin/env bash

########## config.repair_replay #########
# repair_replay specific

echo "BEGIN: config.repair_replay"


export varlist_FLXacc03="${PARMgfs}/product/gefs_parmlist_FLXacc03.parm" # Parameter table for f03 acc/ave/min/max variables (PSL data)
export varlist_masteracc06="${PARMgfs}/product/gefs_parmlist_masteracc06.parm" # Parameter table for f06 acc/ave/min/max variables
export varlist_masteracc03="${PARMgfs}/product/gefs_parmlist_masteracc03.parm" # Parameter table for f06 acc/ave/min/max variables

. "${EXPDIR}/config.resources" repair_replay

echo "END: config.repair_replay"
9 changes: 9 additions & 0 deletions parm/config/gefs/config.resources
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ case ${step} in
export memory="1GB"
;;

"repair_replay")
export walltime="00:10:00"
export ntasks=1
export threads_per_task=1
export tasks_per_node=$(( max_tasks_per_node / threads_per_task ))
export memory="2GB"
;;

"fcst" | "efcs")
export is_exclusive=True

Expand Down Expand Up @@ -194,6 +202,7 @@ case ${step} in
unset NTASKS_TOT
;;


"atmos_products")
export walltime="00:15:00"
export ntasks=24
Expand Down
1 change: 1 addition & 0 deletions parm/config/gefs/yaml/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ base:
DO_AWIPS: "NO"
KEEPDATA: "NO"
DO_EXTRACTVARS: "NO"
DO_REPAIR_REPLAY: "NO"
FHMAX_GFS: 120
FHMAX_HF_GFS: 0
FCST_BREAKPOINTS: "48"
Expand Down
35 changes: 35 additions & 0 deletions parm/product/gefs_parmlist_FLXacc03.parm
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
:WATR:surface:0-3 hour acc fcst:
:SNOWC:surface:0-3 hour ave fcst:
:SNOHF:surface:0-3 hour ave fcst:
:DLWRF:surface:0-3 hour ave fcst:
:ULWRF:surface:0-3 hour ave fcst:
:DSWRF:surface:0-3 hour ave fcst:
:USWRF:surface:0-3 hour ave fcst:
:USWRF:top of atmosphere:0-3 hour ave fcst:
:ULWRF:top of atmosphere:0-3 hour ave fcst:
:UFLX:surface:0-3 hour ave fcst:
:VFLX:surface:0-3 hour ave fcst:
:SHTFL:surface:0-3 hour ave fcst:
:LHTFL:surface:0-3 hour ave fcst:
:PRATE:surface:0-3 hour ave fcst:
:CPRAT:surface:0-3 hour ave fcst:
:ALBDO:surface:0-3 hour ave fcst:
:TCDC:entire atmosphere (considered as a single layer):0-3 hour ave fcst:
:TCDC:boundary layer cloud layer:0-3 hour ave fcst:
:GFLUX:surface:0-3 hour ave fcst:
:U-GWD:surface:0-3 hour ave fcst:
:V-GWD:surface:0-3 hour ave fcst:
:TMP:middle cloud top level:0-3 hour ave fcst:
:TMP:low cloud top level:0-3 hour ave fcst:
:TMP:high cloud top level:0-3 hour ave fcst:
:PRES:high cloud top level:0-3 hour ave fcst:
:PRES:middle cloud top level:0-3 hour ave fcst:
:PRES:low cloud top level:0-3 hour ave fcst:
:PRES:high cloud bottom level:0-3 hour ave fcst:
:PRES:middle cloud bottom level:0-3 hour ave fcst:
:PRES:low cloud bottom level:0-3 hour ave fcst:
:CWORK:entire atmosphere (considered as a single layer):0-3 hour ave fcst:
:DUVB:surface:0-3 hour ave fcst:
:CDUVB:surface:0-3 hour ave fcst:
:TMAX:2 m above ground:0-3 hour max fcst:
:TMIN:2 m above ground:0-3 hour min fcst:
42 changes: 42 additions & 0 deletions parm/product/gefs_parmlist_masteracc03.parm
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
:TSNOWP
:DLWRF:surface
:ULWRF:surface
:DSWRF:surface
:USWRF:surface
:USWRF:top
:ULWRF:top
:UFLX
:VFLX
:SHTFL
:LHTFL
:PRATE
:CPRAT
:ALBDO
:GFLUX
:U-GWD
:V-GWD
:TCDC:entire
:TCDC:boundary
:HCDC:high cloud layer:182-185 min
:LCDC:low cloud layer:182-185 min
:MCDC:middle cloud layer:182-185 min
:APCP
:ACPCP
:NCPCP
:TMIN
:TMAX
:DUVB
:CDUVB
:CWORK
:SNOHF
:SNOWC
:WATR
:TMP:middle cloud top
:TMP:low cloud top
:TMP:high cloud top
:PRES:high cloud top
:PRES:middle cloud top
:PRES:low cloud top
:PRES:high cloud bottom
:PRES:middle cloud bottom
:PRES:low cloud bottom
41 changes: 41 additions & 0 deletions parm/product/gefs_parmlist_masteracc06.parm
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
:WATR
:SNOWC
:SNOHF
:DLWRF:surface
:ULWRF:surface
:DSWRF:surface
:USWRF:surface
:USWRF:top
:ULWRF:top
:UFLX:surface
:VFLX:surface
:SHTFL:surface
:LHTFL:surface
:PRATE:surface:0
:CPRAT:surface:0
:ALBDO:surface
:TCDC:entire
:TCDC:boundary
:HCDC:high cloud layer:0-6
:MCDC:middle cloud layer:0-6
:LCDC:low cloud layer:0-6
:GFLUX:surface
:U-GWD:surface
:V-GWD:surface
:APCP:surface
:ACPCP:surface
:NCPCP:surface
:TMP:middle cloud top
:TMP:low cloud top
:TMP:high cloud top
:PRES:high cloud top
:PRES:middle cloud top
:PRES:low cloud top
:PRES:high cloud bottom
:PRES:middle cloud bottom
:PRES:low cloud bottom
:CWORK
:DUVB
:CDUVB
:TMAX
:TMIN
130 changes: 130 additions & 0 deletions scripts/exgefs_atmos_repair_replay.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
#! /usr/bin/env bash
# shellcheck disable=SC2312


Comment on lines +3 to +4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

source "${USHgfs}/preamble.sh"

cd "${DATA}" || exit 1

#COMIN_03 and {COMIN_ATMOS_MASTER} are directory containing the files that we want to extract
#Extract c00 files for f003 from PSL reanalysis data


fnh=03
echo "extracting f${fnh}"
oufile=${DATA}/gefs.t00z.master.grb2f0${fnh}

infile=${COMIN_03}/GFSPRS.GrbF03
if [[ -f "${infile}" ]]; then #check if input file exists before extraction
${WGRIB2} "${infile}" | grep "TSNOWP" | ${WGRIB2} -i "${infile}" -grib tmp
export err=$?; err_chk

${WGRIB2} tmp -for "2:2" -append -grib "${oufile}">/dev/null
export err=$?; err_chk

${WGRIB2} "${infile}" | grep ":APCP:surface" | ${WGRIB2} -i "${infile}" -grib tmp
export err=$?; err_chk

${WGRIB2} tmp -for "1:1" -append -grib "${oufile}">/dev/null
export err=$?; err_chk

${WGRIB2} "${infile}" | grep ":ACPCP:surface" | ${WGRIB2} -i "${infile}" -grib tmp
export err=$?; err_chk

${WGRIB2} tmp -for "1:1" -append -grib "${oufile}">/dev/null
export err=$?; err_chk

${WGRIB2} "${infile}" | grep ":NCPCP:surface" | ${WGRIB2} -i "${infile}" -grib tmp
export err=$?; err_chk

${WGRIB2} tmp -for "1:1" -append -grib "${oufile}">/dev/null
export err=$?; err_chk

${WGRIB2} "${infile}" | grep ":HCDC:high cloud layer:0" | ${WGRIB2} -i "${infile}" -append -grib "${oufile}">/dev/null
export err=$?; err_chk

${WGRIB2} "${infile}" | grep ":MCDC:middle cloud layer:0" | ${WGRIB2} -i "${infile}" -append -grib "${oufile}">/dev/null
export err=$?; err_chk

${WGRIB2} "${infile}" | grep ":LCDC:low cloud layer:0" | ${WGRIB2} -i "${infile}" -append -grib "${oufile}">/dev/null
export err=$?; err_chk

rm tmp
else
echo "FATAL ERROR: ${infile} does not exist"
export err=1; err_chk
Fixed Show fixed Hide fixed
fi

varlist=${varlist_FLXacc03} # Parameter table for f03 acc/ave/min/max variables (PSL data)
infile=${COMIN_03}/GFSFLX.GrbF03
if [[ -f "${infile}" ]]; then #check if input file exists before extraction
${WGRIB2} "${infile}" | grep -F -f "${varlist}" | ${WGRIB2} -i "${infile}" -append -grib "${oufile}">/dev/null
export err=$?; err_chk
else
echo "FATAL ERROR: ${infile} does not exist"
export err=1; err_chk
Fixed Show fixed Hide fixed
fi
# done


#Extract individual member files for f006 master data
fnh=006

echo "extracting f${fnh}"
infile=${COMIN_ATMOS_MASTER}/gefs.t00z.master.grb2f${fnh}
oufile=${DATA}/gefs.t00z.master.grb2f${fnh}

varlist=${varlist_masteracc06} # Parameter table for f06 acc/ave/min/max variables

if [[ -f "${infile}" ]]; then #check if input file exists before extraction

${WGRIB2} "${infile}" | grep -F -f "${varlist}" | ${WGRIB2} -i "${infile}" -append -grib "${oufile}"
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
export err=$?; err_chk
${WGRIB2} "${infile}" | grep "TSNOWP" | ${WGRIB2} -i "${infile}" -grib tmp
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
export err=$?; err_chk
${WGRIB2} tmp -for "2:2" -append -grib "${oufile}">/dev/null
export err=$?; err_chk
${WGRIB2} tmp -for "1:1" -grib TSNOWP1.dat
export err=$?; err_chk

else
echo "FATAL ERROR: ${infile} does not exist"
export err=1; err_chk
fi

export sorc_name=gefs_6h_ave_1mem.x

"${EXECgfs}/${sorc_name}" > sorc_name.exe.out
cat sorc_name.exe.out

#output f06
infile=${COMIN_ATMOS_MASTER}/gefs.t00z.master.grb2f006

${WGRIB2} "${infile}" -match_inv | grep -v -F -f "${varlist}" | ${WGRIB2} -i "${infile}" -grib out1.grb2
${WGRIB2} out1.grb2 -not "TSNOWP" -grib out2.grb2

cat out2.grb2 TSNOWP1.dat gefs.t00z.pgrb2af006 > out3.grb2
mv "${COMIN_ATMOS_MASTER}/gefs.t00z.master.grb2f006" "${COMIN_ATMOS_MASTER}/gefs.t00z.master.grb2f006_org"
mv out3.grb2 "${COMIN_ATMOS_MASTER}/gefs.t00z.master.grb2f006"

rm -fr out1.grb2 out2.grb2 TSNOWP*.dat

#output f03
varlist=${varlist_masteracc03} # Parameter table for f03 acc/ave/min/max variables
infile=${COMIN_ATMOS_MASTER}/gefs.t00z.master.grb2f003
#
${WGRIB2} "${infile}" | grep "TSNOWP" | ${WGRIB2} -i "${infile}" -grib TSNOWP2.dat
Fixed Show fixed Hide fixed
${WGRIB2} TSNOWP2.dat -for "1:1" -grib out1.grb2 >/dev/null
${WGRIB2} out1.grb2 -set_ftime "0-3 hour acc fcst" -grib TSNOWP1.dat

${WGRIB2} "${infile}" -match_inv | grep -v -F -f "${varlist}" | ${WGRIB2} -i "${infile}" -grib out2.grb2
Fixed Show fixed Hide fixed
${WGRIB2} out2.grb2 -set_ftime "3 hour fcst" -grib out3.grb2

cat out3.grb2 TSNOWP1.dat gefs.t00z.pgrb2af003 > gefs.t00z.master.grb2f003

${NCP} "${COMIN_ATMOS_MASTER}/gefs.t00z.master.grb2f003" "${COMOUT_ATMOS_MASTER}/gefs.t00z.master.grb2f003_org"
${NCP} gefs.t00z.master.grb2f003 "${COMOUT_ATMOS_MASTER}/gefs.t00z.master.grb2f003"

rm -fr out1.grb2 out2.grb2 out3.grb2

exit
2 changes: 1 addition & 1 deletion sorc/link_workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ cd "${HOMEgfs}/exec" || exit 1
for utilexe in fbwndgfs.x gaussian_sfcanl.x gfs_bufr.x supvit.x syndat_getjtbul.x \
syndat_maksynrc.x syndat_qctropcy.x tocsbufr.x overgridid.x rdbfmsua.x \
mkgfsawps.x enkf_chgres_recenter_nc.x tave.x vint.x ocnicepost.x webtitle.x \
ensadd.x ensppf.x ensstat.x wave_stat.x
ensadd.x ensppf.x ensstat.x wave_stat.x gefs_6h_ave_1mem.x
do
[[ -s "${utilexe}" ]] && rm -f "${utilexe}"
${LINK_OR_COPY} "${HOMEgfs}/sorc/gfs_utils.fd/install/bin/${utilexe}" .
Expand Down
1 change: 1 addition & 0 deletions workflow/applications/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def __init__(self, conf: Configuration) -> None:
self.do_goes = _base.get('DO_GOES', False)
self.do_mos = _base.get('DO_MOS', False)
self.do_extractvars = _base.get('DO_EXTRACTVARS', False)
self.do_repair_replay = _base.get('DO_REPAIR_REPLAY', False)
EricSinsky-NOAA marked this conversation as resolved.
Show resolved Hide resolved

self.do_hpssarch = _base.get('HPSSARCH', False)

Expand Down
Loading
Loading