MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
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...
 

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.

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 93 of file StructVector.f90.

94  ! -- dummy variables
95  class(StructVectorType) :: this
96  character(len=*), intent(in) :: token
97  integer(I4B), intent(in) :: structarray_col
98  integer(I4B), intent(in) :: col
99  integer(I4B), intent(in) :: row
100  class(TSStringLocType), pointer :: str_field
101  ! -- local variables
102  class(*), pointer :: obj
103  !
104  ! --
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  !
111  obj => str_field
112  call this%ts_strlocs%Add(obj)
113  !
114  ! -- return
115  return

◆ sv_clear()

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

Definition at line 144 of file StructVector.f90.

145  ! -- modules
146  ! -- dummy
147  class(StructVectorType) :: this
148  class(TSStringLocType), pointer :: ts_strloc
149  integer(I4B) :: n
150  !
151  do n = 1, this%ts_strlocs%Count()
152  ts_strloc => this%get_ts_strloc(n)
153  deallocate (ts_strloc)
154  nullify (ts_strloc)
155  end do
156  !
157  call this%ts_strlocs%Clear()
158  !
159  return

◆ 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 118 of file StructVector.f90.

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

◆ 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 66 of file StructVector.f90.

67  ! -- modules
68  ! -- dummy
69  class(StructVectorType) :: this
70  character(len=*), intent(in) :: token
71  integer(I4B), intent(in) :: structarray_col
72  integer(I4B), intent(in) :: col
73  integer(I4B), intent(in) :: row
74  real(DP) :: val
75  ! -- local
76  integer(I4B) :: istat
77  real(DP) :: r
78  !
79  ! -- initialize
80  val = dnodata
81  !
82  read (token, *, iostat=istat) r
83  if (istat == 0) then
84  val = r
85  else
86  call this%add_ts_strloc(token, structarray_col, col, row)
87  end if
88  !
89  ! -- return
90  return