Skip to content

Commit

Permalink
Fix analysis post processing's handling of 0-padded negative integers (
Browse files Browse the repository at this point in the history
…NOAA-EMC#2187)

This screens for the analysis 'forecast' hour (-001) and handles the '-' and circumvents octal issues.
  • Loading branch information
DavidHuber-NOAA authored Dec 22, 2023
1 parent d125136 commit 774c730
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion jobs/rocoto/atmos_products.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ IFS='_' read -ra fhrs <<< "${FHRLST//f}" # strip off the 'f's and convert to arr
#---------------------------------------------------------------
# Execute the JJOB
for fhr in "${fhrs[@]}"; do
export FORECAST_HOUR=$(( 10#${fhr} ))
# The analysis fhr is -001. Performing math on negative, leading 0 integers is tricky.
# The negative needs to be in front of "10#", so do some regex magic to make it happen.
fhr="10#${fhr}"
fhr=${fhr//10\#-/-10\#}
export FORECAST_HOUR=$(( fhr ))
"${HOMEgfs}/jobs/JGLOBAL_ATMOS_PRODUCTS"
status=$?
if (( status != 0 )); then exit "${status}"; fi
Expand Down

0 comments on commit 774c730

Please sign in to comment.