mHM release v5.13

We, the mHM developers, are proud to release mHM v5.13!

The release can be accessed here:

mHM v5.13


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
# run the downloaded example
runoff_sim_obs = mhm.get_runoff_eval(gauge_id=1)
# plotting
plt.plot(runoff_sim_obs[:, 0])
plt.plot(runoff_sim_obs[:, 1], linestyle="--")
Simple mHM discharge plot.
Simple mHM discharge plot.

Also, another little helper command ships with the bindings: mhm-download. 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:00 for daily output on 1990-01-01)
  • 1: center of the time interval (i.e. 1990-01-01 12:00 for daily output on 1990-01-01)
  • 2: end of the time interval (i.e. 1990-01-02 00:00 for daily output on 1990-01-01)

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:

Output comparison.
Ncview will now show information on the valid time-span.

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:

  1. when a mHM run fails, it will now always return an exit code 1, so your workflow manager will notice it failed
  2. 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

Release notes

The full release notes can be found here:

mHM v5.13 release notes