MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
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 157 of file swf-obs.f90.

158  ! -- dummy
159  class(SwfObsType), intent(inout) :: this
160  type(SwfIcType), pointer, intent(in) :: ic
161  real(DP), dimension(:), pointer, contiguous, intent(in) :: x
162  real(DP), dimension(:), pointer, contiguous, intent(in) :: flowja
163  !
164  this%ic => ic
165  this%x => x
166  this%flowja => flowja
167  !
168  return

◆ 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 54 of file swf-obs.f90.

55  ! -- dummy
56  class(SwfObsType), intent(inout) :: this
57  type(SwfIcType), 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)
66  !
67  return

◆ swf_obs_bd()

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

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

102  ! -- dummy
103  class(SwfObsType), intent(inout) :: this
104  ! -- local
105  integer(I4B) :: i, jaindex, nodenumber
106  character(len=100) :: msg
107  class(ObserveType), pointer :: obsrv => null()
108  !
109  call this%obs_bd_clear()
110  !
111  ! -- iterate through all SWF observations
112  if (this%npakobs > 0) then
113  do i = 1, this%npakobs
114  obsrv => this%pakobs(i)%obsrv
115  nodenumber = obsrv%NodeNumber
116  jaindex = obsrv%JaIndex
117  select case (obsrv%ObsTypeId)
118  case ('STAGE')
119  call this%SaveOneSimval(obsrv, this%x(nodenumber))
120  case ('FLOW-JA-FACE')
121  call this%SaveOneSimval(obsrv, this%flowja(jaindex))
122  case default
123  msg = ' Unrecognized observation type: '//trim(obsrv%ObsTypeId)
124  call store_error(msg)
125  call store_error_unit(this%inUnitObs)
126  end select
127  end do
128  end if
129  !
130  return
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
48  !
49  return
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 144 of file swf-obs.f90.

145  class(SwfObsType), intent(inout) :: this
146  !
147  nullify (this%ic)
148  nullify (this%x)
149  nullify (this%flowja)
150  call this%ObsType%obs_da()
151  !
152  return

◆ 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 72 of file swf-obs.f90.

73  ! -- dummy
74  class(SwfObsType), intent(inout) :: this
75  integer(I4B), intent(in) :: iout
76  character(len=*), intent(in) :: pkgname
77  character(len=*), intent(in) :: filtyp
78  class(DisBaseType), pointer :: dis
79  ! -- local
80  integer(I4B) :: indx
81  !
82  ! Call overridden method of parent class
83  call this%ObsType%obs_df(iout, pkgname, filtyp, dis)
84  !
85  ! -- StoreObsType arguments are: (ObserveType, cumulative, indx);
86  ! indx is returned.
87  !
88  ! -- Store obs type and assign procedure pointer for head observation type
89  call this%StoreObsType('stage', .false., indx)
90  this%obsData(indx)%ProcessIdPtr => swf_process_stage_obs_id
91  !
92  ! -- Store obs type and assign procedure pointer for flow-ja-face observation type
93  call this%StoreObsType('flow-ja-face', .true., indx)
94  this%obsData(indx)%ProcessIdPtr => swf_process_intercell_obs_id
95  !
96  return
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 135 of file swf-obs.f90.

136  class(SwfObsType), intent(inout) :: this
137  !
138  ! Do SWF observations need any checking? If so, add checks here
139  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 208 of file swf-obs.f90.

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

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