MODFLOW 6  version 6.6.0.dev0
USGS Modular Hydrologic Model
swfobsmodule Module Reference

Data Types

type  swfobstype
 

Functions/Subroutines

subroutine, public swf_obs_cr (obs, inobs)
 Create a new obs object. More...
 
subroutine swf_obs_ar (this, ic, x, flowja)
 Allocate and read. More...
 
subroutine swf_obs_df (this, iout, pkgname, filtyp, dis)
 Define. More...
 
subroutine swf_obs_bd (this)
 Save obs. More...
 
subroutine swf_obs_rp (this)
 Do observations need any checking? If so, add checks here. More...
 
subroutine swf_obs_da (this)
 Deallocate memory. More...
 
subroutine set_pointers (this, ic, x, flowja)
 Set pointers. More...
 
subroutine swf_process_stage_obs_id (obsrv, dis, inunitobs, iout)
 Calculate stage observation when requested. More...
 
subroutine swf_process_intercell_obs_id (obsrv, dis, inunitobs, iout)
 Process flow between two cells when requested. More...
 

Function/Subroutine Documentation

◆ set_pointers()

subroutine swfobsmodule::set_pointers ( class(swfobstype), intent(inout)  this,
type(swfictype), intent(in), pointer  ic,
real(dp), dimension(:), intent(in), pointer, contiguous  x,
real(dp), dimension(:), intent(in), pointer, contiguous  flowja 
)
private

Definition at line 147 of file swf-obs.f90.

148  ! -- dummy
149  class(SwfObsType), intent(inout) :: this
150  type(SwfIcType), pointer, intent(in) :: ic
151  real(DP), dimension(:), pointer, contiguous, intent(in) :: x
152  real(DP), dimension(:), pointer, contiguous, intent(in) :: flowja
153  !
154  this%ic => ic
155  this%x => x
156  this%flowja => flowja

◆ swf_obs_ar()

subroutine swfobsmodule::swf_obs_ar ( class(swfobstype), intent(inout)  this,
type(swfictype), intent(in), pointer  ic,
real(dp), dimension(:), intent(in), pointer, contiguous  x,
real(dp), dimension(:), intent(in), pointer, contiguous  flowja 
)
private

Definition at line 52 of file swf-obs.f90.

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

◆ swf_obs_bd()

subroutine swfobsmodule::swf_obs_bd ( class(swfobstype), intent(inout)  this)
private

Definition at line 95 of file swf-obs.f90.

96  ! -- dummy
97  class(SwfObsType), intent(inout) :: this
98  ! -- local
99  integer(I4B) :: i, jaindex, nodenumber
100  character(len=100) :: msg
101  class(ObserveType), pointer :: obsrv => null()
102  !
103  call this%obs_bd_clear()
104  !
105  ! -- iterate through all SWF observations
106  if (this%npakobs > 0) then
107  do i = 1, this%npakobs
108  obsrv => this%pakobs(i)%obsrv
109  nodenumber = obsrv%NodeNumber
110  jaindex = obsrv%JaIndex
111  select case (obsrv%ObsTypeId)
112  case ('STAGE')
113  call this%SaveOneSimval(obsrv, this%x(nodenumber))
114  case ('FLOW-JA-FACE')
115  call this%SaveOneSimval(obsrv, this%flowja(jaindex))
116  case default
117  msg = ' Unrecognized observation type: '//trim(obsrv%ObsTypeId)
118  call store_error(msg)
119  call store_error_unit(this%inUnitObs)
120  end select
121  end do
122  end if
Here is the call graph for this function:

◆ swf_obs_cr()

subroutine, public swfobsmodule::swf_obs_cr ( type(swfobstype), intent(out), pointer  obs,
integer(i4b), intent(in), pointer  inobs 
)

Create observation object, allocate pointers, initialize values

Definition at line 38 of file swf-obs.f90.

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

◆ swf_obs_da()

subroutine swfobsmodule::swf_obs_da ( class(swfobstype), intent(inout)  this)
private

Definition at line 136 of file swf-obs.f90.

137  class(SwfObsType), intent(inout) :: this
138  !
139  nullify (this%ic)
140  nullify (this%x)
141  nullify (this%flowja)
142  call this%ObsType%obs_da()

◆ swf_obs_df()

subroutine swfobsmodule::swf_obs_df ( class(swfobstype), 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 68 of file swf-obs.f90.

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

◆ swf_obs_rp()

subroutine swfobsmodule::swf_obs_rp ( class(swfobstype), intent(inout)  this)
private

Definition at line 127 of file swf-obs.f90.

128  class(SwfObsType), intent(inout) :: this
129  !
130  ! Do SWF observations need any checking? If so, add checks here
131  return

◆ swf_process_intercell_obs_id()

subroutine swfobsmodule::swf_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 194 of file swf-obs.f90.

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

◆ swf_process_stage_obs_id()

subroutine swfobsmodule::swf_process_stage_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 163 of file swf-obs.f90.

164  ! -- dummy
165  type(ObserveType), intent(inout) :: obsrv
166  class(DisBaseType), intent(in) :: dis
167  integer(I4B), intent(in) :: inunitobs
168  integer(I4B), intent(in) :: iout
169  ! -- local
170  integer(I4B) :: nn1
171  integer(I4B) :: icol, istart, istop
172  character(len=LINELENGTH) :: ermsg, string
173  !
174  ! -- Initialize variables
175  string = obsrv%IDstring
176  icol = 1
177  !
178  ! Get node number, with option for ID string to be either node
179  ! number or lay, row, column (when dis is structured).
180  nn1 = dis%noder_from_string(icol, istart, istop, inunitobs, &
181  iout, string, .false.)
182  !
183  if (nn1 > 0) then
184  obsrv%NodeNumber = nn1
185  else
186  ermsg = 'Error reading data from ID string'
187  call store_error(ermsg)
188  call store_error_unit(inunitobs)
189  end if
Here is the call graph for this function:
Here is the caller graph for this function: