Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
913 changes: 0 additions & 913 deletions CHANGELOG

This file was deleted.

896 changes: 896 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion COPYRIGHT.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

![DARTlogo](documentation/images/Dartboard7.png "DART Logo")
![DARTlogo](docs/images/Dartboard7.png "DART Logo")

Copyright 2019 University Corporation for Atmospheric Research

Expand Down
21 changes: 9 additions & 12 deletions assimilation_code/modules/observations/DEFAULT_obs_kind_mod.F90
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
! 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
!
! $Id$

!----------------------------------------------------------------------
! WARNING!! The file obs_kind_mod.f90 is AUTOGENERATED by the
Expand Down Expand Up @@ -489,10 +487,13 @@ module obs_kind_mod
QTY_ION_O_MIXING_RATIO = 365, &
QTY_ATOMIC_H_MIXING_RATIO = 366

integer, parameter, public :: &
QTY_ABSOLUTE_HUMIDITY = 367

! max_defined_quantities is private to this module. see comment below near the max_obs_specific
! declaration for more info about publics and private values.

integer, parameter :: max_defined_quantities = 366
integer, parameter :: max_defined_quantities = 367

!----------------------------------------------------------------------------
! This list is autogenerated by the 'preprocess' program. To add new
Expand All @@ -510,10 +511,9 @@ module obs_kind_mod
!----------------------------------------------------------------------------

! version controlled file description for error handling, do not edit
character(len=*), parameter :: source = &
"$URL$"
character(len=*), parameter :: revision = "$Revision$"
character(len=*), parameter :: revdate = "$Date$"
character(len=*), parameter :: source = 'DEFAULT_obs_def_mod.F90'
character(len=*), parameter :: revision = ''
character(len=*), parameter :: revdate = ''

logical, save :: module_initialized = .false.

Expand Down Expand Up @@ -918,6 +918,8 @@ subroutine initialize_module
obs_kind_names(365) = obs_kind_type(QTY_ION_O_MIXING_RATIO, 'QTY_ION_O_MIXING_RATIO')
obs_kind_names(366) = obs_kind_type(QTY_ATOMIC_H_MIXING_RATIO, 'QTY_ATOMIC_H_MIXING_RATIO')

obs_kind_names(367) = obs_kind_type(QTY_ABSOLUTE_HUMIDITY, 'QTY_ABSOLUTE_HUMIDITY')

! count here, then output below

num_kind_assimilate = 0
Expand Down Expand Up @@ -1487,8 +1489,3 @@ end function get_type_of_obs_from_menu

end module obs_kind_mod

! <next few lines under version control, do not edit>
! $URL$
! $Id$
! $Revision$
! $Date$
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <H2>Overview</H2>
These routines are commonly used in conversion programs which read
observation data from various formats and create a DART observation
sequence in memory, and then write it out to a file. See the
<a href="../../../observations/obs_converters/observations.html">observations</a>
<a href="../../../observations/obs_converters/README.md">observations</a>
directory for examples of programs which create and manipulate
observations using this routines.
</P>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <H2>Overview</H2>
or shorter sequences of observations (although there is no limit on
the number of observations). For creating observation sequence files
directly from large, real-world observation datasets, see the
<a href="../../../observations/obs_converters/observations.html">observations</a> directory.
<a href="../../../observations/obs_converters/README.md">observations</a> directory.
</P>

<P>
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/Models.md
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ There are lots of ways to define an observation sequence that DART can
use as input for a perfect model experiment. If you have observations in
DART format already, you can simply use them. If you have observations
in one of the formats already supported by the DART converters
(check [DART/observations/obs_converters/observations.html](obs_converters_observations.html)),
(check [DART/observations/obs_converters/README.md](obs_converters/README.md)),
convert it to a DART observation sequence. You may need to use the
[obs_sequence_tool](../../assimilation_code/programs/obs_sequence_tool/obs_sequence_tool.html)
to combine multiple observation sequence files into observation sequence
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/Observations.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ the model consistent with those observations - the true state:

Real observations come in a mind-boggling diversity of formats. We have
converters for many formats in the `DART/observations/obs_converters`
directory. The documentation for that directory is listed in
[observations.html](Manhattan/observations/obs_converters/observations.html).
directory. The documentation for that directory is listed in the
[README.md](../../observations/obs_converters/README.md).

The converters are designed to work on one input file format and create
(or add to) an output observation sequence. It may be desirable to
Expand Down
5 changes: 5 additions & 0 deletions models/FESOM/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

<span id="TOP" class="anchor"></span>

![DARTlogo](https://github.com/NCAR/DART/blob/Manhattan/docs/images/Dartboard7.png)

## **Finite Element Sea-ice Ocean Model (FESOM)**

FESOM is an unstructured mesh global ocean model using finite element methods to solve the
Expand Down
5 changes: 5 additions & 0 deletions models/FESOM/diagnostics/script/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

<span id="TOP" class="anchor"></span>

![DARTlogo](https://github.com/NCAR/DART/blob/Manhattan/docs/images/Dartboard7.png)

### Further description of the scripts

Scripts call a fortran tool to post-process the FESOM and DART outputs. They include a **tool** variable
Expand Down
73 changes: 40 additions & 33 deletions models/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
title: Adding a new model to DART
layout: default
---

<span id="TOP" class="anchor"></span>

![DARTlogo](https://github.com/NCAR/DART/blob/Manhattan/docs/images/Dartboard7.png)

## This document is really quite out-of-date. TJH 22 Apr 2020

## Hints for porting a new model to DART:

Expand All @@ -23,6 +25,7 @@ to use the name of the directory for your model.
try ./quickbuild.csh and everything should compile at this point.

the required subroutines are these:
```
public :: get_model_size, &
adv_1step, &
get_state_meta_data, &
Expand All @@ -39,48 +42,49 @@ public :: get_model_size, &
get_close_obs_init, &
get_close_obs, &
ens_mean_for_model
```

in addition, model_mod can contain subroutines that are used
for other utility programs and we recommend at least the following
routines be added to model_mod.f90:

routines be added to `model_mod.f90`:
```
public :: model_file_to_dart_vector, & ! converter
dart_vector_to_model_file, & ! converter
get_gridsize, & ! called by everyone
get_model_filename, & ! called by both (set_model_filename?)
get_state_time, & ! model_to_sv, static_init_model
set_state_time !(?) ! sv_to_model, trans_time

```

edit the model mod and fill in the routines in this order:

1. static_init_model() - make it read in the grid information
1. `static_init_model()` - make it read in the grid information
and the number of variables that will be in the state vector
(fill in the progvar derived type). fill in the model_size
variable. as part of this work, fill in the get_gridsize()
variable. as part of this work, fill in the `get_gridsize()`
code.

after number 1 is done, get_model_size() and
get_model_time_step() from the template should be ok as-is.
after number 1 is done, `get_model_size()` and
`get_model_time_step()` from the template should be ok as-is.

2. model_file_to_dart_vector() - given a model data file, read in
the fields and put them into the 1D DART state vector. make
sure the order and values match the progvar array.

3. dart_vector_to_model_file() - do the reverse of the previous step.

4. get_state_meta_data() - given an index number into the state vector
4. `get_state_meta_data()` - given an index number into the state vector
return the location and type. the code which loops over the
progvar should already do the type, but code to compute what
lon, lat, and vertical (for a 3d model) or x location (1d)
corresponds to this item must be written.

5. model_interpolate() - given a location (lon/lat/vert in 3d, x in 1d)
5. `model_interpolate()` - given a location (lon/lat/vert in 3d, x in 1d)
and a state QTY_xxx kind, return the interpolated value the field
has at that location. this is probably one of the routines that
will take the most code to write.

6. nc_write_model_atts(), nc_write_model_vars() - when filter runs
6. `nc_write_model_atts(), nc_write_model_vars()` - when `filter` runs
it calls these routines to output model data into a netcdf diagnostic
file which is unrelated to the model data files. it is possible to
have the ensemble data just be dumped as a single 1D vector but
Expand All @@ -91,47 +95,55 @@ edit the model mod and fill in the routines in this order:
then optionally some or all of the individual ensemble members.

for now, ignore these routines:
```
get_close_maxdist_init()
get_close_obs_init()
get_close_obs()
ens_mean_for_model()
end_model()
```

if you have data in a dart initial condition/restart file, then you
can ignore these routines:
```
init_time()
init_conditions()
```
otherwise, have them return an initial time and an initial default
ensemble state.

if your model is NOT subroutine callable, you can ignore this routine:
```
adv_1step()
```
otherwise have it call the interface to your model and add the files
necessary to build your model to all the work/path_names_* files.
necessary to build your model to all the `work/path_names_*` files.
add the model source to a src/ directory.

if you want to let filter add gaussian noise to a single state vector
to generate an ensemble, you can ignore this routine
```
pert_model_state()
```
otherwise fill in code that does whatever perturbation makes sense
to have an initial ensemble of states. in some cases that means
adding a different range of values to each different field in the
state vector.

at this point you should have enough code to test and run simple
experiments. the 'model_mod_check' utility program can be used
experiments. the `model_mod_check` utility program can be used
during this process to check your implementation.


the general flow is:

1) ./model_to_dart - read model data and convert it into a dart state vector file
2) ./create_obs_sequence - make a file with a single observation in it
3) ./perfect_model_obs - should interpolate a value for the obs
4) ./dart_to_model - convert the dart vector back into a model data file
1) `./model_to_dart` - read model data and convert it into a dart state vector file
2) `./create_obs_sequence` - make a file with a single observation in it
3) `./perfect_model_obs` - should interpolate a value for the obs
4) `./dart_to_model` - convert the dart vector back into a model data file

5) generate an ensemble of states, or set 'start_from_restart' to .false.
6) run ./filter with the single observation
6) run `./filter` with the single observation
7) look at the preassim.nc and analysis.nc files
diff them with ncdiff: ncdiff analysis.nc preassim.nc Innov.nc
plot it, with ncview if possible: ncview Innov.nc
Expand All @@ -140,7 +152,7 @@ the general flow is:

more details on each of these 7 steps follows.

1) model_to_dart
### 1) model_to_dart
this program needs to read the output file from the model,
whatever format that is (many of our supported models use netcdf).
it needs to create a 1d array of values in whatever order it chooses.
Expand All @@ -150,7 +162,7 @@ that corresponds so, so the mapping from 2d or 3d array to this 1d array
has to be kept track of in the model_mod code so it can be inverted
on demand.

2) create_obs_sequence
### 2) create_obs_sequence
you can make a synthetic observation (or a series of them) with this
interactive program and use them for testing. before running, make sure
the observation types you want to use are in the input.nml file in the
Expand All @@ -175,7 +187,7 @@ a single synthetic obs, this will do.
for an output filename, it suggests 'seq_def.out' but in this case,
tell it 'obs_seq.in'.

3) perfect_model_obs
### 3) perfect_model_obs
if you have run the model_to_dart and created a state vector, make sure
the name matches the input name in the input.nml file, the &perfect_model_obs_nml
namelist. make sure the input obs_sequence is still set to 'obs_seq.in'.
Expand All @@ -186,15 +198,15 @@ in the input.nml file. the sequence files will be short and in ascii.
you can check to see what the interpolated value is. if it's right, yay.
if not, debug the interpolation code in the model_mod.f90 file.

4) dart_to_model
### 4) dart_to_model
if you have run perfect_model_obs, you have not changed the dart
state vector in any way. however, it's a good test to make a copy of
the model input file, then run 'model_to_dart' and then 'dart_to_model'
(you may need to set 'is_model_advance_file' to .false. for the
&dart_to_model_nml namelist) and you should get identical values back
in the model input file as you started with.

5) running from a single input state
### 5) running from a single input state
in the &filter_nml namelist, set 'start_from_restart' to .false.
this tells filter that you have not generated N initial conditions,
that you are only going to supply one and it needs to perturb that
Expand All @@ -208,15 +220,15 @@ you may need to set the &ensemble_manager_nml : perturbation_amplitude
down to something smaller than 0.2 for these tests - 0.00001 is a good
first guess for adding small perturbations to a state.

6) filter
### 6) filter
set the ens_size to something small for testing - between 4 and 10 is
usually a good range. make sure your observation type is in the
'assimilate_these_obs_types' list and not in the evaluate list.
run filter. find bugs and fix them until the output 'obs_seq.final'
seems to have reasonable values. running filter will generate two
netcdf diagnostic files: preassim.nc and analysis.nc

7) diagnostics
### 7) diagnostics
run 'ncdiff analysis.nc preassim.nc differences.nc' and use
your favorite netcdf plotting tool to see if there are any differences
between the 2 files. for modules using a regular lat/lon grid 'ncview'
Expand All @@ -233,8 +245,3 @@ code. if it doesn't have a reasonable value, look at your model_interpolate() c
there's lots more to say about this, but this is a quick pointer to
how to get started.


# <next few lines under version control, do not edit>
# $URL$
# $Revision$
# $Date$
Loading