MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
Collaboration diagram for blockparsermodule::blockparsertype:
Collaboration graph

Public Member Functions

procedure, public initialize (this, inunit, iout)
 Initialize the block parser.
procedure, public clear (this)
 Close the block parser.
procedure, public getblock (this, blockname, isfound, ierr, supportopenclose, blockrequired, blocknamefound)
 Get block.
procedure, public getcellid (this, ndim, cellid, flag_string)
 Get a cellid.
procedure, public getcurrentline (this, line)
 Get the current line.
procedure, public getdouble (this)
 Get a double precision real.
procedure, public trygetdouble (this, r, success)
procedure, public getinteger (this)
 Get a integer.
procedure, public trygetinteger (this, i, success)
procedure, public getlinesread (this)
 Get the number of lines read.
procedure, public getnextline (this, endofblock)
 Get the next line.
procedure, public getremainingline (this, line)
 Get the rest of a line.
procedure, public terminateblock (this)
 Ensure that the block is closed.
procedure, public getstring (this, string, converttoupper)
 Get a string.
procedure, public getstringcaps (this, string)
 Get an upper case string.
procedure, public storeerrorunit (this, terminate)
 Store the unit number.
procedure, public getunit (this)
 Get the unit number.
procedure, public devopt (this)
 Disable development option in release mode.

Public Attributes

integer(i4b), public iuactive
 flag indicating if a file unit is active, variable is not used internally
type(longlinereadertype) line_reader

Private Member Functions

procedure, private readscalarerror (this, vartype)
 Issue a read error.

Private Attributes

integer(i4b), private inunit
 file unit number
integer(i4b), private iuext
 external file unit number
integer(i4b), private iout
 listing file unit number
integer(i4b), private linesread
 number of lines read
integer(i4b), private lloc
 line location counter
character(len=linelength), private blockname
 block name
character(len=linelength), private blocknamefound
 block name found
character(len=lenhugeline), private laststring
 last string read
character(len=:), allocatable, private line
 current line

Detailed Description

Definition at line 23 of file BlockParser.f90.

Member Function/Subroutine Documentation

◆ clear()

procedure, public blockparsermodule::blockparsertype::clear ( class(blockparsertype), intent(inout) this)

Method to clear the block parser, which closes file(s) and clears member variables.

Parameters
[in,out]thisBlockParserType object

Definition at line 37 of file BlockParser.f90.

◆ devopt()

procedure, public blockparsermodule::blockparsertype::devopt ( class(blockparsertype), intent(inout) this)

Terminate with an error if in release mode (IDEVELOPMODE = 0). Enables options for development and testing while disabling for public release.

Definition at line 53 of file BlockParser.f90.

◆ getblock()

procedure, public blockparsermodule::blockparsertype::getblock ( class(blockparsertype), intent(inout) this,
character(len=*), intent(in) blockname,
logical, intent(out) isfound,
integer(i4b), intent(out) ierr,
logical, intent(in), optional supportopenclose,
logical, intent(in), optional blockrequired,
character(len=*), intent(inout), optional blocknamefound )

Method to get the block from a file. The file is read until the blockname is found.

Parameters
[in,out]thisBlockParserType object
[in]blocknameblock name to search for
[out]isfoundboolean indicating if the block name was found
[out]ierrreturn error code, 0 indicates block was found
[in]supportopencloseboolean indicating if the block supports open/close, default false
[in]blockrequiredboolean indicating if the block is required, default true
[in,out]blocknamefoundoptional return value of block name found

Definition at line 38 of file BlockParser.f90.

◆ getcellid()

procedure, public blockparsermodule::blockparsertype::getcellid ( class(blockparsertype), intent(inout) this,
integer(i4b), intent(in) ndim,
character(len=*), intent(out) cellid,
logical, intent(in), optional flag_string )

Method to get a cellid from a line.

Parameters
[in,out]thisBlockParserType object
[in]ndimnumber of dimensions (1, 2, or 3)
[out]cellidcell =id
[in]flag_stringboolean indicating id cellid is a string

Definition at line 39 of file BlockParser.f90.

◆ getcurrentline()

procedure, public blockparsermodule::blockparsertype::getcurrentline ( class(blockparsertype), intent(inout) this,
character(len=*), intent(out) line )

Method to get the current line.

Parameters
[in,out]thisBlockParserType object
[out]linecurrent line

Definition at line 40 of file BlockParser.f90.

◆ getdouble()

procedure, public blockparsermodule::blockparsertype::getdouble ( class(blockparsertype), intent(inout) this)

Function to get adouble precision floating point number from the current line.

Returns
double precision real variable
Parameters
[in,out]thisBlockParserType object

Definition at line 41 of file BlockParser.f90.

◆ getinteger()

procedure, public blockparsermodule::blockparsertype::getinteger ( class(blockparsertype), intent(inout) this)

Function to get a integer from the current line.

Returns
integer variable
Parameters
[in,out]thisBlockParserType object

Definition at line 43 of file BlockParser.f90.

◆ getlinesread()

procedure, public blockparsermodule::blockparsertype::getlinesread ( class(blockparsertype), intent(inout) this)

Function to get the number of lines read from the current block.

Returns
number of lines read
Parameters
[in,out]thisBlockParserType object

Definition at line 45 of file BlockParser.f90.

◆ getnextline()

procedure, public blockparsermodule::blockparsertype::getnextline ( class(blockparsertype), intent(inout) this,
logical, intent(out) endofblock )

Method to get the next line from a file.

Parameters
[in,out]thisBlockParserType object
[out]endofblockboolean indicating if the end of the block was read

Definition at line 46 of file BlockParser.f90.

◆ getremainingline()

procedure, public blockparsermodule::blockparsertype::getremainingline ( class(blockparsertype), intent(inout) this,
character(len=:), intent(out), allocatable line )

Method to get the rest of the line from the current line.

Parameters
[in,out]thisBlockParserType object
[out]lineremainder of the line

Definition at line 47 of file BlockParser.f90.

◆ getstring()

procedure, public blockparsermodule::blockparsertype::getstring ( class(blockparsertype), intent(inout) this,
character(len=*), intent(out) string,
logical, intent(in), optional converttoupper )

Method to get a string from the current line and optionally convert it to upper case.

Parameters
[in,out]thisBlockParserType object
[in]converttoupperboolean indicating if the string should be converted to upper case, default false

Definition at line 49 of file BlockParser.f90.

◆ getstringcaps()

procedure, public blockparsermodule::blockparsertype::getstringcaps ( class(blockparsertype), intent(inout) this,
character(len=*), intent(out) string )

Method to get a string from the current line and convert it to upper case.

Parameters
[in,out]thisBlockParserType object
[out]stringupper case string

Definition at line 50 of file BlockParser.f90.

◆ getunit()

procedure, public blockparsermodule::blockparsertype::getunit ( class(blockparsertype), intent(inout) this)

Function to get the unit number for the block parser.

Returns
unit number for the block parser
Parameters
[in,out]thisBlockParserType object

Definition at line 52 of file BlockParser.f90.

◆ initialize()

procedure, public blockparsermodule::blockparsertype::initialize ( class(blockparsertype), intent(inout) this,
integer(i4b), intent(in) inunit,
integer(i4b), intent(in) iout )

Method to initialize the block parser.

Parameters
[in,out]thisBlockParserType object
[in]inunitinput file unit number
[in]ioutlisting file unit number

Definition at line 36 of file BlockParser.f90.

◆ readscalarerror()

procedure, private blockparsermodule::blockparsertype::readscalarerror ( class(blockparsertype), intent(inout) this,
character(len=*), intent(in) vartype )
private

Method to issue an unable to read error.

Parameters
[in,out]thisBlockParserType object
[in]vartypestring of variable type

Definition at line 54 of file BlockParser.f90.

◆ storeerrorunit()

procedure, public blockparsermodule::blockparsertype::storeerrorunit ( class(blockparsertype), intent(inout) this,
logical, intent(in), optional terminate )

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.

Parameters
[in,out]thisBlockParserType object
[in]terminateboolean indicating if the simulation should be terminated

Definition at line 51 of file BlockParser.f90.

◆ terminateblock()

procedure, public blockparsermodule::blockparsertype::terminateblock ( class(blockparsertype), intent(inout) this)

Method to ensure that the block is closed with an "end".

Parameters
[in,out]thisBlockParserType object

Definition at line 48 of file BlockParser.f90.

◆ trygetdouble()

procedure, public blockparsermodule::blockparsertype::trygetdouble ( class(blockparsertype), intent(inout) this,
real(dp), intent(inout) r,
logical(lgp), intent(inout) success )
Parameters
[in,out]thisBlockParserType object
[in,out]rdouble precision real variable
[in,out]successwhether parsing was successful

Definition at line 42 of file BlockParser.f90.

◆ trygetinteger()

procedure, public blockparsermodule::blockparsertype::trygetinteger ( class(blockparsertype), intent(inout) this,
integer(i4b), intent(inout) i,
logical(lgp), intent(inout) success )
Parameters
[in,out]thisBlockParserType object
[in,out]iinteger variable
[in,out]successwhether parsing was successful

Definition at line 44 of file BlockParser.f90.

Member Data Documentation

◆ blockname

character(len=linelength), private blockparsermodule::blockparsertype::blockname
private

Definition at line 30 of file BlockParser.f90.

30 character(len=LINELENGTH), private :: blockName !< block name

◆ blocknamefound

character(len=linelength), private blockparsermodule::blockparsertype::blocknamefound
private

Definition at line 31 of file BlockParser.f90.

31 character(len=LINELENGTH), private :: blockNameFound !< block name found

◆ inunit

integer(i4b), private blockparsermodule::blockparsertype::inunit
private

Definition at line 25 of file BlockParser.f90.

25 integer(I4B), private :: inunit !< file unit number

◆ iout

integer(i4b), private blockparsermodule::blockparsertype::iout
private

Definition at line 27 of file BlockParser.f90.

27 integer(I4B), private :: iout !< listing file unit number

◆ iuactive

integer(i4b), public blockparsermodule::blockparsertype::iuactive

Definition at line 24 of file BlockParser.f90.

24 integer(I4B), public :: iuactive !< flag indicating if a file unit is active, variable is not used internally

◆ iuext

integer(i4b), private blockparsermodule::blockparsertype::iuext
private

Definition at line 26 of file BlockParser.f90.

26 integer(I4B), private :: iuext !< external file unit number

◆ laststring

character(len=lenhugeline), private blockparsermodule::blockparsertype::laststring
private

Definition at line 32 of file BlockParser.f90.

32 character(len=LENHUGELINE), private :: laststring !< last string read

◆ line

character(len=:), allocatable, private blockparsermodule::blockparsertype::line
private

Definition at line 33 of file BlockParser.f90.

33 character(len=:), allocatable, private :: line !< current line

◆ line_reader

type(longlinereadertype) blockparsermodule::blockparsertype::line_reader

Definition at line 34 of file BlockParser.f90.

34 type(LongLineReaderType) :: line_reader

◆ linesread

integer(i4b), private blockparsermodule::blockparsertype::linesread
private

Definition at line 28 of file BlockParser.f90.

28 integer(I4B), private :: linesRead !< number of lines read

◆ lloc

integer(i4b), private blockparsermodule::blockparsertype::lloc
private

Definition at line 29 of file BlockParser.f90.

29 integer(I4B), private :: lloc !< line location counter

The documentation for this type was generated from the following file: