|
subroutine, public | obs_cr (obs, inobs) |
| @ brief Create a new ObsType object More...
|
|
subroutine, public | defaultobsidprocessor (obsrv, dis, inunitobs, iout) |
| @ brief Process IDstring provided for each observation More...
|
|
subroutine | obs_df (this, iout, pkgname, filtyp, dis) |
| @ brief Define some members of an ObsType object More...
|
|
subroutine | obs_ar (this) |
| @ brief Allocate and read package observations More...
|
|
subroutine | obs_ad (this) |
| @ brief Advance package observations More...
|
|
subroutine | obs_bd_clear (this) |
| @ brief Clear observation output lines More...
|
|
subroutine | obs_ot (this) |
| @ brief Output observation data More...
|
|
subroutine | obs_da (this) |
| @ brief Deallocate observation data More...
|
|
subroutine | saveonesimval (this, obsrv, simval) |
| @ brief Save a simulated value More...
|
|
subroutine | storeobstype (this, obsrvType, cumulative, indx) |
| @ brief Store observation type More...
|
|
subroutine | allocate_scalars (this) |
| @ brief Allocate observation scalars More...
|
|
subroutine | obs_ar1 (this, pkgname) |
| @ brief Read observation options and output formats More...
|
|
subroutine | obs_ar2 (this, dis) |
| @ brief Call procedure provided by package More...
|
|
subroutine | read_obs_options (this) |
| @ brief Read observation options block More...
|
|
subroutine | define_fmts (this) |
| @ brief Define observation output formats More...
|
|
subroutine | read_observations (this) |
| @ brief Read observations More...
|
|
integer(i4b) function | get_num (this) |
| @ brief Get the number of observations More...
|
|
subroutine | build_headers (this) |
| @ brief Build observation headers More...
|
|
subroutine | get_obs_array (this, nObs, obsArray) |
| @ brief Get an array of observations More...
|
|
type(obsdatatype) function, pointer | get_obs_datum (this, obsTypeID) |
| @ brief Get an ObsDataType object More...
|
|
subroutine | set_obs_array (this, nObs, obsArray) |
| @ brief Set observation array values More...
|
|
class(observetype) function, pointer | get_obs (this, indx) |
| @ brief Get an ObserveType object More...
|
|
subroutine | read_obs_blocks (this, fname) |
| @ brief Read observation blocks More...
|
|
subroutine | write_obs_simvals (this) |
| @ brief Write observation data More...
|
|
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.
- (package only) Override BndType.bnd_obs_supported to return true. bnd_obs_supported is called from various places in code.
(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.
- In DF routine: Call bnd_df_obs
- In AR routine: Call ObsType.obs_ar. This reads the OBS input file. Example (gwf_ar): call thisobsobs_ar() Example (lak_ar): call thisobsobs_ar()
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
- In AD routine: Call ObsType.obs_ad Example: gwf_ad
- Write a *_bd_obs routine. This is the routine that actually calculates the simulated value for each observation type supported by the model/package. Call *_bd_obs from the bottom of the _bd routine. *_bd_obs needs to: Call ObsType.obs_bd_clear For each observation: Calculate the simulated value Call ObsType.SaveOneSimval Examples: gwf_bd_obs, maw_bd_obs, lak_bd_obs
- In BD routine: Call BndType.bnd_bd_obs Examples: BndType.bnd_bd calls bnd_bd_obs GwfModelType.gwf_bd calls gwf_bd_obs MawType.maw_bd calls maw_bd_obs LakType.lak_bd calls lak_bd_obs
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)