MODFLOW 6
version 6.6.0.dev0
USGS Modular Hydrologic Model
|
This module contains block parser methods. More...
Data Types | |
type | blockparsertype |
Functions/Subroutines | |
subroutine | initialize (this, inunit, iout) |
@ brief Initialize the block parser More... | |
subroutine | clear (this) |
@ brief Close the block parser More... | |
subroutine | getblock (this, blockName, isFound, ierr, supportOpenClose, blockRequired, blockNameFound) |
@ brief Get block More... | |
subroutine | getnextline (this, endOfBlock) |
@ brief Get the next line More... | |
integer(i4b) function | getinteger (this) |
@ brief Get a integer More... | |
integer(i4b) function | getlinesread (this) |
@ brief Get the number of lines read More... | |
real(dp) function | getdouble (this) |
@ brief Get a double precision real More... | |
subroutine | trygetdouble (this, r, success) |
subroutine | readscalarerror (this, vartype) |
@ brief Issue a read error More... | |
subroutine | getstring (this, string, convertToUpper) |
@ brief Get a string More... | |
subroutine | getstringcaps (this, string) |
@ brief Get an upper case string More... | |
subroutine | getremainingline (this, line) |
@ brief Get the rest of a line More... | |
subroutine | terminateblock (this) |
@ brief Ensure that the block is closed More... | |
subroutine | getcellid (this, ndim, cellid, flag_string) |
@ brief Get a cellid More... | |
subroutine | getcurrentline (this, line) |
@ brief Get the current line More... | |
subroutine | storeerrorunit (this, terminate) |
@ brief Store the unit number More... | |
integer(i4b) function | getunit (this) |
@ brief Get the unit number More... | |
subroutine | devopt (this) |
@ brief Disable development option in release mode More... | |
subroutine, public | uget_block (line_reader, iin, iout, ctag, ierr, isfound, lloc, line, iuext, blockRequired, supportopenclose) |
Find a block in a file. More... | |
subroutine, public | uget_any_block (line_reader, iin, iout, isfound, lloc, line, ctagfound, iuext) |
Find the next block in a file. More... | |
subroutine, public | uterminate_block (iin, iout, key, ctag, lloc, line, ierr, iuext) |
Evaluate if the end of a block has been found. More... | |
This module contains the generic block parser type and methods that are used to parse MODFLOW 6 block data.
|
private |
Method to clear the block parser, which closes file(s) and clears member variables.
[in,out] | this | BlockParserType object |
Definition at line 84 of file BlockParser.f90.
|
private |
Terminate with an error if in release mode (IDEVELOPMODE = 0). Enables options for development and testing while disabling for public release.
Definition at line 549 of file BlockParser.f90.
|
private |
Method to get the block from a file. The file is read until the blockname is found.
[in,out] | this | BlockParserType object |
[in] | blockname | block name to search for |
[out] | isfound | boolean indicating if the block name was found |
[out] | ierr | return error code, 0 indicates block was found |
[in] | supportopenclose | boolean indicating if the block supports open/close, default false |
[in] | blockrequired | boolean indicating if the block is required, default true |
[in,out] | blocknamefound | optional return value of block name found |
Definition at line 123 of file BlockParser.f90.
|
private |
Method to get a cellid from a line.
[in,out] | this | BlockParserType object |
[in] | ndim | number of dimensions (1, 2, or 3) |
[out] | cellid | cell =id |
[in] | flag_string | boolean indicating id cellid is a string |
Definition at line 446 of file BlockParser.f90.
|
private |
Method to get the current line.
[in,out] | this | BlockParserType object |
[out] | line | current line |
Definition at line 495 of file BlockParser.f90.
|
private |
Function to get adouble precision floating point number from the current line.
[in,out] | this | BlockParserType object |
Definition at line 281 of file BlockParser.f90.
|
private |
Function to get a integer from the current line.
[in,out] | this | BlockParserType object |
Definition at line 240 of file BlockParser.f90.
|
private |
Function to get the number of lines read from the current block.
[in,out] | this | BlockParserType object |
Definition at line 265 of file BlockParser.f90.
|
private |
Method to get the next line from a file.
[in,out] | this | BlockParserType object |
[out] | endofblock | boolean indicating if the end of the block was read |
Definition at line 180 of file BlockParser.f90.
|
private |
Method to get the rest of the line from the current line.
[in,out] | this | BlockParserType object |
[out] | line | remainder of the line |
Definition at line 403 of file BlockParser.f90.
|
private |
Method to get a string from the current line and optionally convert it to upper case.
[in,out] | this | BlockParserType object |
[in] | converttoupper | boolean indicating if the string should be converted to upper case, default false |
Definition at line 354 of file BlockParser.f90.
|
private |
Method to get a string from the current line and convert it to upper case.
[in,out] | this | BlockParserType object |
[out] | string | upper case string |
Definition at line 389 of file BlockParser.f90.
|
private |
Function to get the unit number for the block parser.
[in,out] | this | BlockParserType object |
Definition at line 533 of file BlockParser.f90.
|
private |
Method to initialize the block parser.
[in,out] | this | BlockParserType object |
[in] | inunit | input file unit number |
[in] | iout | listing file unit number |
Definition at line 63 of file BlockParser.f90.
|
private |
Method to issue an unable to read error.
[in,out] | this | BlockParserType object |
[in] | vartype | string of variable type |
Definition at line 327 of file BlockParser.f90.
|
private |
Method to store the unit number for the file that caused a read error. Default is to terminate the simulation when this method is called.
[in,out] | this | BlockParserType object |
[in] | terminate | boolean indicating if the simulation should be terminated |
Definition at line 510 of file BlockParser.f90.
|
private |
Method to ensure that the block is closed with an "end".
[in,out] | this | BlockParserType object |
Definition at line 425 of file BlockParser.f90.
|
private |
[in,out] | this | BlockParserType object |
[in,out] | r | double precision real variable |
[in,out] | success | whether parsing was successful |
Definition at line 302 of file BlockParser.f90.
subroutine, public blockparsermodule::uget_any_block | ( | type(longlinereadertype), intent(inout) | line_reader, |
integer(i4b), intent(in) | iin, | ||
integer(i4b), intent(in) | iout, | ||
logical, intent(inout) | isfound, | ||
integer(i4b), intent(inout) | lloc, | ||
character(len=:), intent(inout), allocatable | line, | ||
character(len=*), intent(out) | ctagfound, | ||
integer(i4b), intent(inout) | iuext | ||
) |
Subroutine to read from a file until next block is found. Return isfound with true, if found, and return the block name.
[in] | iin | file unit number |
[in] | iout | output listing file unit |
[in,out] | isfound | boolean indicating if a block was found |
[in,out] | lloc | position in line |
[out] | ctagfound | block name |
[in,out] | iuext | external file unit number |
Definition at line 678 of file BlockParser.f90.
subroutine, public blockparsermodule::uget_block | ( | type(longlinereadertype), intent(inout) | line_reader, |
integer(i4b), intent(in) | iin, | ||
integer(i4b), intent(in) | iout, | ||
character(len=*), intent(in) | ctag, | ||
integer(i4b), intent(out) | ierr, | ||
logical, intent(inout) | isfound, | ||
integer(i4b), intent(inout) | lloc, | ||
character(len=:), intent(inout), allocatable | line, | ||
integer(i4b), intent(inout) | iuext, | ||
logical, intent(in), optional | blockRequired, | ||
logical, intent(in), optional | supportopenclose | ||
) |
Subroutine to read from a file until the tag (ctag) for a block is is found. Return isfound with true, if found.
[in] | iin | file unit |
[in] | iout | output listing file unit |
[in] | ctag | block tag |
[out] | ierr | error |
[in,out] | isfound | boolean indicating if the block was found |
[in,out] | lloc | position in line |
[in,out] | iuext | external file unit number |
[in] | blockrequired | boolean indicating if the block is required |
[in] | supportopenclose | boolean indicating if the block supports open/close |
Definition at line 565 of file BlockParser.f90.
subroutine, public blockparsermodule::uterminate_block | ( | integer(i4b), intent(in) | iin, |
integer(i4b), intent(in) | iout, | ||
character(len=*), intent(in) | key, | ||
character(len=*), intent(in) | ctag, | ||
integer(i4b), intent(inout) | lloc, | ||
character(len=*), intent(inout) | line, | ||
integer(i4b), intent(inout) | ierr, | ||
integer(i4b), intent(inout) | iuext | ||
) |
Subroutine to evaluate if the end of a block has been found. Abnormal termination if 'begin' is found or if 'end' encountered with incorrect tag.
[in] | iin | file unit number |
[in] | iout | output listing file unit number |
[in] | key | keyword in block |
[in] | ctag | block name |
[in,out] | lloc | position in line |
[in,out] | ierr | error |
[in,out] | iuext | external file unit number |
Definition at line 741 of file BlockParser.f90.