jgfs_atmos_grb2spec_master ecf (v17) Analysis - TerrenceMcGuinness-NOAA/global-workflow GitHub Wiki

jgfs_atmos_grb2spec_master.ecf (GFS v17)

Branch / tenant: dev/gfs.v17 (gw_v17) Path: ecf/scripts/gfs/product/atmos/gempak/grb2spec/jgfs_atmos_grb2spec_master.ecf Analysis date: 2026-06-11 Method: AWS Bedrock AgentCore agentcore-mcp-rag MCP (graph traversal, GraphRAG, code-context) cross-checked against the on-disk v17 worktree.


Summary

jgfs_atmos_grb2spec_master.ecf is the NCO production ecFlow task template that converts GFS simulated GOES satellite imagery (GRIB2) into GEMPAK grid format for downstream NAWIPS/AWIPS display and distribution. It is a per-forecast-hour _master template (deployed as jgfs_atmos_grb2spec_f000 through jgfs_atmos_grb2spec_fNNN). At runtime it hands off to the J-Job ${HOMEgfs}/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC, which runs exgfs_atmos_goes_nawips.sh twice β€” once for the regular 0.25-degree GOES simulation grid and once for the legacy 221-grid format.


1. The script itself

#PBS -S /bin/bash
#PBS -N gfs_atmos_grb2spec_%CYC%_f%FHR%
#PBS -j oe
#PBS -q %QUEUE%
#PBS -A %PROJ%-%PROJENVIR%
#PBS -l walltime=00:05:00
#PBS -l select=1:mpiprocs=1:ompthreads=1:ncpus=28:mem=6GB
#PBS -l place=vscatter:shared
#PBS -l debug=true

model=gfs
export cyc="%CYC%"
%include <head.h>
%include <envir-p1.h>

############################################################
# Load modules
############################################################
#TODO: load only the modules needed for each job
source ${HOMEgfs}/dev/ush/load_modules.sh run

module list
export WGF="%WGF%"
export FHR3="%FHR%"
export FHR_LIST="%FHR_LIST%"
export COMPONENT=${WGF}
############################################################
# CALL executable job script here
############################################################
export CDATE=${PDY}${cyc}
export HOMEglobal=${HOMEgfs}

#### ${HOMEgfs}/dev/job_cards/rocoto/gempakgrb2spec.sh
${HOMEgfs}/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC
if [ $? -ne 0 ]; then
   ecflow_client --msg="***JOB ${ECF_NAME} ERROR RUNNING J-SCRIPT ***"
   ecflow_client --abort
   exit
fi

%include <tail.h>
%manual

%end

What each part does

Section Role
#PBS directives PBS Pro batch resources: 1 node, 1 mpiproc, 28 cpus, 6 GB, 5-min wall (much shorter than GEMPAK master β€” simpler single-grid conversion). Job name gfs_atmos_grb2spec_%CYC%_f%FHR%.
%include <head.h> / <envir-p1.h> NCO boilerplate: environment bootstrap, ecflow_client init, production environment.
load_modules.sh run v17 centralized module loading.
WGF, FHR3, FHR_LIST, COMPONENT ecFlow %VAR% placeholders injected per task. WGF = atmos.
HOMEglobal=${HOMEgfs} Bridges v17 HOMEglobal naming to NCO HOMEgfs.
${HOMEgfs}/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC The J-Job. Non-zero exit triggers ecflow_client --abort.
%include <tail.h> / %manual NCO completion handling and operator manual block.

2. Why "_master" β€” the template mechanism

Like jgfs_atmos_gempak_master.ecf, this is a single .ecf file that backs multiple ecFlow tasks. The ecFlow generator deploys it as jgfs_atmos_grb2spec_f000.ecf, jgfs_atmos_grb2spec_f003.ecf, etc. Each task overrides FHR and FHR_LIST via edit statements in the suite definition.

The commented breadcrumb #### ${HOMEgfs}/dev/job_cards/rocoto/gempakgrb2spec.sh points to the Rocoto counterpart; in NCO the .ecf calls the J-Job directly.


3. Execution chain

ecf/defs/gfs_prod.def : task jgfs_atmos_grb2spec_fNNN   (gated on product_fNNN == complete)
  +-- jgfs_atmos_grb2spec_master.ecf            (PBS submit; deployed as *_fNNN.ecf)
       +-- ${HOMEgfs}/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC   (J-Job)
            +-- ${SCRglobal}/exgfs_atmos_goes_nawips.sh "${FHR3}"   (run #1: regular grid)
            +-- ${SCRglobal}/exgfs_atmos_goes_nawips.sh "${FHR3}"   (run #2: grid 221)
                 +-- ${USHglobal}/product_functions.sh   (shared helper, sourced)

Confirmed via MCP graph (trace_data_flow, tenant gw_v17):

  • JGFS_ATMOS_GEMPAK_PGRB2_SPEC INVOKES exgfs_atmos_goes_nawips.sh and SOURCES jjob_header.sh, jjob_standard_vars.sh, jjob_shell_setup.sh, set_strict.sh.
  • exgfs_atmos_goes_nawips.sh sources product_functions.sh for shared utilities.

4. What the J-Job actually produces

JGFS_ATMOS_GEMPAK_PGRB2_SPEC converts simulated GOES satellite imagery GRIB2 files into GEMPAK grids. It runs exgfs_atmos_goes_nawips.sh twice per forecast hour:

Run RUN2 GRIB pattern Output grid DBN alert
1 β€” Regular gfs_goessim goessimpgrb2.0p25.f${FHR3} COMOUT_ATMOS_GEMPAK_0p25 GFS_GOESSIM_GEMPAK
2 β€” Grid 221 gfs_goessim221 goessimpgrb2f${FHR3}.grd221 COMOUT_ATMOS_GEMPAK_0p25 GFS_GOESSIM221_GEMPAK

The ex-script uses nagrib2_nc (GEMPAK NAGRIB utility) to remap GRIB2 fields into GEMPAK-native .gem grids, using lookup parameters from nagrib.tbl. Output files land in ${ROTDIR}/${RUN}.${PDY}/${cyc}/products/atmos/gempak/0p25/.

Error handling

  • Run 1: strict β€” failure in exgfs_atmos_goes_nawips.sh propagates to J-Job exit.
  • Run 2: uses && true to suppress immediate exit from set_strict.sh, then checks $err and calls err_exit if non-zero β€” the EE2-correct pattern.

5. Key environment variables

Variable Origin Meaning
WGF suite edit WGF 'atmos' Weather-Generating-Forecast component.
FHR3 per-task edit FHR Zero-padded forecast hour (e.g. 000, 003).
COMIN_ATMOS_GOES J-Job (declare -rx) Input COM dir for simulated GOES GRIB2 files.
COMOUT_ATMOS_GEMPAK_0p25 J-Job (declare -rx) Output COM dir for GEMPAK grids.
DBN_ALERT_TYPE J-Job (set per run) DBNet alert type (GFS_GOESSIM_GEMPAK or GFS_GOESSIM221_GEMPAK).
RUN2 J-Job Secondary RUN name for nagrib.tbl lookup.
GRIB J-Job GRIB filename pattern prefix.
EXT J-Job File extension (empty for regular, .grd221 for 221).
NAGRIB ex-script Path to nagrib2_nc executable (${GEMEXE}/nagrib2_nc).
SENDDBN env / config Controls DBNet alert distribution.

Configuration

The J-Job sources jjob_header.sh -e "gempak_spec" -c "base gempak", loading:

  • config.base β€” fundamental paths and settings.
  • config.gempak β€” GEMPAK-specific settings (MAX_TASKS=42, resource sourcing).

6. v17-specific notes

  • Centralized module loading via load_modules.sh run β€” single source of truth.
  • product/ family layer: path is ecf/scripts/gfs/product/atmos/gempak/grb2spec/…, reflecting v17's reorganized product family tree.
  • HOMEglobal shim: bridges v17 J-Job naming to NCO HOMEgfs.
  • Shorter walltime (5 min vs 20 min for GEMPAK master) β€” reflects the simpler single-field conversion per forecast hour.
  • Dual-run pattern: the J-Job runs the ex-script twice with different env configs, producing both the native 0.25-degree and legacy grid-221 GOES simulation products.

7. Change-impact snapshot (from MCP, gw_v17)

Symbol Change type Risk Direct dependents
JGFS_ATMOS_GEMPAK_PGRB2_SPEC behavior LOW (0.10) 0 (suite leaf)
exgfs_atmos_goes_nawips.sh signature LOW–MEDIUM Shared by JGFS_ATMOS_GEMPAK_PGRB2_SPEC and JGFS_ATMOS_GEMPAK

The J-Job is a suite leaf with no downstream dependents. The ex-script exgfs_atmos_goes_nawips.sh is shared with the main GEMPAK J-Job (JGFS_ATMOS_GEMPAK), so changes to its interface affect both callers.


Sources

  • On-disk v17 worktree: ecf/scripts/gfs/product/atmos/gempak/grb2spec/jgfs_atmos_grb2spec_master.ecf, dev/jobs/JGFS_ATMOS_GEMPAK_PGRB2_SPEC, dev/scripts/exgfs_atmos_goes_nawips.sh.
  • agentcore-mcp-rag MCP (tenant gw_v17): trace_data_flow, get_code_context, get_change_impact, get_job_details.
⚠️ **GitHub.com Fallback** ⚠️