MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
gwfobsmodule Module Reference

Data Types

type  gwfobstype

Functions/Subroutines

subroutine, public gwf_obs_cr (obs, inobs)
 Create a new GwfObsType object.
subroutine gwf_obs_ar (this, ic, x, flowja)
 Allocate and read.
subroutine gwf_obs_df (this, iout, pkgname, filtyp, dis)
 Define.
subroutine gwf_obs_bd (this)
 Save obs.
subroutine gwf_obs_rp (this)
 Do GWF observations need any checking? If so, add checks here.
subroutine gwf_obs_da (this)
 Deallocate memory.
subroutine set_pointers (this, ic, x, flowja)
 Set pointers.
subroutine gwf_process_head_drawdown_obs_id (obsrv, dis, inunitobs, iout)
 Calculate drawdown observation when requested.
subroutine gwf_process_intercell_obs_id (obsrv, dis, inunitobs, iout)
 Process flow between two cells when requested.

Function/Subroutine Documentation

◆ gwf_obs_ar()

subroutine gwfobsmodule::gwf_obs_ar ( class(gwfobstype), intent(inout) this,
type(gwfictype), intent(in), pointer ic,
real(dp), dimension(:), intent(in), pointer, contiguous x,
real(dp), dimension(:), intent(in), pointer, contiguous flowja )
private

Definition at line 54 of file gwf-obs.f90.

55 ! -- dummy
56 class(GwfObsType), intent(inout) :: this
57 type(GwfIcType), pointer, intent(in) :: ic
58 real(DP), dimension(:), pointer, contiguous, intent(in) :: x
59 real(DP), dimension(:), pointer, contiguous, intent(in) :: flowja
60 !
61 ! Call ar method of parent class
62 call this%obs_ar()
63 !
64 ! set pointers
65 call this%set_pointers(ic, x, flowja)

◆ gwf_obs_bd()

subroutine gwfobsmodule::gwf_obs_bd ( class(gwfobstype), intent(inout) this)
private

Definition at line 101 of file gwf-obs.f90.

102 ! -- dummy
103 class(GwfObsType), intent(inout) :: this
104 ! -- local
105 integer(I4B) :: i, jaindex, nodenumber
106 real(DP) :: v
107 character(len=100) :: msg
108 class(ObserveType), pointer :: obsrv => null()
109 !
110 call this%obs_bd_clear()
111 !
112 ! -- iterate through all GWF observations
113 if (this%npakobs > 0) then
114 do i = 1, this%npakobs
115 obsrv => this%pakobs(i)%obsrv
116 nodenumber = obsrv%NodeNumber
117 jaindex = obsrv%JaIndex
118 select case (obsrv%ObsTypeId)
119 case ('HEAD')
120 call this%SaveOneSimval(obsrv, this%x(nodenumber))
121 case ('DRAWDOWN')
122 v = this%ic%strt(nodenumber) - this%x(nodenumber)
123 call this%SaveOneSimval(obsrv, v)
124 case ('FLOW-JA-FACE')
125 call this%SaveOneSimval(obsrv, this%flowja(jaindex))
126 case default
127 msg = 'Error: Unrecognized observation type: '//trim(obsrv%ObsTypeId)
128 call store_error(msg)
129 end select
130 end do
131 !
132 ! -- write summary of error messages
133 if (count_errors() > 0) then
134 call store_error_unit(this%inUnitObs)
135 end if
136 end if
Here is the call graph for this function:

◆ gwf_obs_cr()

subroutine, public gwfobsmodule::gwf_obs_cr ( type(gwfobstype), intent(out), pointer obs,
integer(i4b), intent(in), pointer inobs )

Create observation object, allocate pointers, initialize values

Definition at line 40 of file gwf-obs.f90.

41 ! -- dummy
42 type(GwfObsType), pointer, intent(out) :: obs
43 integer(I4B), pointer, intent(in) :: inobs
44 !
45 allocate (obs)
46 call obs%allocate_scalars()
47 obs%active = .false.
48 obs%inputFilename = ''
49 obs%inUnitObs => inobs
Here is the caller graph for this function:

◆ gwf_obs_da()

subroutine gwfobsmodule::gwf_obs_da ( class(gwfobstype), intent(inout) this)
private

Definition at line 150 of file gwf-obs.f90.

151 ! -- dummy
152 class(GwfObsType), intent(inout) :: this
153 !
154 nullify (this%ic)
155 nullify (this%x)
156 nullify (this%flowja)
157 call this%ObsType%obs_da()

◆ gwf_obs_df()

subroutine gwfobsmodule::gwf_obs_df ( class(gwfobstype), intent(inout) this,
integer(i4b), intent(in) iout,
character(len=*), intent(in) pkgname,
character(len=*), intent(in) filtyp,
class(disbasetype), pointer dis )
private

Definition at line 70 of file gwf-obs.f90.

71 ! -- dummy
72 class(GwfObsType), intent(inout) :: this
73 integer(I4B), intent(in) :: iout
74 character(len=*), intent(in) :: pkgname
75 character(len=*), intent(in) :: filtyp
76 class(DisBaseType), pointer :: dis
77 ! -- local
78 integer(I4B) :: indx
79 !
80 ! Call overridden method of parent class
81 call this%ObsType%obs_df(iout, pkgname, filtyp, dis)
82 !
83 ! -- StoreObsType arguments are: (ObserveType, cumulative, indx);
84 ! indx is returned.
85 !
86 ! -- Store obs type and assign procedure pointer for head observation type
87 call this%StoreObsType('head', .false., indx)
88 this%obsData(indx)%ProcessIdPtr => gwf_process_head_drawdown_obs_id
89 !
90 ! -- Store obs type and assign procedure pointer for drawdown observation type
91 call this%StoreObsType('drawdown', .false., indx)
92 this%obsData(indx)%ProcessIdPtr => gwf_process_head_drawdown_obs_id
93 !
94 ! -- Store obs type and assign procedure pointer for flow-ja-face observation type
95 call this%StoreObsType('flow-ja-face', .true., indx)
96 this%obsData(indx)%ProcessIdPtr => gwf_process_intercell_obs_id
Here is the call graph for this function:

◆ gwf_obs_rp()

subroutine gwfobsmodule::gwf_obs_rp ( class(gwfobstype), intent(inout) this)
private

Definition at line 141 of file gwf-obs.f90.

142 ! -- dummy
143 class(GwfObsType), intent(inout) :: this
144 !
145 ! Do GWF observations need any checking? If so, add checks here

◆ gwf_process_head_drawdown_obs_id()

subroutine gwfobsmodule::gwf_process_head_drawdown_obs_id ( type(observetype), intent(inout) obsrv,
class(disbasetype), intent(in) dis,
integer(i4b), intent(in) inunitobs,
integer(i4b), intent(in) iout )
private

Definition at line 178 of file gwf-obs.f90.

179 ! -- dummy
180 type(ObserveType), intent(inout) :: obsrv
181 class(DisBaseType), intent(in) :: dis
182 integer(I4B), intent(in) :: inunitobs
183 integer(I4B), intent(in) :: iout
184 ! -- local
185 integer(I4B) :: nn1
186 integer(I4B) :: icol, istart, istop
187 character(len=LINELENGTH) :: ermsg, string
188 !
189 ! -- Initialize variables
190 string = obsrv%IDstring
191 icol = 1
192 !
193 ! Get node number, with option for ID string to be either node
194 ! number or lay, row, column (when dis is structured).
195 nn1 = dis%noder_from_string(icol, istart, istop, inunitobs, &
196 iout, string, .false.)
197 !
198 if (nn1 > 0) then
199 obsrv%NodeNumber = nn1
200 else
201 ermsg = 'Error reading data from ID string'
202 call store_error(ermsg)
203 call store_error_unit(inunitobs)
204 end if
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gwf_process_intercell_obs_id()

subroutine gwfobsmodule::gwf_process_intercell_obs_id ( type(observetype), intent(inout) obsrv,
class(disbasetype), intent(in) dis,
integer(i4b), intent(in) inunitobs,
integer(i4b), intent(in) iout )
private

Definition at line 209 of file gwf-obs.f90.

210 ! -- dummy
211 type(ObserveType), intent(inout) :: obsrv
212 class(DisBaseType), intent(in) :: dis
213 integer(I4B), intent(in) :: inunitobs
214 integer(I4B), intent(in) :: iout
215 ! -- local
216 integer(I4B) :: nn1, nn2
217 integer(I4B) :: icol, istart, istop, jaidx
218 character(len=LINELENGTH) :: ermsg, string
219 ! formats
22070 format('Error: No connection exists between cells identified in text: ', a)
221 !
222 ! -- Initialize variables
223 string = obsrv%IDstring
224 icol = 1
225 !
226 ! Get node number, with option for ID string to be either node
227 ! number or lay, row, column (when dis is structured).
228 nn1 = dis%noder_from_string(icol, istart, istop, inunitobs, &
229 iout, string, .false.)
230 !
231 if (nn1 > 0) then
232 obsrv%NodeNumber = nn1
233 else
234 ermsg = 'Error reading data from ID string: '//string(istart:istop)
235 call store_error(ermsg)
236 end if
237 !
238 ! Get node number, with option for ID string to be either node
239 ! number or lay, row, column (when dis is structured).
240 nn2 = dis%noder_from_string(icol, istart, istop, inunitobs, &
241 iout, string, .false.)
242 if (nn2 > 0) then
243 obsrv%NodeNumber2 = nn2
244 else
245 ermsg = 'Error reading data from ID string: '//string(istart:istop)
246 call store_error(ermsg)
247 end if
248 !
249 ! -- store JA index
250 jaidx = dis%con%getjaindex(nn1, nn2)
251 if (jaidx == 0) then
252 write (ermsg, 70) trim(string)
253 call store_error(ermsg)
254 end if
255 obsrv%JaIndex = jaidx
256 !
257 if (count_errors() > 0) then
258 call store_error_unit(inunitobs)
259 end if
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_pointers()

subroutine gwfobsmodule::set_pointers ( class(gwfobstype), intent(inout) this,
type(gwfictype), intent(in), pointer ic,
real(dp), dimension(:), intent(in), pointer, contiguous x,
real(dp), dimension(:), intent(in), pointer, contiguous flowja )
private

Definition at line 162 of file gwf-obs.f90.

163 ! -- dummy
164 class(GwfObsType), intent(inout) :: this
165 type(GwfIcType), pointer, intent(in) :: ic
166 real(DP), dimension(:), pointer, contiguous, intent(in) :: x
167 real(DP), dimension(:), pointer, contiguous, intent(in) :: flowja
168 !
169 this%ic => ic
170 this%x => x
171 this%flowja => flowja