-
Notifications
You must be signed in to change notification settings - Fork 215
Remove Direct Linking to COM from DATA for wavepostsbs Job
#3303
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
Changes from 20 commits
c0ec095
e8ddc88
f2669df
b06793b
a417365
66269bd
5f59736
13dca27
f7d3bfc
971cafb
53f7378
a674b8b
173d413
514fd35
2b2c234
007e1ac
849feb7
ae24fbd
dc52172
cf52ba5
20e2808
519767e
ec3dca7
79b2926
901860f
89f6112
b9978c3
b5eaebb
f53e11c
f3d9244
92f4ea5
2b73e50
eb3f5f1
3a03f57
3664e90
5919393
53f59f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,7 +82,7 @@ if [[ ! -d "${com_dir}" ]]; then | |
| else | ||
| echo "Directory ${com_dir} already exists." | ||
| fi | ||
| # Only create file if not present in COM | ||
| # Only create file if not present in working directory | ||
| if [[ ! -s "${com_dir}/${outfile}.idx" ]]; then | ||
|
|
||
| set +x | ||
|
|
@@ -169,11 +169,11 @@ if [[ ! -s "${com_dir}/${outfile}.idx" ]]; then | |
| fi | ||
|
|
||
| if (( fhr > 0 )); then | ||
| ${WGRIB2} gribfile -set_date "${PDY}${cyc}" -set_ftime "${fhr} hour fcst" -grib "${com_dir}/${outfile}" | ||
| ${WGRIB2} gribfile -set_date "${PDY}${cyc}" -set_ftime "${fhr} hour fcst" -grib "${outfile}" | ||
| err=$? | ||
| else | ||
| ${WGRIB2} gribfile -set_date "${PDY}${cyc}" -set_ftime "${fhr} hour fcst" \ | ||
| -set table_1.4 1 -set table_1.2 1 -grib "${com_dir}/${outfile}" | ||
| -set table_1.4 1 -set table_1.2 1 -grib "${outfile}" | ||
| err=$? | ||
| fi | ||
|
|
||
|
|
@@ -189,23 +189,44 @@ if [[ ! -s "${com_dir}/${outfile}.idx" ]]; then | |
| fi | ||
|
|
||
| # Create index | ||
| ${WGRIB2} -s "${com_dir}/${outfile}" > "${com_dir}/${outfile}.idx" | ||
| ${WGRIB2} -s "${outfile}" > "${outfile}.idx" | ||
|
|
||
| # Create grib2 subgrid is this is the source grid | ||
| # Create grib2 subgrid if this is the source grid | ||
| if [[ "${grdID}" = "${WAV_SUBGRBSRC}" ]]; then | ||
| for subgrb in ${WAV_SUBGRB}; do | ||
| subgrbref=$(echo ${!subgrb} | cut -d " " -f 1-20) | ||
| subgrbnam=$(echo ${!subgrb} | cut -d " " -f 21) | ||
| subgrbres=$(echo ${!subgrb} | cut -d " " -f 22) | ||
| subfnam="${WAV_MOD_TAG}.${cycle}${ENSTAG}.${subgrbnam}.${subgrbres}.f${FH3}.grib2" | ||
| ${COPYGB2} -g "${subgrbref}" -i0 -x "${com_dir}/${outfile}" "${com_dir}/${subfnam}" | ||
| ${WGRIB2} -s "${com_dir}/${subfnam}" > "${com_dir}/${subfnam}.idx" | ||
| ${COPYGB2} -g "${subgrbref}" -i0 -x "${outfile}" "${subfnam}" | ||
| ${WGRIB2} -s "${subfnam}" > "${subfnam}.idx" | ||
| done | ||
| fi | ||
|
|
||
| # 1.e Save in /com | ||
| # Move grib files to COM directory | ||
| if [[ -s "${outfile}" ]] && [[ -s "${outfile}.idx" ]]; then | ||
| cp -f "${outfile}" "${com_dir}/${outfile}" | ||
| cp -f "${outfile}.idx" "${com_dir}/${outfile}.idx" | ||
|
AntonMFernando-NOAA marked this conversation as resolved.
Outdated
|
||
| echo "Copied ${outfile} and ${outfile}.idx from ${GRIBDATA} to COM" | ||
| else | ||
| echo "${outfile} and ${outfile}.idx not found in ${GRIBDATA} to copy to COM" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be an error?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @JessicaMeixner-NOAA What this does is copying the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's great! Thanks for these updates. What I'm concerned with is if the grib and .idx files do not exist, then perhaps that should be an error message and not just simply a " echo "${outfile} and ${outfile}.idx not found" ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @JessicaMeixner-NOAA
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't it say something like "ERROR: explanation" and then exit instead of continuing on?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @JessicaMeixner-NOAA I will revise the script based on your suggestion. Thank you!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @JessicaMeixner-NOAA I reviewed the script again, and it turns out the issue is addressed in the if blocks (L233-256). However, it only checks the COM files. So, I think your suggestion is correct. |
||
| fi | ||
|
|
||
| if [[ ! -s "${com_dir}/${outfile}" ]]; then | ||
| if [[ "${grdID}" = "${WAV_SUBGRBSRC}" ]]; then | ||
| for subgrb in ${WAV_SUBGRB}; do | ||
| subfnam="${WAV_MOD_TAG}.${cycle}${ENSTAG}.${subgrbnam}.${subgrbres}.f${FH3}.grib2" | ||
|
AntonMFernando-NOAA marked this conversation as resolved.
|
||
| if [[ -s "${subfnam}" ]] && [[ -s "${subfnam}.idx" ]]; then | ||
|
|
||
| cp -f "${subfnam}" "${com_dir}/${subfnam}" | ||
| cp -f "${subfnam}.idx" "${com_dir}/${subfnam}.idx" | ||
|
AntonMFernando-NOAA marked this conversation as resolved.
Outdated
|
||
| echo "Copied ${subfnam} and ${subfnam}.idx from ${GRIBDATA} to COM" | ||
| else | ||
| echo "${subfnam} and ${subfnam}.idx not found in ${GRIBDATA} to copy to COM" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be an error?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same above. |
||
| fi | ||
| done | ||
|
|
||
| fi | ||
|
|
||
| if [[ ! -s "${outfile}" ]]; then | ||
|
AntonMFernando-NOAA marked this conversation as resolved.
Outdated
|
||
| set +x | ||
| echo ' ' | ||
| echo '********************************************* ' | ||
|
|
@@ -217,7 +238,7 @@ if [[ ! -s "${com_dir}/${outfile}.idx" ]]; then | |
| set_trace | ||
| exit 4 | ||
| fi | ||
| if [[ ! -s "${com_dir}/${outfile}.idx" ]]; then | ||
| if [[ ! -s "${outfile}.idx" ]]; then | ||
|
AntonMFernando-NOAA marked this conversation as resolved.
Outdated
|
||
| set +x | ||
| echo ' ' | ||
| echo '*************************************************** ' | ||
|
|
@@ -232,16 +253,14 @@ if [[ ! -s "${com_dir}/${outfile}.idx" ]]; then | |
|
|
||
| if [[ "${SENDDBN}" = 'YES' ]] && [[ ${outfile} != *global.0p50* ]]; then | ||
| set +x | ||
| echo " Alerting GRIB file as ${com_dir}/${outfile}" | ||
| echo " Alerting GRIB index file as ${com_dir}/${outfile}.idx" | ||
| echo " Alerting GRIB file as ${outfile}" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the com_dir be removed from this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @JessicaMeixner-NOAA After the L255 the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is just an echo. its fine to be either. the crucial line is the |
||
| echo " Alerting GRIB index file as ${outfile}.idx" | ||
| set_trace | ||
| "${DBNROOT}/bin/dbn_alert" MODEL "${alertName}_WAVE_GB2" "${job}" "${com_dir}/${outfile}" | ||
| "${DBNROOT}/bin/dbn_alert" MODEL "${alertName}_WAVE_GB2_WIDX" "${job}" "${com_dir}/${outfile}.idx" | ||
| else | ||
| echo "${outfile} is global.0p50 or SENDDBN is NO, no alert sent" | ||
| fi | ||
|
|
||
|
|
||
| # --------------------------------------------------------------------------- # | ||
| # 3. Clean up the directory | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.