MODFLOW 6  version 6.9.0.dev0
USGS Modular Hydrologic Model
structvectormodule Module Reference

This module contains the StructVectorModule. More...

Data Types

type  tsstringloctype
 derived type which describes time series string field More...
 
type  structvectortype
 derived type for generic vector More...
 

Enumerations

enum  
 

Functions/Subroutines

real(dp) function sv_read_token (this, token, structarray_col, col, row)
 
subroutine sv_add_ts_strloc (this, token, structarray_col, col, row)
 
class(tsstringloctype) function, pointer sv_get_ts_strloc (this, idx)
 
subroutine sv_clear (this)
 

Variables

@, public mtype_undef = 0
 undefined memtype More...
 
@, public mtype_int = 1
 int1d column More...
 
@, public mtype_dbl = 2
 dbl1d column More...
 
@, public mtype_str = 3
 charstr1d column More...
 
@, public mtype_intvec = 4
 intvector column More...
 
@, public mtype_int2d = 5
 int2d (NCELLDIM) column More...
 
@, public mtype_dbl2d = 6
 dbl2d (NAUX/NSEG) column More...
 

Detailed Description

This module contains a generic type for storing different types of vectors.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
private

Definition at line 23 of file StructVector.f90.

Function/Subroutine Documentation

◆ sv_add_ts_strloc()

subroutine structvectormodule::sv_add_ts_strloc ( class(structvectortype)  this,
character(len=*), intent(in)  token,
integer(i4b), intent(in)  structarray_col,
integer(i4b), intent(in)  col,
integer(i4b), intent(in)  row 
)
private

Definition at line 102 of file StructVector.f90.

103  class(StructVectorType) :: this
104  character(len=*), intent(in) :: token
105  integer(I4B), intent(in) :: structarray_col
106  integer(I4B), intent(in) :: col
107  integer(I4B), intent(in) :: row
108  class(TSStringLocType), pointer :: str_field
109  class(*), pointer :: obj
110  allocate (str_field)
111  str_field%structarray_col = structarray_col
112  str_field%col = col
113  str_field%row = row
114  str_field%token = token
115  obj => str_field
116  call this%ts_strlocs%Add(obj)

◆ sv_clear()

subroutine structvectormodule::sv_clear ( class(structvectortype)  this)
private

Definition at line 138 of file StructVector.f90.

139  class(StructVectorType) :: this
140  class(TSStringLocType), pointer :: ts_strloc
141  integer(I4B) :: n
142  do n = 1, this%ts_strlocs%Count()
143  ts_strloc => this%get_ts_strloc(n)
144  deallocate (ts_strloc)
145  nullify (ts_strloc)
146  end do
147  call this%ts_strlocs%Clear()

◆ sv_get_ts_strloc()

class(tsstringloctype) function, pointer structvectormodule::sv_get_ts_strloc ( class(structvectortype)  this,
integer(i4b), intent(in)  idx 
)
private
Parameters
[in]idxpackage number

Definition at line 119 of file StructVector.f90.

120  class(StructVectorType) :: this
121  integer(I4B), intent(in) :: idx !< package number
122  class(TSStringLocType), pointer :: res
123  class(*), pointer :: obj
124  ! initialize res
125  res => null()
126  ! get the package from the list
127  obj => this%ts_strlocs%GetItem(idx)
128  if (associated(obj)) then
129  select type (obj)
130  class is (tsstringloctype)
131  res => obj
132  end select
133  end if

◆ sv_read_token()

real(dp) function structvectormodule::sv_read_token ( class(structvectortype)  this,
character(len=*), intent(in)  token,
integer(i4b), intent(in)  structarray_col,
integer(i4b), intent(in)  col,
integer(i4b), intent(in)  row 
)
private

Definition at line 83 of file StructVector.f90.

84  class(StructVectorType) :: this
85  character(len=*), intent(in) :: token
86  integer(I4B), intent(in) :: structarray_col
87  integer(I4B), intent(in) :: col
88  integer(I4B), intent(in) :: row
89  real(DP) :: val
90  integer(I4B) :: istat
91  real(DP) :: r
92  ! initialize
93  val = dnodata
94  read (token, *, iostat=istat) r
95  if (istat == 0) then
96  val = r
97  else
98  call this%add_ts_strloc(token, structarray_col, col, row)
99  end if

Variable Documentation

◆ mtype_dbl

@, public structvectormodule::mtype_dbl = 2

Definition at line 26 of file StructVector.f90.

26  enumerator :: MTYPE_DBL = 2 !< dbl1d column

◆ mtype_dbl2d

@, public structvectormodule::mtype_dbl2d = 6

Definition at line 30 of file StructVector.f90.

30  enumerator :: MTYPE_DBL2D = 6 !< dbl2d (NAUX/NSEG) column

◆ mtype_int

@, public structvectormodule::mtype_int = 1

Definition at line 25 of file StructVector.f90.

25  enumerator :: MTYPE_INT = 1 !< int1d column

◆ mtype_int2d

@, public structvectormodule::mtype_int2d = 5

Definition at line 29 of file StructVector.f90.

29  enumerator :: MTYPE_INT2D = 5 !< int2d (NCELLDIM) column

◆ mtype_intvec

@, public structvectormodule::mtype_intvec = 4

Definition at line 28 of file StructVector.f90.

28  enumerator :: MTYPE_INTVEC = 4 !< intvector column

◆ mtype_str

@, public structvectormodule::mtype_str = 3

Definition at line 27 of file StructVector.f90.

27  enumerator :: MTYPE_STR = 3 !< charstr1d column

◆ mtype_undef

@, public structvectormodule::mtype_undef = 0

Definition at line 24 of file StructVector.f90.

24  enumerator :: MTYPE_UNDEF = 0 !< undefined memtype