- Run create_obs_sequence to generate the type of observation (and observation error) desired.
- Run create_fixed_network_seq to define the temporal distribution of the desired observations.
- Run perfect_model_obs to advance the model from a known initial condition - and harvest the 'observations' (with error) from the (known) true state of the model.
- Run filter to assimilate the 'observations'. Since the true model state is known, it is possible to evaluate the performance of the assimilation.
- Decide what observations you want to investigate and edit the input.nml&obs_kind_nml block.
- Build and run preprocess to create code that supports the observations you want.
- Build and run create_obs_sequence to define the specifics about the observation you want.
- Build and run create_fixed_network_sequence to replicate those specifics through time.
- Build and run perfect_model_obs to create an observation consistent with the model state and specified error distribution at the requested times and locations.
- Section 1 [pdf] Filtering For a One Variable System.
- Section 2 [pdf] The DART Directory Tree.
- Section 3 [pdf] DART Runtime Control and Documentation.
- Section 4 [pdf] How should observations of a state variable impact an unobserved state variable? Multivariate assimilation.
- Section 5 [pdf] Comprehensive Filtering Theory: Non-Identity Observations and the Joint Phase Space.
- Section 6 [pdf] Other Updates for An Observed Variable.
- Section 7 [pdf] Some Additional Low-Order Models.
- Section 8 [pdf] Dealing with Sampling Error.
- Section 9 [pdf] More on Dealing with Error; Inflation.
- Section 10 [pdf] Regression and Non-linear Effects.
- Section 11 [pdf] Creating DART Executables.
- Section 12 [pdf] Adaptive Inflation.
- Section 13 [pdf] Hierarchical Group Filters and Localization.
- Section 14 [pdf] DART Observation Quality Control.
- Section 15 [pdf] DART Experiments: Control and Design.
- Section 16 [pdf] Diagnostic Output.
- Section 17 [pdf] Creating Observation Sequences.
- Section 18 [pdf] Lost in Phase Space: The Challenge of Not Knowing the Truth.
- Section 19 [pdf] DART-Compliant Models and Making Models Compliant.
- Section 20 [pdf] Model Parameter Estimation.
- Section 21 [pdf] Observation Types and Observing System Design.
- Section 22 [pdf] Parallel Algorithm Implementation.
- Carbon Tutorial [pdf] A Simple 1D Advection Model.
- Copy the template directory and files to your own DART model directory.
- Modify the model_mod.f90 file to return specifics about your model. This module MUST contain all the required interfaces (no surprise) but it can also contain many more interfaces as is convenient.
- [optional step] Modify the matlab routines to know about the specifics of the netCDF files produces by your model (sensible defaults, for the most part.)
- Modify shell_scripts/advance_model.csh to:
collect all the input files needed to advance the model into a
clean, temporary directory, convert the state vector file into
input to your model, run your model, and convert your model
output to the expected format for another assimilation by DART.
We have examples - some that use the following support routines.
- Create a routine or set of routines to take a DART array and create input files for your model. This is frequently done by a program called dart_to_model.f90, but you can do it any way you like. It is strongly suggested that you use the DART read mechanism for the restart file - namely assim_model_mod.f90:aread_state_restart()
- Modify the input to your model communicating the run-time
settings necessary to integrate your model from one time
to another
arbitrary time in the future. It may be convenient to do this in dart_to_model.f90. - Run the model (you may need to watch the MPI syntax)
- Create a routine or set of routines to take your model output files and create a DART restart file. This is frequently done by a program called model_to_dart.f90. It is strongly suggested that you use the DART write mechanism for the restart file - namely assim_model_mod.f90:awrite_state_restart()
- Modify shell_scripts/run_filter.csh to: do everything under the sun and then some
- Use explicit typing, do not throw the 'autopromote' flag on your compiler.
- Use the intent() attribute.
- Use the use, xxx_mod, only : bob, sally statements for routines from other modules. This really helps us track down things and ensures you're using what you think you're using.
- Use Fortran namelists for I/O if possible.
- Check out the existing parameters/routines in common/types_mod.f90, utilites/utilities_mod.f90, and time_manager/time_manager_mod.f90. You are free to use these and are encouraged to do so. No point reinventing the wheel and these routines have been tested extensively.
- the process number of the caller - could be the master task ID (zero) or (especially if async = 2) a process id that gets related to the copy. When multiple copies are being advanced simultaneously, each of the advances happens in its own run-time directory.
- the number of state copies belonging to that process
- the name of the (ASCII) filter_control_file for that process.
The filter_control file contains the following information
(one per line): the ensemble member, the name of the input file
(containing the DART state vector), and the name of the output file
from the model containing the new DART state vector. For example,
1
assim_model_state_ic.0001
assim_model_state_ud.0001
2
assim_model_state_ic.0002
assim_model_state_ud.0002
... - Collect all the input files needed to advance the model into a clean, temporary directory.
- Determine how many tasks you have, and how many ensemble members you have. Determine how many 'batches' of ensemble members must be done to advance all of them. With 20 tasks and 80 ensemble members, you will need to loop 4 times, for example. clean, temporary directory
- and loop over the following three steps - each loop advances one ensemble member
- convert the DART state vector file into input for your model,
- run your model, and
- convert your model output to the file with the expected format for another assimilation by DART.
- observation location/value plots
- localization value domain widget?
- namelist settings for damped adaptive spatially-varying group filter
The 'low-order' models supported in DART.ikedaThe Ikeda model is a 2D chaotic map useful for visualization data assimilation updating directly in state space. There are three parameters: a, b, and mu. The state is 2D, x = [X Y]. The equations are: X(i+1) = 1 + mu * ( X(i) * cos( t ) - Y(i) * sin( t ) ) Y(i+1) = mu * ( X(i) * sin( t ) + Y(i) * cos( t ) ), where t = a - b / ( X(i)**2 + Y(i)**2 + 1 ) Note the system is time-discrete already, meaning there is no delta_t. The system stems from nonlinear optics (Ikeda 1979, Optics Communications). Interface written by Greg Lawson. Thanks Greg! lorenz_63
This is the 3-variable model as described in:
Lorenz, E. N. 1963. Deterministic nonperiodic flow.
J. Atmos. Sci. 20, 130-141.
X' = -sigma*X + sigma*Y Y' = -XZ + rX - Y Z' = XY -bZ lorenz_84
This model is based on:
Lorenz E. N., 1984: Irregularity: A fundamental property of the atmosphere.
Tellus, 36A, 98-110.
X' = -Y^2 - Z^2 - aX + aF Y' = XY - bXZ - Y + G Z' = bXY + XZ - Z Where a, b, F, and G are the model parameters. 9varThis model provides interesting off-attractor transients that behave something like gravity waves. lorenz_96
This is the model we use to become familiar with new architectures, i.e.,
it is the one we use 'first'. It can be called as a subroutine or as a separate
executable. We can test this model both single-threaded and mpi-enabled.
... the authors introduce a model consisting of 40 ordinary differential equations, with the dependent variables representing values of some atmospheric quantity at 40 sites spaced equally about a latitude circle. The equations contain quadratic, linear, and constant terms representing advection, dissipation, and external forcing. Numerical integration indicates that small errors (differences between solutions) tend to double in about 2 days. Localized errors tend to spread eastward as they grow, encircling the globe after about 14 days. forced_lorenz_96The forced_lorenz_96 model implements the standard L96 equations except that the forcing term, F, is added to the state vector and is assigned an independent value at each gridpoint. The result is a model that is twice as big as the standard L96 model. The forcing can be allowed to vary in time or can be held fixed so that the model looks like the standard L96 but with a state vector that includes the constant forcing term. An option is also included to add random noise to the forcing terms as part of the time tendency computation which can help in assimilation performance. If the random noise option is turned off (see namelist) the time tendency of the forcing terms is 0. lorenz_96_2scaleThis is the Lorenz 96 2-scale model, documented in Lorenz (1995). It also has the option of the variant on the model from Smith (2001), which is invoked by setting local_y = .true. in the namelist. The time step, coupling, forcing, number of X variables, and the number of Ys per X are all specified in the namelist. Defaults are chosen depending on whether the Lorenz or Smith option is specified in the namelist. Lorenz is the default model. Interface written by Josh Hacker. Thanks Josh! lorenz_04The reference for these models is Lorenz, E.N., 2005: Designing
chaotic models. J. Atmos. Sci., 62, 1574-1587.
simple_advectionThis model is on a periodic one-dimensional domain. A wind field is modeled using Burger's Equation with an upstream semi-lagrangian differencing. This diffusive numerical scheme is stable and forcing is provided by adding in random gaussian noise to each wind grid variable independently at each timestep. An Eulerian option with centered-in-space differencing is also provided. The Eulerian differencing is both numerically unstable and subject to shock formation. However, it can sometimes be made stable in assimilation mode (see recent work by Majda and collaborators). [top] The 'high-order' models supported in DART.In roughly the order they were supported by DART. bgrid_soloThis is a dynamical core for B-grid dynamics using the Held-Suarez forcing. The resolution is configurable, and the entire model can be run as a subroutine. Status: supported. pe2lyrThis model is a 2-layer, isentropic, primitive equation model on a sphere. Status: orphaned. wrfThe Weather Research and Forecasting (WRF) Model is a next-generation mesoscale numerical weather prediction system designed to serve both operational forecasting and atmospheric research needs. More people are using DART with WRF than any other model. Note: The actual WRF code is not distributed with DART. Status: supported. camThe Community Atmosphere Model (CAM) is the latest in a series of global atmosphere models developed at NCAR for the weather and climate research communities. CAM also serves as the atmospheric component of the Community Climate System Model (CCSM). Status: supported. PBL_1dThe PBL model is a single column version of the WRF model. In this instance, the necessary portions of the WRF code are distributed with DART. Status: supported - but looking to be adopted. MITgcm_annulusThe MITgcm annulus model as configured for this application within DART is a non-hydrostatic, rigid lid, C-grid, primitive equation model utilizing a cylindrical coordinate system. For detailed information about the MITgcm, see http://mitgcm.org Status: orphaned - and looking to be adopted. roseThe rose model is for the stratosphere-mesosphere and was used by Tomoko Matsuo (now at CU-Boulder and NOAA) for research in the assimilation of observations of the Mesosphere Lower-Thermosphere (MLT). Note: the model code is not distributed with DART. Status: orphaned MITgcm_oceanThe MIT ocean GCM version 'checkpoint59a' is the foundation of this implementation. It was modified by Ibrahim Hoteit (then of Scripps) to accomodate the interfaces needed by DART. Status: supported - but looking to be adopted. am2The FMS AM2 model is GFDL's atmosphere-only code using observed sea surface temperatures, time-varying radiative forcings (including volcanos) and time-varying land cover type. This version of AM2 (also called AM2.1) uses the finite-volume dynamical core (Lin 2004). Robert Pincus (CIRES/NOAA ESRL PSD1) and Patrick Hoffman (NOAA) wrote the DART interface and are currently using the system for research. Note: the model code is not distributed with DART. Status: supported coampsThe DART interface was originally written and supported by Tim Whitcomb. The following model description is taken from the COAMPS overview web page: The Coupled Ocean/Atmosphere Mesoscale Prediction System (COAMPS) has been developed by the Marine Meteorology Division (MMD) of the Naval Research Laboratory (NRL). The atmospheric components of COAMPS, described below, are used operationally by the U.S. Navy for short-term numerical weather prediction for various regions around the world. Note: the model code is not distributed with DART. Status: supported POPThe Parallel Ocean Program (POP) comes in two variants. Los Alamos National Laboratory provides POP Version 2.0 which has been modified to run in the NCAR Community Climate System Model (CCSM) framework. As of November 2009, the CCSM-POP version is being run. The LANL-POP version is nearly supported - and some extensions useful for data assimilation in general have been proposed to LANL, who have agreed in principle to implement the changes. Fundamentally, the change is an additional restart option in which the first timestep after an assimilation is a Eulerian timestep (similar to a cold start). Note: the souce code for POP is not distributed with DART. Status: actively being developed [top] Downloadable datasets for DART.
The code distribution was getting 'cluttered' with datasets,
boundary conditions, intial conditions, ... large files that were not
necessarily interesting to all people who downloaded the DART code.
Worse, subversion makes a local hidden copy of the original repository
contents, so the penalty for being large is doubled.
It just made sense to make all the large files available on
as 'as-needed' basis.
[top] Creating initial conditions for DART
The idea is to generate an ensemble that has sufficient 'spread' to cover the range
of possible solutions. Insufficient spread can (and usually will) lead to poor
assimilations. Think 'filter divergence'.
Adding noise to a single model stateThis method works well for some models, and fails miserably for others. As it stands, DART supplies a routine that can add gaussian noise to every element of a state vector. This can cause some models to be numerically unstable. You can supply your own model_mod:pert_model_state() if you want a more sophisticated perturbation scheme. Using a collection of model states.The important thing to remember is that the high-order models all come
with routines to convert a single model restart file (or the equivalent) to
a DART initial conditions file.
CAM has trans_pv_sv,
WRF has wrf_to_dart,
POP has pop_to_dart, etc. DART has the ability to read
a single file that contains initial conditions for all the ensemble members,
or a series of restart files - one for each ensemble member. Simply collect your
ensemble of restart files from your model and convert each of them to a DART
initial conditions file of the form filter_ics.####
where #### represents a 4 digit ensemble member counter.
That is, for a 50-member ensemble, they should be named:
filter_ics.0001 ... filter_ics.0050
Initial conditions for the low-order models.In general, there are 'restart files' for the low-order models that already exist as work/filter_ics. If you need more ensemble members than are supplied by these files, you can generate your own by adding noise to a single perfect_ics file. Simply specify &filter_nml start_from_restart = .FALSE., restart_in_file_name = "perfect_ics", ens_size = [whatever you want] [top] 'perfect model' experiments or 'OSSE's.
All of the workshop and tutorial examples are 'perfect model' experiments.
The ability to compare against 'the truth' is great for exploring what does
and doesn't work during experimentation.
Use DART to run a 'perfect model' experiment.
Once a model is compatible with the DART facility, all of the
functionality of DART is available. This includes 'perfect model'
experiments (also called Observing System Simulation Experiments - OSSEs).
Essentially, the model is run forward from some state and, at predefined times,
the observation forward operator is applied to the model state to harvest
synthetic observations. This model trajectory is known as the 'true state'.
The synthetic observations are then used in an
assimilation experiment. The assimilation performance can then be evaluated
precisely because the true state (of the model) is known.
An OSSE is explored in our Lorenz '96 example.
[top] Configuring Matlab® to work for DART
Matlab® R2008b is the first version to have native netCDF support,
with its own syntax that would require a total rewrite of the DART interfaces
that would then be incompatible with older versions of Matlab®.
addpath('replace_this_with_the_real_path_to/DART/matlab')
addpath('replace_this_with_the_real_path_to/DART/diagnostics/matlab')
addpath('some_netcdf_install_dir/snctools')
addpath('some_netcdf_install_dir/mexnc','-BEGIN')
addpath('some_netcdf_install_dir/netcdf_toolbox/netcdf')
addpath('some_netcdf_install_dir/netcdf_toolbox/netcdf/nctype')
addpath('some_netcdf_install_dir/netcdf_toolbox/netcdf/ncutility')
addpath('some_CSIRO_install_dir/matlab_netCDF_OPeNDAP')
which is precisely why I'm trying to shorten it. On my systems, I've bundled the first 4 commands into a function called ~/matlab/startup.m which is automatically run every time I start Matlab. [top] An overview of the DART 'preprocess' program
First and foremost, check out the
DART/preprocess/preprocess.html document
for detailed information.
\rm -f ../../../obs_def/obs_def_mod.f90
\rm -f ../../../obs_kind/obs_kind_mod.f90 ./preprocess ls -l ../../../obs_def/obs_def_mod.f90 ls -l ../../../obs_kind/obs_kind_mod.f90 For example, with a namelist that looks like:
&preprocess_nml
input_obs_kind_mod_file = '../../../obs_kind/DEFAULT_obs_kind_mod.F90',
output_obs_kind_mod_file = '../../../obs_kind/obs_kind_mod.f90',
input_obs_def_mod_file = '../../../obs_def/DEFAULT_obs_def_mod.F90',
output_obs_def_mod_file = '../../../obs_def/obs_def_mod.f90',
input_files = '../../../obs_def/obs_def_gps_mod.f90',
'../../../obs_def/obs_def_QuikSCAT_mod.f90',
'../../../obs_def/obs_def_GWD_mod.f90',
'../../../obs_def/obs_def_altimeter_mod.f90',
'../../../obs_def/obs_def_reanalysis_bufr_mod.f90'
/
preprocess will combine DEFAULT_obs_def_mod.F90, obs_def_gps_mod.f90, obs_def_QuikSCAT_mod.f90, obs_def_GWD_mod.f90, obs_def_altimeter_mod.f90, and obs_def_reanalysis_bufr_mod.f90, into obs_def_mod.f90 - which can be used by the rest of the project. Building and Running 'preprocess'
preprocess is an executable, so it should come as
no surprise that it must be built in the normal DART fashion. The
DART/mkmf/mkmf.template must be correct for your
environment, and the input.nml must have your desired
preprocess_nml set correctly. Given that ...
csh mkmf_preprocess
make ./preprocess will build and run preprocess. The first command generates an appropriate Makefile and the input.nml.preprocess_default file. The second command results in the compilation of a series of Fortran90 modules which ultimately produces an executable file: preprocess. The third command actually runs preprocess - which builds the new obs_kind_mod.f90 and obs_def_mod.f90 source code files. The rest of DART may now be built. A little background for 'preprocess'IMPORTANT: Since each 'observation kind' may require different amounts of metadata to be read or written; any routine to read or write an observation sequence must be compiled with support for those particular observations. The supported observations are listed in the input.nml&obs_kind_nml block. This is the whole point of the 'preprocess' process ... [top] An overview of the observation sequence
Observation sequences are complicated, there's just no better
way to describe it. Trying to automatically accomodate a myriad
of observation file formats, structure, and metadata is simply not
an easy task. For this reason, DART has its own format for observations
and a set of programs to convert observations from their original formats
to DART's format. There are definitely some things to know ...
observation sequence file structure[top] Creating observations and sequences.
It is strongly encouraged that you use a single observation to test
a new model implementation.
Creating a synthetic observation sequence.There are several steps to create an observation sequence file, which follows directly from the modular nature of the DART programming philosophy. Example: generating observations for the Lorenz '63 model.1) There are no 'real' observations for the Lorenz '63 model, so the appropriate namelist settings are:
&obs_kind_nml
assimilate_these_obs_types = 'RAW_STATE_VARIABLE' / &preprocess_nml input_obs_def_mod_file = '../../../obs_def/DEFAULT_obs_def_mod.F90', output_obs_def_mod_file = '../../../obs_def/obs_def_mod.f90', input_obs_kind_mod_file = '../../../obs_kind/DEFAULT_obs_kind_mod.F90', output_obs_kind_mod_file = '../../../obs_kind/obs_kind_mod.f90', input_files = '../../../obs_def/obs_def_1d_state_mod.f90' / 2) Run preprocess in the normal fashion.
3) create_obs_sequence
creates an observation set definition
(typically named set_def.out),
the time-independent part of an observation sequence. It may help
to think of it as trying to define what sorts of observations will
be taken at one 'reading' ... you walk out to the box and take
temperature, humidity, and wind observations all at the same time
and place, for example. You can think of it as one page in an observer's notebook,
and only contains the location, type,
and observational error characteristics
(normally just the diagonal observational error variance)
for a related set of observations. There are no actual observation values,
nor are there any times associated with the definition. The program
is interactive and queries the user for the information it needs.
Begin by creating a minimal observation set definition
in which each of the 3 state variables of L63 is directly observed
with an observational error variance of 1.0 for each observation.
To do this, use the following input sequence
(the text including and after # is a comment and does
not need to be entered):
[unixprompt]$ ./create_obs_sequence
Starting program create_obs_sequence
Initializing the utilities module.
Trying to log to unit 10
Trying to open file dart_log.out
Registering module :
$url: http://squish/DART/trunk/utilities/utilities_mod.f90 $
{ ... }
Input upper bound on number of observations in sequence
4
Input number of copies of data (0 for just a definition)
0
Input number of quality control values per field (0 or greater)
0
input a -1 if there are no more obs
0
Registering module :
$url: http://squish/DART/trunk/obs_def/DEFAULT_obs_def_mod.F90 $
{ ... }
initialize_module obs_kind_nml values are
-------------- ASSIMILATE_THESE_OBS_TYPES --------------
RAW_STATE_VARIABLE
-------------- EVALUATE_THESE_OBS_TYPES --------------
------------------------------------------------------
Input -1 * state variable index for identity observations
OR input the name of the observation kind from table below:
OR input the integer index, BUT see documentation...
1 RAW_STATE_VARIABLE
-1
input time in days and seconds
0 0
Input error variance for this observation definition
1.0
input a -1 if there are no more obs
0
{ this gets repeated ... until you tell it to stop ... }
input a -1 if there are no more obs
-1
Input filename for sequence ( set_def.out usually works well)
set_def.out
write_obs_seq opening formatted file set_def.out
write_obs_seq closed file set_def.out
Rest assured that if you requested to assimilate more realistic observation types, you will be queried for appropriate information by create_obs_sequence. Below is a table that explains all of the input you should need to supply for observations of the L63 model state.
4) create_fixed_network_sequence takes the observation set definition and repeats it in time, essentially making multiple pages in our notebook. Again, the program is interactive and queries the user for information. You should be able to simply follow the prompts. The table below represents the input needed for the L63 example:
5) perfect_model_obs advances the model from the state
defined by the initial conditions file specified in the
input.nml and 'applies the forward operator' to harvest
observations to fill in the observation sequence specified in
obs_seq.in. The observation sequence finally has
values for the observations and is saved in a file generally named
obs_seq.out.
perfect_model_obs is namelist-driven, as opposed to
the previous two (whose input is a lot harder to specify in a namelist).
Take a look at (and modify if you like) the
input.nml&perfect_model_obs_nml
section of the namelist.
[top] Real Observations - Converting to a DART-compatible format.
Real observations come in a mind-boggling diversity of formats.
We have converters for some formats in the
DART/observations directory. Many of the
formats require their own libraries (like HDF), and require intimate
knowledge of the data format to extract the portions required for the
DART observation sequence file.
Please feel free to browse the converters and their companion documentation.
Feel free to donate converters for formats we don't already support!
We like that kind of stuff.
[top] Manipulating observation sequences.
First and foremost, check out the
DART/obs_sequence/obs_sequence_tool.html
document for detailed information and examples.
[top] The difference between observation TYPE and observation KIND.
Broadly speaking, observation TYPES are specific instances of a
generic observation KIND. The distinction is useful for several reasons,
not the least of which is to evaluate observation platforms.
Zonal wind observations from QuikSCAT vs. radiosondes, for example.
They are both observations of zonal winds (what we call KIND_U_WIND_COMPONENT),
but they are different observation TYPES; QKSWND_U_WIND_COMPONENT,
and RADIOSONDE_U_WIND_COMPONENT, respectively.
The forward observation operators are implemented based on observation KIND.
When requested, the model generates a KIND_U_WIND_COMPONENT,
it doesn't need to know that it will be compared to a QuikSCAT value
or a radiosonde value.
Adding support for a new observation TYPE.DART/obs_def/obs_def_mod.html is the source for detailed information. [top] The Data Assimilation Research Testbed - DART Tutorial
DART comes with an extensive set of tutorial materials,
working models of several different levels of complexity, and data to
be assimilated. It has been used in several multi-day workshops and
can be used as the basis to teach a section on Data Assimilation.
Download the DART software distribution and look in the
Taking the tutorial is FAR better! [top] Adding a model to DART - Overview
DART is designed to work with many models without
modifications to the DART routines or the model source code.
DART can 'wrap around' your model in two ways.
One can be used if your model can be called as a subroutine, the
other is for models that are separate executables. Either way,
there are some steps that are common to both paths.
The basic steps to include your model in DART
If your model is not subroutine-callable, there is extra work to be done. There are several examples to raid, but it helps to know which existing model has a strategy that is most similar to yours. More on that later. If a single instance of your model needs to advance using all the MPI tasks, there is one more script that needs to work - run_filter.csh. Test ...Generally, it is a good strategy to use DART to create a synthetic observation sequence with ONE observation location - and ONE observation type - for several assimilation periods. With that, it is possible to run perfect_model_obs and then filter without having to debug too much stuff at once. A separate document will address how to test your model with DART. Programming style#1 Don't shoot the messenger. We have a lot of experience trying to write portable/reproducible code and offer these suggestions. All of these suggestions are for the standalone DART components. We are not asking you to rewrite your model. If your model is a separate executable, leaving it untouched is fine. Writing portable code for the DART components will allow us to include your model in the nightly builds and reduces the risk of us making changes that adversely affect the integration with your model. There are some routines that have to play with the core DART routines, these are the ones we are asking you to write using these few simple guidelines.
character(len=8) :: crdate integer, dimension(8) :: values ... real(r4) :: a,b real(r8) :: bob integer :: istatus, itype ... real(r8), intent(in) :: x(:) type(location_type), intent(in) :: location integer, intent(in) :: itype integer, intent(out) :: istatus real(r8), intent(out) :: obs_val depending on the use. The r4 and r8 types are explicitly defined in DART/common/types_mod.f90 to accurately represent what we have come to expect from 32bit and 64bit floating point real variables, respectively. If you like, you can redefine r8 to be the same as r4 to shrink your memory requirement. The people who run with WRF frequently do this. Do not redefine the digits12 parameter, that one must provide 64bit precision, and is used in precious few places. Adding a model to DART - SpecificsIf your model is a separate executable, there is some flexibility to provide the required interfaces and it would be wise to look at the heavily commented template script DART/models/templates/shell_scripts/advance_model.csh and then a few higher-order models to see how they do it. Become familiar with DART/doc/html/mpi_intro.html (DART's use of MPI), DART/doc/html/filter_async_modes.html, and the filter namelist parameter async in filter.html. 1. Copying the template directory
A little explanation/motivation is warranted. If the model uses the
standard layout, it is much easier to include the model in the nightly
builds and testing. For this reason alone, please try to use the
recommended directory layout. Simply looking at the
DART/models directory should give you a pretty
good idea of how things should be laid out. Copy the
template directory and its contents.
It is best to remove the (hidden) subversion files to keep the
directory 'clean'. The point of copying this directory is to get
a model_mod.f90 that works as-is and you can
modify/debug the routines one at a time.
~/DART/models % cp -r template mymodel ~/DART/models % find mymodel -name .svn -print mymodel/.svn mymodel/shell_scripts/.svn mymodel/work/.svn ~/DART/models % rm -rf `find mymodel -name .svn -print` ~/DART/models % find mymodel -name .svn -print ~/DART/models % The destination directory (your model directory) should be in the DART/models directory to keep life simple. Moving them around will cause problems for the work/mkmf_ Now, you must change all the work/path_names_ 2. model_mod.f90
We have templates, examples, and a document describing the required interfaces
in the DART code tree -
DART/models/model_mod.html.
Every(?) user-visible DART program/module has a matching piece of
documentation that is distributed along with the code.
The DART code tree always has the most current documentation.
Required Interfaces in model_mod.f90
No matter the complexity of the model, the DART software requires
a few interface routines in a model-specific Fortran90 module
model_mod.f90 file. The
models/template/model_mod.f90 file
has extended comment blocks at the heads of each of these routines
that go into much more detail for what is to be provided.
You cannot change the types or number of required arguments
to any of the required interface routines. You can add
optional arguments, but you cannot go back throught the DART tree to
change the gazillion calls to the mandatory routines. It is absolutely
appropriate to look at existing models to get ideas about how to
implement the interfaces. Finding a model implementation that is
functionally close to yours always helps.
3. providing matlab supportSince this is an optional step, it will be covered in a separate document. If your model is subroutine-callable - you're done!The Big Picture for models advanced as separate executables.
The normal sequence of events is that DART reads in its own restart file
(do not worry about where this comes from right now) and eventually
determines it needs to advance the model. DART needs to be able to
take its internal representation of each model state vector, the
valid time of that state, and the amount of time to advance the state -
and communicate that to the model. When the model has advanced the state
to the requested time, the output must be ingested by DART and the cycle
begins again. DART is entirely responsible for reading the observations
and there are several programs for creating and manipulating the observation
sequence files.
4. advance_model.cshThis script is invoked in one of two ways: 1) if filter uses a system() call, or 2) if run_filter.csh makes the call. Either way there are three arguments. async = 2 ... advancing many copies at the same timeModify shell_scripts/advance_model.csh to: async = 4 ... advancing each copy one at a timeIn addition to modifying shell_scripts/advance_model.csh as described above, you must also modify shell_scripts/run_filter.csh in the following way: THIS PART NEEDS TO BE FILLED IN 5. Converting DART output to input for your model.
After DART has assimilated the observations and created new (posterior)
states, it is necessary to reformat those posteriors into input for the
model. Fundamentally, you are unpacking the DART state vector and putting
the pieces back into whatever portion of your model initial conditions file
is appropriate. Frequently this is done by a program called
dart_to_model.f90.
6. Modify the start/stop control of your model run.
Create a routine or set of routines to modify the input to
your model communicating the run-time settings necessary
to integrate your model from one time to another 7. Convert your model output to DART input.After your model has advanced its states to the target time, it is necessary to convey the new state information to DART. The preferred name for this is dart_to_model.f90. This is fundamentally the inverse of model_to_dart.f90. Rip out the bits of the state vector you want to paste into a vector for DART, prepend the valid_time in the approved DART format and you're good to go. If you pack the bits into a DART state vector, there are native DART routines to write out the state vector. This ensures that DART will be able to read what you've written, and insulates you from having to worry about any internal file format changes we might make. [top] Adding Matlab® support for your own model - under construction.
Only needed for state-space diagnostics. [top] Testing Strategies - under construction
Check the converter programs. [top] Was the Assimilation Effective? - under construction
OK - so it didn't blow up ... what now? [top] non-Matlab® diagnostics - under construction.
get the ncl stuff from David Dowell. [top] DART observation-space diagnostics.
It is required to post-process the obs_seq.final file(s) with
obs_diag to generate a netCDF file containing accumulated
diagnostics for specified regions, etc. Since the experiment
information (assimilation interval, assimilating model, etc.) are not recorded in the
obs_seq.final file,
the obs_diag_nml
namelist has a section that allows specification of the necessary quantities.
The observation-space functions are in the DART/diagnostics/matlab directory. Once you have processed the obs_seq.final files into a single obs_diag_output.nc, you can use that as input to the following plotting routines:
[coming soon] Demo plotting locations, etc, verifying obs sequences ... [top] DART state-space diagnostics.
There are a set of Matlab® functions to help explore the assimilation
performance in state-space, which is very useful for OSSE's (i.e. when you
know the true model state). The general guideline here is that anything
that computes an 'error' requires the truth. There are some functions that
work without a true state.
[top] non-Matlab® diagnostics - under construction.
get the ncl stuff from David Dowell. [top] Examples - under construction[top] Customizing DART - under construction.
Modify the code to your heart's content. [top] Adding your efforts to DART.Please let us know if you have suggestions or code to contribute to DART. We're a small group, but we are willing to listen and will make every endeavor to incorporate improvements to the code. Email us at dart@ucar.edu. [top] Assimilation Algorithms employed in DART - under construction.
explain namelist settings for EAKF, EnKF, particle filter, ... [top] namelists - under constructionexplain that one namelist can 'do it all', what parts of the namelist are 'important' ... maybe a namelist with links to the relevant documentation ... [top] |

