namespace mom_tracer_flow_control

Overview

Orchestrates the registration and calling of tracer packages. More…

namespace mom_tracer_flow_control {

// global functions

subroutine, public call_tracer_flux_init(verbosity verbosity);

subroutine, public call_tracer_register(
    HI HI,
    GV GV,
    US US,
    param_file param_file,
    CS CS,
    tr_Reg tr_Reg,
    restart_CS restart_CS
    );

subroutine, public tracer_flow_control_init(
    restart restart,
    day day,
    G G,
    GV GV,
    US US,
    h h,
    param_file param_file,
    diag diag,
    OBC OBC,
    CS CS,
    sponge_CSp sponge_CSp,
    ALE_sponge_CSp ALE_sponge_CSp,
    tv tv
    );

subroutine, public get_chl_from_model(Chl_array Chl_array, G G, CS CS);

subroutine, public call_tracer_set_forcing(
    state state,
    fluxes fluxes,
    day_start day_start,
    day_interval day_interval,
    G G,
    CS CS
    );

subroutine, public call_tracer_column_fns(
    h_old h_old,
    h_new h_new,
    ea ea,
    eb eb,
    fluxes fluxes,
    Hml Hml,
    dt dt,
    G G,
    GV GV,
    tv tv,
    optics optics,
    CS CS,
    debug debug,
    evap_CFL_limit evap_CFL_limit,
    minimum_forcing_depth minimum_forcing_depth
    );

subroutine, public call_tracer_stocks(
    h h,
    stock_values stock_values,
    G G,
    GV GV,
    CS CS,
    stock_names stock_names,
    stock_units stock_units,
    num_stocks num_stocks,
    stock_index stock_index,
    got_min_max got_min_max,
    global_min global_min,
    global_max global_max,
    xgmin xgmin,
    ygmin ygmin,
    zgmin zgmin,
    xgmax xgmax,
    ygmax ygmax,
    zgmax zgmax
    );

subroutine, public call_tracer_surface_state(state state, h h, G G, CS CS);
subroutine, public tracer_flow_control_end(CS CS);

} // namespace mom_tracer_flow_control

Detailed Documentation

Orchestrates the registration and calling of tracer packages.

Global Functions

subroutine, public call_tracer_flux_init(verbosity verbosity)

This subroutine carries out a series of calls to initialize the air-sea tracer fluxes, but it does not record the generated indicies, and it may be called before the ocean model has been initialized and may be called on non-ocean PEs. It is not necessary to call this routine for ocean-only runs, because the same calls are made again inside of the routines called by call_tracer_register.

Parameters:

verbosity

A 0-9 integer indicating a level of verbosity.

subroutine, public call_tracer_register(
    HI HI,
    GV GV,
    US US,
    param_file param_file,
    CS CS,
    tr_Reg tr_Reg,
    restart_CS restart_CS
    )

The following 5 subroutines and associated definitions provide the machinery to register and call the subroutines that initialize tracers and apply vertical column processes to tracers.

Parameters:

hi

A horizontal index type structure.

gv

The ocean’s vertical grid structure.

us

A dimensional unit scaling type

param_file

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

A pointer to the restart control structure.

subroutine, public tracer_flow_control_init(
    restart restart,
    day day,
    G G,
    GV GV,
    US US,
    h h,
    param_file param_file,
    diag diag,
    OBC OBC,
    CS CS,
    sponge_CSp sponge_CSp,
    ALE_sponge_CSp ALE_sponge_CSp,
    tv tv
    )

This subroutine calls all registered tracer initialization subroutines.

Parameters:

restart

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

day

Time of the start of the run.

g

The ocean’s grid structure.

gv

The ocean’s vertical grid structure.

us

A dimensional unit scaling type

h

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

param_file

A structure to parse for run-time parameters

diag

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

sponge_csp

A pointer to the control structure for the sponges, if they are in use. Otherwise this may be unassociated.

ale_sponge_csp

A pointer to the control structure for the ALE sponges, if they are in use. Otherwise this may be unassociated.

tv

A structure pointing to various thermodynamic variables

subroutine, public get_chl_from_model(Chl_array Chl_array, G G, CS CS)

This subroutine extracts the chlorophyll concentrations from the model state, if possible.

Parameters:

chl_array

The array in which to store the model’s

g

The ocean’s grid structure.

cs

The control structure returned by a previous call to call_tracer_register.

subroutine, public call_tracer_set_forcing(
    state state,
    fluxes fluxes,
    day_start day_start,
    day_interval day_interval,
    G G,
    CS CS
    )

This subroutine calls the individual tracer modules’ subroutines to specify or read quantities related to their surface forcing.

Parameters:

state

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

fluxes

A structure containing pointers to any possible forcing fields. Unused fields have NULL ptrs.

day_start

Start time of the fluxes.

day_interval

Length of time over which these fluxes will be applied.

g

The ocean’s grid structure.

cs

The control structure returned by a previous call to call_tracer_register.

subroutine, public call_tracer_column_fns(
    h_old h_old,
    h_new h_new,
    ea ea,
    eb eb,
    fluxes fluxes,
    Hml Hml,
    dt dt,
    G G,
    GV GV,
    tv tv,
    optics optics,
    CS CS,
    debug debug,
    evap_CFL_limit evap_CFL_limit,
    minimum_forcing_depth minimum_forcing_depth
    )

This subroutine calls all registered tracer column physics subroutines.

Parameters:

h_old

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

h_new

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

ea

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

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

A structure containing pointers to any possible forcing fields. Unused fields have NULL ptrs.

hml

Mixed layer depth [H ~> m or kg m-2]

dt

The amount of time covered by this call [s]

g

The ocean’s grid structure.

gv

The ocean’s vertical grid structure.

tv

A structure pointing to various thermodynamic variables.

optics

The structure containing optical properties.

cs

The control structure returned by a previous call to call_tracer_register.

debug

If true calculate checksums

evap_cfl_limit

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

minimum_forcing_depth

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

subroutine, public call_tracer_stocks(
    h h,
    stock_values stock_values,
    G G,
    GV GV,
    CS CS,
    stock_names stock_names,
    stock_units stock_units,
    num_stocks num_stocks,
    stock_index stock_index,
    got_min_max got_min_max,
    global_min global_min,
    global_max global_max,
    xgmin xgmin,
    ygmin ygmin,
    zgmin zgmin,
    xgmax xgmax,
    ygmax ygmax,
    zgmax zgmax
    )

This subroutine calls all registered tracer packages to enable them to add to the surface state returned to the coupler. These routines are optional.

Parameters:

h

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

stock_values

The integrated amounts of a tracer on the current PE, usually in kg x concentration [kg conc].

g

The ocean’s grid structure.

gv

The ocean’s vertical grid structure.

cs

The control structure returned by a previous call to call_tracer_register.

stock_names

Diagnostic names to use for each stock.

stock_units

Units to use in the metadata for each stock.

num_stocks

The number of tracer stocks being returned.

stock_index

The integer stock index from stocks_constants_mod of the stock to be returned. If this is present and greater than 0, only a single stock can be returned.

got_min_max

Indicates whether the global min and

global_min

The global minimum of each tracer

global_max

The global maximum of each tracer

xgmin

The x-position of the global minimum

ygmin

The y-position of the global minimum

zgmin

The z-position of the global minimum

xgmax

The x-position of the global maximum

ygmax

The y-position of the global maximum

zgmax

The z-position of the global maximum

subroutine, public call_tracer_surface_state(state state, h h, G G, CS CS)

This subroutine calls all registered tracer packages to enable them to add to the surface state returned to the coupler. These routines are optional.

Parameters:

state

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

h

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

g

The ocean’s grid structure.

cs

The control structure returned by a previous call to call_tracer_register.

subroutine, public tracer_flow_control_end(CS CS)

Parameters:

cs

The control structure returned by a previous call to call_tracer_register.