-
Notifications
You must be signed in to change notification settings - Fork 166
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
base: feature/gefs_reforecast
Are you sure you want to change the base?
Changes from 2 commits
8181536
08f4f81
fbe4688
e8d7fa0
225eab1
e7b5e7f
0afdfbe
e7c3f9b
c969dda
5e25361
3be3217
e447511
092a787
8d03a14
9624baa
22792e3
bae7d72
5f307ca
8719f90
33391a9
3bde14c
d366fcd
ed47548
416e0bc
e7f0141
9d89ef9
bb436b7
c119f81
251410f
528a2e0
9dda05a
57d24c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,95 @@ | ||||||||||||
#! /usr/bin/env bash | ||||||||||||
# | ||||||||||||
# | ||||||||||||
##################################################################### | ||||||||||||
# 8/14/2024, Hong Guan Scripts to repair F0306 for GEFSv13 reforecasts | ||||||||||||
#################################################################### | ||||||||||||
source "${HOMEgfs}/ush/preamble.sh" | ||||||||||||
source "${HOMEgfs}/ush/jjob_header.sh" -e "repairf0306" -c "base repairf0306" | ||||||||||||
|
||||||||||||
#################################### | ||||||||||||
# obtain unique process id (pid) and make temp directory | ||||||||||||
#################################### | ||||||||||||
|
||||||||||||
export pid=$$ | ||||||||||||
export date=${CDATE} | ||||||||||||
yyyymmdd=`echo $date | cut -c1-8` | ||||||||||||
Check warning Code scanning / shellcheck yyyymmdd appears unused. Verify use (or export if used externally). Warning
yyyymmdd appears unused. Verify use (or export if used externally).
Check notice Code scanning / shellcheck Use $(...) notation instead of legacy backticks .... Note
Use $(...) notation instead of legacy backticks ....
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||||
echo `date` $0 `date -u` begin | ||||||||||||
Check warning Code scanning / shellcheck Quote this to prevent word splitting. Warning
Quote this to prevent word splitting.
Check notice Code scanning / shellcheck Use $(...) notation instead of legacy backticks .... Note
Use $(...) notation instead of legacy backticks ....
Check notice Code scanning / shellcheck Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore). Note
Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check warning Code scanning / shellcheck Quote this to prevent word splitting. Warning
Quote this to prevent word splitting.
Check notice Code scanning / shellcheck Use $(...) notation instead of legacy backticks .... Note
Use $(...) notation instead of legacy backticks ....
Check notice Code scanning / shellcheck Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore). Note
Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).
|
||||||||||||
|
||||||||||||
#################################### | ||||||||||||
# File To Log Msgs | ||||||||||||
#################################### | ||||||||||||
export jlogfile=${jlogfile:-$COMROOT/logs/jlogfiles/jlogfile.${job}.${pid}} | ||||||||||||
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||||
echo $jlogfile | ||||||||||||
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||||
|
||||||||||||
#################################### | ||||||||||||
# Determine Job Output Name on System | ||||||||||||
#################################### | ||||||||||||
export outid="LL$job" | ||||||||||||
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||||
export jobid="${outid}.o${pid}" | ||||||||||||
export pgmout="OUTPUT.${pid}" | ||||||||||||
export pgmerr=errfile | ||||||||||||
echo $outid,$jobid,$pgmout,$pgmerr | ||||||||||||
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
Check notice Code scanning / shellcheck Prefer double quoting even when variables don't contain special characters. Note
Prefer double quoting even when variables don't contain special characters.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
Check notice Code scanning / shellcheck Prefer double quoting even when variables don't contain special characters. Note
Prefer double quoting even when variables don't contain special characters.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||||
|
||||||||||||
#################################### | ||||||||||||
#################################### | ||||||||||||
# Specify Execution Areas | ||||||||||||
#################################### | ||||||||||||
export HOMEgefs=${HOMEgfs} | ||||||||||||
export EXECacc=${EXECacc:-$HOMEgefs/exec} | ||||||||||||
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||||
export SORCacc=${SORCacc:-$HOMEgefs/sorc/gefs_postacc.fd} | ||||||||||||
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||||
export SCRIPTSens_acc=$HOMEgefs/scripts | ||||||||||||
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||||
export FIXens_acc=${FIXacc:-$HOMEgefs/fix} | ||||||||||||
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||||
|
||||||||||||
export PARMgefs=$HOMEgefs/rocoto/parm | ||||||||||||
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||||
echo $PARMgefs | ||||||||||||
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||||
|
||||||||||||
# Construct COM variables from templates | ||||||||||||
#YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COM_ATMOS_ANALYSIS COM_ATMOS_HISTORY COM_ATMOS_MASTER | ||||||||||||
YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COM_ATMOS_MASTER | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
|
||||||||||||
|
||||||||||||
############################## | ||||||||||||
# Run setpdy and initialize PDY variables | ||||||||||||
############################## | ||||||||||||
# | ||||||||||||
#export COMIN_master=${COMIN_master:-$COMROOT/$PSLOT/gefs.$PDY/00/mem001/model_data/atmos/master} | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
export COMIN_master=${COMIN_master:-$COM_ATMOS_MASTER} | ||||||||||||
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||||
export COMIN_00and03=$HOMEgefs/anl | ||||||||||||
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||||
|
||||||||||||
#################################### | ||||||||||||
# Create member list | ||||||||||||
#################################### | ||||||||||||
|
||||||||||||
#export homesyndir=$HOMEacc | ||||||||||||
|
||||||||||||
echo | ||||||||||||
env | sort | ||||||||||||
Check notice Code scanning / shellcheck Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore). Note
Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).
|
||||||||||||
echo | ||||||||||||
|
||||||||||||
######################################################## | ||||||||||||
# Execute the acc script. | ||||||||||||
export cmodel=ens | ||||||||||||
export ymdh=${date} | ||||||||||||
|
||||||||||||
#msg="Begin job for $job" | ||||||||||||
#postmsg "$jlogfile" "$msg" | ||||||||||||
|
||||||||||||
echo ${ymdh} | ||||||||||||
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
|
||||||||||||
$SCRIPTSens_acc/gefs_atmos_f0306.sh ${ymdh} ${DATA} > fv3gefsrf_0306acc.${cmodel}.${ymdh}.out | ||||||||||||
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check notice Code scanning / shellcheck Prefer double quoting even when variables don't contain special characters. Note
Prefer double quoting even when variables don't contain special characters.
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
|
||||||||||||
|
||||||||||||
################################ | ||||||||||||
msg="JOB COMPLETED NORMALLY" | ||||||||||||
Check warning Code scanning / shellcheck msg appears unused. Verify use (or export if used externally). Warning
msg appears unused. Verify use (or export if used externally).
|
||||||||||||
#postmsg "$jlogfile" "$msg" | ||||||||||||
|
||||||||||||
exit | ||||||||||||
|
||||||||||||
############################## | ||||||||||||
# Remove the Temporary working directory | ||||||||||||
############################## | ||||||||||||
if [[ $KEEPDATA != "YES" ]]; then | ||||||||||||
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||||
cd $DATAROOT | ||||||||||||
Check warning Code scanning / shellcheck Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Warning
Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
Check notice Code scanning / shellcheck Command appears to be unreachable. Check usage (or ignore if invoked indirectly). Note
Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||||
rm -rf $DATA | ||||||||||||
Check notice Code scanning / shellcheck Command appears to be unreachable. Check usage (or ignore if invoked indirectly). Note
Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||||
fi | ||||||||||||
|
||||||||||||
echo `date` $job completed | ||||||||||||
Check notice Code scanning / shellcheck Command appears to be unreachable. Check usage (or ignore if invoked indirectly). Note
Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
Check warning Code scanning / shellcheck Quote this to prevent word splitting. Warning
Quote this to prevent word splitting.
Check notice Code scanning / shellcheck Use $(...) notation instead of legacy backticks .... Note
Use $(...) notation instead of legacy backticks ....
Check notice Code scanning / shellcheck Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore). Note
Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).
Check notice Code scanning / shellcheck Command appears to be unreachable. Check usage (or ignore if invoked indirectly). Note
Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
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_ufswm_modules.sh | ||||||
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
|
||||||
status=$? | ||||||
[[ ${status} -ne 0 ]] && exit ${status} | ||||||
Check notice Code scanning / shellcheck Prefer double quoting even when variables don't contain special characters. Note
Prefer double quoting even when variables don't contain special characters.
|
||||||
|
||||||
export job="repairf0306" | ||||||
export jobid="${job}.$$" | ||||||
|
||||||
############################################################### | ||||||
echo | ||||||
echo "=============== START TO RUN EXTRACTVARS ===============" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
# Execute the JJOB | ||||||
${HOMEgfs}/jobs/JGEFS_ATMOS_ACC | ||||||
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
|
||||||
status=$? | ||||||
[[ ${status} -ne 0 ]] && exit ${status} | ||||||
Check notice Code scanning / shellcheck Prefer double quoting even when variables don't contain special characters. Note
Prefer double quoting even when variables don't contain special characters.
|
||||||
|
||||||
exit 0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#! /usr/bin/env bash | ||
|
||
########## config.repairf0306 ######### | ||
# repairf0306 specific | ||
|
||
echo "BEGIN: config.repairf0306" | ||
|
||
|
||
. "${EXPDIR}/config.resources" repairf0306 | ||
|
||
echo "END: config.repairf0306" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,6 +77,14 @@ case ${step} in | |
export memory="1GB" | ||
;; | ||
|
||
"repairf0306") | ||
export wtime_repairf0306="00:10:00" | ||
export npe_repairf0306=1 | ||
export nth_repairf0306=1 | ||
export npe_node_repairf0306=$(( npe_node_max / nth_repairf0306 )) | ||
export memory_repairf0306="2GB" | ||
;; | ||
|
||
"fcst" | "efcs") | ||
export is_exclusive=True | ||
|
||
|
@@ -186,14 +194,15 @@ case ${step} in | |
declare -x "walltime"="06:00:00" | ||
;; | ||
*) | ||
echo "FATAL ERROR: Resources not defined for job ${step} at resolution ${CASE}" | ||
echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${CASE}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why was this changed? |
||
exit 4 | ||
;; | ||
esac | ||
|
||
unset NTASKS_TOT | ||
;; | ||
|
||
|
||
"atmos_products") | ||
export walltime="00:15:00" | ||
export ntasks=24 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please fix the indentation in this script. Also, there is quite a bit of repetition. Consider consolidating it with loops. |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,191 @@ | ||||||||||
#!/bin/ksh | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This script should start like this. A brief description of this script should be added as well.
Suggested change
|
||||||||||
|
||||||||||
set -xa | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The preamble is responsible for handling |
||||||||||
cdate=$1 | ||||||||||
DATA=$2 | ||||||||||
|
||||||||||
foutmax=6 #last lead hour to extract | ||||||||||
Check warning Code scanning / shellcheck foutmax appears unused. Verify use (or export if used externally). Warning
foutmax appears unused. Verify use (or export if used externally).
|
||||||||||
cd $DATA | ||||||||||
Check warning Code scanning / shellcheck Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Warning
Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||
|
||||||||||
ddate=`echo $cdate | cut -c1-8` | ||||||||||
Check warning Code scanning / shellcheck ddate appears unused. Verify use (or export if used externally). Warning
ddate appears unused. Verify use (or export if used externally).
Check notice Code scanning / shellcheck Use $(...) notation instead of legacy backticks .... Note
Use $(...) notation instead of legacy backticks ....
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||
YYYY=`echo $cdate | cut -c1-4` | ||||||||||
Check warning Code scanning / shellcheck YYYY appears unused. Verify use (or export if used externally). Warning
YYYY appears unused. Verify use (or export if used externally).
Check notice Code scanning / shellcheck Use $(...) notation instead of legacy backticks .... Note
Use $(...) notation instead of legacy backticks ....
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||
MONTH=`echo $cdate | cut -c5-6` | ||||||||||
Check warning Code scanning / shellcheck MONTH appears unused. Verify use (or export if used externally). Warning
MONTH appears unused. Verify use (or export if used externally).
Check notice Code scanning / shellcheck Use $(...) notation instead of legacy backticks .... Note
Use $(...) notation instead of legacy backticks ....
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||
DAY=`echo $cdate | cut -c7-8` | ||||||||||
Check warning Code scanning / shellcheck DAY appears unused. Verify use (or export if used externally). Warning
DAY appears unused. Verify use (or export if used externally).
Check notice Code scanning / shellcheck Use $(...) notation instead of legacy backticks .... Note
Use $(...) notation instead of legacy backticks ....
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||
|
||||||||||
# COMIN_00and03 and COMIN_master are directory containing the files that we want to extract | ||||||||||
#Extract c00 files for f003 from PSL reanalysis data | ||||||||||
|
||||||||||
for fnh in 03; do | ||||||||||
Check warning Code scanning / shellcheck This loop will only ever run once. Bad quoting or missing glob/expansion? Warning
This loop will only ever run once. Bad quoting or missing glob/expansion?
|
||||||||||
echo "extracting f${fnh}" | ||||||||||
oufile=$DATA/gefs.t00z.master.grb2f0${fnh} | ||||||||||
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||
|
||||||||||
infile=$COMIN_00and03/GFSPRS.GrbF03 | ||||||||||
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||
if [ -f $infile ]; then #check if input file exists before extraction | ||||||||||
Check notice Code scanning / shellcheck Prefer [[ ]] over [ ] for tests in Bash/Ksh. Note
Prefer [[ ]] over [ ] for tests in Bash/Ksh.
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||
|
||||||||||
$WGRIB2 $infile | grep "TSNOWP" | $WGRIB2 -i $infile -grib tmp | ||||||||||
Check notice Code scanning / shellcheck Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore). Note
Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
Check notice Code scanning / shellcheck Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore). Note
Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||
$WGRIB2 tmp -for "2:2" -append -grib $oufile>/dev/null | ||||||||||
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||||||||||
|
||||||||||
$WGRIB2 $infile | grep ":APCP:surface" | $WGRIB2 -i $infile -grib tmp | ||||||||||
Check notice Code scanning / shellcheck Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore). Note
Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).
|
||||||||||
$WGRIB2 tmp -for "1:1" -append -grib $oufile>/dev/null | ||||||||||
|
||||||||||
$WGRIB2 $infile | grep ":ACPCP:surface" | $WGRIB2 -i $infile -grib tmp | ||||||||||
$WGRIB2 tmp -for "1:1" -append -grib $oufile>/dev/null | ||||||||||
|
||||||||||
$WGRIB2 $infile | grep ":NCPCP:surface" | $WGRIB2 -i $infile -grib tmp | ||||||||||
$WGRIB2 tmp -for "1:1" -append -grib $oufile>/dev/null | ||||||||||
|
||||||||||
$WGRIB2 $infile | grep ":HCDC:high cloud layer:0" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":MCDC:middle cloud layer:0" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":LCDC:low cloud layer:0" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
rm tmp | ||||||||||
else | ||||||||||
echo "$infile does not exist" | ||||||||||
fi | ||||||||||
|
||||||||||
infile=$COMIN_00and03/GFSFLX.GrbF03 | ||||||||||
if [ -f $infile ]; then #check if input file exists before extraction | ||||||||||
$WGRIB2 $infile | grep "WATR" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "SNOWC" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "SNOHF" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":DLWRF:surface:0" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":ULWRF:surface:0" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":DSWRF:surface:0" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":USWRF:surface:0" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":USWRF:top" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":ULWRF:top" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":UFLX:surface" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":VFLX:surface" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":SHTFL:surface:0" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":LHTFL:surface:0" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":PRATE:surface:0" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":CPRAT:surface:0" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":ALBDO:surface" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":TCDC:entire" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":TCDC:boundary" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":GFLUX:surface:0" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":U-GWD:surface" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":V-GWD:surface" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "TMP:middle cloud top" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "TMP:low cloud top" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "TMP:high cloud top" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "PRES:high cloud top" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "PRES:middle cloud top" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "PRES:low cloud top" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "PRES:high cloud bottom" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "PRES:middle cloud bottom" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "PRES:low cloud bottom" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "CWORK" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "DUVB" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "CDUVB" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "TMAX" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "TMIN" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
else | ||||||||||
echo "$infile does not exist" | ||||||||||
fi | ||||||||||
done #fnh | ||||||||||
|
||||||||||
#Extract individual member files for f006 master data | ||||||||||
fnh=006 | ||||||||||
|
||||||||||
echo "extracting f${fnh}" | ||||||||||
infile=$COMIN_master/gefs.t00z.master.grb2f${fnh} | ||||||||||
oufile=$DATA/gefs.t00z.master.grb2f${fnh} | ||||||||||
|
||||||||||
if [ -f $infile ]; then #check if input file exists before extraction | ||||||||||
# rm -f $outfile/gefs.t00z.master.grb2f${fnh} #remove outfile if it already exists before extraction | ||||||||||
$WGRIB2 $infile | grep "TSNOWP" | $WGRIB2 -i $infile -grib tmp | ||||||||||
$WGRIB2 tmp -for "2:2" -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "WATR" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "SNOWC" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "SNOHF" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":DLWRF:surface" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":ULWRF:surface" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":DSWRF:surface" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":USWRF:surface" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":USWRF:top" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":ULWRF:top" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":UFLX:surface" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":VFLX:surface" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":SHTFL:surface" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":LHTFL:surface" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":PRATE:surface:0" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":CPRAT:surface:0" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":ALBDO:surface" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":TCDC:entire" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":TCDC:boundary" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":HCDC:high cloud layer:0-6" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":MCDC:middle cloud layer:0-6" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":LCDC:low cloud layer:0-6" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":GFLUX:surface" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":U-GWD:surface" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":V-GWD:surface" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":APCP:surface" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":ACPCP:surface" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep ":NCPCP:surface" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "TMP:middle cloud top" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "TMP:low cloud top" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "TMP:high cloud top" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "PRES:high cloud top" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "PRES:middle cloud top" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "PRES:low cloud top" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "PRES:high cloud bottom" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "PRES:middle cloud bottom" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "PRES:low cloud bottom" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "CWORK" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "DUVB" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "CDUVB" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "TMAX" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
$WGRIB2 $infile | grep "TMIN" | $WGRIB2 -i $infile -append -grib $oufile>/dev/null | ||||||||||
|
||||||||||
else | ||||||||||
echo "$infile does not exist" | ||||||||||
fi | ||||||||||
|
||||||||||
export exec_dir=$EXECacc | ||||||||||
export sorc_dir=$SORCacc | ||||||||||
export sorc_name=gefs_6h_ave_1mem | ||||||||||
|
||||||||||
# cd $DATA | ||||||||||
|
||||||||||
$exec_dir/$sorc_name >sorc_name.exe.out | ||||||||||
cat sorc_name.exe.out | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @WalterKolczynski-NOAA, @HongGuan-NOAA has source code for this task that has not been added to this PR. Should her source code be added to gfs-utils in a similar manner as the other GEFS-specific programs (e.g. gfs-utils PR #52)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. I thought I had already talked with Hong about opening a PR. |
||||||||||
|
||||||||||
#output f06 | ||||||||||
infile=$COMIN_master/gefs.t00z.master.grb2f006 | ||||||||||
|
||||||||||
$WGRIB2 $infile | grep "TSNOWP" | $WGRIB2 -i $infile -grib TSNOWP2.dat | ||||||||||
$WGRIB2 TSNOWP2.dat -for "1:1" -append -grib TSNOWP1.dat >/dev/null | ||||||||||
|
||||||||||
$WGRIB2 $infile -not "(ULWRF|USWRF)" -not "(TSNOWP|DLWRF|DSWRF|UFLX|VFLX|SHTFL|LHTFL|PRATE|CPRAT|ALBDO|GFLUX|U-GWD|V-GWD)" -not "TCDC:(entire|boundary)" -not "HCDC:high cloud layer:0-6" -not "LCDC:low cloud layer:0-6" -not "MCDC:middle cloud layer:0-6" -not "(APCP|ACPCP|NCPCP)" -not "(TMIN|TMAX|DUVB|CDUVB|CWORK|SNOHF|SNOWC|WATR)" -not "(TMP:middle cloud top|TMP:low cloud top|TMP:high cloud top)" -not "(PRES:high cloud top|PRES:middle cloud top|PRES:low cloud top|PRES:high cloud bottom|PRES:middle cloud bottom|PRES:low cloud bottom)" -grib out1.grb2 | ||||||||||
|
||||||||||
cat out1.grb2 gefs.t00z.pgrb2af006 TSNOWP1.dat > out2.grb | ||||||||||
|
||||||||||
mv $COMIN_master/gefs.t00z.master.grb2f006 $COMIN_master/gefs.t00z.master.grb2f006_org | ||||||||||
mv $COMIN_master/gefs.t00z.master.grb2if006 $COMIN_master/gefs.t00z.master.grb2if006_org | ||||||||||
|
||||||||||
mv out2.grb $COMIN_master/gefs.t00z.master.grb2f006 | ||||||||||
$GRB2INDEX $COMIN_master/gefs.t00z.master.grb2f006 $COMIN_master/gefs.t00z.master.grb2if006 | ||||||||||
|
||||||||||
rm -fr out1.grb2 out2.grb TSNOWP*.dat | ||||||||||
|
||||||||||
#output f03 | ||||||||||
infile=$COMIN_master/gefs.t00z.master.grb2f003 | ||||||||||
# | ||||||||||
$WGRIB2 $infile | grep "TSNOWP" | $WGRIB2 -i $infile -grib TSNOWP2.dat | ||||||||||
$WGRIB2 TSNOWP2.dat -for "1:1" -grib out.grb >/dev/null | ||||||||||
$WGRIB2 out.grb -set_ftime "0-3 hour acc fcst" -grib TSNOWP1.dat | ||||||||||
|
||||||||||
$WGRIB2 $infile -not "(TSNOWP|ULWRF|USWRF)" -not "(DLWRF|DSWRF|UFLX|VFLX|SHTFL|LHTFL|PRATE|CPRAT|ALBDO|GFLUX|U-GWD|V-GWD)" -not "TCDC:(entire|boundary)" -not "HCDC:high cloud layer:182-185 min" -not "LCDC:low cloud layer:182-185 min" -not "MCDC:middle cloud layer:182-185 min" -not "(APCP|ACPCP|NCPCP)" -not "(TMIN|TMAX|DUVB|CDUVB|CWORK|SNOHF|SNOWC|WATR)" -not "(TMP:middle cloud top|TMP:low cloud top|TMP:high cloud top)" -not "(PRES:high cloud top|PRES:middle cloud top|PRES:low cloud top|PRES:high cloud bottom|PRES:middle cloud bottom|PRES:low cloud bottom)" -grib out1.grb | ||||||||||
|
||||||||||
$WGRIB2 out1.grb -set_ftime "3 hour fcst" -grib out2.grb | ||||||||||
cat out2.grb gefs.t00z.pgrb2af003 TSNOWP1.dat > out3.grb | ||||||||||
|
||||||||||
mv $COMIN_master/gefs.t00z.master.grb2f003 $COMIN_master/gefs.t00z.master.grb2f003_org | ||||||||||
mv $COMIN_master/gefs.t00z.master.grb2if003 $COMIN_master/gefs.t00z.master.grb2if003_org | ||||||||||
|
||||||||||
mv out3.grb $COMIN_master/gefs.t00z.master.grb2f003 | ||||||||||
$GRB2INDEX $COMIN_master/gefs.t00z.master.grb2f003 $COMIN_master/gefs.t00z.master.grb2if003 | ||||||||||
|
||||||||||
rm -fr out.grb out1.grb out2.grb | ||||||||||
|
||||||||||
exit |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ def _get_app_configs(self): | |
""" | ||
Returns the config_files that are involved in gefs | ||
""" | ||
configs = ['stage_ic', 'fcst', 'atmos_products', 'arch'] | ||
configs = ['stage_ic', 'fcst', 'repairf0306', 'atmos_products', 'arch'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we call the new job (and associated scripts) |
||
|
||
if self.nens > 0: | ||
configs += ['efcs', 'atmos_ensstat'] | ||
|
@@ -59,6 +59,8 @@ def get_task_names(self): | |
if self.nens > 0: | ||
tasks += ['efcs'] | ||
|
||
tasks += ['repairf0306'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this task should be added to the workflow only for replay cases. This task should probably be conditioned. I suggest reviewing the extractvars task to see how a task can be made optional in the workflow. |
||
|
||
tasks += ['atmos_prod'] | ||
|
||
if self.nens > 0: | ||
|
@@ -76,9 +78,14 @@ def get_task_names(self): | |
tasks += ['wavepostbndpnt', 'wavepostbndpntbll'] | ||
tasks += ['wavepostpnt'] | ||
|
||
<<<<<<< HEAD | ||
|
||
return {f"{self._base['CDUMP']}": tasks} | ||
======= | ||
if self.do_extractvars: | ||
tasks += ['extractvars'] | ||
|
||
tasks += ['arch'] | ||
|
||
return {f"{self._base['RUN']}": tasks} | ||
>>>>>>> EMC/develop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please just use
HOMEgfs
instead of definingHOMEgefs
.