Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.

MOHID instalation in Linux machines

This repository is an attempt to compile MOHID in a linux machine with Ubuntu or CentOS linux distro and intel compiler ifort.

Minimum system requirements

Install the following softwares:

  • intel compiler C and Fortran
  • zlib
  • hdf5
  • netcdf
  • proj4
  • proj4fortran
  • intel mpi or mpich or openMPI, etc.(optional)
  • mohid src

or Install intel compiler first! and after use ./ -opt1 -opt2 ... to install library requirements will download and install all libraries required to compile MOHID. You must respect the instalation order. To see help menu run:

./ -h

Update all paths in script to fit your setup.


To compile MOHID Water and/or MOHID Land, you must compile first MOHID Base 1 and MOHID Base 2. This will create all .mod files used to compile MOHID.

./ -mb1 -mb2

To compile MOHID Water run:

./ -mw

To compile MOHID Land run:

./ -ml

For more information or see all option available, run:

./ -h

Update all paths in script to fit your setup.

Test the installation

Inside test directory there are two test cases, one for mohid water and another one for mohid land. Just execute mohid-in-linux/test/mohidwater/25m_deep/exe/MohidWater.exe or mohid-in-linux/test/mohidland/schematicWatershed/exe/MohidLand.exe to see if there's no errors.

If you see Program Mohid Water successfully terminated or Program Mohid Land successfully terminated, your installation was sucessfull.

If you want to run your own project, make a link for bin/MohidWater.exe or bin/MohidLand.exe

ln -s <MOHID_INSTALLATION_PATH>/Mohid/Solutions/mohid-in-linux/bin/MohidWater.exe <YOUR_PROJECT_PATH>/exe/MohidWater.exe


export INTEL=/opt/intel
export PATH=$PATH:$INTEL/bin:$INTEL/lib/intel64:$INTEL/include:$INTEL/include/intel64
export CC=$INTEL/bin/icc
export CXX=$INTEL/bin/icpc
export FC=$INTEL/bin/ifort
export F9X=$INTEL/bin/ifort
export CFLAGS='-O3 -xHost -ip'
export CXXFLAGS='-O3 -xHost -ip'
export FCFLAGS='-O3 -xHost -ip'
  • Update all paths in scripts
  • MOHID must be compiled with the same compiler used in hdf5 and netcdf libraries
  • If necessary use to uppercase all .f90 to .F90 extensions
  • If necessary use dos2unix linux command: find . -name *.F90 -exec dos2unix {} \;
  • If you want to use MPI, install MPI in your system and make MPI flag true in MPI only work if your project has nested domains.

Help, Bugs, Feedback

If you need help with compile MOHID in linux, you can hang out by mail: or consult our wiki. You can also subscribe to our forum. To report bugs, please contact any developers. More information consult


GNU General Public License. See the GNU General Public License web page for more information.