USER_tracer_example module reference

A sample tracer package that has striped initial conditions

Data Types

USER_tracer_example_CS

The number of tracers in this module.

Functions/Subroutines

USER_register_tracer_example

This subroutine is used to register tracer fields and subroutines to be used with MOM.

USER_initialize_tracer

This subroutine initializes the NTR tracer fields in tr(:,:,:,:) and it sets up the tracer output.

tracer_column_physics

This subroutine applies diapycnal diffusion and any other column tracer physics or chemistry to the tracers from this file. This is a simple example of a set of advected passive tracers. The arguments to this subroutine are redundant in that h_new(k) = h_old(k) + ea(k) - eb(k-1) + eb(k) - ea(k+1)

USER_tracer_stock

This function calculates the mass-weighted integral of all tracer stocks, returning the number of stocks it has calculated. If the stock_index is present, only the stock corresponding to that coded index is returned.

USER_tracer_surface_state

This subroutine extracts the surface fields from this tracer package that are to be shared with the atmosphere in coupled configurations.

USER_tracer_example_end

Clean up allocated memory at the end.

Detailed Description

Original by Robert Hallberg, 2002

This file contains an example of the code that is needed to set up and use a set (in this case one) of dynamically passive tracers.

A single subroutine is called from within each file to register each of the tracers for reinitialization and advection and to register the subroutine that initializes the tracers and set up their output and the subroutine that does any tracer physics or chemistry along with diapycnal mixing (included here because some tracers may float or swim vertically or dye diapycnal processes).

Type Documentation

type, public :: USER_tracer_example_CS

The number of tracers in this module.

The control structure for the USER_tracer_example module

Parameters
  • coupled_tracers

    These tracers are not offered to the coupler.

  • tracer_IC_file

    The full path to the IC file, or " " to initialize internally.

  • Time

    A pointer to the ocean model's clock.

  • tr_Reg

    A pointer to the tracer registry

  • tr

    The array of tracers used in this subroutine, perhaps in [g kg-1]?

  • land_val

    The value of tr that is used where land is masked out, perhaps in [g kg-1]?

  • stripe_width

    The Gaussian width of the stripe in the initial condition for the tracer_example tracers [L ~> m]

  • stripe_lat

    The central latitude of the stripe in the initial condition for the tracer_example tracers, in [degrees_N] or [km] or [m].

  • use_sponge

    If true, sponges may be applied somewhere in the domain.

  • ind_tr

    Indices returned by atmos_ocn_coupler_flux if it is used and the surface tracer concentrations are to be provided to the coupler.

  • diag

    A structure that is used to regulate the timing of diagnostic output.

  • tr_desc

    Descriptions of each of the tracers.

Functions/Subroutine Documentation

function USER_register_tracer_example(G, GV, US, param_file, CS, tr_Reg, restart_CS)

This subroutine is used to register tracer fields and subroutines to be used with MOM.

Parameters
  • G [in]

    The ocean's grid structure

  • GV [in]

    The ocean's vertical grid structure

  • US [in]

    A dimensional unit scaling type

  • param_file [in]

    A structure to parse for run-time parameters

  • CS

    A pointer that is set to point to the control structure for this module

  • tr_Reg

    A pointer that is set to point to the control structure for the tracer advection and diffusion module

  • restart_CS [inout]

    MOM restart control struct

Callees call graph
Callees of user_tracer_example::user_register_tracer_example calls cluster_mom_couplertype_infra MOM_couplertype_infra cluster_mom_error_handler MOM_error_handler cluster_mom_file_parser MOM_file_parser cluster_mom_io MOM_io cluster_mom_string_functions MOM_string_functions cluster_mom_tracer_registry MOM_tracer_registry cluster_user_tracer_example USER_tracer_example mom_couplertype_infra::atmos_ocn_coupler_flux atmos_ocn_coupler_flux mom_error_handler::mom_error MOM_error mom_file_parser::interface::get_param get_param (interface) mom_file_parser::interface::log_param log_param (interface) mom_file_parser::interface::log_version log_version (interface) mom_io::var_desc var_desc mom_string_functions::slasher slasher mom_tracer_registry::register_tracer register_tracer user_tracer_example::user_register_tracer_example USER_register_tracer_example user_tracer_example::user_register_tracer_example->mom_couplertype_infra::atmos_ocn_coupler_flux user_tracer_example::user_register_tracer_example->mom_error_handler::mom_error user_tracer_example::user_register_tracer_example->mom_file_parser::interface::get_param user_tracer_example::user_register_tracer_example->mom_file_parser::interface::log_param user_tracer_example::user_register_tracer_example->mom_file_parser::interface::log_version user_tracer_example::user_register_tracer_example->mom_io::var_desc user_tracer_example::user_register_tracer_example->mom_string_functions::slasher user_tracer_example::user_register_tracer_example->mom_tracer_registry::register_tracer
Text view
Callers call graph
Callers of user_tracer_example::user_register_tracer_example calls cluster_mom_tracer_flow_control MOM_tracer_flow_control cluster_user_tracer_example USER_tracer_example mom_tracer_flow_control::call_tracer_register call_tracer_register user_tracer_example::user_register_tracer_example USER_register_tracer_example mom_tracer_flow_control::call_tracer_register->user_tracer_example::user_register_tracer_example
Text view
subroutine USER_initialize_tracer(restart, day, G, GV, US, h, diag, OBC, CS, sponge_CSp)

This subroutine initializes the NTR tracer fields in tr(:,:,:,:) and it sets up the tracer output.

Parameters
  • restart [in]

    .true. if the fields have already been read from a restart file.

  • day [in]

    Time of the start of the run.

  • G [in]

    The ocean's grid structure

  • GV [in]

    The ocean's vertical grid structure

  • US [in]

    A dimensional unit scaling type

  • h [in]

    Layer thicknesses [H ~> m or kg m-2]

  • diag [in]

    A structure that is used to regulate diagnostic output.

  • OBC

    This open boundary condition type specifies whether, where, and what open boundary conditions are used.

  • CS

    The control structure returned by a previous call to USER_register_tracer_example.

  • sponge_CSp

    A pointer to the control structure for the sponges, if they are in use.

Callees call graph
Callees of user_tracer_example::user_initialize_tracer calls cluster_mom_error_handler MOM_error_handler cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra cluster_mom_sponge MOM_sponge cluster_user_tracer_example USER_tracer_example mom_error_handler::mom_error MOM_error mom_io::interface::mom_read_data MOM_read_data (interface) mom_io::query_vardesc query_vardesc mom_io_infra::interface::file_exists file_exists (interface) mom_sponge::set_up_sponge_field set_up_sponge_field user_tracer_example::user_initialize_tracer USER_initialize_tracer user_tracer_example::user_initialize_tracer->mom_error_handler::mom_error user_tracer_example::user_initialize_tracer->mom_io::interface::mom_read_data user_tracer_example::user_initialize_tracer->mom_io::query_vardesc user_tracer_example::user_initialize_tracer->mom_io_infra::interface::file_exists user_tracer_example::user_initialize_tracer->mom_sponge::set_up_sponge_field
Text view
Callers call graph
Callers of user_tracer_example::user_initialize_tracer calls cluster_mom_tracer_flow_control MOM_tracer_flow_control cluster_user_tracer_example USER_tracer_example mom_tracer_flow_control::tracer_flow_control_init tracer_flow_control_init user_tracer_example::user_initialize_tracer USER_initialize_tracer mom_tracer_flow_control::tracer_flow_control_init->user_tracer_example::user_initialize_tracer
Text view
subroutine tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV, US, CS)

This subroutine applies diapycnal diffusion and any other column tracer physics or chemistry to the tracers from this file. This is a simple example of a set of advected passive tracers. The arguments to this subroutine are redundant in that h_new(k) = h_old(k) + ea(k) - eb(k-1) + eb(k) - ea(k+1)

Parameters
  • G [in]

    The ocean's grid structure

  • GV [in]

    The ocean's vertical grid structure

  • h_old [in]

    Layer thickness before entrainment [H ~> m or kg m-2].

  • h_new [in]

    Layer thickness after entrainment [H ~> m or kg m-2].

  • ea [in]

    an array to which the amount of fluid entrained from the layer above during this call will be added [H ~> m or kg m-2].

  • eb [in]

    an array to which the amount of fluid entrained from the layer below during this call will be added [H ~> m or kg m-2].

  • fluxes [in]

    A structure containing pointers to thermodynamic and tracer forcing fields. Unused fields have NULL ptrs.

  • dt [in]

    The amount of time covered by this call [T ~> s]

  • US [in]

    A dimensional unit scaling type

  • CS

    The control structure returned by a previous call to USER_register_tracer_example.

Callers call graph
Callers of user_tracer_example::tracer_column_physics calls cluster_mom_tracer_flow_control MOM_tracer_flow_control cluster_user_tracer_example USER_tracer_example mom_tracer_flow_control::call_tracer_column_fns call_tracer_column_fns user_tracer_example::tracer_column_physics tracer_column_physics mom_tracer_flow_control::call_tracer_column_fns->user_tracer_example::tracer_column_physics
Text view
function USER_tracer_stock(h, stocks, G, GV, CS, names, units, stock_index)

This function calculates the mass-weighted integral of all tracer stocks, returning the number of stocks it has calculated. If the stock_index is present, only the stock corresponding to that coded index is returned.

Parameters
  • G [in]

    The ocean's grid structure

  • GV [in]

    The ocean's vertical grid structure

  • h [in]

    Layer thicknesses [H ~> m or kg m-2]

  • stocks [out]

    The mass-weighted integrated amount of each tracer, in kg times concentration units [kg conc]

  • CS

    The control structure returned by a previous call to register_USER_tracer.

  • names [out]

    The names of the stocks calculated.

  • units [out]

    The units of the stocks calculated.

  • stock_index [in]

    The coded index of a specific stock being sought.

  • USER_tracer_stock

    Return value: the number of stocks calculated here.

Callees call graph
Callees of user_tracer_example::user_tracer_stock calls cluster_mom_io MOM_io cluster_mom_spatial_means MOM_spatial_means cluster_user_tracer_example USER_tracer_example mom_io::query_vardesc query_vardesc mom_spatial_means::global_mass_int_efp global_mass_int_EFP user_tracer_example::user_tracer_stock USER_tracer_stock user_tracer_example::user_tracer_stock->mom_io::query_vardesc user_tracer_example::user_tracer_stock->mom_spatial_means::global_mass_int_efp
Text view
Callers call graph
Callers of user_tracer_example::user_tracer_stock calls cluster_mom_tracer_flow_control MOM_tracer_flow_control cluster_user_tracer_example USER_tracer_example mom_tracer_flow_control::call_tracer_stocks call_tracer_stocks user_tracer_example::user_tracer_stock USER_tracer_stock mom_tracer_flow_control::call_tracer_stocks->user_tracer_example::user_tracer_stock
Text view
subroutine USER_tracer_surface_state(sfc_state, h, G, GV, CS)

This subroutine extracts the surface fields from this tracer package that are to be shared with the atmosphere in coupled configurations.

Parameters
  • G [in]

    The ocean's grid structure

  • GV [in]

    The ocean's vertical grid structure

  • sfc_state [inout]

    A structure containing fields that describe the surface state of the ocean.

  • h [in]

    Layer thicknesses [H ~> m or kg m-2]

  • CS

    The control structure returned by a previous call to register_USER_tracer.

Callees call graph
Callees of user_tracer_example::user_tracer_surface_state calls cluster_mom_coupler_types MOM_coupler_types cluster_user_tracer_example USER_tracer_example mom_coupler_types::set_coupler_type_data set_coupler_type_data user_tracer_example::user_tracer_surface_state USER_tracer_surface_state user_tracer_example::user_tracer_surface_state->mom_coupler_types::set_coupler_type_data
Text view
Callers call graph
Callers of user_tracer_example::user_tracer_surface_state calls cluster_mom_tracer_flow_control MOM_tracer_flow_control cluster_user_tracer_example USER_tracer_example mom_tracer_flow_control::call_tracer_surface_state call_tracer_surface_state user_tracer_example::user_tracer_surface_state USER_tracer_surface_state mom_tracer_flow_control::call_tracer_surface_state->user_tracer_example::user_tracer_surface_state
Text view
subroutine USER_tracer_example_end(CS)

Clean up allocated memory at the end.

Parameters
  • CS

    The control structure returned by a previous call to register_USER_tracer.

Callers call graph
Callers of user_tracer_example::user_tracer_example_end calls cluster_mom_tracer_flow_control MOM_tracer_flow_control cluster_user_tracer_example USER_tracer_example mom_tracer_flow_control::tracer_flow_control_end tracer_flow_control_end user_tracer_example::user_tracer_example_end USER_tracer_example_end mom_tracer_flow_control::tracer_flow_control_end->user_tracer_example::user_tracer_example_end
Text view
API generated with Flint · Rendered from reStructuredText