Page tree

MESH - A Community Hydrology - Land Surface Model

Skip to end of metadata
Go to start of metadata

MESH directory

Configuration and parameter files 

Often, the input files for MESH are kept in a single directory. At a minimum, a simulation requires the following files.

MESH_drainage_database.r2c*_shd.r2cRenamed, unmodified. The 'SHDFILEFLAG' control flag with option '1' must be activated in MESH_input_run_options.ini.
Must be created, contains configuration options for MESH that are similar to the options of the 'event' file.
MESH_input_streamflow.tb0*_str.tb0Renamed, unmodified. Files for multiple events must be concatenated to a single file. The 'STREAMFLOWFILEFLAG' control flag with the 'tb0' option must be activated in MESH_input_run_options.ini.
MESH_input_reservoir.tb0*_rel.tb0Renamed, unmodified. Files for multiple events must be concatenated to a single file. The 'RESERVOIRFILEFLAG' control flag with the 'tb0' option must be activated in MESH_input_run_options.ini.
Must be created, contains a uniform soil profile definition; used by the land surface scheme.
Must be created, contains parameterization of the land cover types defined in the drainage database. Parameterization of the last cover type in the drainage database, for impervious areas, is not included in this file (the number of GRUs in this file is ':ClassCount' from the drainage database less 1).
MESH_parameters_hydrology.ini (2.0)*_par.csvMust be created, contains additional parameters. If the channel routing and baseflow parameters are defined by 'IAK'/the number of river classes in *_par.csv, these can be copied and re-labelled in the 'channel routing' parameter section of this file.
MESH_parameters.r2c*_par.r2cRenamed, unmodified. Only recommended if the file contains grid-based and GRUs based average elevation, average slope, average aspect, average curvature and average of the difference in elevation between the model (HydroShed DEM) and GEM elevation field parameters (e.g., elevation1, elevation2, elevation3..., slope1, slope2, slope3 ..., aspect1, aspect2, aspect3 ...., curvature1, curvature2, curvature3,.......,delta1, delta2, delta3, ...). The 'INPUTPARAMSFORMFLAG' control flag with the 'r2c' option must be activated in MESH_input_run_options.ini.

Changes required in MESH_input_run_options.ini

To activate and configure ‘Mountain MESH’ module:

- Add ‘MOUNTAINMESH on’ to MESH_input_run_options.ini as shown in the sample MESH_input_run_options.ini file

- You can assign ‘CalcFreq’ like this: optionName=value

To turn off the module

- Add option ‘off’ to ‘MOUNTAINMESH’ in the MESH_input_run_options.ini

- Remove  ‘MOUNTAINMESH’ from MESH_input_run_options.ini

This code also includes ‘MOUNTAINMESH’.

Setups that use “SOLARADJUSTFLAG” will work as before; however, they can be updated by replacing “SOLARADJUSTFLAG” with “MOUNTAINMESH” in run_options.ini. The options previously supported by ‘SOLARADJUSTFLAG’ are also supported by ‘MOUNTAINMESH’:

MOUNTAINMESH           CurveWeight=0.50 CalcFreq=288

MOUNTAINMESH           on

MOUNTAINMESH           off

New options are added to enable/disabled specific components of ‘MOUNTAINMESH’, such that you can select the active components and also between the different options for a particular adjustment without needing to change the code and recompile, as was required before.

All multi-word options can contain NO spacing between the option name, equal sign, and value:


Multiple options should be separated by one or more whitespace:

option1=1 option2=2

Any text or options following ‘#’ is ignored:

FLAG value option=value #this text is ignored

The options supported on the ‘MOUNTAINMESH’ control flag are these:

!> Flags to control MESH runs

 !*  CurveWeight: Wind model curvature weight (0.5 by default or can be calibrated)
!* ipre: Flag to specify precipitation adjustment method. [--].
!> 0: None.
!> 1: Elevation Range with Maximum elevation Method (ERMM) (Zhang et al. (2018)) and (Tesfa et al. (2019))
!> 2: Adjustment based on Thornton, 1997 or derived lapse-rate for elevation.
!* itemp: Flag to specify temperature adjustment method. [--].
!> 0: None.
!> 1: Lapse-rate adjustment.
!* ipres: Flag to specify pressure adjustment method. [--].
!> 0: None.
!> 1: Elevation adjustment.
!* ihumd: Flag to specify specific humidity adjustment method. [--].
!> 0: None.
!> 1: Adjustment based on Kunkel, 1989.
!> 2: Adjustment based on Murray, 1967.
!> 3: No adjustment
!* irlds: Flag to specify longwave radiation adjustment method. [--].
!> 0: None.
!> 1: Correction based on temperature and vapour pressure (Sicart et al., 2005)
!> 2: Lapse-rate adjustment.
!* iwind: Flag to specify wind speed adjustment method. [--].
!> 0: None.
!> 1: Adjustment based on Liston and Sturm, 1998 (requires wind direction, winddir).
!> 2: Lapse-rate adjustment.
!* iphase: Flag to specify precipitation phase partitioning method. [--].
!> 0: Partioning to 0.0 degrees C.
!> 1: Partitioning based on Harder and Pomeroy, 2013.
!* irsrd: Flag to specify shortwave radiation adjustment method. [--].
!> 0: None.
!> 1: Adjustment based on Garnier and Ohmura, 1970.
!> 2: Liston, Elder - 2006 - A Meteorological Distribution System for High-Resolution Terrestrial Modeling (MicroMet).
!* idecl: Flag to specify calculation to use for declination. [--].
!> 0: Alternate approach.
!> 1: Declination calculation (Dingman, 2015 and Iqbal, 1983).

Use the flags to enable or disabled specific adjustments. For example, to adjust everything using the default options but not wind because you want to use ilapse=3 and don’t have wind direction data

MOUNTAINMESH on ilapse=3 iwind=0

With DIAGNOSEMODE enabled, MESH will echo the active configuration to screen and to echo_print.txt


MOUNTAINMESH on CurveWeight=0.50 CalcFreq=288 ilapse=3 ipre=1 itemp=1 ipres=1 ihumd=1 irlds=1 iwind=0 iphase=1 irsrd=1 idecl=1

To use the default options:


To use the default options, including the ‘MOUNTAINMESH’ partitioning for precipitation:



* IPCP must be set to 4 or else CLASS will overwrite the values with its own partitioning!

To disable ‘MOUNTAINMESH’ but preserve the flag in run_options.ini:

MOUNTAINMESH off #can comment old options by leading them with '#'

To disable the adjustments, which require additional inputs to the model, but to still use the ‘MOUNTAINMESH’ partitioning for precipitation:


MOUNTAINMESH on none iphase=1

* IPCP must be set to 4 or else CLASS will overwrite the values with its own partitioning!

For adjustments that use lapse rate, the default table is the one with annual averages based on HRDPS (2.5km GEM), Oct 2016 to Sep 2019. For adjustments that require lapse rate, you must use one of the three hard-coded tables, specified with ilapse=1, ilapse=2, or ilapse=3 (described above). For the adjustment of wind speed using lapse rate (iwind=2), specifically, you can only use ilapse=1 or ilapse=2. If you use an invalid configuration, MESH will stop with an error. I’ll add the option of ilapse=4 to read tables from file at a later date, but for now it’s not supported

Sample Mountain MESH Setup for Bow River Basin at Banff

The following Mountain MESH setup file contains all the required files to run the mountain MESH. It can be used as a template to prepare the required setup file to run Mountain MESH for the study basin.  The forcing file is GEM-CaPA ~ 10km for two years from 01-01-2002 to 31-13-2003. The MESH drainage file and MESH parameters files were produced from available land surface data consist of digital elevation models (DEMs), i.e. the hydrologically conditioned HydroSheds DEM that has a spatial resolution of approximately 90 m available at (, and its derived products including flow direction and drainage density. Soil data was collected from a rasterized version of the Soil Landscapes of Canada (SLC) dataset ( The dataset covers Canada at 90 m spatial resolution and is derived from original data at a scale of 1:1M. This dataset has some missing information for the Bow River Basin, for instance, there is no information on the percentages of clay and sand of the first soil layer (0 – 5 cm depth). Landcover data was downloaded from the Commission for Environmental Cooperation (CEC) ( covering all of North America at a resolution of 30 m with 19 land cover classes. The Randolph Glacier Inventory 6.0 data (, based on Landsat imagery from 2004–06, were used to delineate glacier coverage in the basin. The inventory was generated and manually checked in 2008 (Bolch et al., 2010). The detail on the mountain MESH can be found in the reference below.

A Sample Mountain MESH setup

A sample Mountain MESH setup file for Bow River at Banff can be accessed here.


Script to automate MESH setup

Automating MESH model setup helps to make the setup reproducible. This R script ( intend to facilitate model setup with a minimum efforts. Unlike Green Kenue, this script uses the minimum elevation of the maximum flow accumulation in each of the modeling grid (mostly set as the same as the forcing data grid size) to mimic the digital river network (then flow direction) when upscaling the flow direction from high resolution dem to low resolution modeling grid. The following steps are used in locating and identifying the flow direction from high resolution dem: mask out all the maximum flow accumulation cell in the modeling grid and then mask out the maximum flow accumulation cell by the minimum elevation

Tesemma Z., Shook K., Princz D., Razavi S., Wheater H., Davison B., Li Y., Pietroniro A. and Pomeroy J.W. 2020. Diagnosis of Historical and Future Flow Regimes of the Bow River at Calgary Using a Dynamically Downscaled Climate Model and a Physically Based Land Surface Hydrological Model.  Centre for Hydrology Report #18 (

  • No labels

1 Comment

  1. It is weird to see hf=1440 for any variable, how would MESH disaggregate daily values to 30min?

    What are the meanings of the SOLARAJUSTFLAG options and how to derive those values: Time_Offset, Trans, and CalcFreq?