Personal tools

Keywords

From MohidWiki

Revision as of 00:13, 22 March 2018 by Francisco (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

ASCII input data files in Mohid are organized in keywords and information blocks. Each keyword is defined in a different text line with a maximum of 256 characters. The keyword is always defined on the left of the colon delimiter (“:”) and to the right it is always defined the value of the keyword.

Keyword.jpg

Between the keyword and the delimiter and between the delimiter and the value, blank spaces are allowed. Keywords can define integer numbers; real numbers; boolean values; character strings; one-dimensional arrays of integer or real numbers; dates;

Boolean values are used in variables which can have a TRUE or FALSE value. To minimize input data errors, boolean values in MOHID are always defined by integer numbers: 0 (zero), meaning FALSE, or 1 (one), meaning TRUE.

Dates in MOHID are defined by a 1D array with fixed dimension (6 values). The order of the values is year, month, day, hour, minute and second. The six values are separated by blank spaces.


DENSITY_METHOD 2 Integer Method to compute water density
DT 30 Real Model time step (in seconds)
TIDE 1 Boolean Activates/Deactivates tide calculation
NAME temperature Character string Name of a water property
BOXES_VALUES 3.4 4.5 2.1 6.2 1D array real Values defined for an array defined by 4 boxes
START 2006 1 1 0 0 0 Date Initial date of the simulation (see Mohid Time format)

The detection algorithm of a keyword and its correspondent value is made by scanning all the lines from top to bottom of the file. When a match occurs the file is not scanned anymore. This means that if a keyword is present twice in the file, only the first match is accounted. A keyword can be searched from the entire file, or it can be searched from a defined part of the file, e.g. from a block. This allows the hierarchical ordering of the file, increasing the complexity of information provided in it.


WARNING: Comment lines can NOT have ":" character. For example if ":" character appears in the end of the sentence results in an error, because Module EnterData is expecting to read a value after the ":" character.

Related links