![]() |
Jump to DART Documentation Main Index |
There is a flexible mechanism built into the DART framework
for defining, at compile time, the list of observation types
to be supported by the executables. This can be changed at
any time by adding or removing items from a namelist and
rebuilding the programs. The
special obs_def module being described here is used by the program
preprocess
to insert appropriate code sections into a
DEFAULT_obs_def module
and a
DEFAULT_obs_kind module
to generate
obs_def_mod.f90 and
obs_kind_mod.f90
that are used by
filter and other DART programs.
This module is intended to provide a prototype for those
developing more complicated specialized observation definition modules.
This is an extended format Fortran 90 module that provides the definition
for observation types designed for use with idealized low-order models
that use the 1D location module and can be thought of as having a state
vector that is equally spaced on a 1D cyclic domain. The three observation types
are: a straight linear interpolation to a point on a [0,1] domain called
a RAW_STATE_VARIABLE; the RAW_STATE_VAR_POWER is the interpolated
RAW_STATE_VARIABLE raised to a real-valued power;
an area-weighted 'integral' of the state variable
over some part of the cyclic 1D domain called RAW_STATE_1D_INTEGRAL.
The second type is convenient for studying non-gaussian, non-linear
assimilation problems.
The third type can be used to
do idealized studies related to remote sensing observations that are
best thought of as weighted integrals of some quantity over a finite volume.
The RAW_STATE_1D_INTEGRAL
has an associated half_width and localization type (see the
cov_cutoff module
documentation)
and a number of points at which to compute the associated integral by
quadrature. The location of the observation defines the center of mass of
the integral. The integral is centered around the location and extends
outward on each side to 2*half_width. The weight associated with the
integral is defined by the weight of the localization function (for
instance Gaspari Cohn) using the same localization options as
defined by the cov_cutoff module.
The number of points are used to equally divide the range for
computing the integral by quadrature.
This module was partly motivated to provide a prototype for those
developing more complicated specialized observation definition modules.
Special observation modules like this contain Fortran 90 code PLUS additional
specially formatted commented code that is used to guide the preprocess program
in constructing the obs_def_mod.f90 and obs_kind_mod.f90. These specially
formatted comments are most conveniently placed at the beginning of the module
and comprise seven sections, each beginning and ending with a special F90
comment line that must be included VERBATIM.
The seven sections and their specific instances for the 1d_raw_state_mod are:
! BEGIN DART PREPROCESS KIND LIST ! RAW_STATE_VARIABLE, QTY_STATE_VARIABLE, COMMON_CODE ! RAW_STATE_1D_INTEGRAL, QTY_1D_INTEGRAL ! END DART PREPROCESS KIND LIST
! BEGIN DART PREPROCESS USE OF SPECIAL OBS_DEF MODULE ! use obs_def_1d_state_mod, only : write_1d_integral, read_1d_integral, & ! interactive_1d_integral, get_expected_1d_integral, & ! set_1d_integral ! END DART PREPROCESS USE OF SPECIAL OBS_DEF MODULE
! BEGIN DART PREPROCESS GET_EXPECTED_OBS_FROM_DEF ! case(RAW_STATE_1D_INTEGRAL) ! call get_expected_1d_integral(state, location, obs_def%key, obs_val, istatus) ! END DART PREPROCESS GET_EXPECTED_OBS_FROM_DEF
! BEGIN DART PREPROCESS READ_OBS_DEF ! case(RAW_STATE_1D_INTEGRAL) ! call read_1d_integral(obs_def%key, ifile, fform) ! END DART PREPROCESS READ_OBS_DEF
! BEGIN DART PREPROCESS WRITE_OBS_DEF ! case(RAW_STATE_1D_INTEGRAL) ! call write_1d_integral(obs_def%key, ifile, fform) ! END DART PREPROCESS WRITE_OBS_DEF
! BEGIN DART PREPROCESS INTERACTIVE_OBS_DEF ! case(RAW_STATE_1D_INTEGRAL) ! call interactive_1d_integral(obs_def%key) ! END DART PREPROCESS INTERACTIVE_OBS_DEF
! BEGIN DART PREPROCESS MODULE CODE module obs_def_1d_state_mod ... (module executable code) end module obs_def_1d_state_mod ! END DART PREPROCESS MODULE CODE
types_mod utilities_mod location_mod (1d_location_mod_only) time_manager_mod assim_model_mod cov_cutoff_mod
use obs_def_mod, only : | write_1d_integral |
read_1d_integral | |
interactive_1d_integral | |
get_expected_1d_integral | |
set_1d_integral | |
write_power | |
read_power | |
interactive_power | |
get_expected_power | |
set_power |
integer, intent(in) :: igrkey integer, intent(in) :: ifile character(len=*), intent(in) :: fform
Writes out the extra information for observation with unique identifier key for a 1d_integral observation type. This includes the half-width, localization type and number of quadrature points for this observation.
igrkey | Unique integer key associated with the 1d integral observation being processed. This is not the same as the key that all types of observations have and uniquely distinguishes all observations from each other; this is a key that is only set and retrieved by this code for 1d integral observations. It is stored in the obs_def derived type, not in the main obs_type definition. |
ifile | Unit number on which observation sequence file is open |
fform | String noting whether file is opened for 'formatted' or 'unformatted' IO. |
integer, intent(out) :: igrkey integer, intent(in) :: ifile character(len=*), intent(in) :: fform
Reads the extra information for observation with unique identifier key for a 1d_integral observation type. This information includes the half-width, localization type and number of quadrature points for this observation. The key that is returned is uniquely associated with the definition that has been created and is used by this module to keep track of the associated parameters for this observation.
igrkey | Unique integer key associated with the observation being processed. |
ifile | Unit number on which observation sequence file is open |
fform | String noting whether file is opened for 'formatted' or 'unformatted' IO. |
integer, intent(out) :: igrkey
Uses input from standard in to define the characteristics of a 1D integral observation. The key that is returned is uniquely associated with the definition that has been created and can be used by this module to keep track of the associated parameters (half_width, localization option, number of quadrature points) for this key.
igrkey | Unique identifier associated with the created observation definition in the obs sequence. |
real(r8), intent(in) :: state type(location_type), intent(in) :: location integer, intent(in) :: igrkey real(r8), intent(out) :: val integer, intent(out) :: istatus
Computes the forward observation operator for a 1d integral observation. Calls the interpolate() routine multiple times to invoke the forward operator code in whatever model this has been compiled with.
state | Model state vector (or extended state vector). |
location | Location of this observation. |
igrkey | Unique integer key associated with this observation. |
val | Returned value of forward observation operator. |
istatus | Returns 0 if forward operator was successfully computed, else returns a positive value. (Negative values are reserved for system use.) |
real(r8), intent(in) :: integral_half_width integer, intent(in) :: num_eval_pts integer, intent(in) :: localize_type integer, intent(out) :: igrkey integer, intent(out) :: istatus
Available for use by programs that create observations to set the additional metadata for these observation types. This information includes the integral half-width, localization type and number of quadrature points for this observation. The key that is returned is uniquely associated with the definition that has been created and should be set in the obs_def structure by calling set_obs_def_key(). This key is different from the main observation key which all observation types have. This key is unique to this observation type and is used when reading in the observation sequence to match the corresponding metadata with each observation of this type.
integral_half_width | Real value setting the half-width of the integral. |
num_eval_pts | Integer, number of evaluation points. 5-20 recommended. |
localize_type | Integer localization type: 1=Gaspari-Cohn; 2=Boxcar; 3=Ramped Boxcar |
igrkey | Unique integer key associated with the observation being processed. |
istatus | Return code. 0 means success, any other value is an error |
integer, intent(in) :: powkey integer, intent(in) :: ifile character(len=*), intent(in) :: fform
Writes out the extra information, the power, for observation with unique identifier key for a power observation type.
powkey | Unique integer key associated with the power observation being processed. This is not the same as the key that all types of observations have and uniquely distinguishes all observations from each other; this is a key that is only set and retrieved by this code for power observations. It is stored in the obs_def derived type, not in the main obs_type definition. |
ifile | Unit number on which observation sequence file is open |
fform | String noting whether file is opened for 'formatted' or 'unformatted' IO. |
integer, intent(out) :: powkey integer, intent(in) :: ifile character(len=*), intent(in) :: fform
Reads the extra information, the power, for observation with unique identifier key for a power observation type. The key that is returned is uniquely associated with the definition that has been created and is used by this module to keep track of the associated parameters for this observation.
powkey | Unique integer key associated with the observation being processed. |
ifile | Unit number on which observation sequence file is open |
fform | String noting whether file is opened for 'formatted' or 'unformatted' IO. |
integer, intent(out) :: powkey
Uses input from standard in to define the characteristics of a power observation. The key that is returned is uniquely associated with the definition that has been created and can be used by this module to keep track of the associated parameter, the power, for this key.
powkey | Unique identifier associated with the created observation definition in the obs sequence. |
real(r8), intent(in) :: state type(location_type), intent(in) :: location integer, intent(in) :: powkey real(r8), intent(out) :: val integer, intent(out) :: istatus
Computes the forward observation operator for a power observation. Calls the interpolate() routine to invoke the forward operator code in whatever model this has been compiled with, then raises the result to the specified power associated with this powkey.
state | Model state vector (or extended state vector). |
location | Location of this observation. |
powkey | Unique integer key associated with this observation. |
val | Returned value of forward observation operator. |
istatus | Returns 0 if forward operator was successfully computed, else returns a positive value. (Negative values are reserved for system use.) |
real(r8), intent(in) :: power_in integer, intent(out) :: powkey integer, intent(out) :: istatus
Available for use by programs that create observations to set the additional metadata for these observation types. This information includes the power to which to raise the state variable. The key that is returned is uniquely associated with the definition that has been created and should be set in the obs_def structure by calling set_obs_def_key(). This key is different from the main observation key which all observation types have. This key is unique to this observation type and is used when reading in the observation sequence to match the corresponding metadata with each observation of this type.
power_in | Real value setting the power. |
powkey | Unique integer key associated with the observation being processed. |
istatus | Return code. 0 means success, any other value is an error |
This module has no namelist.
Routine | Message | Comment |
---|---|---|
interactive_1d_integral | Out of space, max_1d_integral_obs limit NNNN (currently 1000). | There is only room for a fixed number of 1d integral observations. The max number is defined by max_1d_integral_obs. Set this to a larger value if more are needed. |
none at this time
none at this time
DART software - Copyright UCAR. This open source software is provided by UCAR, "as is", without charge, subject to all terms of use at http://www.image.ucar.edu/DAReS/DART/DART_download
Contact: | DART core group |
Revision: | $Revision$ |
Source: | $URL$ |
Change Date: | $Date$ |
Change history: | try "svn log" or "svn diff" |