Contact: | Jeff Anderson, Tim Hoar |
Revision: | $Revision: 2801 $ |
Source: | $URL: http://subversion.ucar.edu/DAReS/DART/trunk/models/ikeda/model_mod.html $ |
Change Date: | $Date: 2007-04-04 22:11:48 -0600 (Wed, 04 Apr 2007) $ |
Change history: | try "svn log" or "svn diff" |
DART interface module for the Ikeda model. The 17 public interfaces are standardized for all DART compliant models. These interfaces allow DART to advance the model, get the model state and metadata describing this state, find state variables that are close to a given location, and do spatial interpolation for model state variables.
The 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, CalTech. Thanks Greg!
types_mod time_manager_mod oned/location_mod utilities_mod
The namelist interface &model_nml is read from the file input.nml.
integer :: get_model_size
Returns the length of the model state vector as an integer. This is fixed at 2 for this model.
real(r8), dimension(:), intent(inout) :: x type(time_type), intent(in) :: time
Advances a model for a single time step.
x | State vector of length model_size. |
time | Unused in this model. |
integer, intent(in) :: index_in type(location_type), intent(out) :: location integer, optional, intent(out) :: var_type
Returns the location of the given index, and a dummy integer as the var_type.
index_in | Index into the long state vector. |
location | Returns location of indexed state variable. The location should use a location_mod that is appropriate for the model domain. For realistic atmospheric models, for instance, a three-dimensional spherical location module that can represent height in a variety of ways is provided. |
var_type | Returns the type of the indexed state variable as an optional argument. |
real(r8), dimension(:), intent(in) :: x type(location_type), intent(in) :: location integer, intent(in) :: itype real(r8) :: var real(r8), intent(out) :: obs_val integer, intent(out) :: istatus
A NULL INTERFACE in this model. Always returns istatus = 0.
x | Model state vector. |
location | Location to which to interpolate. |
itype | Integer indexing which type of state variable is to be interpolated. Can be ignored for low order models with a single type of variable. |
obs_val | The value of the observation from the model. |
istatus | Quality control information about the observation of the model state. |
type(time_type) :: get_model_time_step
Returns the models base time step, or forecast length, as a time_type. This is settable in the namelist.
A NULL INTERFACE in this model.
Reads the namelist, defines the 2 initial locations of the state variables, and sets the timestep.
type(time_type), intent(out) :: time
Returns a time of 0.
real(r8), dimension(:), intent(out) :: x
Sets 2 initial locations close to the attractor.
x | Model state vector. |
integer, :: nc_write_model_atts integer, intent(in) :: ncFileId
Uses the default template code.
ncFileId | Integer file descriptor opened to NetCDF file. |
ierr | Returned error code. |
integer :: nc_write_model_vars integer, intent(in) :: ncFileID real(r8), dimension(:), intent(in) :: statevec integer, intent(in) :: copyindex integer, intent(in) :: timeindex
Uses the default template code.
ncFileID | Integer file descriptor opened to NetCDF file. |
statevec | State vector. |
copyindex | Integer index to which copy is to be written. |
timeindex | Integer index of which time in the file is being written. |
ierr | Returned error code. |
real(r8), dimension(:), intent(in) :: state real(r8), dimension(:), intent(out) :: pert_state logical, intent(out) :: interf_provided
Given a model state, produces a perturbed model state. This model does not implement an interface for this and so returns .false. for interf_provided.
state | State vector to be perturbed |
pert_state | Perturbed state vector is returned |
interf_provided | Returns false to have DART perturb state |
type(get_close_type), intent(inout) :: gc real(r8), intent(in) :: maxdist
Pass-through to the 1-D locations module. See get_close_maxdist_init() for the documentation of this subroutine.
type(get_close_type), intent(inout) :: gc integer, intent(in) :: num type(location_type), intent(in) :: obs(num)
Pass-through to the 1-D locations module. See get_close_obs_init() for the documentation of this subroutine.
type(get_close_type), intent(in) :: gc type(location_type), intent(in) :: base_obs_loc integer, intent(in) :: base_obs_kind type(location_type), intent(in) :: obs(:) integer, intent(in) :: obs_kind(:) integer, intent(out) :: num_close integer, intent(out) :: close_ind(:) real(r8), optional, intent(out) :: dist(:)
Pass-through to the 1-D locations module. See get_close_obs() for the documentation of this subroutine.
real(r8), dimension(:), intent(in) :: ens_mean
A NULL INTERFACE in this model.
ens_mean | Ensemble mean state vector |
We adhere to the F90 standard of starting a namelist with an ampersand '&' and terminating with a slash '/'.
namelist / model_nml / & a, b, mu, time_step_days, time_step_seconds, output_state_vector
This namelist is read in a file called input.nml
Contents | Type | Description |
---|---|---|
a | real(r8) | Default is 0.40_r8. |
b | real(r8) | Default is 6.00_r8. |
mu | real(r8) | Default is 0.83_r8. |
time_step_days | integer | Default is 0 |
time_step_seconds | integer | Default is 3600 (1 hour) |
output_state_vector | logical | Default is .true. |
Routine | Message | Comment |
---|---|---|
nc_write_model_atts nc_write_model_vars |
Various NetCDF-f90 interface error messages | From one of the NetCDF calls in the named routine |