regional_dyes module reference

A tracer package for using dyes to diagnose regional flows.

Data Types

dye_tracer_CS

The control structure for the regional dyes tracer package

Functions/Subroutines

register_dye_tracer

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

initialize_dye_tracer

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

dye_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)

dye_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.

dye_tracer_surface_state

This subroutine extracts the surface fields from this tracer package that are to be shared with the atmosphere in coupled configurations. This particular tracer package does not report anything back to the coupler.

regional_dyes_end

Clean up any allocated memory after the run.

Detailed Description

This file contains an example of the code that is needed to set up and use a set (in this case two) of dynamically passive tracers for diagnostic purposes. The tracers here are dye tracers which are set to 1 within the geographical region specified. The depth which a tracer is set is determined by calculating the depth from the seafloor upwards through the column.

The advection scheme of these tracers can be set to be different to that used by active tracers.

Type Documentation

type, public :: dye_tracer_CS

The control structure for the regional dyes tracer package

Parameters
  • ntr

    The number of tracers that are actually used.

  • coupled_tracers

    These tracers are not offered to the coupler.

  • dye_source_minlon

    Minimum longitude of region dye will be injected, in [m] or [km] or [degrees_E]

  • dye_source_maxlon

    Maximum longitude of region dye will be injected, in [m] or [km] or [degrees_E]

  • dye_source_minlat

    Minimum latitude of region dye will be injected, in [m] or [km] or [degrees_N]

  • dye_source_maxlat

    Maximum latitude of region dye will be injected, in [m] or [km] or [degrees_N]

  • dye_source_mindepth

    Minimum depth of region dye will be injected [Z ~> m].

  • dye_source_maxdepth

    Maximum depth of region dye will be injected [Z ~> m].

  • tr_Reg

    A pointer to the tracer registry

  • tr

    The array of tracers used in this subroutine [CU ~> conc]

  • 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.

  • id_tr_dia_diff

    Diagnostic IDs for vertical tracer fluxes (positive up)

  • diag

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

  • restart_CSp

    A pointer to the restart control structure

  • tr_desc

    Descriptions and metadata for the tracers

  • tracers_may_reinit

    If true the tracers may be initialized if not found in a restart file

Functions/Subroutine Documentation

function register_dye_tracer(HI, 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
  • HI [in]

    A horizontal index type 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 structure

Callees call graph
Callees of regional_dyes::register_dye_tracer 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_tracer_advect_schemes MOM_tracer_advect_schemes cluster_mom_tracer_registry MOM_tracer_registry cluster_regional_dyes regional_dyes 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_version log_version (interface) mom_io::query_vardesc query_vardesc mom_io::var_desc var_desc mom_tracer_advect_schemes::set_tracer_advect_scheme set_tracer_advect_scheme mom_tracer_registry::register_tracer register_tracer regional_dyes::register_dye_tracer register_dye_tracer regional_dyes::register_dye_tracer->mom_couplertype_infra::atmos_ocn_coupler_flux regional_dyes::register_dye_tracer->mom_error_handler::mom_error regional_dyes::register_dye_tracer->mom_file_parser::interface::get_param regional_dyes::register_dye_tracer->mom_file_parser::interface::log_version regional_dyes::register_dye_tracer->mom_io::query_vardesc regional_dyes::register_dye_tracer->mom_io::var_desc regional_dyes::register_dye_tracer->mom_tracer_advect_schemes::set_tracer_advect_scheme regional_dyes::register_dye_tracer->mom_tracer_registry::register_tracer
Text view
Callers call graph
Callers of regional_dyes::register_dye_tracer calls cluster_mom_tracer_flow_control MOM_tracer_flow_control cluster_regional_dyes regional_dyes mom_tracer_flow_control::call_tracer_register call_tracer_register regional_dyes::register_dye_tracer register_dye_tracer mom_tracer_flow_control::call_tracer_register->regional_dyes::register_dye_tracer
Text view
subroutine initialize_dye_tracer(restart, day, G, GV, US, h, diag, OBC, CS, sponge_CSp, tv)

This subroutine initializes the CS%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]

    Structure 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 register_dye_tracer.

  • sponge_CSp

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

  • tv [in]

    A structure pointing to various thermodynamic variables

Callees call graph
Callees of regional_dyes::initialize_dye_tracer calls cluster_mom_diag_mediator MOM_diag_mediator cluster_mom_interface_heights MOM_interface_heights cluster_regional_dyes regional_dyes mom_diag_mediator::register_diag_field register_diag_field mom_interface_heights::interface::thickness_to_dz thickness_to_dz (interface) regional_dyes::initialize_dye_tracer initialize_dye_tracer regional_dyes::initialize_dye_tracer->mom_diag_mediator::register_diag_field regional_dyes::initialize_dye_tracer->mom_interface_heights::interface::thickness_to_dz
Text view
Callers call graph
Callers of regional_dyes::initialize_dye_tracer calls cluster_mom_tracer_flow_control MOM_tracer_flow_control cluster_regional_dyes regional_dyes mom_tracer_flow_control::tracer_flow_control_init tracer_flow_control_init regional_dyes::initialize_dye_tracer initialize_dye_tracer mom_tracer_flow_control::tracer_flow_control_init->regional_dyes::initialize_dye_tracer
Text view
subroutine dye_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV, US, tv, CS, evap_CFL_limit, minimum_forcing_depth)

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

  • tv [in]

    A structure pointing to various thermodynamic variables

  • CS

    The control structure returned by a previous call to register_dye_tracer.

  • evap_CFL_limit [in]

    Limit on the fraction of the water that can be fluxed out of the top layer in a timestep [nondim]

  • minimum_forcing_depth [in]

    The smallest depth over which fluxes can be applied [H ~> m or kg m-2]

  • vert_flux

    [conc H T-1 ~> conc m s-1]

Callees call graph
Callees of regional_dyes::dye_tracer_column_physics calls cluster_mom_diag_mediator MOM_diag_mediator cluster_mom_interface_heights MOM_interface_heights cluster_mom_tracer_diabatic MOM_tracer_diabatic cluster_regional_dyes regional_dyes mom_diag_mediator::interface::post_data post_data (interface) mom_interface_heights::interface::thickness_to_dz thickness_to_dz (interface) mom_tracer_diabatic::applytracerboundaryfluxesinout applyTracerBoundaryFluxesInOut mom_tracer_diabatic::tracer_vertdiff tracer_vertdiff regional_dyes::dye_tracer_column_physics dye_tracer_column_physics regional_dyes::dye_tracer_column_physics->mom_diag_mediator::interface::post_data regional_dyes::dye_tracer_column_physics->mom_interface_heights::interface::thickness_to_dz regional_dyes::dye_tracer_column_physics->mom_tracer_diabatic::applytracerboundaryfluxesinout regional_dyes::dye_tracer_column_physics->mom_tracer_diabatic::tracer_vertdiff
Text view
Callers call graph
Callers of regional_dyes::dye_tracer_column_physics calls cluster_mom_tracer_flow_control MOM_tracer_flow_control cluster_regional_dyes regional_dyes mom_tracer_flow_control::call_tracer_column_fns call_tracer_column_fns regional_dyes::dye_tracer_column_physics dye_tracer_column_physics mom_tracer_flow_control::call_tracer_column_fns->regional_dyes::dye_tracer_column_physics
Text view
function dye_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_dye_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.

  • dye_stock

    Return value: the number of stocks calculated here.

Callees call graph
Callees of regional_dyes::dye_stock calls cluster_mom_io MOM_io cluster_mom_spatial_means MOM_spatial_means cluster_regional_dyes regional_dyes mom_io::query_vardesc query_vardesc mom_spatial_means::global_mass_int_efp global_mass_int_EFP regional_dyes::dye_stock dye_stock regional_dyes::dye_stock->mom_io::query_vardesc regional_dyes::dye_stock->mom_spatial_means::global_mass_int_efp
Text view
Callers call graph
Callers of regional_dyes::dye_stock calls cluster_mom_tracer_flow_control MOM_tracer_flow_control cluster_regional_dyes regional_dyes mom_tracer_flow_control::call_tracer_stocks call_tracer_stocks regional_dyes::dye_stock dye_stock mom_tracer_flow_control::call_tracer_stocks->regional_dyes::dye_stock
Text view
subroutine dye_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. This particular tracer package does not report anything back to the coupler.

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 thickness [H ~> m or kg m-2].

  • CS

    The control structure returned by a previous call to register_dye_tracer.

Callees call graph
Callees of regional_dyes::dye_tracer_surface_state calls cluster_mom_coupler_types MOM_coupler_types cluster_regional_dyes regional_dyes mom_coupler_types::set_coupler_type_data set_coupler_type_data regional_dyes::dye_tracer_surface_state dye_tracer_surface_state regional_dyes::dye_tracer_surface_state->mom_coupler_types::set_coupler_type_data
Text view
Callers call graph
Callers of regional_dyes::dye_tracer_surface_state calls cluster_mom_tracer_flow_control MOM_tracer_flow_control cluster_regional_dyes regional_dyes mom_tracer_flow_control::call_tracer_surface_state call_tracer_surface_state regional_dyes::dye_tracer_surface_state dye_tracer_surface_state mom_tracer_flow_control::call_tracer_surface_state->regional_dyes::dye_tracer_surface_state
Text view
subroutine regional_dyes_end(CS)

Clean up any allocated memory after the run.

Parameters
  • CS

    The control structure returned by a previous call to register_dye_tracer.

Callers call graph
Callers of regional_dyes::regional_dyes_end calls cluster_mom_tracer_flow_control MOM_tracer_flow_control cluster_regional_dyes regional_dyes mom_tracer_flow_control::tracer_flow_control_end tracer_flow_control_end regional_dyes::regional_dyes_end regional_dyes_end mom_tracer_flow_control::tracer_flow_control_end->regional_dyes::regional_dyes_end
Text view
API generated with Flint · Rendered from reStructuredText