diff --git a/jobs/rocoto/atmos_products.sh b/jobs/rocoto/atmos_products.sh index fbc10cadbd..d7d78cc1a1 100755 --- a/jobs/rocoto/atmos_products.sh +++ b/jobs/rocoto/atmos_products.sh @@ -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=$( echo ${fhr} | sed "s/10#-/-10#/" ) + export FORECAST_HOUR=$(( ${fhr} )) "${HOMEgfs}/jobs/JGLOBAL_ATMOS_PRODUCTS" status=$? if (( status != 0 )); then exit "${status}"; fi