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

Data Types

type  prtobstype
 

Functions/Subroutines

subroutine, public prt_obs_cr (obs, inobs)
 Create a new PrtObsType object. More...
 
subroutine prt_obs_ar (this, x, flowja)
 Allocate and read. More...
 
subroutine prt_obs_df (this, iout, pkgname, filtyp, dis)
 Define package. More...
 
subroutine prt_obs_bd (this)
 Save observations. More...
 
subroutine prt_obs_rp (this)
 Read and prepare. More...
 
subroutine prt_obs_da (this)
 Deallocate. More...
 
subroutine set_pointers (this, x, flowja)
 Set pointers. More...
 
subroutine prt_process_concentration_obs_id (obsrv, dis, inunitobs, iout)
 
subroutine prt_process_intercell_obs_id (obsrv, dis, inunitobs, iout)
 

Function/Subroutine Documentation

◆ prt_obs_ar()

subroutine prtobsmodule::prt_obs_ar ( class(prtobstype), intent(inout)  this,
real(dp), dimension(:), intent(in), pointer, contiguous  x,
real(dp), dimension(:), intent(in), pointer, contiguous  flowja 
)
private

Definition at line 47 of file prt-obs.f90.

48  ! -- dummy
49  class(PrtObsType), intent(inout) :: this
50  real(DP), dimension(:), pointer, contiguous, intent(in) :: x
51  real(DP), dimension(:), pointer, contiguous, intent(in) :: flowja
52  !
53  ! Call ar method of parent class
54  call this%obs_ar()
55  !
56  ! set pointers
57  call this%set_pointers(x, flowja)
58 

◆ prt_obs_bd()

subroutine prtobsmodule::prt_obs_bd ( class(prtobstype), intent(inout)  this)
private

Definition at line 89 of file prt-obs.f90.

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

◆ prt_obs_cr()

subroutine, public prtobsmodule::prt_obs_cr ( type(prtobstype), intent(out), pointer  obs,
integer(i4b), intent(in), pointer  inobs 
)

Definition at line 33 of file prt-obs.f90.

34  ! -- dummy
35  type(PrtObsType), pointer, intent(out) :: obs
36  integer(I4B), pointer, intent(in) :: inobs
37  !
38  allocate (obs)
39  call obs%allocate_scalars()
40  obs%active = .false.
41  obs%inputFilename = ''
42  obs%inUnitObs => inobs
43 
Here is the caller graph for this function:

◆ prt_obs_da()

subroutine prtobsmodule::prt_obs_da ( class(prtobstype), intent(inout)  this)
private

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

128  ! -- dummy
129  class(PrtObsType), intent(inout) :: this
130  !
131  nullify (this%x)
132  nullify (this%flowja)
133  call this%ObsType%obs_da()
134 

◆ prt_obs_df()

subroutine prtobsmodule::prt_obs_df ( class(prtobstype), 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 62 of file prt-obs.f90.

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

◆ prt_obs_rp()

subroutine prtobsmodule::prt_obs_rp ( class(prtobstype), intent(inout)  this)
private

Definition at line 121 of file prt-obs.f90.

122  class(PrtObsType), intent(inout) :: this
123  ! Do PRT observations need any checking? If so, add checks here

◆ prt_process_concentration_obs_id()

subroutine prtobsmodule::prt_process_concentration_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 151 of file prt-obs.f90.

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

◆ prt_process_intercell_obs_id()

subroutine prtobsmodule::prt_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 181 of file prt-obs.f90.

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

◆ set_pointers()

subroutine prtobsmodule::set_pointers ( class(prtobstype), intent(inout)  this,
real(dp), dimension(:), intent(in), pointer, contiguous  x,
real(dp), dimension(:), intent(in), pointer, contiguous  flowja 
)
private

Definition at line 138 of file prt-obs.f90.

139  ! -- dummy
140  class(PrtObsType), intent(inout) :: this
141  real(DP), dimension(:), pointer, contiguous, intent(in) :: x
142  real(DP), dimension(:), pointer, contiguous, intent(in) :: flowja
143  !
144  this%x => x
145  this%flowja => flowja
146