Skip to content

STOFS-2D-Global ops mode: one 180 h forecast forcing segment (hourly, 121-180 h interpolated) - #72

Merged
MansurJisan-NCO merged 4 commits into
mainfrom
feat/stofs-2d-glo-single-forecast
Oct 12, 2026
Merged

MansurJisan-NCO merged 4 commits into
mainfrom
feat/stofs-2d-glo-single-forecast

Conversation

@MansurJisan-NCO

@MansurJisan-NCO MansurJisan-NCO commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Description

For STOFS-2D-Global ops mode, build_sfcf_forcing replaces segments fcst1 (0-120 h hourly) and fcst2 (120-180 h 3-hourly) with one segment fcst: 181 hourly records over 0-180 h. It is used for a single 180 h forecast run.

  • Hours 0-120, and every 3rd hour after, are copied byte for byte from the GFS sfcf records.
  • Hours 121-179 not divisible by 3 are filled by linear interpolation between the bracketing 3-hourly records, streamed two files at a time. ADCIRC interpolates meteorology linearly in time between snapshots, so the forcing at every model step matches the operational fcst2 to float32 rounding.
  • The later bracketing file must have the same lat/lon values as the earlier one, and the forcing manifest lists both bracketing files for each interpolated record.
  • ncst is unchanged.

Type of change

  • New feature (non-breaking change which adds functionality)

Change characteristics

  • Changes outputs (values, COMOUT files or names, archives)? YES, STOFS-2D-Global ops mode only: <RUN>_fcst.{221,222,225}.nc replaces the fcst1/fcst2 files.
  • Breaking change to existing functionality? NO. The fcst1/fcst2 segments were only used by ops mode, which changes with the paired nos-workflow PR.
  • Requires a nos-utils submodule bump (nos-workflow) or a paired nos-workflow change (nos-utils)? YES, the paired nos-workflow PR; merge this one first.
  • Requires new or regenerated fix files on the machine? NO
  • Requires a re-prep or a new hotstart before the next cycle? NO
  • Machines affected: both

How has this been tested?

  • pytest: 1280 passed, 9 skipped.
  • New tests (small synthetic sfcf files):
    • 181 records;
    • exact copies at native hours (0, 7, 120, 123, 126, 180);
    • weights 1/3 and 2/3 at hours 121 and 122;
    • fill values preserved;
    • the manifest lists both bracketing files;
    • a bracketing file on a shifted grid fails with no partial files;
    • a missing f180 waits, then fails, leaving no partial files.
  • Independent review: GO.
  • Not yet run on WCOSS2.

Checklist

  • Dependent PRs merged and published (nos-utils before any submodule bump)
  • pytest suite passes
  • Existing operational behavior preserved, or the change is called out above
  • No edits to a shared FIXofs while it is cycling
  • Self-review done; yaml comments and docstrings updated where behavior changed
  • No markdown files added to the repo (this template is the only exception)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The bracket-grid validation checks only array shape, allowing incompatible equal-sized grids to be interpolated silently.

1 open finding
What changed in this PR

Consolidates STOFS-2D-Global forecast forcing into one hourly 180-hour segment.

Changes:

  • Replaces fcst1/fcst2 with fcst.
  • Interpolates non-native hours after forecast hour 120.
  • Adds interpolation, fill-value, manifest, and failure tests.
File Description
nos_utils/​forcing/​adcirc_met.py Implements unified forecast generation and interpolation.
tests/​test_adcirc_met.py Tests the new forecast behavior.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread nos_utils/forcing/adcirc_met.py Outdated
Comment on lines +722 to +723
if hi.variables["lat"].shape != lat.shape:
raise MetForcingError("{}: grid differs from {}".format(srcs[1], src))
@MansurJisan-NCO
MansurJisan-NCO merged commit 5496da0 into main Oct 12, 2026
1 check passed
@MansurJisan-NCO
MansurJisan-NCO deleted the feat/stofs-2d-glo-single-forecast branch October 20, 2026 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants