Add dnwm: CDEPS data component for NWM river discharge (one-way NWM to OCN) - #4
Draft
mansurjisan wants to merge 5 commits into
Draft
Conversation
New dnwm/ (cloned from drof) exporting river_volume_flux (m3 s-1, volumetric per-element discharge), datamode copyall. cpl_scalars SetScalar guarded by NUOPC_IsConnected for the direct NWM->OCN connector path.
Stamp river_volume_flux export at init (InitializeRealize) and each ModelAdvance so the connector copies a valid timestamp to SCHISM. Pairs with the SCHISM cap CheckImport override for the direct NWM->OCN connector path.
…s, build-order and rc checks, prune clone leftovers - add missing error check after shr_strdata_advance (a failed stream read no longer silently exports stale discharge) - count and log clamped special/negative discharge values instead of silently zeroing them - move dnwm before dwav in the component list (cime_config/buildlib waits on libdwav.a as the last-built library) - check rc from NUOPC_FieldDictionaryHasEntry and NUOPC_IsConnected before using their results - remove unused clone leftovers (timeStep/nextTime, itemtype_scalar, ESMF alarm/state imports, i8, SHR_CONST_SPVAL, stream-domain import) - rename next_ymd/next_tod to current_ymd/current_tod to match the currTime read; fix the stale next_time comment - drop the redundant per-mode gate around restart writes (datamode is validated at advertise)
mansurjisan
force-pushed
the
pr/dnwm-data-component
branch
from
July 9, 2026 12:18
8a8c7bc to
60d7fb6
Compare
…ist option - restart pointer/file naming now always uses the window-END time (the CDEPS convention a continued run resumes from), decoupled from the stream interpolation target which defaults to the window start - new namelist option advance_to_next_time (default .false., the validated direct-connector behavior) restores the standard CDEPS next-time interpolation convention for configurations where a mediator consumes the export at a later phase - document the deliberate ROF identity at dshr_init and its consequences (default log name, PIO keying, no coexistence with drof)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
dnwm, a CDEPS data component that reads a National Water Model discharge stream and exports a single field,river_volume_flux(m^3 s-1), one value per unstructured-mesh element. It is the data-ingestion half of one-way NWM -> ocean river forcing for the coastal application (used with a companion ufs-weather-model wiring PR; addresses the data-ingestion portion of ufs-weather-model's NWM coupling roadmap).Design
Cloned from
drofand kept deliberately minimal:datamode = "copyall"passthrough of an element-indexed stream. The component knows nothing about reaches or hydrology - the reach-to-element mapping is done offline; dnwm is a faithful transport.Keeps the ROF identity (
dshr_init(gcomp, 'ROF', ...)) so a future CMEPS mediator route(ROF -> MED -> OCN) is a drop-in.
The exchange downstream is
remapMethod=redistunder an element-id contract (stream/mesh element order == ocean-model global element ids), so the exported field is volumetric m^3/s with no area-flux conversion anywhere.Stream interpolation target: by default the stream is read AT the current time - on the mediator-less direct connector the consumer holds the value over [t, t+dt], so the export must be valid at the window start. A namelist option
advance_to_next_time = .true.restores the standard CDEPS next-time convention for configurations where a mediator consumes the export at a later phase. Restart artifacts are always named at the window end (the CDEPS convention a continued run resumes from), independent of the interpolation target.Fill values and negative discharge are clamped to zero; every clamp is counted and reported to the component log (never silent).