regional_dyes module reference

A tracer package for using dyes to diagnose regional flows.

More…

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

dye_stock()

This function calculates the mass-weighted integral of all tracer stocks, returning the number of stocks it has calculated.

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.

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.

Type Documentation

type regional_dyes/dye_tracer_cs

The control structure for the regional dyes tracer package.

Type fields:
  • % ntr [integer] :: The number of tracers that are actually used.

  • % coupled_tracers [logical] :: These tracers are not offered to the coupler.

  • % dye_source_minlon [real(:),allocatable] :: Minimum longitude of region dye will be injected, in [m] or [km] or [degrees_E].

  • % dye_source_maxlon [real(:),allocatable] :: Maximum longitude of region dye will be injected, in [m] or [km] or [degrees_E].

  • % dye_source_minlat [real(:),allocatable] :: Minimum latitude of region dye will be injected, in [m] or [km] or [degrees_N].

  • % dye_source_maxlat [real(:),allocatable] :: Maximum latitude of region dye will be injected, in [m] or [km] or [degrees_N].

  • % dye_source_mindepth [real(:),allocatable] :: Minimum depth of region dye will be injected [Z ~> m].

  • % dye_source_maxdepth [real(:),allocatable] :: Maximum depth of region dye will be injected [Z ~> m].

  • % tr_reg [type(tracer_registry_type),pointer] :: A pointer to the tracer registry.

  • % tr [real(:,:,:,:),pointer] :: The array of tracers used in this subroutine [CU ~> conc].

  • % ind_tr [integer(:),allocatable] :: Indices returned by atmos_ocn_coupler_flux if it is used and the surface tracer concentrations are to be provided to the coupler.

  • % diag [type( diag_ctrl ),pointer] :: A structure that is used to regulate the timing of diagnostic output.

  • % restart_csp [type( mom_restart_cs ),pointer] :: A pointer to the restart control structure.

  • % tr_desc [type( vardesc )(:),allocatable] :: Descriptions and metadata for the tracers.

  • % tracers_may_reinit [logical] :: If true the tracers may be initialized if not found in a restart file.

Function/Subroutine Documentation

function regional_dyes/register_dye_tracer(HI, GV, US, param_file, CS, tr_Reg, restart_CS) [logical]

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

Call to:

mom_error_handler::mom_error mom_io::query_vardesc mom_tracer_registry::register_tracer mom_io::var_desc

subroutine regional_dyes/initialize_dye_tracer(restart, day, G, GV, h, diag, OBC, CS, sponge_CSp, tv)

This subroutine initializes the CSntr 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

  • 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

subroutine regional_dyes/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

  • eb :: [in] an array to which the amount of fluid entrained

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

Call to:

mom_tracer_diabatic::applytracerboundaryfluxesinout mom_tracer_diabatic::tracer_vertdiff

function regional_dyes/dye_stock(h, stocks, G, GV, CS, names, units, stock_index) [integer]

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.

Return:

undefined :: Return value: the number of stocks calculated here.

Call to:

mom_spatial_means::global_mass_int_efp mom_io::query_vardesc

Called from:

mom_tracer_flow_control::call_tracer_stocks

subroutine regional_dyes/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.

Call to:

mom_coupler_types::set_coupler_type_data

subroutine regional_dyes/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.

Called from:

mom_tracer_flow_control::tracer_flow_control_end