Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 2 additions & 4 deletions .github/workflows/bash_code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Install shfmt
uses: mfinelli/setup-shfmt@v4
- name: shfmt scan
run: shfmt -d dev/jobs dev/job_cards dev/scripts dev/ush ush
run: shfmt -d dev/jobs dev/job_cards dev/scripts dev/ush gempak ush

shellcheck:
runs-on: ubuntu-22.04
Expand All @@ -64,6 +64,7 @@ jobs:
dev/job_cards
dev/scripts
dev/ush
gempak
ush
pattern: |
config.*
Expand Down Expand Up @@ -100,6 +101,3 @@ jobs:
*.env
*.sh
*.bash



4 changes: 2 additions & 2 deletions gempak/fix/gfs_meta
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ ${HOMEgfs}/gempak/ush/gfs_meta_trop.sh 384
${HOMEgfs}/gempak/ush/gfs_meta_usext.sh 384
${HOMEgfs}/gempak/ush/gfs_meta_mar_ql.sh 24 48 96 180
${HOMEgfs}/gempak/ush/gfs_meta_mar_comp.sh 126
${HOMEgfs}/gempak/ush/gfs_meta_opc_na_ver 126
${HOMEgfs}/gempak/ush/gfs_meta_opc_np_ver 126
${HOMEgfs}/gempak/ush/gfs_meta_opc_na_ver.sh 126
${HOMEgfs}/gempak/ush/gfs_meta_opc_np_ver.sh 126
${HOMEgfs}/gempak/ush/gfs_meta_mar_atl.sh 180
${HOMEgfs}/gempak/ush/gfs_meta_mar_pac.sh 180
${HOMEgfs}/gempak/ush/gfs_meta_mar_ver.sh 48
Expand Down
13 changes: 7 additions & 6 deletions gempak/ush/gdas_ecmwf_meta_ver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

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

export pgm=gdplot2_nc;. prep_step
export pgm=gdplot2_nc
source prep_step

cyc2=12
device="nc | ecmwfver.meta"
Expand All @@ -28,7 +29,7 @@ fcsthr="0600f006"
areas="SAM NAM"

for area in ${areas}; do
if [[ "${area}" == "NAM" ]] ; then
if [[ "${area}" == "NAM" ]]; then
garea="5.1;-124.6;49.6;-11.9"
proj="STR/90.0;-95.0;0.0"
latlon="0"
Expand All @@ -39,7 +40,7 @@ for area in ${areas}; do
latlon="1/10/1/2/10;10"
run=" "
fi
for (( fhr=24; fhr<=168; fhr+=24 )); do
for ((fhr = 24; fhr <= 168; fhr += 24)); do
dgdattim=$(printf "f%03d" "${fhr}")
sdatenum=$(date --utc +%y%m%d -d "${PDY} ${cyc2} - ${fhr} hours")

Expand Down Expand Up @@ -142,19 +143,19 @@ export err=$?
# WHEN IT CAN NOT PRODUCE THE DESIRED GRID. CHECK
# FOR THIS CASE HERE.
#####################################################
if (( err != 0 )) || [[ ! -s ecmwfver.meta ]]; then
if [[ "${err}" -ne 0 ]] || [[ ! -s ecmwfver.meta ]]; then
echo "FATAL ERROR: Failed to create ecmwf meta file"
exit "${err}"
fi

mv ecmwfver.meta "${COMOUT_ATMOS_GEMPAK_META}/ecmwfver_${PDY}_${cyc2}"
export err=$?
if (( err != 0 )) ; then
if [[ "${err}" -ne 0 ]]; then
echo "FATAL ERROR: Failed to move meta file to ${COMOUT_ATMOS_GEMPAK_META}/ecmwfver_${PDY}_${cyc2}"
exit "${err}"
fi

if [[ "${SENDDBN}" == "YES" ]] ; then
if [[ "${SENDDBN}" == "YES" ]]; then
"${DBNROOT}/bin/dbn_alert" MODEL ECMWFVER_HPCMETAFILE "${job}" \
"${COMOUT_ATMOS_GEMPAK_META}/ecmwfver_${PDY}_${cyc2}"
fi
Expand Down
23 changes: 12 additions & 11 deletions gempak/ush/gdas_meta_loop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@ if [[ ! -L "${COMIN}" ]]; then
${NLN} "${COMIN_ATMOS_GEMPAK_1p00}" "${COMIN}"
fi

if [[ "${envir}" == "para" ]] ; then
export m_title="GDASP"
if [[ "${envir}" == "para" ]]; then
export m_title="GDASP"
else
export m_title="GDAS"
export m_title="GDAS"
fi

export pgm=gdplot2_nc;. prep_step
export pgm=gdplot2_nc
source prep_step

for (( fhr=24; fhr<=144; fhr+=24 )); do
for ((fhr = 24; fhr <= 144; fhr += 24)); do
day=$(date --utc +%Y%m%d -d "${PDY} ${cyc} - ${fhr} hours")
if (( ${day}${cyc} < SDATE )); then
if [[ "${day}${cyc}" -lt "${SDATE}" ]]; then
# Stop looking because these cycles weren't run
if (( fhr == 24 )); then
if [[ "${fhr}" -eq 24 ]]; then
exit
else
break
Expand Down Expand Up @@ -123,7 +124,7 @@ EOF

gdfile="${COMIN}/gdas_1p00_${day}${cycle}f000"

"${GEMEXE}/gdplot2_nc" << EOF
"${GEMEXE}/gdplot2_nc" << EOF
\$MAPFIL = mepowo.gsf
GDFILE = ${gdfile}
GDATTIM = F000
Expand Down Expand Up @@ -223,19 +224,19 @@ export err=$?
# WHEN IT CAN NOT PRODUCE THE DESIRED GRID. CHECK
# FOR THIS CASE HERE.
#####################################################
if (( err != 0 )) || [[ ! -s gdasloop.meta ]]; then
if [[ "${err}" -ne 0 ]] || [[ ! -s gdasloop.meta ]]; then
echo "FATAL ERROR: Failed to create gdasloop meta file"
exit "${err}"
fi

mv gdasloop.meta "${COMOUT_ATMOS_GEMPAK_META}/gdas_${PDY}_${cyc}_loop"
export err=$?
if (( err != 0 )) ; then
if [[ "${err}" -ne 0 ]]; then
echo "FATAL ERROR: Failed to move meta file to ${COMOUT_ATMOS_GEMPAK_META}/gdas_${PDY}_${cyc}_loop"
exit "${err}"
fi

if [[ ${SENDDBN} == "YES" ]] ; then
if [[ ${SENDDBN} == "YES" ]]; then
"${DBNROOT}/bin/dbn_alert" MODEL "${DBN_ALERT_TYPE}" "${job}" \
"${COMOUT_ATMOS_GEMPAK_META}/gdas_${PDY}_${cyc}_loop"
fi
Expand Down
15 changes: 8 additions & 7 deletions gempak/ush/gdas_meta_na.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ if [[ ! -L "${COMIN}" ]]; then
${NLN} "${COMIN_ATMOS_GEMPAK_1p00}" "${COMIN}"
fi

if [[ "${envir}" == "para" ]] ; then
export m_title="GDASP"
if [[ "${envir}" == "para" ]]; then
export m_title="GDASP"
else
export m_title="GDAS"
export m_title="GDAS"
fi

export pgm=gdplot2_nc; prep_step
export pgm=gdplot2_nc
prep_step

"${GEMEXE}/gdplot2_nc" << EOF
GDFILE = F-GDAS | ${PDY:2}/${cyc}00
Expand Down Expand Up @@ -94,19 +95,19 @@ export err=$?
# WHEN IT CAN NOT PRODUCE THE DESIRED GRID. CHECK
# FOR THIS CASE HERE.
#####################################################
if (( err != 0 )) || [[ ! -s gdas.meta ]] &> /dev/null; then
if [[ "${err}" -ne 0 ]] || [[ ! -s gdas.meta ]] &> /dev/null; then
echo "FATAL ERROR: Failed to create gempak meta file for North America"
exit "${err}"
fi

mv gdas.meta "${COMOUT_ATMOS_GEMPAK_META}/gdas_${PDY}_${cyc}_na"
export err=$?
if (( err != 0 )) ; then
if [[ "${err}" -ne 0 ]]; then
echo "FATAL ERROR: Failed to move meta file to ${COMOUT_ATMOS_GEMPAK_META}/gdas_${PDY}_${cyc}_na"
exit "${err}"
fi

if [[ "${SENDDBN}" == "YES" ]] ; then
if [[ "${SENDDBN}" == "YES" ]]; then
"${DBNROOT}/bin/dbn_alert" MODEL "${DBN_ALERT_TYPE}" "${job}" \
"${COMOUT_ATMOS_GEMPAK_META}/gdas_${PDY}_${cyc}_na"
fi
11 changes: 6 additions & 5 deletions gempak/ush/gdas_ukmet_meta_ver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

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

export pgm=gdplot2_nc;. prep_step
export pgm=gdplot2_nc
source prep_step

device="nc | ukmetver_12.meta"
cpreq "${HOMEgfs}/gempak/fix/datatype.tbl" datatype.tbl
Expand All @@ -33,7 +34,7 @@ areas="SAM NAM"

# GENERATING THE METAFILES.
for area in ${areas}; do
if [[ "${area}" == "NAM" ]] ; then
if [[ "${area}" == "NAM" ]]; then
garea="5.1;-124.6;49.6;-11.9"
proj="STR/90.0;-95.0;0.0"
latlon="0"
Expand Down Expand Up @@ -150,19 +151,19 @@ export err=$?
# WHEN IT CAN NOT PRODUCE THE DESIRED GRID. CHECK
# FOR THIS CASE HERE.
#####################################################
if (( err != 0 )) || [[ ! -s ukmetver_12.meta ]]; then
if [[ "${err}" -ne 0 ]] || [[ ! -s ukmetver_12.meta ]]; then
echo "FATAL ERROR: Failed to create ukmet meta file"
exit "${err}"
fi

mv ukmetver_12.meta "${COMOUT_ATMOS_GEMPAK_META}/ukmetver_${PDY}_12"
export err=$?
if (( err != 0 )) ; then
if [[ "${err}" -ne 0 ]]; then
echo "FATAL ERROR: Failed to move meta file to ${COMOUT_ATMOS_GEMPAK_META}/ukmetver_${PDY}_12"
exit "${err}"
fi

if [[ "${SENDDBN}" == "YES" ]] ; then
if [[ "${SENDDBN}" == "YES" ]]; then
"${DBNROOT}/bin/dbn_alert" MODEL UKMETVER_HPCMETAFILE "${job}" \
"${COMOUT_ATMOS_GEMPAK_META}/ukmetver_${PDY}_12"
fi
Expand Down
50 changes: 22 additions & 28 deletions gempak/ush/gempak_gdas_f000_gif.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,11 @@ hgtiso200dev="gdas_200_hgt_iso_nh_anl_${cyc}.gif"
mslpthksfclab="ANALYSIS MEAN SEA LEVEL PRESSURE/1000-500MB THICKNESS"
mslpthksfcdev="gdas_sfc_mslp_thk_nh_anl_${cyc}.gif"


# Set grid date and input file name

gdattim="${PDY:2:6}/${cyc}00F000"
gdfile=gem_grids${fhr3}.gem


# Execute the GEMPAK program

"${GEMEXE}/gdplot2_gif" << EOF
Expand Down Expand Up @@ -274,27 +272,26 @@ EOF

# Copy the GIF images into my area

cpfs "${hgttmp850dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."
cpfs "${hgttmp700dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."
cpfs "${hgttmp500dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."
cpfs "${hgtiso300dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."
cpfs "${hgtiso250dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."
cpfs "${hgtiso200dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."
cpfs "${mslpthksfcdev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."
cpfs "${hgttmp850dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."
cpfs "${hgttmp700dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."
cpfs "${hgttmp500dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."
cpfs "${hgtiso300dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."
cpfs "${hgtiso250dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."
cpfs "${hgtiso200dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."
cpfs "${mslpthksfcdev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."

# Send the GIF images onto the NCDC area on the public ftp server

if [[ ${SENDDBN} == YES ]]; then
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgttmp850dev}"
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgttmp700dev}"
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgttmp500dev}"
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgtiso300dev}"
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgtiso250dev}"
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgtiso200dev}"
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${mslpthksfcdev}"
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgttmp850dev}"
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgttmp700dev}"
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgttmp500dev}"
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgtiso300dev}"
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgtiso250dev}"
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgtiso200dev}"
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${mslpthksfcdev}"
fi


##########################################################
# SOUTHERN HEMISPHERE ANALYSIS CHARTS #
##########################################################
Expand All @@ -311,7 +308,6 @@ hgtiso300dev="gdas_300_hgt_iso_sh_anl_${cyc}.gif"
hgtiso250lab="250MB ANALYSIS HEIGHTS/ISOTACHS"
hgtiso250dev="gdas_250_hgt_iso_sh_anl_${cyc}.gif"


# Execute the GEMPAK program

"${GEMEXE}/gdplot2_gif" << EOF
Expand Down Expand Up @@ -438,23 +434,21 @@ hgtiso250dev="gdas_250_hgt_iso_sh_anl_${cyc}.gif"
exit
EOF


"${GEMEXE}/gpend"


# Copy the GIF images into my area
cpfs "${mslpthksfcdev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."
cpfs "${hgttmp500dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."
cpfs "${hgtiso300dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."
cpfs "${hgtiso250dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."
cpfs "${mslpthksfcdev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."
cpfs "${hgttmp500dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."
cpfs "${hgtiso300dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."
cpfs "${hgtiso250dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/."

# Copy the GIF images onto the NCDC area on the public ftp server

if [[ ${SENDDBN} == YES ]]; then
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${mslpthksfcdev}"
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgttmp500dev}"
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgtiso300dev}"
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgtiso250dev}"
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${mslpthksfcdev}"
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgttmp500dev}"
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgtiso300dev}"
"${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgtiso250dev}"
fi

exit
Loading