The observations are stored in a single NetCDF file. This file also contains information about the observation error, latest two iterations of nonlinear and tangent linear model values at observation locations, and the interpolation weights. The unlimited dimension, datum, is used to store each observation in space and time.
The NetCDF dimensions are:
Code: Select all
record Number of saved iteration records
survey Number of different time surveys
weight Number of interpolation weights
datum Observations counter, unlimited dimension
The NetCDF variables are:
Code: Select all
spherical Grid type logical switch (T/F)
Nobs(survey) Number of observations per time survey
survey_time(survey) Survey time (days)
obs_type(datum) State variable ID associated with observation
obs_time(datum) Time of observation (days)
obs_lon(datum) Longitude of observation (degrees_east)
obs_lat(datum) Latitude of observation (degrees_north)
obs_depth(datum) Depth of observation (meters or level)
obs_Xgrid(datum) X-grid observation location (nondimensional)
obs_Ygrid(datum) Y-grid observation location (nondimensional)
obs_Zgrid(datum) Z-grid observation location (nondimensional)
obs_error(datum) Observation error, assigned weight
obs_value(datum) Observation value
NLmodel_value(record,datum) Nonlinear model interpolated value
TLmodel_value(record,datum) Tangen linear model interpolated value
Hmat(weight,datum) Interpolation weights
Code: Select all
obs_type = 1 Free-surface
obs_type = 2 Vertically-integrated u-momentum component
obs_type = 3 Vertically-integrated v-momentum component
obs_type = 4 Total u-momentum component
obs_type = 5 Total v-momentum component
obs_type = 6 Potential temperature
obs_type = 7 Salinity
obs_type = ... Other passive tracers, NAT+1:NT
The obs_lon and obs_lat are not used in the model directly. However, they are used in the pre-processing software to compute the fractional grid coordinates (nondimensional): obs_Xgrid and obs_Ygrid. In orthogonal curvilinear applications, this fractional coordinates are computed via interpolation. The coordinate search for each observation datum is not trivial and very expensive to do it inside the model over and over during descent iterations. The utility to compute these fractional coordinates include the hindices, try_range, and inside routines which are part of the model. The depth of observations, obs_depth, can be specified as an actual depth (negative value) or a model level (positive values from 1:N).
The interpolation weights matrix, Hmat(1:8,iobs), is as follows:
Code: Select all
8____________7
/. /| (i2,j2,k2)
/ . / |
5/___________/6 |
| . | |
| . | | Grid Cell
| 4.........|..|3
| . | /
|. | /
(i1,j1,k1) |___________|/
1 2
Notice that the metadata model is generic. Several CDL file are provided to generate the observations NetCDF file:
Code: Select all
roms_2dobs.cdl 2D Cartesian applications
roms_2dobs_geo.cdl 2D spherical applications
roms_3dobs.cdl 3D Cartesian applications
roms_3dobs_geo.cdl 3D spherical applications
The above CDL files can downloaded from:
http://mwww.myroms.org/links/4dvar_cdl.tar.gz
Recall that a NetCDF file can be generated from a CDL file by simply typing:
ncgen -b roms_3dobs_geo.cdl
However, before doing so, edit the CDL file and provide the appropriate value for the survey dimension. This means that you need to know this value in advance. Then, any kind of software can be use to process the observation data and write it to the NetCDF file. I usually use Matlab and the NetCDF toolbox to read and write data very quickly with just few commands. The NetCDF toolbox for Matlab can be found at
http://woodshole.er.usgs.gov/operations ... excdf.html
Finally, the observations need to be processed using the following rules:
1) Need to know ahead of time how many assimilation cycles or survey times occur whitin the data set. That is, how many different observations times are available. This is not a big problem because its value is known when processing the observations. This value need to be entered in the survey dimension of the CDL file.
2) Count the observations available per survey time and write its value in Nobs(survey). Also write the associated survey time in survey_time(survey). These values are extremely important inside the model to process the appropriate data in each assimilation cycle.
3) The observations need to be sorted in ascending time order. It is also a good idea, but not necessary, to sort the observations according its state variable ID value (obs_type), so all similar data is processed together and sequentially.
Good luck,
Hernan G. Arango
arango@imcs.rutgers.edu