INTERFACE / PUBLIC COMPONENTS / NAMELIST / FILES / REFERENCES / ERRORS / BUGS / PLANS

MODULE model_mod (Lorenz_63)

Contact: Jeff Anderson
Revision: $Revision: 2801 $
Source: $URL: http://subversion.ucar.edu/DAReS/DART/trunk/models/lorenz_63/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"

OVERVIEW

DART interface module for the Lorenz-63 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 distinctive part of the model interfaces is the namelist.

This is the 3-variable model as described in:   Lorenz, E. N. 1963. Deterministic nonperiodic flow.  J. Atmos. Sci.  20, 130-141.

The system of equations is:

X' = -sigma*X + sigma*Y
Y' = -XZ + rX - Y
Z' =  XY -bZ




OTHER MODULES USED

types_mod
time_manager_mod
oned/location_mod
utilities_mod



PUBLIC INTERFACE

use model_mod, only : get_model_size
 adv_1step
 get_state_meta_data
 model_interpolate
 get_model_time_step
 end_model
 static_init_model
 init_time
 init_conditions
 nc_write_model_atts
 nc_write_model_vars
 pert_model_state
 get_close_maxdist_init
 get_close_obs_init
 get_close_obs
 ens_mean_for_model

NOTES

Optional namelist interface &model_mod_nml may be read from file input.nml.




PUBLIC COMPONENTS

The following are the public entry points:


var = get_model_size( )
integer                               ::  get_model_size 

Description

Returns the length of the model state vector, 3.


call adv_1step(x, time)
real(r8), dimension(:),   intent(inout) ::  x 
type(time_type),          intent(in)    ::  time 

Description

Advances the model for a single time step. The time associated with the initial model state is also input although it is not used for the computation.

x State vector of length model_size.
time Gives time of the initial model state.


call get_state_meta_data (index_in, location, [,var_type] )
integer,                  intent(in)    ::  index_in 
type(location_type),      intent(out)   ::  location 
integer, optional,        intent(out)   ::  var_type 

Description

Returns metadata about a given element, indexed by index_in, in the model state vector. The location defines where the state variable is located. For lorenz-63, the variable 1 (x) is at 0.0, the variable 2 (y) at 1/3, and the variable 3 (z) at 2/3 on a cyclic [0, 1] domain. The variable type is always returned as 1.

index_in Index into the long state vector.
location Returns location of indexed state variable.
var_type Returns the type (always 1) of the indexed state variable as an optional argument.

Notes


call model_interpolate(x, location, itype, obs_val, istatus)
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 

Description

Given model state, returns the value interpolated to a given location in [0, 1] by linear interpolation. Variable locations are at 0, 1/3 and 2/3 in the cyclic [0, 1] domain. So, a value of 1/6 is an average of the x and y variables. The type variable is not used here and istatus is always returned as 0 (successful interpolation).

x     Model state vector.
location Location to which to interpolate.
itype Not used.
obs_val The interpolated value from the model.
istatus Quality control information, always returned 0.

Notes


var = get_model_time_step( )
type(time_type)                       ::  get_model_time_step 

Description

Returns the models base time step as a time_type. This is settable by namelist and defaults to 1 hour.

Notes


call end_model( )

Description

A stub since lorenz-63 requires no clean up.

Notes


call static_init_model( )

Description

Used for runtime initialization of model; reads namelist, initializes model parameters, etc. This is the first call made to the model by any DART compliant assimilation routine.

Notes


call init_time(time)
type(time_type),          intent(out)    ::  time 

Description

Returns the time at which the model will start if no input initial conditions are to be used. This is used to spin-up the model from rest. This model sets the time to 0.

Notes


call init_conditions( x )
real(r8), dimension(:),   intent(out)   ::  x 

Description

Returns default initial conditions for the model; generally used for spinning up initial model states. Values chosen here are 0.1 for all three state variables.

x Model state vector.

Notes


ierr = nc_write_model_atts(ncFileId)
integer,                              ::  nc_write_model_atts 
integer,                  intent(in)  ::  ncFileId 

Description

Function to write model specific attributes to a netCDF file. This function writes the metadata associated with the model to a NetCDF file opened to a file identified by ncFileID.

ncFileId     Integer file descriptor opened to NetCDF file.
ierr Returned error code.

Notes


ierr = nc_write_model_vars(ncFileID, statevec, copyindex, timeindex)
integer                               ::  nc_write_model_vars 
integer,                  intent(in)  ::  ncFileID 
real(r8), dimension(:),   intent(in)  ::  statevec 
integer,                  intent(in)  ::  copyindex
integer,                  intent(in)  ::  timeindex 

Description

Writes a copy of the state variables to a NetCDF file. Multiple copies of the state for a given time are supported, allowing, for instance, a single file to include multiple ensemble estimates of the state.

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.

Notes


call pert_model_state(state, pert_state, interf_provided)
real(r8), dimension(:),   intent(in)    ::  state 
real(r8), dimension(:),   intent(out)   ::  pert_state 
logical,                  intent(out)   ::  interf_provided 

Description

Given a model state, produces a perturbed model state. Lorenz-63 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: NOT returned.
interf_provided Returned false; interface is not implemented.

Notes


call get_close_maxdist_init(gc, maxdist)
 type(get_close_type), intent(inout) :: gc
 real(r8),             intent(in)    :: maxdist
 

Description

Pass-through to the 1-D locations module. See get_close_maxdist_init() for the documentation of this subroutine.


call get_close_obs_init(gc, num, obs)
 type(get_close_type), intent(inout) :: gc
 integer,              intent(in)    :: num
 type(location_type),  intent(in)    :: obs(num)
 

Description

Pass-through to the 1-D locations module. See get_close_obs_init() for the documentation of this subroutine.


call get_close_obs(gc, base_obs_loc, base_obs_kind, obs, obs_kind, num_close, close_ind [, dist])
 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(:)
 

Description

Pass-through to the 1-D locations module. See get_close_obs() for the documentation of this subroutine.


call ens_mean_for_model(ens_mean)
 real(r8), dimension(:), intent(in)  :: ens_mean
 

Description

A NULL INTERFACE in this model.

ens_mean    Ensemble mean state vector




NAMELIST

We adhere to the F90 standard of starting a namelist with an ampersand '&' and terminating with a slash '/'.

namelist / model_nml /  &
    sigma, r, b, deltat, time_step_days, time_step_seconds

Discussion

This namelist is read in a file called input.nml

Contents Type Description
sigma real(r8) Model parameter, see comp_dt in code for equations. Default: 10.
r real(r8) Model parameter, see comp_dt in code for equations. Default: 28.
b real(r8) Model parameter, see comp_dt in code for equations. Default: 8/3.
deltat real(r8) Non-dimensional timestep, default 0.01. This is mapped to the dimensional timestep specified by time_step_days and time_step_seconds.
time_step_days real(r8) Number of days for dimensional timestep, mapped to deltat. Default: 0.
time_step_seconds real(r8) Number of seconds for dimensional timestep, mapped to deltat. Default: 3600



FILES




REFERENCES

Lorenz, E. N. 1963. Deterministic nonperiodic flow.  J. Atmos. Sci.  20, 130-141.

ERROR CODES and CONDITIONS

RoutineMessageComment
nc_write_model_atts
nc_write_model_vars
Various NetCDF-f90 interface error messages From one of the NetCDF calls in the named routine



KNOWN BUGS




FUTURE PLANS