We, the mHM developers, are proud to release mHM v5.13!
The release can be accessed here:
We have added some neat new features. The most notable ones are listed below.
Python bindings and distribution
mHM was bitten by Python. This means, you can install mhm as a Python package now and it will bring you both:
vanilla mHM as a command
mhm as well as the Python bindings to control the model from within Python.
There are pre-built wheels for Linux and MacOS (no ARM64 at the moment) that you can install with
$ pip install mhm
The conda package was updated as well to ship the bindings. Just do a
$ conda install mhm
as described in our installation instructions.
Then you can do things like these:
import mhm import matplotlib.pyplot as plt # download test domain 1 mhm.download_test(path="example_domain") # run the downloaded example mhm.model.init(cwd="example_domain") mhm.model.run() runoff_sim_obs = mhm.get_runoff_eval(gauge_id=1) mhm.model.finalize() # plotting plt.plot(runoff_sim_obs[:, 0]) plt.plot(runoff_sim_obs[:, 1], linestyle="--") plt.show()
Also, another little helper command ships with the bindings:
To download the test-domains and to check if your installation is working, you can do:
$ mhm-download --verbose --domain 1 --path example_domain $ mhm example_domain/
More information can be found in the documentation.
Improved NetCDF output
You now have more control over the output time-stamps in the written NetCDF files. Before, the time-stamp was always one hour before the end of the respective time-span which could be confusing for different step sizes.
Depending on the output time-step, you can set the reference point via the
output_time_reference namelist entry in the output namelists with these flag values:
0: (default) start of the time interval (i.e.
1990-01-01 00:00for daily output on
1: center of the time interval (i.e.
1990-01-01 12:00for daily output on
2: end of the time interval (i.e.
1990-01-02 00:00for daily output on
Also, all axes in the NetCDF files will now have bounds for each point. Especially in case of the time-axis, the represented time-span is now explicitly given:
Silent mode and better exit codes
Many users run mHM on HPCs with different workflow managers. To improve the user experience here, we added two features:
- when a mHM run fails, it will now always return an exit code
1, so your workflow manager will notice it failed
- to keep your log file clean (e.g. when doing optimizations), we added a silent mode:
$ mhm --quiet # or -q
This will prevent terminal messages during the run, but still displays error messages. To even disable error messages, you can repeat this flag:
$ mhm -qq
The full release notes can be found here: