ideal_age_example module reference
A tracer package of ideal age tracers.
Data Types
The control structure for the ideal_age_tracer package. |
Functions/Subroutines
Register the ideal age tracer fields to be used with MOM. |
|
Sets the ideal age traces to their initial values and sets up the tracer output. |
|
Applies diapycnal diffusion, aging and regeneration at the surface to the ideal age tracers. |
|
Calculates the mass-weighted integral of all tracer stocks, returning the number of stocks it has calculated. |
|
This subroutine extracts the surface fields from this tracer package that are to be shared with the atmosphere in coupled configurations. |
|
Deallocate any memory associated with this tracer package. |
|
Detailed Description
Originally 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 two) of dynamically passive tracers for diagnostic purposes. The tracers here are an ideal age tracer that ages at a rate of 1/year once it is isolated from the surface, and a vintage tracer, whose surface concentration grows exponen- with time with a 30-year timescale (similar to CFCs).
Type Documentation
- type ideal_age_example/ideal_age_tracer_cs
The control structure for the ideal_age_tracer package.
- Type fields:
% ntr ::
integerThe number of tracers that are actually used.% coupled_tracers ::
logicalThese tracers are not offered to the coupler.% nkbl ::
integerThe number of layers in the boundary layer. The ideal.% ic_file ::
character(len=200)The file in which the age-tracer initial values can be found, or an empty string for internal initialization.% z_ic_file ::
logicalIf true, the IC_file is in Z-space. The default is false.% time ::
type(time_type), pointerA pointer to the ocean model’s clock.% tr_reg ::
type(tracer_registry_type), pointerA pointer to the tracer registry.% tr ::
real, dimension(:,:,:,:), pointerThe array of tracers used in this package [years] or other units.% ic_val ::
real, dimension(ntr_max)The (uniform) initial condition value [years] or other units.% young_val ::
real, dimension(ntr_max)The value assigned to tr at the surface [years] or other units.% land_val ::
real, dimension(ntr_max)The value of tr used where land is masked out [years] or other units.% growth_rate ::
real, dimension(ntr_max)The exponential growth rate for the young value [year-1].% tracer_start_year ::
real, dimension(ntr_max)The year in which tracers start aging, or at which the surface value equals young_val [years].% use_real_bl_depth ::
logicalIf true, uses the BL scheme to determine the number of layers above the BL depth instead of the fixed nkbl value.% bl_residence_num ::
integerThe tracer number assigned to the BL residence tracer in this module.% tracers_may_reinit ::
logicalIf true, these tracers be set up via the initialization code if they are not found in the restart files.% tracer_ages ::
logical, dimension(ntr_max)Indicates whether each tracer ages.% ind_tr ::
integer, dimension(ntr_max)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), pointerA structure that is used to regulate the timing of diagnostic output.% restart_csp ::
type(mom_restart_cs), pointerA pointer to the restart controls structure.% tr_desc ::
type(vardesc), dimension(ntr_max)Descriptions and metadata for the tracers.
Function/Subroutine Documentation
- function ideal_age_example/register_ideal_age_tracer(HI, GV, param_file, CS, tr_Reg, restart_CS)
Register the ideal age tracer fields to be used with MOM.
- Parameters:
hi :: [in] A horizontal index type structure
gv :: [in] The ocean’s vertical grid structure
param_file ::
param_file[in] A structure to parse for run-time parameterscs :: The control structure returned by a previous call to register_ideal_age_tracer.
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
- Call to:
mom_error_handler::mom_errormom_io::query_vardescmom_tracer_registry::register_tracermom_io::var_desc
- subroutine ideal_age_example/initialize_ideal_age_tracer(restart, day, G, GV, US, h, diag, OBC, CS, sponge_CSp)
Sets the ideal age traces to their initial values and sets up the tracer output.
- Parameters:
restart ::
restart[in] .true. if the fields have already been read from a restart file.day ::
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 ::
h[in] Layer thicknesses [H ~> m or kg m-2]diag ::
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 register_ideal_age_tracer.
sponge_csp :: Pointer to the control structure for the sponges.
- Call to:
mom_error_handler::mom_errormom_io::query_vardescmom_tracer_z_init::tracer_z_init
- subroutine ideal_age_example/ideal_age_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV, US, CS, evap_CFL_limit, minimum_forcing_depth, Hbl)
Applies diapycnal diffusion, aging and regeneration at the surface to the ideal age tracers.
- Parameters:
g :: [in] The ocean’s grid structure
gv :: [in] The ocean’s vertical grid structure
h_old ::
h_old[in] Layer thickness before entrainment [H ~> m or kg m-2].h_new ::
h_new[in] Layer thickness after entrainment [H ~> m or kg m-2].ea ::
ea[in] an array to which the amount of fluid entrainedeb ::
eb[in] an array to which the amount of fluid entrainedfluxes ::
fluxes[in] A structure containing pointers to thermodynamic and tracer forcing fields. Unused fields have NULL ptrs.dt ::
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 register_ideal_age_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 ::
minimum_forcing_depth[in] The smallest depth over which fluxes can be applied [H ~> m or kg m-2]hbl :: [in] Boundary layer thickness [H ~> m or kg m-2]
- Call to:
mom_tracer_diabatic::applytracerboundaryfluxesinoutcount_bl_layersmom_error_handler::mom_errormom_tracer_diabatic::tracer_vertdiff
- function ideal_age_example/ideal_age_stock(h, stocks, G, GV, CS, names, units, stock_index)
Calculates the mass-weighted integral of all tracer stocks, returning the number of stocks it has calculated. If stock_index is present, only the stock corresponding to that coded index is found.
- Parameters:
g :: [in] The ocean’s grid structure
gv :: [in] The ocean’s vertical grid structure
h ::
h[in] Layer thicknesses [H ~> m or kg m-2]stocks ::
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_ideal_age_tracer.
names ::
names[out] the names of the stocks calculated.units ::
units[out] the units of the stocks calculated.stock_index ::
stock_index[in] the coded index of a specific stock being sought.
- Return:
undefined :: The number of stocks calculated here.
- Call to:
mom_spatial_means::global_mass_int_efpmom_io::query_vardesc- Called from:
- subroutine ideal_age_example/ideal_age_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 ::
sfc_state[inout] A structure containing fields that describe the surface state of the ocean.h ::
h[in] Layer thickness [H ~> m or kg m-2].cs :: The control structure returned by a previous call to register_ideal_age_tracer.
- Call to:
- subroutine ideal_age_example/ideal_age_example_end(CS)
Deallocate any memory associated with this tracer package.
- Parameters:
cs :: The control structure returned by a previous call to register_ideal_age_tracer.
- Called from:
- subroutine ideal_age_example/count_bl_layers(G, GV, h, Hbl, BL_layers)
- Parameters:
g :: [in] The ocean’s grid structure
gv :: [in] The ocean’s vertical grid structure
h ::
h[in] Layer thicknesses [H ~> m or kg m-2].hbl :: [in] Boundary layer thickness [H ~> m or kg m-2]
bl_layers :: [out] Number of model layers in the boundary layer [nondim]
- Called from: