![]() |
mHM
The mesoscale Hydrological Model
|
Python bindings to control mHM.
The wrapper (mhm/wrapper.f90) is just a small layer on top of the interfaces provided by mHM to be compatible with f2py.
There is a PyPI package to install the latest release:
Installing the mHM Python package will provide the mhm command to execute mHM the traditional way.
In order to compile the Python bindings from scratch you need:
FC (and F77), CC and CXX accordingly). In case of gcc, this could look like: See the Compilation instructions for these dependencies.
You can also use a conda environment (set up with miniforge for example) to get everything:
To compile everything after cloning/downloading, you can use pip:
To install it directly from the git repository you can type:
The following environment variables can be used to control the compilation and installation of the python bindings for mHM:
SKBUILD_CMAKE_BUILD_TYPE=[Release|Debug]: build type for the mhm library (default: Release)MHM_BUILD_FORCES_PATH=<path>: custom path to forces source dir (default: None)MHM_BUILD_PARALLEL=[0|1]: whether to use OpenMP with mHM (default: 0)Together with the Python bindings comes a command line script to download the test domains:
You can then run mHM on this test domain with:
You can get help on how to use this script with mhm-download -h:
Within python scripts, you can use this tool with mhm.download_test. See below for examples.
See mhm.tools and wrapper.f90 for further information on the provided routines.
If you have cloned the repository, you can do the following to simply run mhm without optimization:
Or you can do the following to control each timestep:
See also the examples folder.
LGPLv3 (c) 2005-2023 mHM-Developers