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

Data Types

type  tspobstype
 

Functions/Subroutines

subroutine, public tsp_obs_cr (obs, inobs, dvt)
 Create a new TspObsType object. More...
 
subroutine tsp_obs_ar (this, ic, x, flowja)
 Allocate and read method for package. More...
 
subroutine tsp_obs_df (this, iout, pkgname, filtyp, dis)
 Define observation object. More...
 
subroutine tsp_obs_bd (this)
 Save observations. More...
 
subroutine tsp_obs_rp (this)
 If transport model observations need checks, add them here. More...
 
subroutine tsp_obs_da (this)
 Deallocate memory. More...
 
subroutine set_pointers (this, ic, x, flowja)
 Set pointers needed by the transport OBS package. More...
 
subroutine tsp_process_obs_id (obsrv, dis, inunitobs, iout)
 Procedure related to Tsp observations (NOT type-bound) More...
 
subroutine tsp_process_intercell_obs_id (obsrv, dis, inunitobs, iout)
 Procedure related to Tsp observations (NOT type-bound) More...
 

Function/Subroutine Documentation

◆ set_pointers()

subroutine tspobsmodule::set_pointers ( class(tspobstype), intent(inout)  this,
type(tspictype), intent(in), pointer  ic,
real(dp), dimension(:), intent(in), pointer, contiguous  x,
real(dp), dimension(:), intent(in), pointer, contiguous  flowja 
)
private

Definition at line 159 of file tsp-obs.f90.

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

◆ tsp_obs_ar()

subroutine tspobsmodule::tsp_obs_ar ( class(tspobstype), intent(inout)  this,
type(tspictype), intent(in), pointer  ic,
real(dp), dimension(:), intent(in), pointer, contiguous  x,
real(dp), dimension(:), intent(in), pointer, contiguous  flowja 
)
private

Method to allocate and read static data for the package.

Definition at line 61 of file tsp-obs.f90.

62  ! -- dummy
63  class(TspObsType), intent(inout) :: this
64  type(TspIcType), pointer, intent(in) :: ic
65  real(DP), dimension(:), pointer, contiguous, intent(in) :: x
66  real(DP), dimension(:), pointer, contiguous, intent(in) :: flowja
67  !
68  ! -- Call ar method of parent class
69  call this%obs_ar()
70  !
71  ! -- set pointers
72  call this%set_pointers(ic, x, flowja)

◆ tsp_obs_bd()

subroutine tspobsmodule::tsp_obs_bd ( class(tspobstype), intent(inout)  this)
private

Definition at line 104 of file tsp-obs.f90.

105  ! -- dummy
106  class(TspObsType), intent(inout) :: this
107  ! -- local
108  integer(I4B) :: i, jaindex, nodenumber
109  character(len=100) :: msg
110  class(ObserveType), pointer :: obsrv => null()
111  !
112  call this%obs_bd_clear()
113  !
114  ! -- iterate through all GWT observations
115  if (this%npakobs > 0) then
116  do i = 1, this%npakobs
117  obsrv => this%pakobs(i)%obsrv
118  nodenumber = obsrv%NodeNumber
119  jaindex = obsrv%JaIndex
120  select case (obsrv%ObsTypeId)
121  case ('CONCENTRATION', 'TEMPERATURE')
122  call this%SaveOneSimval(obsrv, this%x(nodenumber))
123  case ('FLOW-JA-FACE')
124  call this%SaveOneSimval(obsrv, this%flowja(jaindex))
125  case default
126  msg = ' Unrecognized observation type: '//trim(obsrv%ObsTypeId)
127  call store_error(msg)
128  call store_error_unit(this%inUnitObs)
129  end select
130  end do
131  end if
Here is the call graph for this function:

◆ tsp_obs_cr()

subroutine, public tspobsmodule::tsp_obs_cr ( type(tspobstype), intent(out), pointer  obs,
integer(i4b), intent(in), pointer  inobs,
character(len=lenvarname), intent(in)  dvt 
)

This routine:

  • creates an observation object
  • allocates pointers
  • initializes values
    Parameters
    [in]dvt"concentration" or "temperature"

Definition at line 43 of file tsp-obs.f90.

44  ! -- dummy
45  type(TspObsType), pointer, intent(out) :: obs
46  integer(I4B), pointer, intent(in) :: inobs
47  character(len=LENVARNAME), intent(in) :: dvt !< "concentration" or "temperature"
48  !
49  allocate (obs)
50  call obs%allocate_scalars()
51  obs%active = .false.
52  obs%inputFilename = ''
53  obs%inUnitObs => inobs
54  obs%depvartype = dvt
Here is the caller graph for this function:

◆ tsp_obs_da()

subroutine tspobsmodule::tsp_obs_da ( class(tspobstype), intent(inout)  this)
private

Deallocate memory associated with transport model

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

148  ! -- dummy
149  class(TspObsType), intent(inout) :: this
150  !
151  nullify (this%ic)
152  nullify (this%x)
153  nullify (this%flowja)
154  call this%ObsType%obs_da()

◆ tsp_obs_df()

subroutine tspobsmodule::tsp_obs_df ( class(tspobstype), 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 77 of file tsp-obs.f90.

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

◆ tsp_obs_rp()

subroutine tspobsmodule::tsp_obs_rp ( class(tspobstype), intent(inout)  this)
private

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

137  ! -- dummy
138  class(TspObsType), intent(inout) :: this
139  !
140  ! Do GWT (or GWE) observations need any checking? If so, add checks here

◆ tsp_process_intercell_obs_id()

subroutine tspobsmodule::tsp_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

Process an intercell observation requested by the user

Definition at line 208 of file tsp-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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tsp_process_obs_id()

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

Process a specific observation ID

Definition at line 175 of file tsp-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
Here is the call graph for this function:
Here is the caller graph for this function: