From 5974b9640681072ddd00d70609303ccedd8d83b1 Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 20 Dec 2024 19:12:37 +0000 Subject: [PATCH 01/23] Only archive gempak if it was run --- parm/archive/gfs_downstream.yaml.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/parm/archive/gfs_downstream.yaml.j2 b/parm/archive/gfs_downstream.yaml.j2 index 94bdd1df56..43aa4df4ba 100644 --- a/parm/archive/gfs_downstream.yaml.j2 +++ b/parm/archive/gfs_downstream.yaml.j2 @@ -3,8 +3,10 @@ gfs_downstream: name: "GFS_DOWNSTREAM" target: "{{ ATARDIR }}/{{ cycle_YMDH }}/gfs_downstream.tar" required: + {% if DO_GEMPAK %} - "{{ COMIN_ATMOS_GEMPAK | relpath(ROTDIR) }}/gfs_{{ cycle_YMDH }}.sfc" - "{{ COMIN_ATMOS_GEMPAK | relpath(ROTDIR) }}/gfs_{{ cycle_YMDH }}.snd" + {% endif %} {% for i in range(1, NUM_SND_COLLECTIVES) %} - "{{ COMIN_ATMOS_BUFR | relpath(ROTDIR) }}/gfs_collective{{ i }}.fil" {% endfor %} From 2649a86444b1c0ad82642263eb43a49c071d6466 Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 20 Dec 2024 19:13:33 +0000 Subject: [PATCH 02/23] Remove literal quotes --- scripts/exgfs_atmos_postsnd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/exgfs_atmos_postsnd.sh b/scripts/exgfs_atmos_postsnd.sh index 8f2aa43568..61761b936d 100755 --- a/scripts/exgfs_atmos_postsnd.sh +++ b/scripts/exgfs_atmos_postsnd.sh @@ -117,7 +117,7 @@ for fhr in "${hour_list[@]}"; do echo "File ${filename} is required but not found." err_exit "FATAL ERROR: logf${fhr} not found." else - echo "${runscript} \"${fhr}\" \"${fhr_p}\" \"${FINT}\" \"${F00FLAG}\" \"${DATA}/${fhr}\"" >> "${DATA}/poescript_bufr" + echo "${runscript} ${fhr} ${fhr_p} ${FINT} ${F00FLAG} ${DATA}/${fhr}" >> "${DATA}/poescript_bufr" fi done From a038cb9ed1375a38332edf7667df8b087a9c4524 Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 20 Dec 2024 19:14:45 +0000 Subject: [PATCH 03/23] Shellcheck stuff --- ush/gfs_bufr.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ush/gfs_bufr.sh b/ush/gfs_bufr.sh index 0a7a8e8522..485fd0318b 100755 --- a/ush/gfs_bufr.sh +++ b/ush/gfs_bufr.sh @@ -21,11 +21,12 @@ # 2024-08-08 Bo Cui: Update to handle one forecast at a time # echo "History: February 2003 - First implementation of this utility script" # -fhr="$1" -fhr_p="$2" -FINT="$3" -F00FLAG="$4" -workdir="$5" +set -x +fhr="${1}" +fhr_p="${2}" +FINT="${3}" +F00FLAG="${4}" +workdir="${5}" cd "${workdir}" || exit 2 From 1180627e6ecb903d31db2a3889c2cf8e32f5e0c2 Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 20 Dec 2024 19:15:08 +0000 Subject: [PATCH 04/23] Remove duplicate marinebmat entry --- env/HERA.env | 5 ----- 1 file changed, 5 deletions(-) diff --git a/env/HERA.env b/env/HERA.env index f10bfcc537..8ae3a147bc 100755 --- a/env/HERA.env +++ b/env/HERA.env @@ -131,11 +131,6 @@ elif [[ "${step}" = "marinebmat" ]]; then export APRUNCFP="${launcher} -n \$ncmd --multi-prog" export APRUN_MARINEBMAT="${APRUN_default}" -elif [[ "${step}" = "marinebmat" ]]; then - - export APRUNCFP="${launcher} -n \$ncmd --multi-prog" - export APRUN_MARINEBMAT="${APRUN_default}" - elif [[ "${step}" = "marineanlvar" ]]; then export APRUNCFP="${launcher} -n \$ncmd --multi-prog" From 1efe711cff618c2fb431bb703de990eba83c08bb Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 20 Dec 2024 19:16:53 +0000 Subject: [PATCH 05/23] Add DO_GEMPAK to archive environment --- scripts/exglobal_archive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/exglobal_archive.py b/scripts/exglobal_archive.py index 5ae57ca7e3..e1cffa4900 100755 --- a/scripts/exglobal_archive.py +++ b/scripts/exglobal_archive.py @@ -33,7 +33,7 @@ def main(): 'NMEM_ENS', 'DO_JEDIATMVAR', 'DO_VRFY_OCEANDA', 'FHMAX_FITS', 'waveGRD', 'IAUFHRS', 'DO_FIT2OBS', 'NET', 'FHOUT_HF_GFS', 'FHMAX_HF_GFS', 'REPLAY_ICS', 'OFFSET_START_HOUR', 'ARCH_EXPDIR', 'EXPDIR', 'ARCH_EXPDIR_FREQ', 'ARCH_HASHES', - 'ARCH_DIFFS', 'SDATE', 'EDATE', 'HOMEgfs'] + 'ARCH_DIFFS', 'SDATE', 'EDATE', 'HOMEgfs', 'DO_GEMPAK'] archive_dict = AttrDict() for key in keys: From 4df2811f16b2e9d883c29019366a74231497ef3e Mon Sep 17 00:00:00 2001 From: David Huber Date: Tue, 24 Dec 2024 19:42:24 +0000 Subject: [PATCH 06/23] Fix fbwinds resource assignments --- parm/config/gfs/config.resources | 1 + workflow/applications/gfs_cycled.py | 2 +- workflow/rocoto/gfs_tasks.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/parm/config/gfs/config.resources b/parm/config/gfs/config.resources index 230872b8f3..d08e2cc4f2 100644 --- a/parm/config/gfs/config.resources +++ b/parm/config/gfs/config.resources @@ -1288,6 +1288,7 @@ case ${step} in ntasks=1 threads_per_task=1 memory="4GB" + tasks_per_node=1 ;; "mos_stn_prep") diff --git a/workflow/applications/gfs_cycled.py b/workflow/applications/gfs_cycled.py index 543d7a9d8c..6c90e32dd4 100644 --- a/workflow/applications/gfs_cycled.py +++ b/workflow/applications/gfs_cycled.py @@ -119,7 +119,7 @@ def _get_app_configs(self, run): configs += ['postsnd'] if options['do_awips']: - configs += ['awips'] + configs += ['awips', 'fbwind'] if options['do_wave']: configs += ['waveinit', 'waveprep', 'wavepostsbs', 'wavepostpnt'] diff --git a/workflow/rocoto/gfs_tasks.py b/workflow/rocoto/gfs_tasks.py index 54870b79cc..a43a0b6728 100644 --- a/workflow/rocoto/gfs_tasks.py +++ b/workflow/rocoto/gfs_tasks.py @@ -1410,7 +1410,7 @@ def fbwind(self): deps.append(rocoto.add_dependency(dep_dict)) dependencies = rocoto.create_dependency(dep=deps, dep_condition='and') - resources = self.get_resource('awips') + resources = self.get_resource('fbwind') # TODO: It would be better to use task dependencies on the # individual post jobs rather than data dependencies to avoid # prematurely starting with partial files. Unfortunately, the From 939c2389ddf80394d1dbf485a0d336dadc38540b Mon Sep 17 00:00:00 2001 From: David Huber Date: Tue, 24 Dec 2024 19:44:35 +0000 Subject: [PATCH 07/23] Source preamble in gfs_bufr.sh --- ush/gfs_bufr.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ush/gfs_bufr.sh b/ush/gfs_bufr.sh index 485fd0318b..fe76893dd7 100755 --- a/ush/gfs_bufr.sh +++ b/ush/gfs_bufr.sh @@ -21,7 +21,9 @@ # 2024-08-08 Bo Cui: Update to handle one forecast at a time # echo "History: February 2003 - First implementation of this utility script" # -set -x + +source "${USHgfs}/preamble.sh" + fhr="${1}" fhr_p="${2}" FINT="${3}" From 52a1225aec30f19ad4b6fb71113a9ede719f2dc3 Mon Sep 17 00:00:00 2001 From: David Huber Date: Mon, 30 Dec 2024 16:32:34 +0000 Subject: [PATCH 08/23] Remove duplicate preamble sourcing --- ush/gfs_bufr.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/ush/gfs_bufr.sh b/ush/gfs_bufr.sh index fe76893dd7..14b9540308 100755 --- a/ush/gfs_bufr.sh +++ b/ush/gfs_bufr.sh @@ -32,8 +32,6 @@ workdir="${5}" cd "${workdir}" || exit 2 -source "${USHgfs}/preamble.sh" - if [[ "${F00FLAG}" == "YES" ]]; then f00flag=".true." else From 28e77758a3fec00b650577952f8e63307b1245fa Mon Sep 17 00:00:00 2001 From: David Huber Date: Mon, 30 Dec 2024 18:54:29 +0000 Subject: [PATCH 09/23] Enable AWIPS for extended CI test --- ci/cases/yamls/gfs_extended_ci.yaml | 2 +- workflow/hosts/hera.yaml | 1 + workflow/hosts/hercules.yaml | 1 + workflow/hosts/orion.yaml | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ci/cases/yamls/gfs_extended_ci.yaml b/ci/cases/yamls/gfs_extended_ci.yaml index 2e7a173994..12ccda6bbd 100644 --- a/ci/cases/yamls/gfs_extended_ci.yaml +++ b/ci/cases/yamls/gfs_extended_ci.yaml @@ -6,7 +6,7 @@ base: DO_GOES: "YES" DO_BUFRSND: "YES" DO_GEMPAK: "YES" - DO_AWIPS: "NO" + DO_AWIPS: "YES" DO_NPOESS: "YES" DO_GENESIS_FSU: "NO" FCST_BREAKPOINTS: 192 diff --git a/workflow/hosts/hera.yaml b/workflow/hosts/hera.yaml index e9e749ad3c..b95d0abb8d 100644 --- a/workflow/hosts/hera.yaml +++ b/workflow/hosts/hera.yaml @@ -24,6 +24,7 @@ LOCALARCH: 'NO' ATARDIR: '/NCEPDEV/${HPSS_PROJECT}/1year/${USER}/${machine}/scratch/${PSLOT}' MAKE_NSSTBUFR: 'NO' MAKE_ACFTBUFR: 'NO' +DO_AWIPS: 'NO' SUPPORTED_RESOLUTIONS: ['C1152', 'C768', 'C384', 'C192', 'C96', 'C48'] COMINecmwf: /scratch1/NCEPDEV/global/glopara/data/external_gempak/ecmwf COMINnam: /scratch1/NCEPDEV/global/glopara/data/external_gempak/nam diff --git a/workflow/hosts/hercules.yaml b/workflow/hosts/hercules.yaml index f528761cf1..a2974377dd 100644 --- a/workflow/hosts/hercules.yaml +++ b/workflow/hosts/hercules.yaml @@ -26,6 +26,7 @@ MAKE_NSSTBUFR: 'NO' MAKE_ACFTBUFR: 'NO' DO_TRACKER: 'NO' DO_GENESIS: 'NO' +DO_AWIPS: 'NO' SUPPORTED_RESOLUTIONS: ['C1152', 'C768', 'C384', 'C192', 'C96', 'C48'] COMINecmwf: /work/noaa/global/glopara/data/external_gempak/ecmwf COMINnam: /work/noaa/global/glopara/data/external_gempak/nam diff --git a/workflow/hosts/orion.yaml b/workflow/hosts/orion.yaml index 985c24c6fb..9b1a908e2c 100644 --- a/workflow/hosts/orion.yaml +++ b/workflow/hosts/orion.yaml @@ -26,6 +26,7 @@ MAKE_NSSTBUFR: 'NO' MAKE_ACFTBUFR: 'NO' DO_TRACKER: 'NO' DO_GENESIS: 'NO' +DO_AWIPS: 'NO' SUPPORTED_RESOLUTIONS: ['C1152', 'C768', 'C384', 'C192', 'C96', 'C48'] COMINecmwf: /work/noaa/global/glopara/data/external_gempak/ecmwf COMINnam: /work/noaa/global/glopara/data/external_gempak/nam From 0796a09e918b2fe7e82d012d29ddb97538699851 Mon Sep 17 00:00:00 2001 From: David Huber Date: Thu, 2 Jan 2025 18:07:06 +0000 Subject: [PATCH 10/23] Source config.fbwnd if running AWIPS in forecast only mode --- workflow/applications/gfs_forecast_only.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/applications/gfs_forecast_only.py b/workflow/applications/gfs_forecast_only.py index fffdab6ef9..9ce8d01b5f 100644 --- a/workflow/applications/gfs_forecast_only.py +++ b/workflow/applications/gfs_forecast_only.py @@ -61,7 +61,7 @@ def _get_app_configs(self, run): configs += ['gempak'] if options['do_awips']: - configs += ['awips'] + configs += ['awips', 'fbwind'] if options['do_ocean'] or options['do_ice']: configs += ['oceanice_products'] From a1831e5f70b937abbdccb16863d268ab190f6cda Mon Sep 17 00:00:00 2001 From: David Huber Date: Wed, 8 Jan 2025 18:39:26 +0000 Subject: [PATCH 11/23] Apply multiple fixes for the gempakncdcupapgif job --- .gitignore | 4 - gempak/ush/gempak_gdas_f000_gif.sh | 44 ++-- gempak/ush/gempak_gfs_f000_gif.sh | 66 ++--- gempak/ush/gempak_gfs_fhhh_gif.sh | 18 +- jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF | 14 +- modulefiles/module_base.wcoss2.lua | 1 + scripts/exgfs_atmos_gempak_gif_ncdc_skew_t.sh | 12 +- sorc/gfs_utils.fd | 2 +- sorc/link_workflow.sh | 3 - ush/make_NTC_file.pl | 118 +++++++++ ush/make_ntc_bull.pl | 242 ++++++++++++++++++ ush/make_tif.sh | 31 +++ ush/month_name.sh | 112 ++++++++ versions/run.wcoss2.ver | 1 + 14 files changed, 586 insertions(+), 82 deletions(-) create mode 100755 ush/make_NTC_file.pl create mode 100755 ush/make_ntc_bull.pl create mode 100755 ush/make_tif.sh create mode 100755 ush/month_name.sh diff --git a/.gitignore b/.gitignore index f3cb1e1b3e..7669dac845 100644 --- a/.gitignore +++ b/.gitignore @@ -162,10 +162,6 @@ ush/global_cycle_driver.sh ush/jediinc2fv3.py ush/ufsda ush/soca -ush/make_NTC_file.pl -ush/make_ntc_bull.pl -ush/make_tif.sh -ush/month_name.sh ush/imsfv3_scf2ioda.py ush/atparse.bash ush/run_bufr2ioda.py diff --git a/gempak/ush/gempak_gdas_f000_gif.sh b/gempak/ush/gempak_gdas_f000_gif.sh index 80e28f5345..3e7ebf3c47 100755 --- a/gempak/ush/gempak_gdas_f000_gif.sh +++ b/gempak/ush/gempak_gdas_f000_gif.sh @@ -274,24 +274,24 @@ EOF # Copy the GIF images into my area -cp "${hgttmp850dev}" "${COM_ATMOS_GEMPAK_GIF}/." -cp "${hgttmp700dev}" "${COM_ATMOS_GEMPAK_GIF}/." -cp "${hgttmp500dev}" "${COM_ATMOS_GEMPAK_GIF}/." -cp "${hgtiso300dev}" "${COM_ATMOS_GEMPAK_GIF}/." -cp "${hgtiso250dev}" "${COM_ATMOS_GEMPAK_GIF}/." -cp "${hgtiso200dev}" "${COM_ATMOS_GEMPAK_GIF}/." -cp "${mslpthksfcdev}" "${COM_ATMOS_GEMPAK_GIF}/." +cp "${hgttmp850dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/." +cp "${hgttmp700dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/." +cp "${hgttmp500dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/." +cp "${hgtiso300dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/." +cp "${hgtiso250dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/." +cp "${hgtiso200dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/." +cp "${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}" "${COM_ATMOS_GEMPAK_GIF}/${hgttmp850dev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${hgttmp700dev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${hgttmp500dev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${hgtiso300dev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${hgtiso250dev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${hgtiso200dev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_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 @@ -443,18 +443,18 @@ EOF # Copy the GIF images into my area -cp "${mslpthksfcdev}" "${COM_ATMOS_GEMPAK_GIF}/." -cp "${hgttmp500dev}" "${COM_ATMOS_GEMPAK_GIF}/." -cp "${hgtiso300dev}" "${COM_ATMOS_GEMPAK_GIF}/." -cp "${hgtiso250dev}" "${COM_ATMOS_GEMPAK_GIF}/." +cp "${mslpthksfcdev}" "${COMOUT_ATMOS_GEMPAK_GIF}/." +cp "${hgttmp500dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/." +cp "${hgtiso300dev}" "${COMOUT_ATMOS_GEMPAK_GIF}/." +cp "${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}" "${COM_ATMOS_GEMPAK_GIF}/${mslpthksfcdev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${hgttmp500dev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${hgtiso300dev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_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 diff --git a/gempak/ush/gempak_gfs_f000_gif.sh b/gempak/ush/gempak_gfs_f000_gif.sh index 6a709fcc16..4393c01a7e 100755 --- a/gempak/ush/gempak_gfs_f000_gif.sh +++ b/gempak/ush/gempak_gfs_f000_gif.sh @@ -15,6 +15,8 @@ # ######################################################################### +source "${HOMEgfs}/ush/preamble.sh" + LATVAL="1/1/1/1/5;5" pixels="1728;1472" cp "${HOMEgfs}/gempak/fix/coltbl.spc" coltbl.xwp @@ -533,41 +535,41 @@ EOF # Copy the GIF images into my area -cp "${hgttmp700dev}" "${COM_ATMOS_GEMPAK_GIF}" -cp "${hgttmp500dev}" "${COM_ATMOS_GEMPAK_GIF}" -cp "${hgtiso300dev}" "${COM_ATMOS_GEMPAK_GIF}" -cp "${hgtiso250dev}" "${COM_ATMOS_GEMPAK_GIF}" -cp "${hgttmp250dev}" "${COM_ATMOS_GEMPAK_GIF}" -cp "${hgtiso200dev}" "${COM_ATMOS_GEMPAK_GIF}" -cp "${hgtiso100dev}" "${COM_ATMOS_GEMPAK_GIF}" -cp "${hgttmp100dev}" "${COM_ATMOS_GEMPAK_GIF}" -cp "${mslpthksfcdev}" "${COM_ATMOS_GEMPAK_GIF}" -cp "${mslpthksfcusdev}" "${COM_ATMOS_GEMPAK_GIF}" -cp "${hgtvor500dev}" "${COM_ATMOS_GEMPAK_GIF}" -cp "${hgtvor500usdev}" "${COM_ATMOS_GEMPAK_GIF}" -cp "${liftdev}" "${COM_ATMOS_GEMPAK_GIF}" -cp "${prswshtropdev}" "${COM_ATMOS_GEMPAK_GIF}" -cp "${rhvvel700dev}" "${COM_ATMOS_GEMPAK_GIF}" +cp "${hgttmp700dev}" "${COMOUT_ATMOS_GEMPAK_GIF}" +cp "${hgttmp500dev}" "${COMOUT_ATMOS_GEMPAK_GIF}" +cp "${hgtiso300dev}" "${COMOUT_ATMOS_GEMPAK_GIF}" +cp "${hgtiso250dev}" "${COMOUT_ATMOS_GEMPAK_GIF}" +cp "${hgttmp250dev}" "${COMOUT_ATMOS_GEMPAK_GIF}" +cp "${hgtiso200dev}" "${COMOUT_ATMOS_GEMPAK_GIF}" +cp "${hgtiso100dev}" "${COMOUT_ATMOS_GEMPAK_GIF}" +cp "${hgttmp100dev}" "${COMOUT_ATMOS_GEMPAK_GIF}" +cp "${mslpthksfcdev}" "${COMOUT_ATMOS_GEMPAK_GIF}" +cp "${mslpthksfcusdev}" "${COMOUT_ATMOS_GEMPAK_GIF}" +cp "${hgtvor500dev}" "${COMOUT_ATMOS_GEMPAK_GIF}" +cp "${hgtvor500usdev}" "${COMOUT_ATMOS_GEMPAK_GIF}" +cp "${liftdev}" "${COMOUT_ATMOS_GEMPAK_GIF}" +cp "${prswshtropdev}" "${COMOUT_ATMOS_GEMPAK_GIF}" +cp "${rhvvel700dev}" "${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}" "${COM_ATMOS_GEMPAK_GIF}/${hgttmp700dev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${hgttmp500dev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${hgtiso300dev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${hgtiso250dev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${hgttmp250dev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${hgtiso200dev}" -# "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${hgttmp200dev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${hgtiso100dev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${hgttmp100dev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${mslpthksfcdev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${mslpthksfcusdev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${hgtvor500dev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${hgtvor500usdev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${liftdev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${prswshtropdev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${rhvvel700dev}" + "${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}/${hgttmp250dev}" + "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgtiso200dev}" +# "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgttmp200dev}" + "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgtiso100dev}" + "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgttmp100dev}" + "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${mslpthksfcdev}" + "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${mslpthksfcusdev}" + "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgtvor500dev}" + "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgtvor500usdev}" + "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${liftdev}" + "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${prswshtropdev}" + "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${rhvvel700dev}" @@ -576,7 +578,7 @@ fi # Convert the 500mb NH Hgts/Temps chart to tif, attach a heading and # send to TOC via the NTC -export input=${COM_ATMOS_GEMPAK_GIF}/${hgttmp500dev} +export input=${COMOUT_ATMOS_GEMPAK_GIF}/${hgttmp500dev} export HEADER=YES export OUTPATH=${DATA}/gfs_500_hgt_tmp_nh_anl_${cyc}.tif "${USHgfs}/make_tif.sh" diff --git a/gempak/ush/gempak_gfs_fhhh_gif.sh b/gempak/ush/gempak_gfs_fhhh_gif.sh index 33f5764068..2a89219ecc 100755 --- a/gempak/ush/gempak_gfs_fhhh_gif.sh +++ b/gempak/ush/gempak_gfs_fhhh_gif.sh @@ -7,6 +7,8 @@ # ######################################################################### +source "${HOMEgfs}/ush/preamble.sh" + LATVAL="1/1/1/1/5;5" pixels="1728;1472" cp "${HOMEgfs}/gempak/fix/coltbl.spc" coltbl.xwp @@ -170,18 +172,18 @@ EOF # Copy the GIF images into my area -cp "${mslpthksfcdev}" "${COM_ATMOS_GEMPAK_GIF}" -cp "${hgtvor500dev}" "${COM_ATMOS_GEMPAK_GIF}" -cp "${hgtvor500usdev}" "${COM_ATMOS_GEMPAK_GIF}" -cp "${rhvvel700dev}" "${COM_ATMOS_GEMPAK_GIF}" +cp "${mslpthksfcdev}" "${COMOUT_ATMOS_GEMPAK_GIF}" +cp "${hgtvor500dev}" "${COMOUT_ATMOS_GEMPAK_GIF}" +cp "${hgtvor500usdev}" "${COMOUT_ATMOS_GEMPAK_GIF}" +cp "${rhvvel700dev}" "${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}" "${COM_ATMOS_GEMPAK_GIF}/${mslpthksfcdev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${hgtvor500dev}" - # "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${hgtvor500usdev}" - "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COM_ATMOS_GEMPAK_GIF}/${rhvvel700dev}" + "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${mslpthksfcdev}" + "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgtvor500dev}" + # "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${hgtvor500usdev}" + "${DBNROOT}/bin/dbn_alert" MODEL NCDCGIF "${job}" "${COMOUT_ATMOS_GEMPAK_GIF}/${rhvvel700dev}" fi echo "GEMPAK_GIF ${fhr3} hour completed normally" diff --git a/jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF b/jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF index d62c3320a1..3abc7e538a 100755 --- a/jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF +++ b/jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF @@ -29,17 +29,20 @@ export COMPONENT="atmos" ############################################## # Define COM directories ############################################## -YMD=${PDY} HH=${cyc} declare_from_tmpl -rx "COM_OBS" -GRID=1p00 YMD=${PDY} HH=${cyc} declare_from_tmpl -rx "COM_ATMOS_GEMPAK_1p00:COM_ATMOS_GEMPAK_TMPL" +YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COMIN_OBS:COM_OBS_TMPL +GRID=1p00 YMD=${PDY} HH=${cyc} declare_from_tmpl -rx "COMIN_ATMOS_GEMPAK_1p00:COM_ATMOS_GEMPAK_TMPL" for grid in gif upper_air; do - gempak_dir="COM_ATMOS_GEMPAK_${grid^^}" + # This job reads and writes to the GEMPAK directories + gempak_dir="COMIN_ATMOS_GEMPAK_${grid^^}" + gempak_out_dir="COMOUT_ATMOS_GEMPAK_${grid^^}" GRID=${grid} YMD=${PDY} HH=${cyc} declare_from_tmpl -rx "${gempak_dir}:COM_ATMOS_GEMPAK_TMPL" + GRID=${grid} YMD=${PDY} HH=${cyc} declare_from_tmpl -rx "${gempak_out_dir}:COM_ATMOS_GEMPAK_TMPL" if [[ ! -d "${!gempak_dir}" ]]; then mkdir -m 775 -p "${!gempak_dir}"; fi done -YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COM_ATMOS_WMO -if [[ ! -d "${COM_ATMOS_WMO}" ]]; then mkdir -m 775 -p "${COM_ATMOS_WMO}"; fi +YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COMOUT_ATMOS_WMO:COM_ATMOS_WMO_TMPL +if [[ ! -d "${COMOUT_ATMOS_WMO}" ]]; then mkdir -m 775 -p "${COMOUT_ATMOS_WMO}"; fi export SENDDBN=${SENDDBN:-NO} export DBNROOT=${DBNROOT:-${UTILROOT}/fakedbn} @@ -65,4 +68,3 @@ fi if [[ "${KEEPDATA}" != "YES" ]] ; then rm -rf "${DATA}" fi - diff --git a/modulefiles/module_base.wcoss2.lua b/modulefiles/module_base.wcoss2.lua index 830ea78b05..ad4f45f7d5 100644 --- a/modulefiles/module_base.wcoss2.lua +++ b/modulefiles/module_base.wcoss2.lua @@ -17,6 +17,7 @@ load(pathJoin("libjpeg", (os.getenv("libjpeg_ver") or "None"))) load(pathJoin("udunits", (os.getenv("udunits_ver") or "None"))) load(pathJoin("gsl", (os.getenv("gsl_ver") or "None"))) load(pathJoin("cdo", (os.getenv("cdo_ver") or "None"))) +load(pathJoin("imagemagick", (os.getenv("imagemagick_ver") or "None"))) load(pathJoin("hdf5", (os.getenv("hdf5_ver") or "None"))) load(pathJoin("netcdf", (os.getenv("netcdf_ver") or "None"))) diff --git a/scripts/exgfs_atmos_gempak_gif_ncdc_skew_t.sh b/scripts/exgfs_atmos_gempak_gif_ncdc_skew_t.sh index f7e981c6b6..e8a7c305d5 100755 --- a/scripts/exgfs_atmos_gempak_gif_ncdc_skew_t.sh +++ b/scripts/exgfs_atmos_gempak_gif_ncdc_skew_t.sh @@ -27,7 +27,7 @@ if [[ "${MODEL}" == GDAS ]] || [[ "${MODEL}" == GFS ]]; then max_tries=180 for fhr in ${fcsthrs}; do fhr3=$(printf %03d "${fhr}") - export GRIBFILE=${COM_ATMOS_GEMPAK_1p00}/${RUN}_1p00_${PDY}${cyc}f${fhr3} + export GRIBFILE=${COMIN_ATMOS_GEMPAK_1p00}/${RUN}_1p00_${PDY}${cyc}f${fhr3} if ! wait_for_file "${GRIBFILE}" "${sleep_interval}" "${max_tries}" ; then echo "FATAL ERROR: ${GRIBFILE} not found after ${max_tries} iterations" exit 10 @@ -50,7 +50,7 @@ export RSHPDY="${PDY:4:}${PDY:2:2}" cp "${HOMEgfs}/gempak/dictionaries/sonde.land.tbl" sonde.land.tbl cp "${HOMEgfs}/gempak/dictionaries/metar.tbl" metar.tbl sort -k 2n,2 metar.tbl > metar_stnm.tbl -cp "${COM_OBS}/${model}.${cycle}.adpupa.tm00.bufr_d" fort.40 +cp "${COMIN_OBS}/${model}.${cycle}.adpupa.tm00.bufr_d" fort.40 err=$? if (( err != 0 )) ; then echo "FATAL ERROR: File ${model}.${cycle}.adpupa.tm00.bufr_d could not be copied (does it exist?)." @@ -68,11 +68,11 @@ export filesize=$( ls -l rdbfmsua.out | awk '{print $5}' ) ################################################################ if (( filesize > 40 )); then - cp rdbfmsua.out "${COM_ATMOS_GEMPAK_UPPER_AIR}/${RUN}.${cycle}.msupperair" - cp sonde.idsms.tbl "${COM_ATMOS_GEMPAK_UPPER_AIR}/${RUN}.${cycle}.msupperairtble" + cp rdbfmsua.out "${COMOUT_ATMOS_GEMPAK_UPPER_AIR}/${RUN}.${cycle}.msupperair" + cp sonde.idsms.tbl "${COMOUT_ATMOS_GEMPAK_UPPER_AIR}/${RUN}.${cycle}.msupperairtble" if [[ ${SENDDBN} = "YES" ]]; then - "${DBNROOT}/bin/dbn_alert" DATA MSUPPER_AIR "${job}" "${COM_ATMOS_GEMPAK_UPPER_AIR}/${RUN}.${cycle}.msupperair" - "${DBNROOT}/bin/dbn_alert" DATA MSUPPER_AIRTBL "${job}" "${COM_ATMOS_GEMPAK_UPPER_AIR}/${RUN}.${cycle}.msupperairtble" + "${DBNROOT}/bin/dbn_alert" DATA MSUPPER_AIR "${job}" "${COMOUT_ATMOS_GEMPAK_UPPER_AIR}/${RUN}.${cycle}.msupperair" + "${DBNROOT}/bin/dbn_alert" DATA MSUPPER_AIRTBL "${job}" "${COMOUT_ATMOS_GEMPAK_UPPER_AIR}/${RUN}.${cycle}.msupperairtble" fi fi diff --git a/sorc/gfs_utils.fd b/sorc/gfs_utils.fd index 4848ecbb5e..53c6b285f4 160000 --- a/sorc/gfs_utils.fd +++ b/sorc/gfs_utils.fd @@ -1 +1 @@ -Subproject commit 4848ecbb5e713b16127433e11f7d3edc6ac784c4 +Subproject commit 53c6b285f4624a19b93251f3e543ea5d78a9484a diff --git a/sorc/link_workflow.sh b/sorc/link_workflow.sh index b70b9e894f..1988fe60f6 100755 --- a/sorc/link_workflow.sh +++ b/sorc/link_workflow.sh @@ -167,9 +167,6 @@ cd "${HOMEgfs}/ush" || exit 8 for file in emcsfc_ice_blend.sh global_cycle_driver.sh emcsfc_snow.sh global_cycle.sh; do ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_utils.fd/ush/${file}" . done -for file in make_ntc_bull.pl make_NTC_file.pl make_tif.sh month_name.sh; do - ${LINK_OR_COPY} "${HOMEgfs}/sorc/gfs_utils.fd/ush/${file}" . -done # Link these templates from ufs-weather-model cd "${HOMEgfs}/parm/ufs" || exit 1 diff --git a/ush/make_NTC_file.pl b/ush/make_NTC_file.pl new file mode 100755 index 0000000000..62905f6aae --- /dev/null +++ b/ush/make_NTC_file.pl @@ -0,0 +1,118 @@ +#!/usr/bin/perl +# +#------------------------------------------------------ +# +# This is make_NTC_file.pl +# It attaches the appropriate headers to the input file +# and copies it to a unique name for input to NTC. +# +# The following lines are prepended to the file: +# 1. A Bulletin Flag Field Seperator +# 2. A WMO header line +# 3. An optional subheader, e.g. DIFAX1064 +# +# Input wmoheader Originator datetime path +# where: +# wmoheader - WMO id to use in WMO header. +# subheader - "NONE" if none. +# Originator - Originator to use in WMO header +# datetime - date/time to use in WMO header, yyyymmddhh +# path - name input file +# output_path - name of output file +# +# Author: Paula Freeman based on script by Larry Sager +# +#------------------------------------------------------ + +$NArgs = @ARGV; + +if ($NArgs < 6) { + usage (); + exit; +} + +# +# Get input +# + +$WMOHeader=shift; +$Origin=shift; +$YYYYMMDDHH=shift; +$SubHeader=shift; +$Filename=shift; +$OutputFilename=shift; + +print "Filename is $Filename\n"; +print "Output Filename is $OutputFilename\n"; +$YYYYMMDDHH =~ /\d{4}(\d{2})(\d{4})/; +$MMDDHH = $1 . $2; +$DDHHMM = $2 . "00"; +print "WMOHeader = $WMOHeader\n"; +print "SubHeader = $SubHeader\n"; +print "Origin = $Origin\n"; + + +if ( ($WMOHeader eq "") || ($Origin eq "") || ($YYYYMMDDHH eq "") || ($Filename eq "") || ($OutputFilename eq "") || ($SubHeader eq "") ) { + usage (); + exit; +} + +# +# Create the file for TOC +# + + make_toc (); +# +# + + +sub usage () { + print "Usage: $0 \n"; +} + +sub make_toc { + +# +# Attach WMO header and subheader (if not "NONE"). +# Get the bytecount of file to insert into the Bulletin Flag Field Seperator. +# Add in length of WMO header, plus two carriage returns and line feed. +# If Subheader specified, count that in also, plus line a feed. +# + + $Header = "$WMOHeader $Origin $DDHHMM"; + $ByteCount = `wc -c $Filename | cut -c1-8`; + $ByteCount= $ByteCount + length($Header) + 3; + if ($SubHeader =~ /NONE/) { + print "No Subheader\n"; + } else { + if ($SubHeader =~ /IMAG/){ + $ByteCount = $ByteCount + length($SubHeader); + } else { + $ByteCount = $ByteCount + length($SubHeader) + 3; + } + } + $BulletinFlagFieldSep = sprintf( "****%10.10d****", $ByteCount); + + open(OUTFILE, ">$OutputFilename") or die "Cannot open $OutputFilename for output."; + print OUTFILE "$BulletinFlagFieldSep\n"; + print OUTFILE "$Header\r\r\n"; + if ($SubHeader =~ /NONE/) { + print "No Subheader\n"; + } else { + if ($SubHeader =~ /IMAG/){ + print OUTFILE "$SubHeader"; + } else { + print OUTFILE "$SubHeader\r\r\n"; + } + } + open (INFILE, $Filename) or die "Cannot open $Filename"; + + while ($rec=) { + print OUTFILE $rec; + } + + close INFILE; + close OUTFILE; + + print "$Filename -> $OutputFilename\n"; +} diff --git a/ush/make_ntc_bull.pl b/ush/make_ntc_bull.pl new file mode 100755 index 0000000000..6dc9e29231 --- /dev/null +++ b/ush/make_ntc_bull.pl @@ -0,0 +1,242 @@ +#!/usr/bin/perl +# +#------------------------------------------------------ +# +# This is make_ntc_bull.pl +# It attaches the appropriate headers to the input file +# and copies it to a unique name for input to NTC. +# +# A Bulletin Flag Field Separator is prepended to the +# text bulletin. This TOC header contains the total +# number of bytes in the product not counting the +# bulletin flag field separator. +# +# Input: +# File identifier - Output name identier. +# subheader - "NONE" if none. +# Originator - Not used currently +# datetime - Not used currently +# filename - input file name +# output_path - name of output file +# +# Author: Larry Sager based on a script by Paula Freeman +# +# 31 Oct 05 -- new script +# +#------------------------------------------------------ + +if ($ENV{job}) { $job=$ENV{job}; } +if ($ENV{SENDDBN}) { $SENDDBN=$ENV{SENDDBN}; } +$NArgs = @ARGV; + +if ($NArgs < 6) { + usage (); + exit; +} + +# +# Get input +# + +$NAME=shift; +$WMOname=shift; +$ORIGname=shift; +$DATEname=shift; +$Filename=shift; +$OutputFilename=shift; +print " Input : $Filename"; +print " Output: $OutputFilename"; + + +if ( ($Filename eq "") || ($OutputFilename eq "") ) { + usage (); + exit; +} + +# +# Create the file for TOC +# + if ( $NAME eq "plot" ) { + make_tocplot (); + } + elsif ($NAME eq "redb" ) { + make_tocredb (); + } + else { + make_tocbull (); + } +# +# + + +sub usage () { + print "Usage: $0 \n"; +} + +sub make_tocbull { + +# +# Attach WMO header +# Get the bytecount of file to insert into the Bulletin Flag Field Seperator. +# + + $ix = 0; + $under = "_"; + open (INFILE, $Filename) or die "Cannot open $Filename"; + + while ($cho=) { + $rec = $rec . $cho; + } + $cho = $rec; + $cho =~ s/\n//g; + $cho =~ s/<<@@/\r\r\n/g; + $cho =~ s/<<@/\r\r\n/g; + $cho =~ s/<//g; + $cho =~ s/\^//g; + $cho =~ s/\$//g; + $cho =~ s/\|/+/g; + $value = 40; + $Outp="$OutputFilename"; + open(OUTFILE, ">$Outp") or die "Cannot open $OutputFilename for output."; + while ($ix == 0) { + $cho = substr($cho,$value); + $value = 38; + $cho =~ s/'1/\&\&/; + $cho =~ s/'0/\&\&/; +# print "cho is $cho"; + ($cho2,$cho) = split(/\&\&/,$cho); + ($cho2,$cho3) = split(/\%/,$cho2); +# print "cho2 is $cho2"; + $ByteCount = length($cho2); + print " length is $ByteCount "; + $BulletinFlagFieldSep = sprintf( "****%10.10d****", $ByteCount); + if ($ByteCount > 50 ) { + print OUTFILE "$BulletinFlagFieldSep\n"; + print OUTFILE $cho2; + } + else { + $ix = 1; + } + } + close OUTFILE; + if ($SENDDBN eq "YES" ) { +# Modified 20051205 by wx11rp to ensure the current production machine is used. +# $dbn_alert="/gpfs/w/nco/dbnet/bin/dbn_alert"; + $dbn_alert=$ENV{'DBNROOT'} . "/bin/dbn_alert"; + $type="GRIB_LOW"; + $job2=$job; + $subtype=$ORIGname; + $file_path=$Outp; + @command = ($dbn_alert, $type, $subtype, $job2, $file_path); + if (system (@command) != 0) { + print "Error alerting: @command \n"; + } + } + + close INFILE; + close OUTFILE; + + print "$Filename -> $OutputFilename\n"; +} + +sub make_tocplot { + +# +# Attach WMO header +# Get the bytecount of file to insert into the Bulletin Flag Field Seperator. +# + + $ix = 0; + $under = "_"; + open (INFILE, $Filename) or die "Cannot open $Filename"; + + while ($cho=) { + $rec = $rec . $cho; + } + $cho = $rec; +# $Outp="$OutputFilename$under$job"; + $Outp="$OutputFilename"; + open(OUTFILE, ">$Outp") or die "Cannot open $OutputFilename for output."; + while ($ix == 0) { + $cho =~ s/\$\$/\&\&/; + ($cho2,$cho) = split(/\&\&/,$cho); +# $cho2 =~ s/@/ /g; +# $cho2 = $cho2 . " "; + $ByteCount = length($cho2); + print " length is $ByteCount "; + $BulletinFlagFieldSep = sprintf( "****%10.10d****", $ByteCount); + if ($ByteCount > 50 ) { + print OUTFILE "$BulletinFlagFieldSep\n"; + print OUTFILE $cho2; + } + else { + $ix = 1; + } + } + close OUTFILE; + if ($SENDDBN eq "YES" ) { +# 20051205 Modified by wx11rp to allow the script to run on any manchine labeled as the production machine +# $dbn_alert="/gpfs/w/nco/dbnet/bin/dbn_alert"; + $dbn_alert=$ENV{'DBNROOT'} . "/bin/dbn_alert"; + $type="GRIB_LOW"; + $subtype=$DATEname; + $job2=$job; + $file_path=$Outp; + @command = ($dbn_alert, $type, $subtype, $job2, $file_path); + if (system (@command) != 0) { + print "Error alerting: @command \n"; + } + } + + close INFILE; + close OUTFILE; + + print "$Filename -> $OutputFilename\n"; +} +sub make_tocredb { + +# +# Prepare the Redbook graphic for transmission to TOC by removing the AWIPS +# header and creating an NTC header. Get the Bytecount of the file to +# insert into the Bulletin Flag Field Seperator. +# + + $ix = 0; + $under = "_"; + open (INFILE, $Filename) or die "Cannot open $Filename"; + + while ($cho=) { + $rec = $rec . $cho; + } + $cho = $rec; + $Outp="$OutputFilename"; + open(OUTFILE, ">$Outp") or die "Cannot open $OutputFilename for output."; + $cho = substr($cho,24); + $ByteCount = length($cho); + print " length is $ByteCount "; + $BulletinFlagFieldSep = sprintf( "****%10.10d****", $ByteCount); + if ($ByteCount > 50 ) { + print OUTFILE "$BulletinFlagFieldSep\n"; + print OUTFILE $cho; + } + close OUTFILE; + if ($SENDDBN eq "YES" ) { +# 20051205 Modified by wx11rp to allow the script to run on any manchine labeled as the production machine +# $dbn_alert="/gpfs/w/nco/dbnet/bin/dbn_alert"; + $dbn_alert=$ENV{'DBNROOT'} . "/bin/dbn_alert"; + $type="GRIB_LOW"; + $subtype=$DATEname; + $job2=$job; + $file_path=$Outp; + @command = ($dbn_alert, $type, $subtype, $job2, $file_path); + if (system (@command) != 0) { + print "Error alerting: @command \n"; + } + } + + close INFILE; + close OUTFILE; + + print "$Filename -> $OutputFilename\n"; +} diff --git a/ush/make_tif.sh b/ush/make_tif.sh new file mode 100755 index 0000000000..93ae4ca20e --- /dev/null +++ b/ush/make_tif.sh @@ -0,0 +1,31 @@ +#! /usr/bin/env bash + +source "${HOMEgfs}/ush/preamble.sh" + +cd "${DATA}" + +outname=out.tif + +convert gif:"${input}" fax:"${outname}" + +# +# Add the ntc heading: +# + +WMO=QTUA11 +ORIG=KWBC +PDYHH="${PDY}${cyc}" + +if [[ "${HEADER}" == "YES" ]]; then + INPATH="${DATA}/${outname}" + SUB=DFAX1064 + "${HOMEgfs}/ush/make_NTC_file.pl" "${WMO}" "${ORIG}" "${PDYHH}" "${SUB}" "${INPATH}" "${OUTPATH}" +# +# Send the graphic to TOC + +cp "${OUTPATH}" "${COMOUT_ATMOS_WMO}/gfs_500_hgt_tmp_nh_anl_${cyc}.tif" + if [[ "${SENDDBN}" == "YES" ]]; then + + "${DBNROOT}/bin/dbn_alert" GRIB_LOW "${NET}" "${job}" "${COMOUT_ATMOS_WMO}/gfs_500_hgt_tmp_nh_anl_${cyc}.tif" + fi +fi diff --git a/ush/month_name.sh b/ush/month_name.sh new file mode 100755 index 0000000000..48437e21d5 --- /dev/null +++ b/ush/month_name.sh @@ -0,0 +1,112 @@ +#!/bin/ksh + +#################################################################### +# +# SCRIPT: month_name.sh +# +# This script returns the name/abreviation of a month +# in a small text file, month_name.txt. It also echos the +# name/abreviation to stdout. The form of the returned +# name/abreviation is specified by the script arguments. +# +# USAGE: ./month_name.sh < month > < monthspec> +# +# EXAMPLE: ./month_name.sh 5 MON +# +# month spec contents of month_name.txt +# ----------- ------ ---------------------------- +# +# 6/06 Mon Jun +# 8/08 Month August +# 9/09 MON SEP +# 11 MONTH NOVEMBER +# +# +# Note: Variables may be assigned the value of the returned name +# by either of the following methods: +# +# MM=`cat month_name.txt` after executing month_name.sh +# - OR - +# MM=`month_name.sh 5 MON` (for example) +# +# +# +# HISTORY: 07/08/2005 - Original script +# +# +#################################################################### + + + typeset -Z2 month_num + + + month_num=$1 + month_spec=$2 + + case ${month_num} in + + 01) Mon=Jan + Month=January ;; + + 02) Mon=Feb + Month=February ;; + + 03) Mon=Mar + Month=March ;; + + 04) Mon=Apr + Month=April ;; + + 05) Mon=May + Month=May ;; + + 06) Mon=Jun + Month=June ;; + + 07) Mon=Jul + Month=July ;; + + 08) Mon=Aug + Month=August ;; + + 09) Mon=Sep + Month=September ;; + + 10) Mon=Oct + Month=October ;; + + 11) Mon=Nov + Month=November ;; + + 12) Mon=Dec + Month=December ;; + + esac + + + if [ ${month_spec} = Mon ]; then + + echo ${Mon} + echo ${Mon} > month_name.txt + + elif [ ${month_spec} = Month ]; then + + echo ${Month} + echo ${Month} > month_name.txt + + elif [ ${month_spec} = MON ]; then + + MON=`echo ${Mon} | tr [a-z] [A-Z]` + echo ${MON} + echo ${MON} > month_name.txt + + elif [ ${month_spec} = MONTH ]; then + + MONTH=`echo ${Month} | tr [a-z] [A-Z]` + echo ${MONTH} + echo ${MONTH} > month_name.txt + + fi + + + diff --git a/versions/run.wcoss2.ver b/versions/run.wcoss2.ver index f5b11b3a6f..6165bb37e9 100644 --- a/versions/run.wcoss2.ver +++ b/versions/run.wcoss2.ver @@ -27,6 +27,7 @@ export jasper_ver=2.0.25 export zlib_ver=1.2.11 export libpng_ver=1.6.37 export cdo_ver=1.9.8 +export imagemagick_ver=7.0.8-7 export hdf5_ver=1.10.6 export netcdf_ver=4.7.4 From 8187b7ab92586ae26593a98339a14f0f1e3dd8d7 Mon Sep 17 00:00:00 2001 From: David Huber Date: Wed, 8 Jan 2025 18:54:11 +0000 Subject: [PATCH 12/23] Address shellcheck issues --- ush/make_tif.sh | 2 +- ush/month_name.sh | 37 +++++++++++++++++++------------------ 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/ush/make_tif.sh b/ush/make_tif.sh index 93ae4ca20e..633c4ded0c 100755 --- a/ush/make_tif.sh +++ b/ush/make_tif.sh @@ -2,7 +2,7 @@ source "${HOMEgfs}/ush/preamble.sh" -cd "${DATA}" +cd "${DATA}" || exit 2 outname=out.tif diff --git a/ush/month_name.sh b/ush/month_name.sh index 48437e21d5..458d81296e 100755 --- a/ush/month_name.sh +++ b/ush/month_name.sh @@ -1,4 +1,4 @@ -#!/bin/ksh +#!/bin/bash #################################################################### # @@ -81,32 +81,33 @@ 12) Mon=Dec Month=December ;; + *) + echo "FATAL ERROR input month number (${month_num}) is invalid" + exit 2 + esac - if [ ${month_spec} = Mon ]; then + if [[ "${month_spec}" == "Mon" ]]; then - echo ${Mon} - echo ${Mon} > month_name.txt + echo "${Mon}" + echo "${Mon}" > month_name.txt - elif [ ${month_spec} = Month ]; then + elif [[ "${month_spec}" == "Month" ]; then - echo ${Month} - echo ${Month} > month_name.txt + echo "${Month}" + echo "${Month}" > month_name.txt - elif [ ${month_spec} = MON ]; then + elif [[ "${month_spec}" == "MON" ]; then - MON=`echo ${Mon} | tr [a-z] [A-Z]` - echo ${MON} - echo ${MON} > month_name.txt + MON="${Mon^^}" + echo "${MON}" + echo "${MON}" > month_name.txt - elif [ ${month_spec} = MONTH ]; then + elif [[ "${month_spec}" == "MONTH" ]]; then - MONTH=`echo ${Month} | tr [a-z] [A-Z]` - echo ${MONTH} - echo ${MONTH} > month_name.txt + MONTH="${Month^^}" + echo "${MONTH}" + echo "${MONTH}" > month_name.txt fi - - - From 1309cc0d75ea3445b9c320c2c41cf52f5e0a8d44 Mon Sep 17 00:00:00 2001 From: David Huber Date: Wed, 8 Jan 2025 18:56:13 +0000 Subject: [PATCH 13/23] Add missing braces --- ush/month_name.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ush/month_name.sh b/ush/month_name.sh index 458d81296e..463e4a08be 100755 --- a/ush/month_name.sh +++ b/ush/month_name.sh @@ -93,12 +93,12 @@ echo "${Mon}" echo "${Mon}" > month_name.txt - elif [[ "${month_spec}" == "Month" ]; then + elif [[ "${month_spec}" == "Month" ]]; then echo "${Month}" echo "${Month}" > month_name.txt - elif [[ "${month_spec}" == "MON" ]; then + elif [[ "${month_spec}" == "MON" ]]; then MON="${Mon^^}" echo "${MON}" From ce3924a75ed92bc92053da429ff7038a9d401012 Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 10 Jan 2025 17:34:48 +0000 Subject: [PATCH 14/23] Replace COM with COMIN/OUT for the wavegempak jjob --- jobs/JGLOBAL_WAVE_GEMPAK | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jobs/JGLOBAL_WAVE_GEMPAK b/jobs/JGLOBAL_WAVE_GEMPAK index 9822e4d416..c7b615c560 100755 --- a/jobs/JGLOBAL_WAVE_GEMPAK +++ b/jobs/JGLOBAL_WAVE_GEMPAK @@ -13,9 +13,11 @@ export DBN_ALERT_TYPE=GFS_WAVE_GEMPAK export SENDDBN=${SENDDBN:-YES} export DBNROOT=${DBNROOT:-${UTILROOT}/fakedbn} -YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COM_WAVE_GRID COM_WAVE_GEMPAK +YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \ + COMIN_WAVE_GRID:COM_WAVE_GRID_TMPL \ + COMOUT_WAVE_GEMPAK:COM_WAVE_GEMPAK_TMPL -if [[ ! -d ${COM_WAVE_GEMPAK} ]]; then mkdir -p "${COM_WAVE_GEMPAK}"; fi +if [[ ! -d ${COMOUT_WAVE_GEMPAK} ]]; then mkdir -p "${COMOUT_WAVE_GEMPAK}"; fi ######################################################## # Execute the script. From cdea635be70e5a69da861ddb7ad0567446dcbf15 Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 10 Jan 2025 17:38:53 +0000 Subject: [PATCH 15/23] Fix multiple issues with waveawipsgridded job --- parm/config/gfs/config.waveawipsgridded | 8 +- scripts/exgfs_wave_prdgen_gridded.sh | 152 +++++++++++++----------- 2 files changed, 91 insertions(+), 69 deletions(-) diff --git a/parm/config/gfs/config.waveawipsgridded b/parm/config/gfs/config.waveawipsgridded index bd7c7c11e4..48cbfda6a7 100644 --- a/parm/config/gfs/config.waveawipsgridded +++ b/parm/config/gfs/config.waveawipsgridded @@ -8,6 +8,12 @@ echo "BEGIN: config.waveawipsgridded" # Get task specific resources . $EXPDIR/config.resources waveawipsgridded -export DBNROOT=/dev/null +# AWIPS output frequency +export FHMAX_HF_WAV_WMO=72 +export FHMAX_WAV_WMO=180 +export FHOUT_HF_WAV_WMO=3 +export FHOUT_WAV_WMO=6 +export FHMAX_HF_WAV_WMO=$(( FHMAX_HF_WAV_WMO > FHMAX_WAV ? FHMAX_WAV : FHMAX_HF_WAV_WMO )) +export FHMAX_WAV_WMO=$(( FHMAX_WAV_WMO > FHMAX_WAV ? FHMAX_WAV : FHMAX_WAV_WMO )) echo "END: config.waveawipsgridded" diff --git a/scripts/exgfs_wave_prdgen_gridded.sh b/scripts/exgfs_wave_prdgen_gridded.sh index 9111c81273..badd0f3c2e 100755 --- a/scripts/exgfs_wave_prdgen_gridded.sh +++ b/scripts/exgfs_wave_prdgen_gridded.sh @@ -1,4 +1,5 @@ #! /usr/bin/env bash +#shellcheck enable=all ############################################################################### # # @@ -9,7 +10,7 @@ # - Supplemental error output is witten to the wave.log file. # # # # COM inputs: # -# - ${COMIN_WAVE_GRID}/${RUNwave}.${cycle}.${grdID}.f${fhr}.grib2 # +# - ${COMIN_WAVE_GRID}/${RUNwave}.${cycle}.${grdIDin}.f${fhr}.grib2 # # # # COM outputs: # # - ${COMOUT_WAVE_WMO}/grib2.${cycle}.f${fhr}.awipsww3_${grdOut} # @@ -31,38 +32,40 @@ source "${USHgfs}/preamble.sh" export RUNwave=${RUNwave:-${RUN}wave} export envir=${envir:-ops} export fstart=${fstart:-0} - export FHMAX_WAV=${FHMAX_WAV:-180} #180 Total of hours to process - export FHMAX_HF_WAV=${FHMAX_HF_WAV:-72} #from 00 to 72 inc=3 - export FHOUT_WAV=${FHOUT_WAV:-6} #from 72 to 180 inc=6 - export FHOUT_HF_WAV=${FHOUT_HF_WAV:-3} + export FHMAX_WAV=${FHMAX_WAV_WMO:-180} #180 Total of hours to process + export FHMAX_HF_WAV=${FHMAX_HF_WAV_WMO:-72} #from 00 to 72 inc=3 + export FHOUT_WAV=${FHOUT_WAV_WMO:-6} #from 72 to 180 inc=6 + export FHOUT_HF_WAV=${FHOUT_HF_WAV_WMO:-3} export maxtries=720 export cyc=${cyc:-00} export cycle=${cycle:-t${cyc}z} export pgmout=OUTPUT.$$ export DATA=${DATA:-${DATAROOT:?}/${job}.$$} - mkdir -p $DATA - cd $DATA + mkdir -p "${DATA}" + cd "${DATA}" || exit 1 export wavelog=${DATA}/${RUNwave}_prdggridded.log echo "Starting MWW3 GRIDDED PRODUCTS SCRIPT" +# Input grid +grid_in="${waveinterpGRD:-glo_15mxt}" # Output grids - # grids=${grids:-ao_9km at_10m ep_10m wc_10m glo_30m} -grids=${grids:-ak_10m at_10m ep_10m wc_10m glo_30m} +grids=${grids:-ao_9km at_10m ep_10m wc_10m glo_30m} # export grids=${wavepostGRD} maxtries=${maxtries:-720} # 0.b Date and time stuff - export date=$PDY + start_time=$(date) + export date=${PDY} export YMDH=${PDY}${cyc} echo ' ' echo ' ****************************' echo ' *** MWW3 PRODUCTS SCRIPT ***' echo ' ****************************' - echo " $date $cycle" + echo " ${date} ${cycle}" echo ' ' - echo "Starting at : $(date)" + echo "Starting at : ${start_time}" echo ' ' echo " AWIPS grib fields" - echo " Wave Grids : $grids" + echo " Wave Grids : ${grids}" echo ' ' set_trace @@ -79,16 +82,28 @@ grids=${grids:-ak_10m at_10m ep_10m wc_10m glo_30m} ASWDIR=(SWDIR1 SWDIR2) # Indices of DIRECTIONS from partitions # (should be same as ASWELL) #export arrpar=(WIND UGRD VGRD HTSGW PERPW DIRPW WVHGT WVPER WVDIR WDIR ${ASWELL[@]} ${ASWDIR[@]} ${ASWPER[@]}) - export arrpar=(WIND WDIR UGRD VGRD HTSGW PERPW DIRPW WVHGT ${ASWELL[@]} WVPER ${ASWPER[@]} WVDIR ${ASWDIR[@]} ) - export nparam=$(echo ${arrpar[@]} | wc -w) + export arrpar=(WIND WDIR UGRD VGRD HTSGW PERPW DIRPW WVHGT "${ASWELL[@]}" WVPER "${ASWPER[@]}" WVDIR "${ASWDIR[@]}" ) + export nparam=$(echo "${arrpar[@]}" | wc -w) # 1.a Grib file (AWIPS and FAX charts) - fhcnt=$fstart - while [ $fhcnt -le $FHMAX_WAV ]; do - fhr=$(printf "%03d" $fhcnt) - for grdOut in $grids;do - case $grdOut in + # Get input grid + # TODO flesh this out with additional input grids if needed + case ${grid_in} in + glo_200) + grdIDin='global.2p00' ;; + glo_15mxt) + grdIDin='global.0p25' ;; + *) + echo "FATAL ERROR Unrecognized input grid ${grid_in}" + exit 2;; + esac + + fhcnt=${fstart} + while [[ "${fhcnt}" -le "${FHMAX_WAV}" ]]; do + fhr=$(printf "%03d" "${fhcnt}") + for grdOut in ${grids}; do + case ${grdOut} in ao_9km) grdID='arctic.9km' ;; at_10m) grdID='atlocn.0p16' ;; ep_10m) grdID='epacif.0p16' ;; @@ -100,56 +115,58 @@ grids=${grids:-ak_10m at_10m ep_10m wc_10m glo_30m} esac # - GRIBIN="${COM_WAVE_GRID}/${RUNwave}.${cycle}.${grdID}.f${fhr}.grib2" + GRIBIN="${COMIN_WAVE_GRID}/${RUNwave}.${cycle}.${grdIDin}.f${fhr}.grib2" GRIBIN_chk="${GRIBIN}.idx" sleep_interval=5 max_tries=1000 if ! wait_for_file "${GRIBIN_chk}" "${sleep_interval}" "${max_tries}"; then echo "FATAL ERROR: ${GRIBIN_chk} not found after waiting $((sleep_interval * ( max_tries - 1))) secs" - echo "$RUNwave $grdID ${fhr} prdgen $date $cycle : GRIB file missing." >> $wavelog - err=1;export err;${errchk} || exit ${err} + echo "${RUNwave} ${grdIDin} ${fhr} prdgen ${date} ${cycle} : GRIB file missing." >> "${wavelog}" + err=1;export err;${errchk} || exit "${err}" fi - GRIBOUT=$RUNwave.$cycle.$grdID.f${fhr}.clipped.grib2 + GRIBOUT="${RUNwave}.${cycle}.${grdID}.f${fhr}.clipped.grib2" iparam=1 - while [ ${iparam} -le ${nparam} ]; do - nip=${arrpar[$iparam-1]} - prepar=$(echo $nip | rev | cut -c2- | rev) #Part prefix (assumes 1 digit index) - paridx=$(echo $nip | rev | cut -c-1) + while [[ "${iparam}" -le "${nparam}" ]]; do + nip=${arrpar[${iparam}-1]} + prepar=${nip::-1} # Part prefix (assumes 1 digit index) + paridx="${nip:0-1}" npart=0 - case $prepar in + case ${prepar} in SWELL) npart=1 ;; SWDIR) npart=1 ;; SWPER) npart=1 ;; *) npart=0 ;; esac - echo $nip $prepar $paridx $npart - rm temp.grib2 - if [ "${npart}" = "0" ]; then - $WGRIB2 $GRIBIN -s | grep ":${nip}" | $WGRIB2 -i $GRIBIN -grib temp.grib2 > wgrib.out 2>&1 - $WGRIB2 temp.grib2 -append -grib $GRIBOUT + echo "${nip} ${prepar} ${paridx} ${npart}" + rm -f temp.grib2 + if [[ "${npart}" -eq 0 ]]; then + #shellcheck disable=SC2312 + ${WGRIB2} "${GRIBIN}" -s | grep ":${nip}" | "${WGRIB2}" -i "${GRIBIN}" -grib temp.grib2 > wgrib.out 2>&1 + #shellcheck disable=SC2312 + ${WGRIB2} temp.grib2 -append -grib "${GRIBOUT}" else - $WGRIB2 $GRIBIN -s | grep ":${prepar}" | grep "${paridx} in sequence" | \ - $WGRIB2 -i $GRIBIN -grib temp.grib2 > wgrib.out 2>&1 - $WGRIB2 temp.grib2 -append -grib $GRIBOUT + #shellcheck disable=SC2312 + ${WGRIB2} "${GRIBIN}" -s | grep ":${prepar}" | grep "${paridx} in sequence" | \ + ${WGRIB2} -i "${GRIBIN}" -grib temp.grib2 > wgrib.out 2>&1 + ${WGRIB2} temp.grib2 -append -grib "${GRIBOUT}" fi - iparam=$(expr ${iparam} + 1) + iparam=$(( iparam + 1 )) done #end wave param loop #====================================================================== - GRIBIN=$RUNwave.$cycle.$grdID.f${fhr}.clipped.grib2 - GRIBIN_chk=$GRIBIN.idx + GRIBIN="${RUNwave}.${cycle}.${grdID}.f${fhr}.clipped.grib2" - ${NLN} $GRIBIN gribfile.$grdID.f${fhr} + ${NLN} "${GRIBIN}" "gribfile.${grdID}.f${fhr}" # # 1.d Input template files - parmfile=${PARMgfs}/wave/grib2_${RUNwave}.$grdOut.f${fhr} - if [ -f $parmfile ]; then - ${NLN} $parmfile awipsgrb.$grdID.f${fhr} + parmfile="${PARMgfs}/wave/grib2_${RUNwave}.${grdOut}.f${fhr}" + if [[ -f "${parmfile}" ]]; then + ${NLN} "${parmfile}" "awipsgrb.${grdID}.f${fhr}" else - echo '*** ERROR : NO template grib2_${RUNwave}.$grdID.f${fhr} *** ' - echo "$RUNwave $grdID $fhr prdgen $date $cycle : GRIB template file missing." >> $wavelog - err=3;export err;${errchk} || exit ${err} + echo "FATAL ERROR: NO template grib2_${RUNwave}.${grdID}.f${fhr}" + echo "${RUNwave} ${grdID} ${fhr} prdgen ${date} ${cycle} : GRIB template file missing." >> "${wavelog}" + err=3;export err;${errchk} || exit "${err}" fi # # 2. AWIPS product generation @@ -161,26 +178,25 @@ grids=${grids:-ak_10m at_10m ep_10m wc_10m glo_30m} # 2.a.1 Set up for tocgrib2 echo " Do set up for tocgrib2." set_trace - #AWIPSGRB=awipsgrib.$grdID.f${fhr} AWIPSGRB=awipsgrib # 2.a.2 Make GRIB index echo " Make GRIB index for tocgrib2." set_trace - $GRB2INDEX gribfile.$grdID.f${fhr} gribindex.$grdID.f${fhr} + ${GRB2INDEX} "gribfile.${grdID}.f${fhr}" "gribindex.${grdID}.f${fhr}" OK=$? - if [ "$OK" != '0' ] + if [[ ${OK} -ne 0 ]] then - msg="ABNORMAL EXIT: ERROR IN grb2index MWW3 for grid $grdID" + msg="ABNORMAL EXIT: ERROR IN grb2index MWW3 for grid ${grdID}" #set +x echo ' ' echo '******************************************** ' echo '*** FATAL ERROR : ERROR IN grb2index MWW3 *** ' echo '******************************************** ' echo ' ' - echo $msg + echo "${msg}" #set_trace - echo "$RUNwave $grdID prdgen $date $cycle : error in grbindex." >> $wavelog + echo "${RUNwave} ${grdID} prdgen ${date} ${cycle} : error in grbindex." >> "${wavelog}" err=4;export err;err_chk fi @@ -192,13 +208,13 @@ grids=${grids:-ak_10m at_10m ep_10m wc_10m glo_30m} export pgmout=tocgrib2.out . prep_step - export FORT11="gribfile.$grdID.f${fhr}" - export FORT31="gribindex.$grdID.f${fhr}" - export FORT51="$AWIPSGRB.$grdID.f${fhr}" + export FORT11="gribfile.${grdID}.f${fhr}" + export FORT31="gribindex.${grdID}.f${fhr}" + export FORT51="${AWIPSGRB}.${grdID}.f${fhr}" - $TOCGRIB2 < awipsgrb.$grdID.f${fhr} > tocgrib2.out 2>&1 + ${TOCGRIB2} < "awipsgrb.${grdID}.f${fhr}" > tocgrib2.out 2>&1 OK=$? - if [ "$OK" != '0' ]; then + if [[ ${OK} -ne 0 ]]; then cat tocgrib2.out msg="ABNORMAL EXIT: ERROR IN tocgrib2" #set +x @@ -207,9 +223,9 @@ grids=${grids:-ak_10m at_10m ep_10m wc_10m glo_30m} echo '*** FATAL ERROR : ERROR IN tocgrib2 *** ' echo '*************************************** ' echo ' ' - echo $msg + echo "${msg}" #set_trace - echo "$RUNwave prdgen $date $cycle : error in tocgrib2." >> $wavelog + echo "${RUNwave} prdgen ${date} ${cycle} : error in tocgrib2." >> "${wavelog}" err=5;export err;err_chk else echo '*** tocgrib2 ran succesfully *** ' @@ -219,27 +235,27 @@ grids=${grids:-ak_10m at_10m ep_10m wc_10m glo_30m} echo " Get awips GRIB bulletins out ..." #set_trace #set +x - echo " Saving $AWIPSGRB.$grdOut.f${fhr} as grib2.$cycle.awipsww3_${grdID}.f${fhr}" + echo " Saving ${AWIPSGRB}.${grdOut}.f${fhr} as grib2.${cycle}.awipsww3_${grdID}.f${fhr}" echo " in ${COMOUT_WAVE_WMO}" #set_trace cp "${AWIPSGRB}.${grdID}.f${fhr}" "${COMOUT_WAVE_WMO}/grib2.${cycle}.f${fhr}.awipsww3_${grdOut}" #set +x - if [ "$SENDDBN" = 'YES' ] + if [[ "${SENDDBN}" != 'YES' ]] then - echo " Sending $AWIPSGRB.$grdID.f${fhr} to DBRUN." + echo " Sending ${AWIPSGRB}.${grdID}.f${fhr} to DBRUN." "${DBNROOT}/bin/dbn_alert" GRIB_LOW "${RUN}" "${job}" "${COMOUT_WAVE_WMO}/grib2.${cycle}.f${fhr}.awipsww3_${grdOut}" fi - rm -f $AWIPSGRB.$grdID.f${fhr} tocgrib2.out + rm -f "${AWIPSGRB}.${grdID}.f${fhr}" tocgrib2.out done # For grids - if [ $fhcnt -ge $FHMAX_HF_WAV ]; then - inc=$FHOUT_WAV + if [[ ${fhcnt} -ge ${FHMAX_HF_WAV} ]]; then + inc="${FHOUT_WAV}" else - inc=$FHOUT_HF_WAV + inc="${FHOUT_HF_WAV}" fi - let fhcnt=fhcnt+inc + ((fhcnt = fhcnt+inc)) done #For fcst time From ed10ae1169936e632b187330542d54633b231fd6 Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 10 Jan 2025 17:39:41 +0000 Subject: [PATCH 16/23] Replace COM with COMIN/OUT for wavegempak script; add glo_200 grid rules; fix typo --- scripts/exgfs_wave_nawips.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/exgfs_wave_nawips.sh b/scripts/exgfs_wave_nawips.sh index 949425cbc1..68ebfc90c7 100755 --- a/scripts/exgfs_wave_nawips.sh +++ b/scripts/exgfs_wave_nawips.sh @@ -14,7 +14,7 @@ source "${USHgfs}/preamble.sh" #export grids=${grids:-'glo_30m at_10m ep_10m wc_10m ao_9km'} #Interpolated grids -export grids=${grids:-'glo_30m'} #Native grids +export grids=${grids:-${waveinterpGRD:-'glo_30m'}} #Native grids export RUNwave=${RUNwave:-${RUN}wave} export fstart=${fstart:-0} export FHMAX_WAV=${FHMAX_WAV:-180} #180 Total of hours to process @@ -68,13 +68,15 @@ while [ ${fhcnt} -le ${FHMAX_WAV} ]; do gso_15m) grdIDin='gsouth.0p25' #grdIDout='gfswaves25k' ;; grdIDout='gfswavesh' ;; - *) gridIDin= + glo_200) grdIDin='global.2p00' + grdIDout='gfswaves200k' ;; + *) grdIDin= grdIDout= ;; esac - GRIBIN="${COM_WAVE_GRID}/${RUNwave}.${cycle}.${grdIDin}.f${fhr}.grib2" + GRIBIN="${COMIN_WAVE_GRID}/${RUNwave}.${cycle}.${grdIDin}.f${fhr}.grib2" GRIBIN_chk=${GRIBIN}.idx if ! wait_for_file "${GRIBIN_chk}" "${sleep_interval}" "${maxtries}"; then - echo "FATAL ERROR: ${GRIBIN_chk} not found after waiting $((sleep_interval * ( max_tries - 1))) secs" + echo "FATAL ERROR: ${GRIBIN_chk} not found after waiting $((sleep_interval * ( maxtries - 1))) secs" echo "${RUNwave} ${grdID} ${fhr} prdgen ${date} ${cycle} : GRIB file missing." >> "${wavelog}" err=1;export err;"${errchk}" || exit "${err}" fi @@ -140,11 +142,11 @@ while [ ${fhcnt} -le ${FHMAX_WAV} ]; do gpend fi - cpfs "${GEMGRD}" "${COM_WAVE_GEMPAK}/${GEMGRD}" + cpfs "${GEMGRD}" "${COMOUT_WAVE_GEMPAK}/${GEMGRD}" if [ ${SENDDBN} = "YES" ] ; then - "${DBNROOT}/bin/dbn_alert" MODEL "${DBN_ALERT_TYPE}" "${job}" "${COM_WAVE_GEMPAK}/${GEMGRD}" + "${DBNROOT}/bin/dbn_alert" MODEL "${DBN_ALERT_TYPE}" "${job}" "${COMOUT_WAVE_GEMPAK}/${GEMGRD}" else - echo "##### DBN_ALERT is: MODEL ${DBN_ALERT_TYPE} ${job} ${COM_WAVE_GEMPAK}/${GEMGRD}#####" + echo "##### DBN_ALERT is: MODEL ${DBN_ALERT_TYPE} ${job} ${COMOUT_WAVE_GEMPAK}/${GEMGRD}#####" fi rm grib_${grid} done From ec02b2e01d5525c9806d203e9601dfd0341f4fa4 Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 10 Jan 2025 17:41:35 +0000 Subject: [PATCH 17/23] Group gempak/goes tasks --- workflow/applications/gfs_cycled.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/workflow/applications/gfs_cycled.py b/workflow/applications/gfs_cycled.py index e9946d27d0..45a7bccc7a 100644 --- a/workflow/applications/gfs_cycled.py +++ b/workflow/applications/gfs_cycled.py @@ -281,12 +281,9 @@ def get_task_names(self): task_names[run] += ['postsnd'] if options['do_gempak']: - task_names[run] += ['gempak'] - task_names[run] += ['gempakmeta'] - task_names[run] += ['gempakncdcupapgif'] + task_names[run] += ['gempak', 'gempakmeta', 'gempakncdcupapgif'] if options['do_goes']: - task_names[run] += ['npoess_pgrb2_0p5deg'] - task_names[run] += ['gempakpgrb2spec'] + task_names[run] += ['npoess_pgrb2_0p5deg', 'gempakpgrb2spec'] if options['do_awips']: task_names[run] += ['awips_20km_1p0deg', 'fbwind'] From 4b1551ff5cceeb7b979bce1e3b37e71c75b3b669 Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 10 Jan 2025 17:42:20 +0000 Subject: [PATCH 18/23] Remove obs-dependent gempak jobs from forecast-only --- workflow/applications/gfs_forecast_only.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/applications/gfs_forecast_only.py b/workflow/applications/gfs_forecast_only.py index 9ce8d01b5f..5b397c105b 100644 --- a/workflow/applications/gfs_forecast_only.py +++ b/workflow/applications/gfs_forecast_only.py @@ -136,7 +136,7 @@ def get_task_names(self): tasks += ['postsnd'] if options['do_gempak']: - tasks += ['gempak', 'gempakmeta', 'gempakncdcupapgif', 'gempakpgrb2spec'] + tasks += ['gempak', 'gempakmeta'] if options['do_awips']: tasks += ['awips_20km_1p0deg', 'fbwind'] From 34442231983ec083952b559266292ddb6f42a31c Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 10 Jan 2025 17:42:47 +0000 Subject: [PATCH 19/23] Fix cleanup dependencies for gempak jobs --- workflow/rocoto/gfs_tasks.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/workflow/rocoto/gfs_tasks.py b/workflow/rocoto/gfs_tasks.py index be6d64c354..6cbf6bdb1f 100644 --- a/workflow/rocoto/gfs_tasks.py +++ b/workflow/rocoto/gfs_tasks.py @@ -2349,13 +2349,14 @@ def cleanup(self): elif self.run in ['gfs']: dep_dict = {'type': 'task', 'name': f'{self.run}_gempakmeta'} deps.append(rocoto.add_dependency(dep_dict)) - dep_dict = {'type': 'task', 'name': f'{self.run}_gempakncdcupapgif'} - deps.append(rocoto.add_dependency(dep_dict)) - if self.options['do_goes']: - dep_dict = {'type': 'metatask', 'name': f'{self.run}_gempakgrb2spec'} - deps.append(rocoto.add_dependency(dep_dict)) - dep_dict = {'type': 'task', 'name': f'{self.run}_npoess_pgrb2_0p5deg'} + if self.app_config.mode in ['cycled']: + dep_dict = {'type': 'task', 'name': f'{self.run}_gempakncdcupapgif'} deps.append(rocoto.add_dependency(dep_dict)) + if self.options['do_goes']: + dep_dict = {'type': 'task', 'name': f'{self.run}_npoess_pgrb2_0p5deg'} + deps.append(rocoto.add_dependency(dep_dict)) + dep_dict = {'type': 'metatask', 'name': f'{self.run}_gempakgrb2spec'} + deps.append(rocoto.add_dependency(dep_dict)) if self.options['do_metp'] and self.run in ['gfs']: deps2 = [] From 3bbcc416e1d4da050d6faf4f157fbe453bae15f7 Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 10 Jan 2025 17:51:35 +0000 Subject: [PATCH 20/23] Remove shellcheck directive --- scripts/exgfs_wave_prdgen_gridded.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/exgfs_wave_prdgen_gridded.sh b/scripts/exgfs_wave_prdgen_gridded.sh index badd0f3c2e..8fd6b5cc76 100755 --- a/scripts/exgfs_wave_prdgen_gridded.sh +++ b/scripts/exgfs_wave_prdgen_gridded.sh @@ -1,5 +1,4 @@ #! /usr/bin/env bash -#shellcheck enable=all ############################################################################### # # From 5789de3caa51fa4d38715e3742fb19f1954dbf93 Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 10 Jan 2025 17:56:12 +0000 Subject: [PATCH 21/23] Update gfs_utils hash --- sorc/gfs_utils.fd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sorc/gfs_utils.fd b/sorc/gfs_utils.fd index 53c6b285f4..a8022c2dde 160000 --- a/sorc/gfs_utils.fd +++ b/sorc/gfs_utils.fd @@ -1 +1 @@ -Subproject commit 53c6b285f4624a19b93251f3e543ea5d78a9484a +Subproject commit a8022c2dde6eabd78f93d4467c1d3e2283b92416 From 5265d98e320bf648cc3bab1f160da0967122bb6c Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 10 Jan 2025 18:00:30 +0000 Subject: [PATCH 22/23] Add C48_S2SW_extended test case --- ci/cases/pr/C48_S2SW_extended.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ci/cases/pr/C48_S2SW_extended.yaml diff --git a/ci/cases/pr/C48_S2SW_extended.yaml b/ci/cases/pr/C48_S2SW_extended.yaml new file mode 100644 index 0000000000..f3c2a567b7 --- /dev/null +++ b/ci/cases/pr/C48_S2SW_extended.yaml @@ -0,0 +1,21 @@ +experiment: + system: gfs + mode: forecast-only + +arguments: + pslot: {{ 'pslot' | getenv }} + app: S2SW + resdetatmos: 48 + resdetocean: 5.0 + comroot: {{ 'RUNTESTS' | getenv }}/COMROOT + expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR + idate: 2021032312 + edate: 2021032312 + yaml: {{ HOMEgfs }}/ci/cases/yamls/gfs_extended_ci.yaml + +skip_ci_on_hosts: + - hera + - gaea + - orion + - hercules + - wcoss2 # TODO run on WCOSS2 once the gfs_waveawipsbulls job is fixed From 8905bface9cba10de91e91d40718321124a2cbf6 Mon Sep 17 00:00:00 2001 From: David Huber Date: Fri, 10 Jan 2025 18:31:11 +0000 Subject: [PATCH 23/23] Clarify COM directory creation --- jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF b/jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF index 3abc7e538a..b9559ed7ac 100755 --- a/jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF +++ b/jobs/JGFS_ATMOS_GEMPAK_NCDC_UPAPGIF @@ -32,12 +32,11 @@ export COMPONENT="atmos" YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COMIN_OBS:COM_OBS_TMPL GRID=1p00 YMD=${PDY} HH=${cyc} declare_from_tmpl -rx "COMIN_ATMOS_GEMPAK_1p00:COM_ATMOS_GEMPAK_TMPL" +# Declare COMOUT_ATMOS_GEMPAK_GIF and COMOUT_ATMOS_GEMPAK_UPPER_AIR for grid in gif upper_air; do - # This job reads and writes to the GEMPAK directories - gempak_dir="COMIN_ATMOS_GEMPAK_${grid^^}" - gempak_out_dir="COMOUT_ATMOS_GEMPAK_${grid^^}" + _GRID="${grid^^}" + gempak_dir="COMOUT_ATMOS_GEMPAK_${_GRID}" GRID=${grid} YMD=${PDY} HH=${cyc} declare_from_tmpl -rx "${gempak_dir}:COM_ATMOS_GEMPAK_TMPL" - GRID=${grid} YMD=${PDY} HH=${cyc} declare_from_tmpl -rx "${gempak_out_dir}:COM_ATMOS_GEMPAK_TMPL" if [[ ! -d "${!gempak_dir}" ]]; then mkdir -m 775 -p "${!gempak_dir}"; fi done