MODFLOW 6  version 6.8.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 97 of file StructVector.f90.

98  class(StructVectorType) :: this
99  character(len=*), intent(in) :: token
100  integer(I4B), intent(in) :: structarray_col
101  integer(I4B), intent(in) :: col
102  integer(I4B), intent(in) :: row
103  class(TSStringLocType), pointer :: str_field
104  class(*), pointer :: obj
105  allocate (str_field)
106  str_field%structarray_col = structarray_col
107  str_field%col = col
108  str_field%row = row
109  str_field%token = token
110  obj => str_field
111  call this%ts_strlocs%Add(obj)

◆ sv_clear()

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

Definition at line 133 of file StructVector.f90.

134  class(StructVectorType) :: this
135  class(TSStringLocType), pointer :: ts_strloc
136  integer(I4B) :: n
137  do n = 1, this%ts_strlocs%Count()
138  ts_strloc => this%get_ts_strloc(n)
139  deallocate (ts_strloc)
140  nullify (ts_strloc)
141  end do
142  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 114 of file StructVector.f90.

115  class(StructVectorType) :: this
116  integer(I4B), intent(in) :: idx !< package number
117  class(TSStringLocType), pointer :: res
118  class(*), pointer :: obj
119  ! initialize res
120  res => null()
121  ! get the package from the list
122  obj => this%ts_strlocs%GetItem(idx)
123  if (associated(obj)) then
124  select type (obj)
125  class is (tsstringloctype)
126  res => obj
127  end select
128  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 78 of file StructVector.f90.

79  class(StructVectorType) :: this
80  character(len=*), intent(in) :: token
81  integer(I4B), intent(in) :: structarray_col
82  integer(I4B), intent(in) :: col
83  integer(I4B), intent(in) :: row
84  real(DP) :: val
85  integer(I4B) :: istat
86  real(DP) :: r
87  ! initialize
88  val = dnodata
89  read (token, *, iostat=istat) r
90  if (istat == 0) then
91  val = r
92  else
93  call this%add_ts_strloc(token, structarray_col, col, row)
94  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