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

Data Types

type  prtfmitype
 

Functions/Subroutines

subroutine, public fmi_cr (fmiobj, name_model, inunit, iout)
 Create a new PrtFmi object. More...
 
subroutine fmi_ad (this)
 Time step advance. More...
 
subroutine prtfmi_df (this, dis, idryinactive)
 Define the flow model interface. More...
 
subroutine accumulate_flows (this)
 Accumulate flows. More...
 

Variables

character(len=lenpackagename) text = ' PRTFMI'
 

Function/Subroutine Documentation

◆ accumulate_flows()

subroutine prtfmimodule::accumulate_flows ( class(prtfmitype this)

Definition at line 157 of file prt-fmi.f90.

158  implicit none
159  ! -- dummy
160  class(PrtFmiType) :: this
161  ! -- local
162  integer :: j, i, ip, ib
163  integer :: ioffset, iflowface, iauxiflowface !, iface
164  double precision :: qbnd
165  character(len=LENAUXNAME) :: auxname
166  integer(I4B) :: naux
167  !
168  this%StorageFlows = 0d0
169  if (this%igwfstrgss /= 0) &
170  this%StorageFlows = this%StorageFlows + &
171  this%gwfstrgss
172  if (this%igwfstrgsy /= 0) &
173  this%StorageFlows = this%StorageFlows + &
174  this%gwfstrgsy
175  ! kluge note: need separate SourceFlows and SinkFlows? just for budget-reporting?
176  ! kluge note: SinkFlows used to identify weak sinks
177  this%SourceFlows = 0d0
178  this%SinkFlows = 0d0
179  this%BoundaryFlows = 0d0
180  do ip = 1, this%nflowpack
181  iauxiflowface = 0
182  naux = this%gwfpackages(ip)%naux
183  if (naux > 0) then
184  do j = 1, naux
185  auxname = this%gwfpackages(ip)%auxname(j)
186  if (trim(adjustl(auxname)) == "IFLOWFACE") then
187  iauxiflowface = j
188  exit
189  ! else if (trim(adjustl(auxname)) == "IFACE") then ! kluge note: allow IFACE and do conversion???
190  ! iauxiflowface = -j
191  ! exit
192  end if
193  end do
194  end if
195  do ib = 1, this%gwfpackages(ip)%nbound
196  i = this%gwfpackages(ip)%nodelist(ib)
197  ! if (this%gwfibound(i) <= 0) cycle
198  if (this%ibound(i) <= 0) cycle
199  qbnd = this%gwfpackages(ip)%get_flow(ib)
200  iflowface = 0 ! kluge note: eventually have default iflowface values for different packages
201  if (iauxiflowface > 0) then
202  ! expected int here... ok to round??
203  iflowface = nint(this%gwfpackages(ip)%auxvar(iauxiflowface, ib))
204  if (iflowface < 0) iflowface = iflowface + 11 ! bot -> 9, top -> 10; see note re: max faces below
205  ! else if (iauxiflowface < 0) then ! kluge note: allow IFACE and do conversion???
206  ! ! kluge note: is it possible to check for a rectangular-celled grid here???
207  ! iface = this%gwfpackages(ip)%auxvar(-iauxiflowface, ib)
208  ! iflowface = iface ! kluge note: will need to convert
209  end if
210  if (iflowface .gt. 0) then
211  ioffset = (i - 1) * 10 ! kluge note: hardwired for max 8 polygon faces plus top and bottom for now
212  this%BoundaryFlows(ioffset + iflowface) = &
213  this%BoundaryFlows(ioffset + iflowface) + qbnd
214  else if (qbnd .gt. 0d0) then
215  this%SourceFlows(i) = this%SourceFlows(i) + qbnd
216  else if (qbnd .lt. 0d0) then
217  this%SinkFlows(i) = this%SinkFlows(i) + qbnd
218  end if
219  end do
220  end do
221 

◆ fmi_ad()

subroutine prtfmimodule::fmi_ad ( class(prtfmitype this)
private

Definition at line 66 of file prt-fmi.f90.

67  ! -- modules
68  use constantsmodule, only: dhdry
69  ! -- dummy
70  class(PrtFmiType) :: this
71  ! -- local
72  integer(I4B) :: n
73  character(len=15) :: nodestr
74  character(len=*), parameter :: fmtdry = &
75  &"(/1X,'WARNING: DRY CELL ENCOUNTERED AT ',a,'; RESET AS INACTIVE')"
76  character(len=*), parameter :: fmtrewet = &
77  &"(/1X,'DRY CELL REACTIVATED AT ', a)"
78  !
79  ! -- Set flag to indicated that flows are being updated. For the case where
80  ! flows may be reused (only when flows are read from a file) then set
81  ! the flag to zero to indicated that flows were not updated
82  this%iflowsupdated = 1
83  !
84  ! -- If reading flows from a budget file, read the next set of records
85  if (this%iubud /= 0) then
86  call this%advance_bfr()
87  end if
88  !
89  ! -- If reading heads from a head file, read the next set of records
90  if (this%iuhds /= 0) then
91  call this%advance_hfr()
92  end if
93  !
94  ! -- If mover flows are being read from file, read the next set of records
95  if (this%iumvr /= 0) then
96  call this%mvrbudobj%bfr_advance(this%dis, this%iout)
97  end if
98  !
99  ! -- Accumulate flows
100  call this%accumulate_flows()
101  !
102  ! -- if flow cell is dry, then set this%ibound = 0
103  do n = 1, this%dis%nodes
104  !
105  ! -- Calculate the ibound-like array that has 0 if saturation
106  ! is zero and 1 otherwise
107  if (this%gwfsat(n) > dzero) then
108  this%ibdgwfsat0(n) = 1
109  else
110  this%ibdgwfsat0(n) = 0
111  end if
112  !
113  ! -- Check if active model cell is inactive for flow
114  if (this%ibound(n) > 0) then
115  if (this%gwfhead(n) == dhdry) then
116  ! -- cell should be made inactive
117  this%ibound(n) = 0
118  call this%dis%noder_to_string(n, nodestr)
119  write (this%iout, fmtdry) trim(nodestr)
120  end if
121  end if
122  !
123  ! -- Convert dry model cell to active if flow has rewet
124  if (this%ibound(n) == 0) then
125  if (this%gwfhead(n) /= dhdry) then
126  ! -- cell is now wet
127  this%ibound(n) = 1
128  call this%dis%noder_to_string(n, nodestr)
129  write (this%iout, fmtrewet) trim(nodestr)
130  end if
131  end if
132  end do
133 
This module contains simulation constants.
Definition: Constants.f90:9
real(dp), parameter dhdry
real dry cell constant
Definition: Constants.f90:93

◆ fmi_cr()

subroutine, public prtfmimodule::fmi_cr ( type(prtfmitype), pointer  fmiobj,
character(len=*), intent(in)  name_model,
integer(i4b), intent(inout)  inunit,
integer(i4b), intent(in)  iout 
)

Definition at line 36 of file prt-fmi.f90.

37  ! -- dummy
38  type(PrtFmiType), pointer :: fmiobj
39  character(len=*), intent(in) :: name_model
40  integer(I4B), intent(inout) :: inunit
41  integer(I4B), intent(in) :: iout
42  !
43  ! -- Create the object
44  allocate (fmiobj)
45  !
46  ! -- create name and memory path
47  call fmiobj%set_names(1, name_model, 'FMI', 'FMI')
48  fmiobj%text = text
49  !
50  ! -- Allocate scalars
51  call fmiobj%allocate_scalars()
52  !
53  ! -- Set variables
54  fmiobj%inunit = inunit
55  fmiobj%iout = iout
56  !
57  ! -- Initialize block parser
58  call fmiobj%parser%Initialize(fmiobj%inunit, fmiobj%iout)
59  !
60  ! -- Assign dependent variable label
61  fmiobj%depvartype = 'TRACKS '
62 
Here is the caller graph for this function:

◆ prtfmi_df()

subroutine prtfmimodule::prtfmi_df ( class(prtfmitype this,
class(disbasetype), intent(in), pointer  dis,
integer(i4b), intent(in)  idryinactive 
)

Definition at line 137 of file prt-fmi.f90.

138  ! -- modules
139  use simmodule, only: store_error
140  ! -- dummy
141  class(PrtFmiType) :: this
142  class(DisBaseType), pointer, intent(in) :: dis
143  integer(I4B), intent(in) :: idryinactive
144  !
145  ! -- Call parent class define
146  call this%FlowModelInterfaceType%fmi_df(dis, idryinactive)
147  !
148  ! -- Allocate arrays
149  allocate (this%StorageFlows(this%dis%nodes)) ! kluge note: need allocate_arrays subroutine
150  allocate (this%SourceFlows(this%dis%nodes))
151  allocate (this%SinkFlows(this%dis%nodes))
152  allocate (this%BoundaryFlows(this%dis%nodes * 10)) ! kluge note: hardwired to max 8 polygon faces plus top and bottom for now
153 
This module contains simulation methods.
Definition: Sim.f90:10
subroutine, public store_error(msg, terminate)
Store an error message.
Definition: Sim.f90:92
Here is the call graph for this function:

Variable Documentation

◆ text

character(len=lenpackagename) prtfmimodule::text = ' PRTFMI'
private

Definition at line 16 of file prt-fmi.f90.

16  character(len=LENPACKAGENAME) :: text = ' PRTFMI'