This page describes how to use existing RUNCLASS input files to run MESH in a "point mode".
Overview
The input files from an existing RUNCLASS ("standalone CLASS") run can be re-used and run with MESH by renaming the files, creating the MESH_input_run_options.ini and MESH_parameters_hydrology.ini files, and running MESH in a "point mode".
Contents:
Step-by-step guide
Renaming the RUNCLASS input files
The RUNCLASS input files must be renamed to be recognized by MESH.
A subset of the RUNCLASS input files sometimes share a common filename, representative of the project or basin, with various extensions. For example, OJP.MET and OJP.INI. In the following table, the project/basin name (e.g., "OJP") is identified as "RunID".
The files should renamed as follows:
RUNCLASS filename | MESH filename |
---|---|
RunID.INI | MESH_parameters_CLASS.ini |
RunID.MET | basin_forcing.met |
soil_3lev | MESH_input_soil_levels.txt |
Creating and configuring the MESH_input_run_options.ini file
A new text file should be created, named "MESH_input_run_options.ini". A sample file is attached for reference.
The contents of the file should be as follows:
MESH run options input file ##### Control Flags ##### ----# 9 # Number of control flags HOURLYFLAG 30 BASINFORCINGFLAG met SHDFILEFLAG 2 IWF 0 SOILINIFLAG 0 RUNMODE noroute DIAGNOSEMODE 0 BASINAVGWBFILEFLAG daily OUTFILESFLAG 0 ##### Output Grid selection ##### ----# 0 # Number of output grid points (5 points maximum) ---------# 1 #1 Grid number 1 #2 Land class . #3 Output directory ##### Output Directory ##### ---------# . # Output Directory for total-basin files ##### Simulation Run Times ##### ---#---#---#---# 0 0 0 0 # Start year, day, hour, minute 0 0 0 0 # Stop year, day, hour, minute
Control flags
If control flags are added or removed, the "number of control flags" at the head of this section in the file must be updated to reflect the number of controls flags that are listed in this file:
----# 9 # Number of control flags
Descriptions of the active control flags are as follows:
Control Flag | Option | Description |
---|---|---|
HOURLYFLAG | 30 | This flag describes the uniform frame length in minutes of the records found inside the meteorological driving data For hourly data, the value should be changed from 30 to 60 . |
BASINFORCINGFLAG | met | This flag tells MESH to read the CLASS MET format forcing file. This flag can be replaced with respective BASINRAINFLAG, BASINTEMPERATUREFLAG, etc.., flags to use alternate file formats for the forcing files. Any subset of the BASINRAINFLAG, BASINTEMPERATUREFLAG, etc.., can be listed after BASINFORCINGFLAG with valid options to override specific columns of meteorological driving data from the CLASS MET format forcing file. |
SHDFILEFLAG | 2 | This flag must be set to option 2 to activate the "point mode" and prevent MESH from searching for a drainage database file containing the additional attributes and basin information that are required for running fully-distributed hydrological simulations. |
IWF | 0 | This flag should be set to 0 to emulate RUNCLASS, which does not include the WATROF and WATDRN algorithms for overland sloped runoff and interflow calculations. If set to 1 or 2 , additional parameters must be specified in one or both of the MESH_parameters_CLASS.ini and MESH_parameters_hydrology.ini files for the WATROF/WATDRN or PDMROF routines, respectively. Refer to the "IWF" column in the parameter table for hydraulic parameters for MESH_parameters_CLASS.ini to see the parameters required for WATROF/WATDRN when IWF is enabled with option 1 . Refer to the "IWF 2" section for "GRU-dependent parameters" for MESH_parameters_hydrology.ini to see the parameters required for PDMROF when IWF is enabled with option 2 . |
SOILINIFLAG | 0 | This flag can be optionally activated to control or override automatic adjustments made to the soil texture values when the sum of the SAND and CLAY components adds to > 100.0. |
RUNMODE | noroute | This flag must be set to the noroute option to disable hydrological routing routines, which require additional hydrological attributes and basin information, which are not included in the RUNCLASS input files. |
DIAGNOSEMODE | 0 | This flag can be optionally activated with option 1 to print additional diagnostic information during the initialization of the model to the screen and to MESH_output_echo_print.txt. |
BASINAVGWBFILEFLAG | daily | This flag can be optionally configured to control the output of the basin-average water balance files. For example, the flag also supports the ts and monthly options to create files with values at every model time-step or only at the end of each calendar month, respectively. Likewise, the BASINAVGEBFILEFLAG could be added as an additional control flag to control the output of the basin-average energy balance files. In both cases, outputs via these flags can be completely disabled with option none . |
OUTFILESFLAG | 0 | This flag can be optionally activated with option 1 to create additional outputs of various variables in multiple file formats as time-series at multiple output frequencies (e.g., hourly, daily, monthly, annually, or representative of seasonality). If the output of a specific CLASS variable is desired and the variable is accessible via OUTFILESFLAG, using OUTFILESFLAG is recommended over activating the "CLASS point outputs". If OUTFILESFLAG is active, it requires configuration via the outputs_balance.txt input file. If OUTFILESFLAG is enabled and outputs_balance.txt does not exist, the model will stop during initialization with an error. |
CLASS point outputs
"CLASS point outputs" can be optionally activated by changing the "number of output grid points" in MESH_input_run_options.ini to 1
. However, in almost all instances if the variable is accessible as a MESH output, using OUTFILESFLAG is recommended over activating "CLASS point outputs". A list of all of the variables that are available as MESH outputs via OUTFILESFLAG is here.
In the sample, a single period ".
" as the "output directory" means that the CLASS output files will be created in the same folder where MESH is run. If the outputs should be created in a subfolder in this location, the name of the folder can be specified instead ("CLASSOUT1
" in the sample excerpt below). The folder name must be less than 10 characters (the same number of dashes in the line above where the "grid number", "land class", and "output directory" are specified). MESH does not create directories by itself, so the "output directory" must be created and already exist before the simulation is run.
The "point mode" can only be run for 1 GRU (within a single "unit grid") so only 1 "CLASS point output" should be specified in this section.
##### Output Grid selection ##### ----# 1 # Number of output grid points (5 points maximum) ---------# 1 #1 Grid number 1 #2 Land class CLASSOUT1 #3 Output directory
General and basin-average outputs
In the sample, a single period ".
" as the "output directory for total-basin files" means that MESH output files will be created in the same folder where MESH is run If the outputs should be created in a subfolder in this location, the name of the folder can be specified instead ("BASINAVG1
" in the sample excerpt below). The folder name must be less than 10 characters (the same number of dashes in the line above where the "output directory" is specified). MESH does not create directories by itself, so the "output directory for total-basin files" must be crated and already exist before the simulation is run. If the folder does not exist when MESH is run, the model will stop during initialization with an error.
If outputs are created using OUTFILESFLAG (configured with the outputs_balance.txt file), those outputs will also be created inside the "output directory for total-basin files".
##### Output Directory ##### ---------# BASINAVG1 # Output Directory for total-basin files
Creating MESH_parameters_hydrology.ini
A new text file should be created, named "MESH_parameters_hydrology.ini". This file is necessary to add values for three ponding limits that are assumed constant in RUNCLASS and thus do not appear in its parameter file. A sample file is included with the attached sample "point mode" MESH setup for reference.
The contents of the file should be as follows:
2.0: MESH hydrology parameters file !> Any line leading with '!' is ignored !> Spacing, whether by tabs or spaces doesn't matter !> Parameter/field names are not case sensitive ##### Option Flags ##### ----# 0 # Number of option flags ##### Channel routing parameters ##### -----# 0 # Number of channel routing parameters !> IAK ----- 1 ##### GRU-independent parameters ##### -------# 0 # Number of GRU-independent parameters ##### GRU-dependent parameters ##### -------# 3 #Number of GRU-dependent parameters !> GRU ------- 1 ZSNL 0.1 ZPLS 0.1 ZPLG 0.1
The ponding limits defined in this file are described in the section for "GRU-dependent parameters" for MESH_parameters_hydrology.ini. In the sample they are set to 0.1 m, which corresponds to the values noted in the CLASS technical manual and should be consistent with the values found in the RUNCLASS ("standalone CLASS") code.
In some circumstances (for example, possibly when running over bare soil), the ponding limits may still be overwritten by CLASS in MESH and these values, while required, may be disabled and have no effect. Details of the specific configurations when these values are overwritten by CLASS will be posted soon.
Running the model
Any "point mode" configuration made for 1.4.1037 must ensure that "RUNMODE" is listed in the list of control flags in MESH_input_run_options.ini and that it explicitly includes the option "noroute". This was not previously required, but is now required when running any newer version of the code.
RUNMODE noroute
The distinction between 1.4.1037 and the new code is that grid processes are not completely disabled with "point mode" in the new code, so that the full suite of outputs, such as the basin-average output files and files created via OUTFILESFLAG, are accessible. With grid processes not completely disabled, all routing must thus be explicitly disabled via the "noroute" option on RUNMODE. Without this change, "point mode" configurations for 1.4.1037 will cause errors using the new code, when the enabled routing will try to route runoff from the land surface scheme in the absence of hydrological attributes and parameters.
Once the RUNCLASS input files have been renamed and the additional input files for MESH have been created, the folder should contain the following files:
File | File Type | Description |
---|---|---|
basin_forcing.met | Input file | CLASS MET format driving data (input forcing data) |
MESH_input_run_options.ini | Input file | MESH run configuration |
MESH_input_soil_levels.txt | Input file | Soil layer discretization |
MESH_parameters_CLASS.ini | Input file | CLASS parameter file |
MESH_parameters_hydrology.ini | Input file | Hydrology parameter file (with only CLASS parameters active) |
sa_mesh | Executable/binary program | Standalone MESH program |
With these files and MESH_input_run_options.ini properly configured, running MESH is exactly the same as for any model setup. Without any further modification, the Standalone MESH program file can be run as-is.
Because the routing code is disabled, MESH will print a time-series of only three variables to screen. These are the same three columns that print to the end of the line in a regular MESH run: the basin-average precipitation, evapotranspiration, and runoff. In the case of a point run, the "basin" is in fact a "unit grid", so these are the precipitation, evapotranspiration, and runoff amounts of the single GRU in the RUNCLASS grid.
Related articles
-
MESH_parameters_CLASS.ini — This page provides an overview of the MESH_parameters_CLASS.ini parameter file, which stores values for the parameters that are needed to run the CLASS portion of MESH and initial conditions. It is very similar to the "INI" configuration file used by the RUNCLASS ("standalone CLASS") program.
-
-
How-to use RUNCLASS input files with Standalone MESH running in "point mode" — This page describes how to use existing RUNCLASS input files to run MESH in a "point mode".
-
-