MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
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  {
  mtype_undef = 0 , mtype_int = 1 , mtype_dbl = 2 , mtype_str = 3 ,
  mtype_intvec = 4 , mtype_int2d = 5 , mtype_dbl2d = 6
}

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)

Detailed Description

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

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
mtype_undef 

undefined memtype

mtype_int 

int1d column

mtype_dbl 

dbl1d column

mtype_str 

charstr1d column

mtype_intvec 

intvector column

mtype_int2d 

int2d (NCELLDIM) column

mtype_dbl2d 

dbl2d (NAUX/NSEG) column

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 )

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