-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential for unit mismatch between formulations providing variables with the same name #829
Comments
For example if we have 'topmodel' and 'cfe' variables names of
could be generated. This names would be checked to see if there was a known conversion for the output that would allow the name to be changed to 'infiltration-excess' when variable names match expected units. |
So, as I see things:
In either case, something dedicated to explicitly defining things within this scope will have to be added to the realization config, either centrally or in each formulation. We might could leverage the variable names mapping capabilities, but additional restrictions would need to be enforced, on a different scope than those currently in place for it. It'd probably be better to just add something similar strictly for aliasing variables within the netcdf output scope. We could also leverage Along those lines, while this risks being premature optimization, it might be wise to:
|
In the current code there is nothing preventing a scenario where two Formulations both provide an output variable with the same name.
This is an issue because the netcdf output code creates variables for each output variable defined by any formulation in a layer. This means the variable would be created when first located in a formulation and ignored thereafter. However the units for later instance of the output variable name are not guaranteed to be the same, which can lead to either incorrect values in output or program termination.
##Example
Formulation A --> (stream-flow-excess cm^3/s float )
Formulation B --> (stream-flow-excess m^3/h double)
Formulation C --> (stream-flow-excess 'none' string)
The variable stream flow excess will only be created once with the type and units set by the first encountered formulation (we can not create separate variables for each formulation as there is currently no way to determine what formulation is bound to a BMI_Formulation object.)
Proposed Fix
Allow formulation name to be retrievable this would allow per formulation variables with maps used to combine compatible definitions.
The text was updated successfully, but these errors were encountered: