17 character(len=LENPACKAGENAME) ::
text =
' PRTFMI'
21 double precision,
allocatable,
public :: sourceflows(:)
22 double precision,
allocatable,
public :: sinkflows(:)
23 double precision,
allocatable,
public :: storageflows(:)
24 double precision,
allocatable,
public :: boundaryflows(:)
37 subroutine fmi_cr(fmiobj, name_model, inunit, iout)
40 character(len=*),
intent(in) :: name_model
41 integer(I4B),
intent(inout) :: inunit
42 integer(I4B),
intent(in) :: iout
48 call fmiobj%set_names(1, name_model,
'FMI',
'FMI')
52 call fmiobj%allocate_scalars()
55 fmiobj%inunit = inunit
59 call fmiobj%parser%Initialize(fmiobj%inunit, fmiobj%iout)
62 fmiobj%depvartype =
'TRACKS '
74 character(len=15) :: nodestr
75 character(len=*),
parameter :: fmtdry = &
76 &
"(/1X,'WARNING: DRY CELL ENCOUNTERED AT ',a,'; RESET AS INACTIVE')"
77 character(len=*),
parameter :: fmtrewet = &
78 &
"(/1X,'DRY CELL REACTIVATED AT ', a)"
83 this%iflowsupdated = 1
86 if (this%iubud /= 0)
then
87 call this%advance_bfr()
91 if (this%iuhds /= 0)
then
92 call this%advance_hfr()
96 if (this%iumvr /= 0)
then
97 call this%mvrbudobj%bfr_advance(this%dis, this%iout)
101 call this%accumulate_flows()
104 do n = 1, this%dis%nodes
108 if (this%gwfsat(n) > dzero)
then
109 this%ibdgwfsat0(n) = 1
111 this%ibdgwfsat0(n) = 0
115 if (this%ibound(n) > 0)
then
116 if (this%gwfhead(n) ==
dhdry)
then
119 call this%dis%noder_to_string(n, nodestr)
120 write (this%iout, fmtdry) trim(nodestr)
125 if (this%ibound(n) == 0)
then
126 if (this%gwfhead(n) /=
dhdry)
then
129 call this%dis%noder_to_string(n, nodestr)
130 write (this%iout, fmtrewet) trim(nodestr)
144 integer(I4B),
intent(in) :: idryinactive
147 call this%FlowModelInterfaceType%fmi_df(dis, idryinactive)
150 allocate (this%StorageFlows(this%dis%nodes))
151 allocate (this%SourceFlows(this%dis%nodes))
152 allocate (this%SinkFlows(this%dis%nodes))
163 integer(I4B) :: j, i, ip, ib
164 integer(I4B) :: ioffset, iflowface, iauxiflowface
166 character(len=LENAUXNAME) :: auxname
169 this%StorageFlows =
dzero
170 if (this%igwfstrgss /= 0) &
171 this%StorageFlows = this%StorageFlows + &
173 if (this%igwfstrgsy /= 0) &
174 this%StorageFlows = this%StorageFlows + &
177 this%SourceFlows =
dzero
178 this%SinkFlows =
dzero
179 this%BoundaryFlows =
dzero
180 do ip = 1, this%nflowpack
182 naux = this%gwfpackages(ip)%naux
185 auxname = this%gwfpackages(ip)%auxname(j)
186 if (trim(adjustl(auxname)) ==
"IFLOWFACE")
then
192 do ib = 1, this%gwfpackages(ip)%nbound
193 i = this%gwfpackages(ip)%nodelist(ib)
195 if (this%ibound(i) <= 0) cycle
196 qbnd = this%gwfpackages(ip)%get_flow(ib)
199 if (iauxiflowface > 0)
then
200 iflowface = nint(this%gwfpackages(ip)%auxvar(iauxiflowface, ib))
204 if (iflowface .gt. 0)
then
206 this%BoundaryFlows(ioffset + iflowface) = &
207 this%BoundaryFlows(ioffset + iflowface) + qbnd
208 else if (qbnd .gt.
dzero)
then
209 this%SourceFlows(i) = this%SourceFlows(i) + qbnd
210 else if (qbnd .lt.
dzero)
then
211 this%SinkFlows(i) = this%SinkFlows(i) + qbnd
integer(i4b), parameter, public max_poly_cells
This module contains simulation constants.
real(dp), parameter dhdry
real dry cell constant
integer(i4b), parameter lenpackagename
maximum length of the package name
integer(i4b), parameter lenauxname
maximum length of a aux variable
real(dp), parameter dzero
real constant zero
This module defines variable data types.
subroutine, public fmi_cr(fmiobj, name_model, inunit, iout)
Create a new PrtFmi object.
subroutine accumulate_flows(this)
Accumulate flows.
subroutine fmi_ad(this)
Time step advance.
subroutine prtfmi_df(this, dis, idryinactive)
Define the flow model interface.
character(len=lenpackagename) text
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
subroutine, public store_error_unit(iunit, terminate)
Store the file unit number.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string