Code to manage the simple addition of tracers to the FMS code. This code keeps track of the numbers and names of tracers included in a tracer table.
mpp_mod
mpp_io_mod
fms_mod
field_manager_mod
call tracer_manager_init
call register_tracers (model, num_tracers,num_prog,num_diag)
model | A parameter to identify which model is being used. [integer] |
num_tracers | The total number of valid tracers within the component model. [integer] |
num_prog | The number of prognostic tracers within the component model. [integer] |
num_diag | The number of diagnostic tracers within the component model. [integer] |
call get_number_tracers (model, num_tracers,num_prog,num_diag)
model | A parameter to identify which model is being used. [integer] |
num_tracers | The total number of valid tracers within the component model. [integer, optional] |
num_prog | The number of prognostic tracers within the component model. [integer, optional] |
num_diag | The number of diagnostic tracers within the component model. [integer, optional] |
call get_tracer_indices (model, ind, prog_ind, diag_ind)
model | A parameter to identify which model is being used. [integer] |
ind | An array containing the tracer manager defined indices for
all the tracers within the component model. [integer, optional, dimension(:)] |
prog_ind | An array containing the tracer manager defined indices for
the prognostic tracers within the component model. [integer, optional, dimension(:)] |
diag_ind | An array containing the tracer manager defined indices for
the diagnostic tracers within the component model. [integer, optional, dimension(:)] |
integer: index = get_tracer_index (model, name, indices, verbose) logical: if ( get_tracer_index(model, name, index, indices, verbose) ) then
model | A parameter to identify which model is being used. [integer] |
name | The name of the tracer (as assigned in the field table). [character] |
indices | An array indices.
When present, the returned index will limit the search for the tracer
to those tracers whos indices are amoung those in array "indices".
This would be useful when it is desired to limit the search to a subset
of the tracers. Such a subset might be the diagnostic or prognostic tracers.
(Note that subroutine get_tracer_indices returns these subsets) [integer, optional, dimension(:)] |
verbose | A flag to allow the message saying that a tracer with this name has not
been found. This should only be used for debugging purposes. [logical, optional] |
get_tracer_index | integer function:
The index of the tracer named "name".
If no tracer by that name exists then the returned value is NO_TRACER.
logical function:
If no tracer by that name exists then the returned value is .false.,
otherwise the returned value is .true. [integer] |
call tracer_manager_end
call get_tracer_names (model,n,name,longname, units)
model | A parameter representing the component model in use. [integer] |
n | Tracer number. [integer] |
name | Field name associated with tracer number. [character] |
longname | The long name associated with tracer number. [character, optional] |
units | The units associated with tracer number. [character, optional] |
if(.not. get_tracer_name (model,n,name,longname, units, err_msg)) call mpp_error(.....
model | A parameter representing the component model in use. [integer] |
n | Tracer number. [integer] |
name | Field name associated with tracer number. [character] |
longname | The long name associated with tracer number. [character, optional] |
units | The units associated with tracer number. [character, optional] |
err_msg | When present:
If a FATAL error condition is detected then err_msg will contain an error message
and the return value of get_tracer_name will be .false.
If no FATAL error is detected err_msg will be filled with space characters and
and the return value of get_tracer_name will be .true.
When not present:
A FATAL error will result in termination inside get_tracer_name without returning.
If no FATAL error is detected the return value of get_tracer_name will be .true. [character, optional] |
logical = check_if_prognostic (model, n)
model | A parameter representing the component model in use. [integer] |
n | Tracer number [integer] |
check_if_prognostic | A logical flag set TRUE if the tracer is
prognostic. [logical] |
call set_tracer_profile (model, n, tracer)
model | A parameter representing the component model in use. [integer] |
n | Tracer number. [integer] |
tracer_array | The initialized tracer array. [real] |
logical = query_method (method_type, model, n, name, control)
method_type | The method that is being requested. [character] |
model | A parameter representing the component model in use. [integer] |
n | Tracer number [integer] |
name | A string containing the modified name to be used with
method_type. i.e. "2nd_order" might be the default for
advection. One could use "4th_order" here to modify
that behaviour. [character] |
control | A string containing the modified parameters that are
associated with the method_type and name. [character, optional] |
query_method | A flag to show whether method_type exists with regard to
tracer n. If method_type is not present then one must
have default values. [logical] |
call set_tracer_atts (model, name, longname, units)
model | A parameter representing the component model in use. [integer] |
name | Tracer name. [character] |
longname | A string describing the longname of the tracer for output to NetCDF files [character, optional] |
units | A string describing the units of the tracer for output to NetCDF files [character, optional] |
call set_tracer_method (model, name, method_type, method_name, method_control)
model | A parameter representing the component model in use. [integer] |
name | Tracer name. [character] |
method_type | The type of the method to be set. [character] |
method_name | The name of the method to be set. [character] |
method_control | The control parameters of the method to be set. [character] |