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
use tracer_manager_mod [, only: tracer_manager_init,
register_tracers,
get_number_tracers,
get_tracer_indices,
get_tracer_index,
assign_tracer_field,
tracer_manager_end,
get_tracer_field,
get_tracer_tlevels,
get_tracer_tendency,
get_tracer_names,
get_family_name,
check_if_prognostic,
find_family_members,
add_members_to_family,
split_family_into_members,
set_tracer_profile,
query_method,
query_combined,
set_tracer_atts ]
call tracer_manager_init
call register_tracers (model, num_tracers,num_prog,num_diag,num_family)
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] |
num_family | The number of family tracers within the component model. [integer] |
call get_number_tracers (model, num_tracers,num_prog,num_diag,num_family)
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] |
num_family | The number of family tracers within the component model. [integer, optional] |
call get_tracer_indices (model, ind, prog_ind, diag_ind, fam_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(:)] |
fam_ind | An array containing the tracer manager defined indices for
the family tracers within the component model. [integer, optional, dimension(:)] |
value= get_tracer_index (model, name, indices, verbose)
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 of the component model indices. This array can be found by
calling get_tracer_indices. [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 | The index of the tracer named "name".
If indices is passed then the result is the array index which
corresponds to tracer named "name". [integer] |
call assign_tracer_field (model,index, data, data_tlevels, tendency)
model | A parameter representing the component model in use. [integer] |
index | The tracer number that you wish to assign a tracer
field for. [integer] |
data | The 3D field that is associated with the present time
step in the component model. [real, target, optional, dimension(:,:,:)] |
tendency | The 3D field that is associated with the tendency time
step in the component model. [real, target, optional, dimension(:,:,:)] |
data_tlevels | The 4D field that is associated with the tracer field
in the component model. [real, target, optional, dimension(:,:,:,:)] |
call tracer_manager_end
array= get_tracer_field (model, tracer_index)
model | A parameter representing the component model in use. [integer] |
tracer_index | The tracer number within the component model. [integer] |
data | The tracer field is returned in this array. [real, pointer, dimension(:,:,:)] |
array= get_tracer_tlevels (model, tracer_index)
model | A parameter representing the component model in use. [integer] |
tracer_index | The tracer number within the component model. [integer] |
data | The tracer field is returned in this array. [real, pointer, dimension(:,:,:,:)] |
array= get_tracer_tendency (model, tracer_index)
model | A parameter representing the component model in use. [integer] |
tracer_index | The tracer number within the component model. [integer] |
data | The tracer tendency field is returned in this array. [real, pointer, dimension(:,:,:)] |
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] |
call get_family_name (model,n,name)
model | A parameter representing the component model in use. [integer] |
n | Tracer number that you want the family name for. [integer] |
name | The family name. [character] |
logical = check_if_prognostic (model, n)
model | A parameter representing the component model in use. [integer] |
n | Tracer number that you want the family name for. [integer] |
check_if_prognostic | A logical flag set TRUE if the tracer is
prognostic. [logical] |
call find_family_members (model, family_name,is_family_member)
model | A parameter representing the component model in use. [integer] |
family_name | The family name of the members one is seeking. [character] |
is_family_member | A logical array where the tracer number is used as
the index to signify which tracer is part of the family.
i.e. If tracers 1, 3, and 7 are part of the same family
then is_family_member(1), is_family_member(3), and
is_family_member(7) are set TRUE. [logical, dimension(:)] |
call add_members_to_family (model,family_name, cur, prev, next)
model | A parameter representing the component model in use. [integer] |
n | Tracer number. [integer] |
cur | Array index for the current time step. This is only of use
with a three timestep model. [integer, optional] |
prev | Array index for the previous time step. This is only of use
with a three timestep model. [integer, optional] |
next | Array index for the next time step. This is only of use
with a three timestep model. [integer, optional] |
call split_family_into_members (model,family_name,cur,prev,next)
model | A parameter representing the component model in use. [integer] |
family_name | The name of the family of tracers that you would
like to split up. [character] |
cur | Array index for the current time step. This is only of use
with a three timestep model. [integer, optional] |
prev | Array index for the previous time step. This is only of use
with a three timestep model. [integer, optional] |
next | Array index for the next time step. This is only of use
with a three timestep model. [integer, optional] |
call set_tracer_profile (model, n, surf_value, multiplier)
model | A parameter representing the component model in use. [integer] |
n | Tracer number. [integer] |
surf_value | The surface value that will be initialized for the tracer [real] |
multiplier | The vertical multiplier for the tracer
Level(k-1) = multiplier * Level(k) [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 that you want the family name for. [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] |
logical = query_combined (model, index)
model | A parameter representing the component model in use. [integer] |
index | Tracer number. [integer] |
query_combined | A flag to show whether the tracer family has been combined. [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] |
set_tracer_atts | A flag to show that [character, optional] |