-
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
Wflow ZMQ Server #356
Merged
Merged
Wflow ZMQ Server #356
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
initialization of Wflow model
also changed the `ModelHandler` so the same `wflow_bmi` function can be used for initialization and other BMI functions.
should have been part of previous 2 commits...
Move set states functionality from initialization function to a separate `set_states` function for each Model type. It also makes coupling to OpenDA more convenient (load and save states from OpenDA).
- fix list of exchange variables, if a model does not include reservoirs or lakes, these variables should be left out. - add grid types "scalar" (for uniform/constant variables) and "none" (for variables not related to a model grid) - add "flextopo" model
SurfaceFlow is used for both kinematic wave river and overland flow. This is now split into structs SurfaceFlowRiver and SurfaceFlowLand. It simplifies the orginal update function (split into two, logic easier to follow), and dispatching on these types is easier (e.g. for BMI to extract relevant properties as grid type).
- use simulation starttime as t = 0 (not 1970). - BMI.get_time_units: return "s" (instead of "seconds since 1970-01-01T00:00:00"). - BMI.get_time_units now gets called on the model rather than the type.
to get a reference datetime. Model start time (BMI) returns always 0.0.
ZMQ port number can be provided as command line argument (default = 5555).
change of `starttime` definition
File was not up-to-date with Master.
Scalar variables are not exposed through BMI.
Also update docs Wflow.jl (mention possibilty to run Wflow as a server).
Closed
Co-authored-by: Martijn Visser <[email protected]>
Co-authored-by: Martijn Visser <[email protected]>
Co-authored-by: Martijn Visser <[email protected]>
Co-authored-by: Martijn Visser <[email protected]>
Thanks for the useful comments. I did address all comments except about changes to CI (I agree and will also change this). |
- Project.toml needs uuid - Logging dep was missing
CI workflow for Wflow ZMQ Server now also triggered by PR (and push to Master) as CI workflow for Wflow. Wflow test model (Moselle) for Wflow ZMQ Server is downloaded to Wflow\server\test\.
visr
approved these changes
Feb 27, 2024
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.
Looks good!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue addressed
Fixes #93
Explanation
See also issue #93. We decided to use ZeroMQ instead of Thrift (used in the wflow Python version, Thrift Julia version seems not very active), with JSON messaging to run Wflow functions exposed through BMI and three additional Wflow functions related to state handling and Unix time. The Wflow ZMQ Server can be used to couple external software packages (other programming language than Julia), for example with the data-assimilation software OpenDA (Java). The Wflow ZMQ Server is not part of the Wflow.jl project (
src\
), and is located in directoryserver\
, including a README.md with instructions how to start the server.Checklist
master
Additional Notes (optional)
The server is tested against the Master branch of Wflow.jl.