Skip to content

provide time info from realization file#172

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

provide time info from realization file#172
mkarim-rtx wants to merge 10 commits into
developmentfrom
handle_time_outside_bmi_config_mohammed

Conversation

@mkarim-rtx
Copy link
Copy Markdown

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

https://jira.nextgenwaterprediction.com/browse/NGWPC-10207
https://jira.nextgenwaterprediction.com/browse/NGWPC-10194
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

PR: Pull requests · NGWPC/topoflow-glacier

  1. 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
    PR: updates to use time fron NGEN by mkarim-rtx · Pull Request #8 · NGWPC/noah-owp-modular

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 marked this pull request as draft April 20, 2026 23:34
@mkarim-rtx mkarim-rtx requested a review from zhengtaocui April 21, 2026 23:03
@kyle-larkin
Copy link
Copy Markdown

We do not want to hardcode ngen to have to know what model is being used. Do not merge this as is.

@mkarim-rtx
Copy link
Copy Markdown
Author

We do not want to hardcode ngen to have to know what model is being used. Do not merge this as is.

@kyle-larkin @jswade-rtx I have made ngen model agnostic. Please review.

@jswade-rtx
Copy link
Copy Markdown

I tested noah-owp, ueb, and topoflow-glacier with the new updates and confirmed they could be run without time info in the configs

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.

3 participants