Skip to content

updated groundwater_to_stream_recharge unit#15

Merged
mkarim-rtx merged 5 commits into
developmentfrom
unit_conversion_err_fix_mohammed
May 5, 2026
Merged

updated groundwater_to_stream_recharge unit#15
mkarim-rtx merged 5 commits into
developmentfrom
unit_conversion_err_fix_mohammed

Conversation

@mkarim-rtx
Copy link
Copy Markdown

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

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

Issue

groundwater_to_stream_recharge was originally exposed in m (depth per timestep), while NWM expects m³/s (discharge) for qBucket, causing: Unable to convert m to m3/s

Fix

A new BMI output variable was introduced: groundwater_to_stream_recharge_m3_per_s → m³/s
Computed as:
q = depth × catchment_area / timestep
The original variable remains unchanged:
groundwater_to_stream_recharge → m

Why
Preserves LASAM native semantics (depth remains depth)
Avoids repurposing existing variables
Aligns with NWM discharge requirements (qBucket)
Maintains consistency with updates in CFE and Sac-SMA

Result
Eliminates unit conversion warning
Produces physically correct discharge output
Maintains backward compatibility and clarity

Final Mapping
Variable Meaning Units
groundwater_to_stream_recharge groundwater recharge depth m
groundwater_to_stream_recharge_m3_per_s

@mkarim-rtx mkarim-rtx marked this pull request as draft April 28, 2026 15:43
@jswade-rtx jswade-rtx requested a review from sivasankkar April 28, 2026 15:59
Comment thread src/bmi_lgar.cxx Outdated
}

bmi_unit_conv.volQ_gw_timestep_m3_per_s = 0.0;
bmi_unit_conv.catchment_area_m2 = 1.0;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is there a reasoning behind initializing the area to 1?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good catch. The 1.0 m2 value was only a placeholder, but it could produce physically incorrect discharge if the real catchment area is not provided. I changed the default to 0.0 and added a guard so the converted m3/s output remains 0.0 unless a valid positive catchment area is available. @sivasankkar

@mkarim-rtx mkarim-rtx marked this pull request as ready for review May 5, 2026 15:11
@cmaynard-ngwpc cmaynard-ngwpc requested a review from sivasankkar May 5, 2026 23:30
@mkarim-rtx mkarim-rtx merged commit 23d7176 into development May 5, 2026
@jswade-rtx jswade-rtx deleted the unit_conversion_err_fix_mohammed branch May 6, 2026 19:29
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