MOHID ASCII Files

Introduction

MOHID ASCII files are ASCII files which follow special formatting rules. These files are used to provide all input information to the FORTRAN based numerical MOHID models (MOHID Water, MOHID Land and MOHID River). Some outputs of these models are also written in this format.

MOHID ASCII files are organized by keywords and information blocks, which can pile up to three hierarchical levels and aggregate groups of keywords. This format can be seen likewise to a simple Mark-Up Language. File generation can be made manually, using a text editor (like MOHID Studio’s Text Editor) or by tools (like MOHID Studio Tools).

The maximum number of characters per line is restricted to 256. As each line contains only one instruction, this restriction does not represent any practical limitation to the user. Files can have blank lines and keywords do not have to follow any specific order. This reduces the effort of preparing input data files in a rigid format and reduces input data errors. With exception to some cases, all the reading (keywords, keyword values, blocks definition tags) are case sensitive. So, caution is advised in the preparation of the files because recognition is only achieved by full correspondence of characters in the code and in the data files. In Figure 1 is represented an example of a MOHID ASCII file, with keyword, keyword values and blocks.

MOHID Studio - User Guide 154.png
Figure 1 : Example of a MOHID ASCII file.

XYZ Files

XYZ Files are used to define a set of points with x, y and z coordinates. These files are typically used to store information from bathymetric or topographic surveys.

XYZ Files are ASCII text file which extension should be *.xyz. XYZ Files contain a set of blocks, each containing a set of point values. One block is delimited by the following case sensitive keywords: <begin_xyz> and <end_xyz>.

A fourth column can be optionally included and it is handled as a character string which can also be used as a legend for each point.

In Figure 2 is represented a simple example of a three column XYZ MOHID ASCII File.

MOHID Studio - User Guide 155.png
Figure 2 : Example of MOHID ASCII XYZ file.

Line Files

MOHID ASCII Line files are used to store simple lines. The default extension for MOHID ASCII Line files is *.lin. These files are organized in blocks, each containing the vertices for a determined line. One block is defined by the following keywords: <begin_line> and <end_line>. Note that these keywords are case sensitive.

One file can contain an infinite number of blocks. Inside each block there are 2 columns and at least 2 rows, one for each vertex of the line. The left column relates to the XX coordinates of a point and the right one to the YY coordinates. In Figure 3 represents an example of an MOHID ASCII Line file.

MOHID Studio - User Guide 156.png
Figure 3 : Example of a MOHID ASCII Line file.

Polygon Files

MOHID ASCII Polygon files are used to store polygons. The default extension for Polygons files is *.xy. These files are organized in blocks, each containing the vertices for a certain polygon. One block is defined by the following keywords: <beginpolygon> and <endpolygon>. Note that these keywords are case sensitive. One file can contain an infinite number of blocks. Inside each block there are 2 columns: the left relates to the XX coordinates of the polygon vertices and the right one to the YY coordinates of the polygon vertices. Figure 4 shows an example of one MOHID ASCII Polygon file.

MOHID Studio - User Guide 157.png
Figure 4 : Example of a MOHID ASCII Polygon file.

Grid Files

MOHID ASCII Grid files are used to stores grid. The organization of these files is divided into a header section and a grid spacing section. MOHID supports orthogonal horizontal grids, which can be rectangular or curvilinear. The default extension for Grid files is *.grd. In Figure 5 are represented examples of grids that are supported by MOHID Studio: regular equally spaced, regular not-equally spaced, rotated, and curvilinear).

Note that in MOHID the i index refers to the YY axis and the j index to the XX axis. As an example grid cell (5, 2) is the fifth grid cell in the YY axis and the second in the XX axis.

MOHID Studio - User Guide 158.png
Figure 5 : Example Grids supported by MOHID.

The header section contains information related to the grid global definitions, such as the number of cells, the type of coordinates used, the origin coordinates of the grid, etc. Below are shown the keywords supported by the header section of a Grid file.

  • ILB_IUB - Two integer numbers defining the minimum and maximum I values along the Y-axis of the grid.
  • JLB_JUB - Two integer numbers defining the minimum and maximum J values along the X-axis of the grid.
  • COORD_TIP - A flag which indicates the used coordinates type.
  • ORIGIN - Two real values, which indicate the origin of the lower left corner of the grid.
  • ZONE - Integer values defining the UTM Zone where the bathymetry is located.
  • GRID_ANGLE - Counter-clock mesh rotation relative to the north. The base point is the origin of the grid.
  • LATITUDE - Average latitude value used to compute Coriolis frequency and solar radiation when metric coordinates cannot be converted to WGS84 geographic coordinates.
  • LONGITUDE - Average longitude value used to compute Coriolis frequency and solar radiation when metric coordinates cannot be converted to WGS84 geographic coordinates.
  • CONSTANT_SPACING_X - Boolean defining if the spacing in the X axis is constant
  • CONSTANT_SPACING_Y - Boolean defining if the spacing in the Y axis is constant
  • DX - Constant spacing distance in XX axis
  • DY - Constant spacing distance in YY axis

If the spacing is not constant, the grid spacing section contains information about the grid spacing in the XX and YY axis namely through defining the grid cells corners coordinates. This information is stored in blocks, one for each direction. The data is stored inside a block defined by the following keywords: <BeginXX> and <EndXX> for the XX axis and <BeginYY> and <EndYY> for the YY axis. Note that the keywords of these block definition tags are case sensitive. Each value must be stored in a single line. The values are read from left to right in the XX axis and from bottom to top in the YY axis. The first value is always zero in both directions, being the following values cumulative. Figure 6 shows an example of an MOHID ASCII Grid file.

NOTE: For more information about MOHID Grid files can be found here check the following link:

http://www.mohid.com/wiki/index.php?title=Grid

MOHID Studio - User Guide 159.png
Figure 6 : Example of a MOHID ASCII Grid file.

Grid Data Files

MOHID ASCII Grid Data files relate 2D or 3D information to a grid. Grid data is stored in an ASCII text file and has multiple and flexible formatting options. Grid Data files are used to store one value per grid cell (as for bathymetry, topography). MOHID ASCII Grid Data Files contain the same sections as Grid files (header section and grid spacing section) plus an additional data section.

The data section contains the values of the Grid Data. The data is stored inside a block defined by the following keywords: <BeginGridData2D> and <EndGridData2D>. Note that these keywords are case sensitive. It is possible to specify the values by giving a list of all values of all the grid cells. Each value must be stored in a single line. The values are read from the lower left corner to the upper right corner of the grid by row-column order. Therefore, the first grid data values are read in the following order: (ILB, JLB), (ILB, JLB+1), … (ILB, JUB), (ILB+1, JLB), …, (IUB, JUB-1), (IUB, JUB). Note that the index "i" refers to the Y-axis and the "j" index to the X-Axis. In this case, if you have a (IUB x JUB) grid then the list must have (IUB x JUB) values.

NOTE: More information about MOHID Grid Data files can be found on the following link: http://www.mohid.com/wiki/index.php?title=Grid_Data

Drainage Network Files

MOHID ASCII Drainage Network Files are used to stores information about drainage network. The organization of this file is divided into blocks defining single nodes and blocks of defining links between nodes.

Single node blocks contain information related to each node which makes part of the drainage network. Single nodes blocks are delimited by the <BeginNode> and <EndNode> blocks. An example of a node block is represented in Figure 7.

MOHID Studio - User Guide 160.png
Figure 7 : Example Node Definition.

Links between nodes are defined by blocks delimited by <BeginReach> and <EndReach> blocks. An example of a node block is represented in Figure 8.

MOHID Studio - User Guide 161.png
Figure 8 : Example Reach Definition.

Due to the complexity of these files, it is recommended to generate these files with MOHID Studio’s Watershed delineation tool.

NOTE: More information about MOHID Drainage Network files can be found on the following link: http://www.mohid.com/wiki/index.php?title=Mohid_Land.

Time Series Files

MOHID ASCII Time series files are used to store information varying in time. These files serve as input and as output for the MOHID numerical programs. MOHID ASCII Time Series files should contains have an extension *.sr* (e.g. *.srh, *.srm, etc).

Time Series files have a header section containing general definition about the series (location, time units, and name) and data section.</center>

The header section must define the following keywords:

  • NAME – Name of the Station to which the series belong;
  • COORD_X – X Coordinate of the station;
  • COORD_Y – Y Coordinate of the station;
  • SERIES_INITIAL_DATA - definition of the series initial data;
  • TIME_UNITS – Time units in which the data is given;

The data section is defined inside a block defined by the tags <BeginTimeSerie> and <EndTimeSerie>. Inside the block data is formatted into columns separated by blank spaces. The leftmost column defines the accumulated time, in the time units defined in the header section and starting from the time series initial date, also defined in the header section. The number of columns is limited by the default number of characters allowed in one single line, which are 256. In order to read the properties (e.g. temperature, salinity, wind speed, etc.) associated to a certain column, a header line must be present on the line just above the <BeginTimeSerie> tag. The number of properties names in this header line must be equal to the number of columns in the data section including the accumulated time column. The names must be separated by blank spaces, thus properties names with blank spaces are not allowed. Blank spaces of properties must be replaced by an underscore. The Figure 9 shows an example of a simple time series file with one column and in the Figure 10 it is possible to see an advanced example.

MOHID Studio - User Guide 162.png
Figure 9 : Example MOHID ASCII Time Series file (simple).
MOHID Studio - User Guide 163.png
Figure 10 : Example MOHID ASCII Time Series File (advanced).

XML Files

Introduction

MOHID Studio uses XML files to store data of many kinds. Many of these files are for internal use only and are not described here. XML Files suitable to be edited are XML files which contain geometry information. These are described along the next subsections.

XML Named Points Files

XML named points files are used to store "named points" and can be generated with MOHID Studio’s tools. An example of a XML Named point file is represented in Figure 11.

MOHID Studio - User Guide 164.png
Figure 11 : A XML Named Point File.

XML Named Lines Files

XML named lines files are used to store "named lines" and can be generated with MOHID Studio’s tools.

XML Named Polygon Files

XML named polygon files are used to store "named polygons" and can be generated with MOHID Studio’s tools.

Other Formats

HDF Files

HDF5 is a general purpose library and file format for storing scientific data. It is the standard input/output format of spatial and/or temporal data sets in MOHID. Through MOHID Studio’s integrated map engine it is possible to visualize data contained in HDF files. Besides this, MOHID Studio includes tools to manipulate HDF Files and export data from HDF files to other formats.

HDF5 itself does not define a standard of how to georeference data sets, nor how to time reference data sets. In order to overcome this lack of definition, MOHID defines some special rules how data inside a HDF file should be organized, in order to be MOHID-HDF. For more information about this subject can be found at the following link: http://www.mohid.com/wiki/index.php?title=HDF_file.

MOHID’s modules produce HDF files which contain: (i) polygon (grid data) based data sets, (ii) drainage network based information and (iii) lagrangian (particle) based data sets.

ESRI Shapefiles

The ESRI Shapefile is a popular geospatial vector data format for geographic information systems software. It is developed and regulated by ESRI as a (mostly) open specification for data interoperability among ESRI and other software products. MOHID Studio is able to disable data contained in ESRI Shapefiles. Some MOHID Studio tools are based on ESRI Shapefiles and through file conversion it is possible to convert between ERSI Shapefiles and other file formats.

Links

Go back to MOHID Studio User Guide

User Guides