From 467e567fbaa803d336694aac7f17c51240bf6962 Mon Sep 17 00:00:00 2001 From: henrywinterbottom-wxdev Date: Mon, 18 Dec 2023 08:31:37 -0700 Subject: [PATCH 1/9] Reorganization of scripts. --- jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS | 42 --------------------- scripts/exgfs_atmos_grib2_special_npoess.sh | 39 ++++++++++++++++++- 2 files changed, 38 insertions(+), 43 deletions(-) diff --git a/jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS b/jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS index 1cb29be58b..a98835ada2 100755 --- a/jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS +++ b/jobs/JGFS_ATMOS_PGRB2_SPEC_NPOESS @@ -10,7 +10,6 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "npoess" -c "base" export OMP_NUM_THREADS=${OMP_NUM_THREADS:-1} - ################################ # Set up the HOME directory ################################ @@ -38,47 +37,6 @@ GRID="0p50" YMD=${PDY} HH=${cyc} generate_com -rx COM_ATMOS_GRIB_0p50:COM_ATMOS_ mkdir -m 775 -p "${COM_ATMOS_GOES}" -# TODO - This should be in the ex-script (#1226) - -#################################### -# Specify Forecast Hour Range -#################################### -export SHOUR=000 -export FHOUR=180 -export FHINC=003 - -#################################### -# Specify Timeout Behavior of Post -# -# SLEEP_TIME - Amount of time to wait for -# a restart file before exiting -# SLEEP_INT - Amount of time to wait between -# checking for restart files -#################################### -export SLEEP_TIME=900 -export SLEEP_INT=5 - -#################################### -# Check if this is a restart -#################################### -if [[ -f "${COM_ATMOS_GOES}/${RUN}.t${cyc}z.control.goessimpgrb2" ]]; then - modelrecvy=$(cat < "${COM_ATMOS_GOES}/${RUN}.t${cyc}z.control.goessimpgrb") - recvy_cyc="${modelrecvy:8:2}" - recvy_shour="${modelrecvy:10:13}" - - if [[ ${RERUN} == "NO" ]]; then - NEW_SHOUR=$(( recvy_shour + FHINC )) - if (( NEW_SHOUR >= SHOUR )); then - export SHOUR=${NEW_SHOUR} - fi - if (( recvy_shour >= FHOUR )); then - echo "Forecast Pgrb Generation Already Completed to ${FHOUR}" - else - echo "Starting: PDY=${PDY} cycle=t${recvy_cyc}z SHOUR=${SHOUR}" - fi - fi -fi - ############################################################# # Execute the script "${HOMEgfs}/scripts/exgfs_atmos_grib2_special_npoess.sh" diff --git a/scripts/exgfs_atmos_grib2_special_npoess.sh b/scripts/exgfs_atmos_grib2_special_npoess.sh index 23161c2714..4e9c9a98dc 100755 --- a/scripts/exgfs_atmos_grib2_special_npoess.sh +++ b/scripts/exgfs_atmos_grib2_special_npoess.sh @@ -40,13 +40,49 @@ export opt26=' -set_grib_max_bits 25 -fi -if ' export opt27=":(APCP|ACPCP|PRATE|CPRAT|DZDT):" export opt28=' -new_grid_interpolation budget -fi ' -SLEEP_LOOP_MAX=$(expr $SLEEP_TIME / $SLEEP_INT) +#################################### +# Specify Timeout Behavior of Post +# +# SLEEP_TIME - Amount of time to wait for +# a restart file before exiting +# SLEEP_INT - Amount of time to wait between +# checking for restart files +#################################### +export SLEEP_TIME=${SLEEP_TIME:-900} +export SLEEP_INT=${SLEEP_TIME:-5} + +SLEEP_LOOP_MAX=$(expr ${SLEEP_TIME} / ${SLEEP_INT}) + +# TODO: Does this section do anything? I retained if for clarity of +# changes/updates, but it does not appear to do anything. + +#################################### +# Check if this is a restart +#################################### +if [[ -f "${COM_ATMOS_GOES}/${RUN}.t${cyc}z.control.goessimpgrb2" ]]; then + modelrecvy=$(cat < "${COM_ATMOS_GOES}/${RUN}.t${cyc}z.control.goessimpgrb") + recvy_cyc="${modelrecvy:8:2}" + recvy_shour="${modelrecvy:10:13}" + + if [[ ${RERUN} == "NO" ]]; then + NEW_SHOUR=$(( recvy_shour + FHINC )) + if (( NEW_SHOUR >= SHOUR )); then + export SHOUR="${NEW_SHOUR}" + fi + if (( recvy_shour >= FHOUR )); then + echo "Forecast Pgrb Generation Already Completed to ${FHOUR}" + else + echo "Starting: PDY=${PDY} cycle=t${recvy_cyc}z SHOUR=${SHOUR}" + fi + fi +fi ############################################################################## # Specify Forecast Hour Range F000 - F024 for GFS_NPOESS_PGRB2_0P5DEG ############################################################################## export SHOUR=000 export FHOUR=024 +export FHINC=003 ############################################################ # Loop Through the Post Forecast Files @@ -109,6 +145,7 @@ done ################################################################ export SHOUR=000 export FHOUR=180 +export FHINC=003 ################################# # Process GFS PGRB2_SPECIAL_POST From ecabc62c49e3ba3ac25cfdbdd7d64d047de89003 Mon Sep 17 00:00:00 2001 From: "Henry R. Winterbottom" <49202169+HenryWinterbottom-NOAA@users.noreply.github.com> Date: Tue, 19 Dec 2023 08:02:18 -0700 Subject: [PATCH 2/9] Update scripts/exgfs_atmos_grib2_special_npoess.sh Co-authored-by: Walter Kolczynski - NOAA --- scripts/exgfs_atmos_grib2_special_npoess.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/exgfs_atmos_grib2_special_npoess.sh b/scripts/exgfs_atmos_grib2_special_npoess.sh index 4e9c9a98dc..d33e055b04 100755 --- a/scripts/exgfs_atmos_grib2_special_npoess.sh +++ b/scripts/exgfs_atmos_grib2_special_npoess.sh @@ -51,7 +51,7 @@ export opt28=' -new_grid_interpolation budget -fi ' export SLEEP_TIME=${SLEEP_TIME:-900} export SLEEP_INT=${SLEEP_TIME:-5} -SLEEP_LOOP_MAX=$(expr ${SLEEP_TIME} / ${SLEEP_INT}) +SLEEP_LOOP_MAX=$(( SLEEP_TIME / SLEEP_INT )) # TODO: Does this section do anything? I retained if for clarity of # changes/updates, but it does not appear to do anything. From 55aee40790497097189fa3c384a933f9ee728c4b Mon Sep 17 00:00:00 2001 From: henrywinterbottom-wxdev Date: Tue, 19 Dec 2023 08:40:26 -0700 Subject: [PATCH 3/9] Updated based on reviewer suggestion. --- scripts/exgfs_atmos_grib2_special_npoess.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/exgfs_atmos_grib2_special_npoess.sh b/scripts/exgfs_atmos_grib2_special_npoess.sh index d33e055b04..86c40f0c6b 100755 --- a/scripts/exgfs_atmos_grib2_special_npoess.sh +++ b/scripts/exgfs_atmos_grib2_special_npoess.sh @@ -50,6 +50,7 @@ export opt28=' -new_grid_interpolation budget -fi ' #################################### export SLEEP_TIME=${SLEEP_TIME:-900} export SLEEP_INT=${SLEEP_TIME:-5} +export FHMAX_GFS=${FHMAX_GFS:-180} SLEEP_LOOP_MAX=$(( SLEEP_TIME / SLEEP_INT )) From 15e27bc57f745c04949601e80bc15fb833deca79 Mon Sep 17 00:00:00 2001 From: henrywinterbottom-wxdev Date: Tue, 19 Dec 2023 09:05:14 -0700 Subject: [PATCH 4/9] Removed unnecessary previous commit addition. --- scripts/exgfs_atmos_grib2_special_npoess.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/exgfs_atmos_grib2_special_npoess.sh b/scripts/exgfs_atmos_grib2_special_npoess.sh index 86c40f0c6b..d33e055b04 100755 --- a/scripts/exgfs_atmos_grib2_special_npoess.sh +++ b/scripts/exgfs_atmos_grib2_special_npoess.sh @@ -50,7 +50,6 @@ export opt28=' -new_grid_interpolation budget -fi ' #################################### export SLEEP_TIME=${SLEEP_TIME:-900} export SLEEP_INT=${SLEEP_TIME:-5} -export FHMAX_GFS=${FHMAX_GFS:-180} SLEEP_LOOP_MAX=$(( SLEEP_TIME / SLEEP_INT )) From 947caf19e5247098bb56edb784e55b4e8cd67685 Mon Sep 17 00:00:00 2001 From: henrywinterbottom-wxdev Date: Tue, 19 Dec 2023 09:33:04 -0700 Subject: [PATCH 5/9] Updates based on reviewer suggestions. --- scripts/exgfs_atmos_grib2_special_npoess.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/exgfs_atmos_grib2_special_npoess.sh b/scripts/exgfs_atmos_grib2_special_npoess.sh index d33e055b04..8e94ca7fff 100755 --- a/scripts/exgfs_atmos_grib2_special_npoess.sh +++ b/scripts/exgfs_atmos_grib2_special_npoess.sh @@ -83,6 +83,9 @@ fi export SHOUR=000 export FHOUR=024 export FHINC=003 +if [[ "${FHOUR}" -lt "${FHMAX_GFS}" ]]; then + export FHOUR="${FHMAX_GFS}" +fi ############################################################ # Loop Through the Post Forecast Files @@ -146,6 +149,9 @@ done export SHOUR=000 export FHOUR=180 export FHINC=003 +if [[ "${FHOUR}" -lt "${FHMAX_GFS}" ]]; then + export FHOUR="${FHMAX_GFS}" +fi ################################# # Process GFS PGRB2_SPECIAL_POST From 5e0686da3af2c3234fd324a4ade5997d52ac64fe Mon Sep 17 00:00:00 2001 From: "Henry R. Winterbottom" <49202169+HenryWinterbottom-NOAA@users.noreply.github.com> Date: Tue, 19 Dec 2023 11:56:57 -0700 Subject: [PATCH 6/9] Update scripts/exgfs_atmos_grib2_special_npoess.sh Co-authored-by: Walter Kolczynski - NOAA --- scripts/exgfs_atmos_grib2_special_npoess.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/exgfs_atmos_grib2_special_npoess.sh b/scripts/exgfs_atmos_grib2_special_npoess.sh index 8e94ca7fff..676727d17b 100755 --- a/scripts/exgfs_atmos_grib2_special_npoess.sh +++ b/scripts/exgfs_atmos_grib2_special_npoess.sh @@ -149,9 +149,6 @@ done export SHOUR=000 export FHOUR=180 export FHINC=003 -if [[ "${FHOUR}" -lt "${FHMAX_GFS}" ]]; then - export FHOUR="${FHMAX_GFS}" -fi ################################# # Process GFS PGRB2_SPECIAL_POST From 4a1ffeac9664d5f565889db7b337abfce7c240cc Mon Sep 17 00:00:00 2001 From: henrywinterbottom-wxdev Date: Tue, 19 Dec 2023 12:06:17 -0700 Subject: [PATCH 7/9] Updates as per reviewer recommendations. --- scripts/exgfs_atmos_grib2_special_npoess.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/exgfs_atmos_grib2_special_npoess.sh b/scripts/exgfs_atmos_grib2_special_npoess.sh index 676727d17b..358814f433 100755 --- a/scripts/exgfs_atmos_grib2_special_npoess.sh +++ b/scripts/exgfs_atmos_grib2_special_npoess.sh @@ -83,7 +83,7 @@ fi export SHOUR=000 export FHOUR=024 export FHINC=003 -if [[ "${FHOUR}" -lt "${FHMAX_GFS}" ]]; then +if [[ "${FHOUR}" < "${FHMAX_GFS}" ]]; then export FHOUR="${FHMAX_GFS}" fi @@ -149,6 +149,9 @@ done export SHOUR=000 export FHOUR=180 export FHINC=003 +if [[ "${FHOUR}" > "${FHMAX_GFS}" ]]; then + export FHOUR="${FHMAX_GFS}" +fi ################################# # Process GFS PGRB2_SPECIAL_POST From fce5557a044b8beac1142c4a3de232d7782f811f Mon Sep 17 00:00:00 2001 From: henrywinterbottom-wxdev Date: Tue, 19 Dec 2023 12:45:29 -0700 Subject: [PATCH 8/9] Updates based on user suggestions. --- scripts/exgfs_atmos_grib2_special_npoess.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/exgfs_atmos_grib2_special_npoess.sh b/scripts/exgfs_atmos_grib2_special_npoess.sh index 358814f433..f235ed7de1 100755 --- a/scripts/exgfs_atmos_grib2_special_npoess.sh +++ b/scripts/exgfs_atmos_grib2_special_npoess.sh @@ -83,7 +83,7 @@ fi export SHOUR=000 export FHOUR=024 export FHINC=003 -if [[ "${FHOUR}" < "${FHMAX_GFS}" ]]; then +if [[ "${FHOUR}" -lt "${FHMAX_GFS}" ]]; then export FHOUR="${FHMAX_GFS}" fi @@ -149,7 +149,7 @@ done export SHOUR=000 export FHOUR=180 export FHINC=003 -if [[ "${FHOUR}" > "${FHMAX_GFS}" ]]; then +if [[ "${FHOUR}" -gt "${FHMAX_GFS}" ]]; then export FHOUR="${FHMAX_GFS}" fi From a23e90fb03b0eb179db72344caecec4257ec59ff Mon Sep 17 00:00:00 2001 From: "Henry R. Winterbottom" <49202169+HenryWinterbottom-NOAA@users.noreply.github.com> Date: Fri, 22 Dec 2023 07:29:08 -0700 Subject: [PATCH 9/9] Update scripts/exgfs_atmos_grib2_special_npoess.sh Co-authored-by: Walter Kolczynski - NOAA --- scripts/exgfs_atmos_grib2_special_npoess.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/exgfs_atmos_grib2_special_npoess.sh b/scripts/exgfs_atmos_grib2_special_npoess.sh index f235ed7de1..a43c279ae6 100755 --- a/scripts/exgfs_atmos_grib2_special_npoess.sh +++ b/scripts/exgfs_atmos_grib2_special_npoess.sh @@ -83,7 +83,7 @@ fi export SHOUR=000 export FHOUR=024 export FHINC=003 -if [[ "${FHOUR}" -lt "${FHMAX_GFS}" ]]; then +if [[ "${FHOUR}" -gt "${FHMAX_GFS}" ]]; then export FHOUR="${FHMAX_GFS}" fi