Skip to content

Taking time info from ngen #14

Open
mkarim-rtx wants to merge 8 commits into
developmentfrom
handle_time_outside_bmi_config_mohammed
Open

Taking time info from ngen #14
mkarim-rtx wants to merge 8 commits into
developmentfrom
handle_time_outside_bmi_config_mohammed

Conversation

@mkarim-rtx
Copy link
Copy Markdown

@mkarim-rtx mkarim-rtx commented Apr 21, 2026

https://jira.nextgenwaterprediction.com/browse/NGWPC-10157

Centralizing time control via NGen across UEB, TopoFlow-Glacier, and Noah-OWP

This task standardizes how simulation time (start, end, timestep) is handled across multiple models—UEB, TopoFlow-Glacier, and Noah-OWP-Modular—by shifting control from model-specific configuration files to the NGen Framework.

Objective

Ensure all models:

Ignore hardcoded config time (start/end/dt)
Use NGen-provided realization time dynamically via BMI
Maintain compatibility with existing workflows with minimal code changes

What was done

1. NGen (Core Change)
Added logic to pass realization time through BMI inputs:
start_utime
end_utime
dt_seconds
Ensures a single source of truth for time control
Applies uniformly across all BMI models

PR: provide time info from realization file by mkarim-rtx · Pull Request #172 · NGWPC/ngen

2. UEB
Replaced reliance on config timing with runtime override
Implemented:
Temporary rewrite of UEB control file before Initialize()
Injected NGen time into rewritten file
Result:
UEB runs using NGen time without modifying original config
Zero changes required in UEB internal physics

PR: Taking time info from ngen by mkarim-rtx · Pull Request #14 · NGWPC/ueb_bmi

3. TopoFlow-Glacier
Added full BMI-level time handling:
adapter_set_realization_times()
_apply_realization_time_from_strings()
Logic:
Prefer NGen time if provided
Fallback to config only if missing
Result:
Fully decoupled from YAML time configuration
Works seamlessly with NGen forcing window

4. Noah-OWP
Removed dependency on internal RunModule time handling
Implemented:
BMI-side apply_realization_time_config logic
Updated NamelistRead.f90:
Made startdate and enddate optional
Added placeholder defaults instead of fatal error

Result:
Model initializes without config time
Real time applied later via BMI inputs from NGen
Why this change was needed

Before
Each model:
Required its own config-based time
Could conflict with NGen realization
Caused errors or inconsistencies

After
NGen controls time globally
Models become:
Consistent
Easier to integrate
Less error-prone

Final Outcome
All three models now:
Use NGen-driven time
Do not require config start/end dates
Maintain backward compatibility via fallbacks
Eliminates duplicated logic and synchronization issues across models

@mkarim-rtx mkarim-rtx requested a review from zhengtaocui April 21, 2026 22:46
@mkarim-rtx mkarim-rtx marked this pull request as draft April 21, 2026 22:46
Copy link
Copy Markdown

@jswade-rtx jswade-rtx left a comment

Choose a reason for hiding this comment

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

I rebuilt my docker containers manually using the ngen-forcing -> ngen -> mswm chain and was able to run UEB with timing information removed from the BMI configs using this ngen_timing_info_mohammed branch and mswm branch jwade_NGWPC-10592_config_times.

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