MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
gwfmvrperioddatamodule Module Reference

This module contains the GwfMvrPeriodDataModule Module. More...

Data Types

type  gwfmvrperioddatatype
 Derived type for GwfMvrPeriodDataType. More...
 

Functions/Subroutines

subroutine construct (this, maxsize, memoryPath)
 @ brief Construct arrays More...
 
subroutine read_from_parser (this, parser, nmvr, modelname)
 @ brief Fill the arrays from parser More...
 
subroutine destroy (this)
 @ brief Destroy memory More...
 

Detailed Description

This module contains the code for storing and reading stress period data for the GwfMvr Package.

Function/Subroutine Documentation

◆ construct()

subroutine gwfmvrperioddatamodule::construct ( class(gwfmvrperioddatatype this,
integer(i4b), intent(in)  maxsize,
character(len=lenmempath), intent(in)  memoryPath 
)
private

Allocate maximum space for mover input.

Parameters
thisGwfMvrPeriodDataType
[in]maxsizesize of arrays
[in]memorypathmemory manager path

Definition at line 51 of file GwfMvrPeriodData.f90.

52  ! -- modules
54  ! -- dummy
55  class(GwfMvrPeriodDataType) :: this !< GwfMvrPeriodDataType
56  integer(I4B), intent(in) :: maxsize !< size of arrays
57  character(len=LENMEMPATH), intent(in) :: memoryPath !< memory manager path
58 
59  ! -- character arrays
60  allocate (this%mname1(maxsize))
61  allocate (this%pname1(maxsize))
62  allocate (this%mname2(maxsize))
63  allocate (this%pname2(maxsize))
64 
65  ! -- integer and real
66  call mem_allocate(this%id1, maxsize, 'ID1', memorypath)
67  call mem_allocate(this%id2, maxsize, 'ID2', memorypath)
68  call mem_allocate(this%imvrtype, maxsize, 'IMVRTYPE', memorypath)
69  call mem_allocate(this%value, maxsize, 'VALUE', memorypath)
70 
71  return

◆ destroy()

subroutine gwfmvrperioddatamodule::destroy ( class(gwfmvrperioddatatype this)
private

Deallocate memory from the memory manager.

Parameters
thisGwfMvrPeriodDataType

Definition at line 155 of file GwfMvrPeriodData.f90.

156  ! -- modules
158  ! -- dummy
159  class(GwfMvrPeriodDataType) :: this !< GwfMvrPeriodDataType
160 
161  ! -- character arrays
162  deallocate (this%mname1)
163  deallocate (this%pname1)
164  deallocate (this%mname2)
165  deallocate (this%pname2)
166 
167  ! -- integer and real
168  call mem_deallocate(this%id1)
169  call mem_deallocate(this%id2)
170  call mem_deallocate(this%imvrtype)
171  call mem_deallocate(this%value)
172 
173  return

◆ read_from_parser()

subroutine gwfmvrperioddatamodule::read_from_parser ( class(gwfmvrperioddatatype this,
type(blockparsertype), intent(inout)  parser,
integer(i4b), intent(out)  nmvr,
character(len=lenmodelname), intent(in)  modelname 
)

Use the provided block parser to fill the input arrays.

Parameters
thisGwfMvrPeriodDataType
[in,out]parserblock parser
[out]nmvrnumber of mover entries read
[in]modelnamename of model or empty string

Definition at line 79 of file GwfMvrPeriodData.f90.

80  ! -- dummy
81  class(GwfMvrPeriodDataType) :: this !< GwfMvrPeriodDataType
82  type(BlockParserType), intent(inout) :: parser !< block parser
83  integer(I4B), intent(out) :: nmvr !< number of mover entries read
84  character(len=LENMODELNAME), intent(in) :: modelname !< name of model or empty string
85  ! -- local
86  integer(I4B) :: i
87  integer(I4B) :: maxmvr
88  logical :: endOfBlock
89  character(len=LINELENGTH) :: line
90  character(len=12) :: mvrtype_char
91  !
92  ! -- Initialize
93  i = 1
94  maxmvr = size(this%id1)
95  !
96  ! -- Read each mover entry
97  do
98  call parser%GetNextLine(endofblock)
99  if (endofblock) exit
100  !
101  ! -- Raise error if movers exceeds maxmvr
102  if (i > maxmvr) then
103  call parser%GetCurrentLine(line)
104  write (errmsg, '(a,a)') 'Movers exceed MAXMVR on line: ', &
105  trim(adjustl(line))
106  call store_error(errmsg)
107  call parser%StoreErrorUnit()
108  end if
109  !
110  ! -- modelname, package name, id for provider
111  if (modelname == '') then
112  call parser%GetStringCaps(this%mname1(i))
113  else
114  this%mname1(i) = modelname
115  end if
116  call parser%GetStringCaps(this%pname1(i))
117  this%id1(i) = parser%GetInteger()
118  !
119  ! -- modelname, package name, id for receiver
120  if (modelname == '') then
121  call parser%GetStringCaps(this%mname2(i))
122  else
123  this%mname2(i) = modelname
124  end if
125  call parser%GetStringCaps(this%pname2(i))
126  this%id2(i) = parser%GetInteger()
127  !
128  ! -- Mover type and value
129  call parser%GetStringCaps(mvrtype_char)
130  select case (mvrtype_char)
131  case ('FACTOR')
132  this%imvrtype(i) = 1
133  case ('EXCESS')
134  this%imvrtype(i) = 2
135  case ('THRESHOLD')
136  this%imvrtype(i) = 3
137  case ('UPTO')
138  this%imvrtype(i) = 4
139  case default
140  call store_error('Invalid mover type: '//trim(mvrtype_char))
141  call parser%StoreErrorUnit()
142  end select
143  this%value(i) = parser%GetDouble()
144  i = i + 1
145  end do
146  nmvr = i - 1
147  return
Here is the call graph for this function: