-
Notifications
You must be signed in to change notification settings - Fork 202
Adding wave_stat job scripts, Second step to PR #3846 #4121
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
Conversation
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.
ShellCheck found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
@sbanihash |
@aerorahul Working on it, Thanks for the guidance. |
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.
Similar changes are required in the other scripts.
- Please follow shellcheck suggested warnings. It might only point a few errors that are repeated, and not flag subsequent warnings.
- Check variables are defined before being used
- Use cpfs and cpreq where files are being copied from DATA to COM or when they are required.
export err=1 | ||
err_exit "Requires NTASKS to be set" | ||
fi | ||
MEMDIR="ensstat" YMD=${PDY} HH=${cyc} declare_from_tmpl COMOUT_WAVE_STATION_ENS:COM_WAVE_STATION_TMPL |
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.
MEMDIR="ensstat" YMD=${PDY} HH=${cyc} declare_from_tmpl COMOUT_WAVE_STATION_ENS:COM_WAVE_STATION_TMPL | |
MEMDIR="ensstat" YMD=${PDY} HH=${cyc} declare_from_tmpl COMOUT_WAVE_STATION_ENS:COM_WAVE_STATION_TMPL |
valid_time=$(date -u -d "${PDY} ${cyc}" "+%Y%m%d%H") | ||
ymdh_init=$(date -u -d "${valid_time:0:8} ${valid_time:8:2} - ${WAVHINDH} hours" "+%Y%m%d%H") | ||
|
||
mkdir output_${ymdh_init} |
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.
mkdir output_${ymdh_init} | |
mkdir "output_${ymdh_init}" |
ymdh_init=$(date -u -d "${valid_time:0:8} ${valid_time:8:2} - ${WAVHINDH} hours" "+%Y%m%d%H") | ||
|
||
mkdir output_${ymdh_init} | ||
cd output_${ymdh_init} || exit |
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.
cd output_${ymdh_init} || exit | |
cd "output_${ymdh_init}" || exit |
|
||
|
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.
dir_var="${COMOUT_WAVE_STATION_ENS}" | ||
|
||
# Ensure directory exists before proceeding | ||
if [ ! -d "$dir_var" ]; then |
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.
if [ ! -d "$dir_var" ]; then | |
if [[ ! -d "${dir_var}" ]]; then |
# | ||
if [ "$SENDDBN" = 'YES' ] | ||
then | ||
MODCOM=$(echo ${NET}_${COMPONENT} | tr '[a-z]' '[A-Z]') |
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.
MODCOM=$(echo ${NET}_${COMPONENT} | tr '[a-z]' '[A-Z]') | |
MODCOM="${NET}_${COMPONENT^^}" |
if [ "$SENDDBN" = 'YES' ] | ||
then | ||
MODCOM=$(echo ${NET}_${COMPONENT} | tr '[a-z]' '[A-Z]') | ||
$DBNROOT/bin/dbn_alert MODEL ${MODCOM}_GB2 $job ${ROTDIR}/${RUN}.${PDY}/${cyc}/${ENSTAG}/products/wave/station/${RUN}.t${cyc}z.bull_tar |
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.
$DBNROOT/bin/dbn_alert MODEL ${MODCOM}_GB2 $job ${ROTDIR}/${RUN}.${PDY}/${cyc}/${ENSTAG}/products/wave/station/${RUN}.t${cyc}z.bull_tar | |
"${DBNROOT}/bin/dbn_alert" MODEL "${MODCOM}_GB2" "${job}" "${ROTDIR}/${RUN}.${PDY}/${cyc}/${ENSTAG}/products/wave/station/${RUN}.t${cyc}z.bull_tar" |
then | ||
MODCOM=$(echo ${NET}_${COMPONENT} | tr '[a-z]' '[A-Z]') | ||
$DBNROOT/bin/dbn_alert MODEL ${MODCOM}_GB2 $job ${ROTDIR}/${RUN}.${PDY}/${cyc}/${ENSTAG}/products/wave/station/${RUN}.t${cyc}z.bull_tar | ||
$DBNROOT/bin/dbn_alert MODEL ${MODCOM}_GB2 $job ${ROTDIR}/${RUN}.${PDY}/${cyc}/${ENSTAG}/products/wave/station/${RUN}.t${cyc}z.station_tar |
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.
$DBNROOT/bin/dbn_alert MODEL ${MODCOM}_GB2 $job ${ROTDIR}/${RUN}.${PDY}/${cyc}/${ENSTAG}/products/wave/station/${RUN}.t${cyc}z.station_tar | |
"${DBNROOT}/bin/dbn_alert" MODEL "${MODCOM}_GB2" "${job}" "${ROTDIR}/${RUN}.${PDY}/${cyc}/${ENSTAG}/products/wave/station/${RUN}.t${cyc}z.station_tar" |
fi | ||
# | ||
|
||
echo "$job completed normally" |
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.
echo "$job completed normally" | |
echo "${job} completed normally" |
|
||
echo "$job completed normally" | ||
# | ||
echo "Ending at : `date`" |
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.
echo "Ending at : `date`" | |
echo "Ending at : $(date)" |
Do not use backticks
Description
This PR will add the missing scripts that will complete PR#3846 in order to add the capability to add ensemble mean, spread and prob gridded and point outputs to the gefs application.
Type of change
Change characteristics
How has this been tested?
Yes
/lfs/h2/emc/couple/noscrub/saeideh.banihashemi/WAVE_INFRST/RUNTESTS
Added products could be seen in the C48_S2SWA_gefs test at this location on Cactus:
/lfs/h2/emc/couple/noscrub/saeideh.banihashemi/WAVE_INFRST/RUNTESTS/COMROOT/C48_S2SWA_gefs_wavestat2/gefs.20210323/12/ensstat/products/wave
gridded files;
gridded/gefs.t12z.mean.global.5p00.f***.grib2 gridded/gefs.t12z.prob.global.5p00.f***.grib2 gridded/gefs.t12z.spread.global.5p00.f***.grib2
station files;
gefs.t12z.bull_tar gefs.t12z.station_tar
Checklist