![]() |
MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
|
This module contains the derived type ObsType. More...
Data Types | |
| type | obstype |
Functions/Subroutines | |
| subroutine, public | obs_cr (obs, inobs) |
| Create a new ObsType object. | |
| subroutine, public | defaultobsidprocessor (obsrv, dis, inunitobs, iout) |
| Process IDstring provided for each observation. | |
| subroutine | obs_df (this, iout, pkgname, filtyp, dis) |
| Define some members of an ObsType object. | |
| subroutine | obs_ar (this) |
| Allocate and read package observations. | |
| subroutine | obs_ad (this) |
| Advance package observations. | |
| subroutine | obs_bd_clear (this) |
| Clear observation output lines. | |
| subroutine | obs_ot (this) |
| Output observation data. | |
| subroutine | obs_da (this) |
| Deallocate observation data. | |
| subroutine | saveonesimval (this, obsrv, simval) |
| Save a simulated value. | |
| subroutine | storeobstype (this, obsrvtype, cumulative, indx) |
| Store observation type. | |
| subroutine | allocate_scalars (this) |
| Allocate observation scalars. | |
| subroutine | obs_ar1 (this, pkgname) |
| Read observation options and output formats. | |
| subroutine | obs_ar2 (this, dis) |
| Call procedure provided by package. | |
| subroutine | read_obs_options (this) |
| Read observation options block. | |
| subroutine | define_fmts (this) |
| Define observation output formats. | |
| subroutine | read_observations (this) |
| Read observations. | |
| integer(i4b) function | get_num (this) |
| Get the number of observations. | |
| subroutine | build_headers (this) |
| Build observation headers. | |
| subroutine | get_obs_array (this, nobs, obsarray) |
| Get an array of observations. | |
| type(obsdatatype) function, pointer | get_obs_datum (this, obstypeid) |
| Get an ObsDataType object. | |
| subroutine | set_obs_array (this, nobs, obsarray) |
| Set observation array values. | |
| class(observetype) function, pointer | get_obs (this, indx) |
| Get an ObserveType object. | |
| subroutine | read_obs_blocks (this, fname) |
| Read observation blocks. | |
| subroutine | write_obs_simvals (this) |
| Write observation data. | |
This module defines type ObsType, which is the highest-level derived type for implementing observations. All objects derived from NumericalModelType or BndType already contain an ObsType member.
Examples: NumericalModelType.obs BndType.obs
Similarly, an ObsType member could be added to, say, NumericalExchangeType or any other type that has DF, AR, RP, AD, BD, and OT routines.
IMPLEMENTATION OF OBSERVATIONS IN A MODEL OR PACKAGE
For simple boundary packages like RIV and DRN, only steps 1-6 are needed. For models and advanced packages like MAW and SFR, additional steps are needed.
(optional) Write a subroutine that implements abstract interface ObserveModule.ProcessIdSub. (Not needed if IDstring, which identifies location in model to be observed, is either a single node number or a single {lay, row, col} set of indices).
Examples: gwf_process_head_drawdown_obs_id, gwf_process_intercell_obs_id
A package can allow IDstring to be a boundary name. Example: ObsModule.DefaultObsIdProcessor
Override BndType.bnd_df_obs() to define string(s) to be recognized as observation type(s) and (optional) assign ProcessIdPtr (not needed if IDstring is either a node number or a {lay, row, col} set of indices).
Examples: gwf_df_obs, drn_df_obs
When boundary names are allowed and developer wants simulated value to be cumulative (flow, for example) if user specifies multiple boundaries with the same BOUNDNAME, in bnd_df_obs call to ObsPackage.StoreObsType, provide cumulative argument as true. Otherwise, simulated values are not cumulative.
Override BndType.bnd_rp_obs for any package that needs to check user input or process observation input in any special way. If no special processing is needed, BndType.bnd_rp_obs can be used. This routine also expands the ObserveTypeindxbnds array for each observation in a package. ObserveTypeindxbnds is used to sum simulated values from multiple boundaries when BOUNDNAMES is used. Equivalent routine may or may not be needed for model observations. If needed, call it from bottom of RP routine.
Examples: BndType.bnd_rp_obs, which is called from gwf_rp
Ensure that ObsType.obs_ot is called. For packages, obs_ot is called from the model _ot procedure. The model _ot procedure should also call obs_ot for its own observations. Do not call obs_ot from a package _ot procedure because the package _ot procedure may not be called, depending on Output Control settings (ibudfl).
Note: BndType.bnd_ot_obs calls: ObsType.obs_ot
Note: ObsType.obs_ot calls: store_all_simvals write_continuous_simvals obsOutputList.WriteOutputLines
BINARY OUTPUT:
When observation-output files are written, the user has the option to have output written to a binary file. Binary obs output files start with a 100-byte header structured as follows:
bytes 1-4 (ascii): Observation type contained in file; options are: "cont" – Continuous observations byte 5: blank bytes 6-11 (ascii): Precision of all floating-point values; options are: "single" – Single precision "double" – Double precision bytes 12-15 (ascii): LENOBSNAME (integer; length of observation names, in bytes) bytes 16-100: blank
IN A FILE OF CONTINUOUS OBSERVATIONS:
The 100-byte header is followed by: NOBS (4-byte integer) – Number of observations. NOBS repetitions of OBSNAME (ascii, LENOBSNAME bytes each). Any number of repetitions of: TIME SIMVAL-1 SIMVAL-2 ... SIMVAL-NOBS (floating point)
|
private |
Subroutine to allocate and initialize memory for non-allocatable
Definition at line 512 of file Obs.f90.
|
private |
Subroutine to build headers for CSV-formatted and unformatted continuous-observation output files and write them to those files.
Each formatted header will have the form: "time,obsname-1,obsname-2, ..."
Definition at line 761 of file Obs.f90.
| subroutine, public obsmodule::defaultobsidprocessor | ( | type(observetype), intent(inout) | obsrv, |
| class(disbasetype), intent(in) | dis, | ||
| integer(i4b), intent(in) | inunitobs, | ||
| integer(i4b), intent(in) | iout ) |
Subroutine to process the IDstring provided for each observation. The IDstring identifies the location in the model of the node(s) or feature(s) where the simulated value is to be extracted and recorded. Subroutine
| [in,out] | obsrv | observation ObserveType |
| [in] | dis | discretization object |
| [in] | inunitobs | observation input file unit |
| [in] | iout | model list file |
Definition at line 245 of file Obs.f90.


|
private |
Subroutine to define observation output formats.
Definition at line 706 of file Obs.f90.
|
private |
Function to get the number of observationns in this ObsType object.
Definition at line 744 of file Obs.f90.


|
private |
Subroutine to get an ObserveType object from the list of observations using an list index.
| [in] | indx | observation list index |
Definition at line 908 of file Obs.f90.

|
private |
Subroutine to get an array containing all observations in this ObsType object.
| [out] | nobs | number of observations |
| [in,out] | obsarray | observation array |
Definition at line 834 of file Obs.f90.
|
private |
Function to get an ObsDataType object for the specified observation type.
| [in] | obstypeid | observation type |
Definition at line 855 of file Obs.f90.

|
private |
Subroutine to advance each package observations by resetting the "current" value.
Definition at line 330 of file Obs.f90.
|
private |
Subroutine to allocate and read observations for a package. Subroutine
Definition at line 314 of file Obs.f90.
|
private |
Subroutine to read the options block in the observation input file and define output formats.
| [in] | pkgname | package name |
Definition at line 532 of file Obs.f90.
|
private |
Subroutine to call procedure provided by package to interpret IDstring and store required data.
| dis | discretization object |
Definition at line 559 of file Obs.f90.

|
private |
| subroutine, public obsmodule::obs_cr | ( | type(obstype), intent(out), pointer | obs, |
| integer(i4b), intent(in), pointer | inobs ) |
Subroutine to create a new ObsType object. Soubroutine
| [out] | obs | observation ObsType |
| [in] | inobs | observation input file unit |
Definition at line 224 of file Obs.f90.

|
private |
Subroutine to deallocate observation data.
Definition at line 384 of file Obs.f90.
|
private |
Subroutine to define some members of an ObsType object.
| [in] | iout | model list file unit |
| [in] | pkgname | package name |
| [in] | filtyp | package file type |
| dis | discretization object |
Definition at line 289 of file Obs.f90.
|
private |
Subroutine to output observation data. Subroutine
This procedure should NOT be called from a package's _ot procedure because the package _ot procedure may not be called every time step.
Definition at line 369 of file Obs.f90.
|
private |
Subroutine to read CONTIGUOUS block from the observation input file.
Definition at line 922 of file Obs.f90.

|
private |
Subroutine to read the options block in the observation input file.
Definition at line 597 of file Obs.f90.

|
private |
Subroutine to read the observations from the observation input file and build headers for the observation output files.
Definition at line 727 of file Obs.f90.
|
private |
Subroutine to save or accumulate a simulated value to its ObserveType object.
| [in,out] | obsrv | observation ObserveType |
| [in] | simval | simulated value |
Definition at line 430 of file Obs.f90.
|
private |
Subroutine to set values in an observation array.
| [in] | nobs | number of observations |
| [in,out] | obsarray | observation array |
Definition at line 884 of file Obs.f90.
|
private |
Subroutine to store type name and related information for an observation type that belongs to a package or model in the obsData array.
| [in] | obsrvtype | observation type |
| [in] | cumulative | logical indicating if the observation should be accumulated |
| [out] | indx | observation index |
Definition at line 461 of file Obs.f90.

|
private |
Subroutine to write observation data for a time step for each observation to the observation output file.
Definition at line 1076 of file Obs.f90.
