-
Notifications
You must be signed in to change notification settings - Fork 21
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
Mapping of internal model variables and parameters to standard names #518
Conversation
Was removed in combination with testing `get_alias`.
to `saturated_hydraulic_conductivity_profile`. Move this key from `config.vertical` to `config.model`.
Just to jump in this discussion here: we indeed decided to reorganize the toml file, so perhaps better to wait with #519 to prevent double work ;) ). |
Rename these parameters to standard names. Additionally, made a start with standard name mapping (external standard name => internal model name). It makes use of `Wflow.param` functionality as much as possible, allowing to write any model output variable with the former TOML keys.
to standard names using `model_boundary_condition` (e.g. CSDMS uses `model_grid_ edge`) as objects.
Use lenses from `Accessors` for mapping standard names and for input parameters (`ncread`). Change parameter names of demand and groundwater to standard names. Writing any model output variable with the former TOML keys is possible (using `param`).
As the `sediment` model type makes use of hydrological forcing timeseries that are stored differently (internally) than the same timeseries used by model types `sbm` and `sbm_gwf`, the standard name mapping is done separately for the `sediment` model type (different dict). The same hydrological forcing data is used by the `SoilLoss` and `OverlandFlowSediment` components. This data is now only stored in the `SoilLoss` component and shared (memory) with the `OverlandFlowSediment` component.
Hydrological forcing data in model type Possible improvements:
|
Checking list of standard names (`input.state.variables`).
For variables that can represent multiple soil layers.
@JoostBuitink and @hboisgon, this PR is ready for review, couple of comments from my side:
|
Use `count` instead of `number` as quantity as it preferable according CSDMS. Move reservoir and lake location and area IDs to this list (from `input.parameters`), for the `sediment` model type reservoir and lake area IDS were already part of `input`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the sediment part and most of it looks good already! Thanks @vers-w :)
Sorry that the metadata or unit in the code is not clear enough sometimes, I think also for me it's not clear that variables like precipitation or interception in mm are volumes or fluxes so the same happens for the sediment. If you know places in the code where it can be made clearer let me know and I can assist.
Note that the docs were not updated yet for sediment so that will still be on the todo list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, and great steps for wflow as well! I have added a couple of comments and suggestions for additional parameters. I agree with the names are they are currently there, I think they nicely describe what they represent.
Co-authored-by: JoostBuitink <[email protected]>
Co-authored-by: JoostBuitink <[email protected]>
For soil erosion and overland flow. Co-authored-by: hboisgon <[email protected]>
And rename standard name for river `inflow` (`inflow` not part of quantity).
Use `instantaneous` in quantity part for instantaneous (state) variables. For average values (per model time step), that are most useful for wflow users, `time_average_of` has been removed from the quantity part.
Remove `water` from objects in standard name as it is about river or land surface sediment properties (and not sediment transported by water).
These are average variables for the model time step. Rename reservoir `volume` to `storage` (consistent with lake).
Also rename `storage` in quantity in standard names to `depth` (it is not listed as quantity by CSDMS).
Also used by CSDMS and more consistent with other standard names.
`volume` is a quantity (and used as such in CSDMS standard names), use of `storage` is preferred.
Added `storage_av` to routing components with an internal time step. Moved computation of average flow routing variables from update function of instanteneous values to the loop over model time step. Added helper functions for the computation of average flow routing variables.
For computation of average flow routing variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work; looks good to me!
Issue addressed
Fixes #481
sbm
: change model parameters, states, and output variables (sub-selection) to standard names.sbm_gwf
: change model parameters, states, and output variables (sub-selection) to standard names.sediment
: change model parameters, states, and output variables (sub-selection) to standard names.sediment
, see also Mapping of internal model variables and parameters to standard names #518 (comment), for now we decided to go with improvement in commit 8b38fb2.standard_name_map
).sediment
model, not always clear from code/metadata/docs as the unit is also part of the standard name (quantity).NCDatasets
(need to look further into this, not part of this PR).