MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
gridfilereadermodule::gridfilereadertype Type Reference
Collaboration diagram for gridfilereadermodule::gridfilereadertype:
Collaboration graph

Public Member Functions

procedure, public initialize (this, iu)
 Initialize the grid file reader.
procedure, public finalize (this)
 Finalize the grid file reader.
procedure, public has_variable (this, name)
 Check whether the grid file contains a variable.
procedure, public read_int (this, name)
 Read an integer scalar from a grid file.
procedure, public read_dbl (this, name)
 Read a double precision scalar from a grid file.
procedure, public read_grid_shape (this)
 Read the grid shape from a grid file.
procedure, public read_int_1d (this, name)
 Read a 1D integer array from a grid file.
procedure, public read_dbl_1d (this, name)
 Read a 1D double array from a grid file.
procedure, public read_charstr (this, name)
 Read a character string from a grid file.
procedure, public read_int_1d_into (this, name, v)
 Read a 1D integer array into a preallocated array.
procedure, public read_dbl_1d_into (this, name, v)
 Read a 1D double array into a preallocated array.
procedure, public read_charstr_into (this, name, charstr)
 Read a character string into a preallocated string.

Public Attributes

integer(i4b), public inunit
 file unit
character(len=10), public grid_type
 DIS, DISV, DISU, etc.
integer(i4b), public version
 binary grid file format version
integer(i4b) ntxt
 number of variables
integer(i4b) lentxt
 header line length per variable
type(hashtabletype), pointer idx
 map variable name to variable index
character(len=10), dimension(:), allocatable, public names
 variable names
integer(i4b), dimension(:), allocatable ndims
 variable number of dims
integer(i4b), dimension(:), allocatable typs
 variable type (TYP_INT, TYP_DBL, TYP_CHR)
integer(i4b), dimension(:), allocatable shp_start
 variable shape start in shp
integer(i8b), dimension(:), allocatable pos
 variable position in file
integer(i4b), dimension(:), allocatable shp
 flat array of variable shapes

Private Member Functions

procedure, private read_header (this)
 Read the file's self-describing header. Internal use only.
procedure, private read_header_meta (this)
 Read self-describing metadata (first four lines). Internal use only.
procedure, private read_header_body (this)
 Read the header body section (text following first.
procedure, private lookup (this, name, ndim, typ, desc)
 Look up a variable and check its rank and type.

Detailed Description

Definition at line 19 of file GridFileReader.f90.

Member Function/Subroutine Documentation

◆ finalize()

procedure, public gridfilereadermodule::gridfilereadertype::finalize ( class(gridfilereadertype) this)

Definition at line 37 of file GridFileReader.f90.

◆ has_variable()

procedure, public gridfilereadermodule::gridfilereadertype::has_variable ( class(gridfilereadertype) this,
character(len=*), intent(in) name )

Definition at line 38 of file GridFileReader.f90.

◆ initialize()

procedure, public gridfilereadermodule::gridfilereadertype::initialize ( class(gridfilereadertype) this,
integer(i4b), intent(in) iu )

Definition at line 36 of file GridFileReader.f90.

◆ lookup()

procedure, private gridfilereadermodule::gridfilereadertype::lookup ( class(gridfilereadertype), intent(inout) this,
character(len=*), intent(in) name,
integer(i4b), intent(in) ndim,
integer(i4b), intent(in) typ,
character(len=*), intent(in) desc )
private

Returns the variable's index. Terminates with an error if the variable does not exist or does not have the expected rank and type. Internal use only.

Parameters
[in]ndimexpected number of dims
[in]typexpected type
[in]descexpected kind, for error messages

Definition at line 43 of file GridFileReader.f90.

◆ read_charstr()

procedure, public gridfilereadermodule::gridfilereadertype::read_charstr ( class(gridfilereadertype), intent(inout) this,
character(len=*), intent(in) name )

Allocates and returns a new character string containing the data.

Definition at line 51 of file GridFileReader.f90.

◆ read_charstr_into()

procedure, public gridfilereadermodule::gridfilereadertype::read_charstr_into ( class(gridfilereadertype), intent(inout) this,
character(len=*), intent(in) name,
character(len=:), intent(inout), allocatable charstr )

Populates a preallocated character string. If the string is not allocated or is the wrong length, it will be (re)allocated to the correct length.

Definition at line 55 of file GridFileReader.f90.

◆ read_dbl()

procedure, public gridfilereadermodule::gridfilereadertype::read_dbl ( class(gridfilereadertype), intent(inout) this,
character(len=*), intent(in) name )

Definition at line 46 of file GridFileReader.f90.

◆ read_dbl_1d()

procedure, public gridfilereadermodule::gridfilereadertype::read_dbl_1d ( class(gridfilereadertype), intent(inout) this,
character(len=*), intent(in) name )

Allocates and returns a new array containing the data.

Definition at line 50 of file GridFileReader.f90.

◆ read_dbl_1d_into()

procedure, public gridfilereadermodule::gridfilereadertype::read_dbl_1d_into ( class(gridfilereadertype), intent(inout) this,
character(len=*), intent(in) name,
real(dp), dimension(:), intent(inout) v )

Populates a preallocated array. Array must already be allocated to the correct size. This version is compatible with both allocatable arrays and memory-manager-allocated pointer targets.

Definition at line 54 of file GridFileReader.f90.

◆ read_grid_shape()

procedure, public gridfilereadermodule::gridfilereadertype::read_grid_shape ( class(gridfilereadertype) this)

Definition at line 47 of file GridFileReader.f90.

◆ read_header()

procedure, private gridfilereadermodule::gridfilereadertype::read_header ( class(gridfilereadertype) this)
private

Definition at line 40 of file GridFileReader.f90.

◆ read_header_body()

procedure, private gridfilereadermodule::gridfilereadertype::read_header_body ( class(gridfilereadertype) this)
private

Definition at line 42 of file GridFileReader.f90.

◆ read_header_meta()

procedure, private gridfilereadermodule::gridfilereadertype::read_header_meta ( class(gridfilereadertype) this)
private

Definition at line 41 of file GridFileReader.f90.

◆ read_int()

procedure, public gridfilereadermodule::gridfilereadertype::read_int ( class(gridfilereadertype), intent(inout) this,
character(len=*), intent(in) name )

Definition at line 45 of file GridFileReader.f90.

◆ read_int_1d()

procedure, public gridfilereadermodule::gridfilereadertype::read_int_1d ( class(gridfilereadertype), intent(inout) this,
character(len=*), intent(in) name )

Allocates and returns a new array containing the data.

Definition at line 49 of file GridFileReader.f90.

◆ read_int_1d_into()

procedure, public gridfilereadermodule::gridfilereadertype::read_int_1d_into ( class(gridfilereadertype), intent(inout) this,
character(len=*), intent(in) name,
integer(i4b), dimension(:), intent(inout) v )

Populates a preallocated array. Array must already be allocated to the correct size. This version is compatible with both allocatable arrays and memory-manager-allocated pointer targets.

Definition at line 53 of file GridFileReader.f90.

Member Data Documentation

◆ grid_type

character(len=10), public gridfilereadermodule::gridfilereadertype::grid_type

Definition at line 23 of file GridFileReader.f90.

23 character(len=10), public :: grid_type !< DIS, DISV, DISU, etc

◆ idx

type(hashtabletype), pointer gridfilereadermodule::gridfilereadertype::idx

Definition at line 28 of file GridFileReader.f90.

28 type(HashTableType), pointer :: idx !< map variable name to variable index

◆ inunit

integer(i4b), public gridfilereadermodule::gridfilereadertype::inunit

Definition at line 21 of file GridFileReader.f90.

21 integer(I4B), public :: inunit !< file unit

◆ lentxt

integer(i4b) gridfilereadermodule::gridfilereadertype::lentxt

Definition at line 26 of file GridFileReader.f90.

26 integer(I4B) :: lentxt !< header line length per variable

◆ names

character(len=10), dimension(:), allocatable, public gridfilereadermodule::gridfilereadertype::names

Definition at line 29 of file GridFileReader.f90.

29 character(len=10), allocatable, public :: names(:) !< variable names

◆ ndims

integer(i4b), dimension(:), allocatable gridfilereadermodule::gridfilereadertype::ndims

Definition at line 30 of file GridFileReader.f90.

30 integer(I4B), allocatable :: ndims(:) !< variable number of dims

◆ ntxt

integer(i4b) gridfilereadermodule::gridfilereadertype::ntxt

Definition at line 25 of file GridFileReader.f90.

25 integer(I4B) :: ntxt !< number of variables

◆ pos

integer(i8b), dimension(:), allocatable gridfilereadermodule::gridfilereadertype::pos

Definition at line 33 of file GridFileReader.f90.

33 integer(I8B), allocatable :: pos(:) !< variable position in file

◆ shp

integer(i4b), dimension(:), allocatable gridfilereadermodule::gridfilereadertype::shp

Definition at line 34 of file GridFileReader.f90.

34 integer(I4B), allocatable :: shp(:) !< flat array of variable shapes

◆ shp_start

integer(i4b), dimension(:), allocatable gridfilereadermodule::gridfilereadertype::shp_start

Definition at line 32 of file GridFileReader.f90.

32 integer(I4B), allocatable :: shp_start(:) !< variable shape start in shp

◆ typs

integer(i4b), dimension(:), allocatable gridfilereadermodule::gridfilereadertype::typs

Definition at line 31 of file GridFileReader.f90.

31 integer(I4B), allocatable :: typs(:) !< variable type (TYP_INT, TYP_DBL, TYP_CHR)

◆ version

integer(i4b), public gridfilereadermodule::gridfilereadertype::version

Definition at line 24 of file GridFileReader.f90.

24 integer(I4B), public :: version !< binary grid file format version

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