mom_tracer_registry module reference

This module contains the tracer_registry_type() and the subroutines that handle registration of tracers and related subroutines. The primary subroutine, register_tracer, is called to indicate the tracers advected and diffused. and the subroutines that handle registration of tracers and related subroutines. The primary subroutine, register_tracer, is called to indicate the tracers advected and diffused.

More…

Data Types

tracer_registry_type

Type to carry basic tracer information.

tracer_type

The tracer type.

Functions/Subroutines

register_tracer()

This subroutine registers a tracer to be advected and laterally diffused.

lock_tracer_registry()

This subroutine locks the tracer registry to prevent the addition of more tracers.

register_tracer_diagnostics()

register_tracer_diagnostics does a set of register_diag_field calls for any previously registered in a tracer registry with a value of registry_diags set to .true.

preale_tracer_diagnostics()

postale_tracer_diagnostics()

post_tracer_diagnostics_at_sync()

Post tracer diganostics when that should only be posted when MOM’s state is self-consistent (also referred to as ‘synchronized’)

post_tracer_transport_diagnostics()

Post the advective and diffusive tendencies.

mom_tracer_chksum()

This subroutine writes out chksums for tracers.

mom_tracer_chkinv()

Calculates and prints the global inventory of all tracers in the registry.

tracer_name_lookup()

Find a tracer in the tracer registry by name.

tracer_registry_init()

Initialize the tracer registry.

tracer_registry_end()

This routine closes the tracer registry module.

Detailed Description

This module contains the tracer_registry_type() and the subroutines that handle registration of tracers and related subroutines. The primary subroutine, register_tracer, is called to indicate the tracers advected and diffused. and the subroutines that handle registration of tracers and related subroutines. The primary subroutine, register_tracer, is called to indicate the tracers advected and diffused.

Type Documentation

type mom_tracer_registry/tracer_registry_type

Type to carry basic tracer information.

Type fields
  • % ntr [integer] :: number of registered tracers

  • % tr [type( tracer_type )(50)] :: array of registered tracers

  • % locked [logical] :: New tracers may be registered if locked=.false. When locked=.true., no more tracers can be registered, at which point common diagnostics can be set up for the registered tracers.

type mom_tracer_registry/tracer_type

The tracer type.

Type fields
  • % id_tr [integer] :: Diagnostic IDs.

  • % id_tr_post_horzn [integer] :: Diagnostic IDs.

  • % id_adx [integer] :: Diagnostic IDs.

  • % id_ady [integer] :: Diagnostic IDs.

  • % id_dfx [integer] :: Diagnostic IDs.

  • % id_dfy [integer] :: Diagnostic IDs.

  • % id_lbd_bulk_dfx [integer] :: Diagnostic IDs.

  • % id_lbd_bulk_dfy [integer] :: Diagnostic IDs.

  • % id_lbd_dfx [integer] :: Diagnostic IDs.

  • % id_lbd_dfy [integer] :: Diagnostic IDs.

  • % id_lbd_dfx_2d [integer] :: Diagnostic IDs.

  • % id_lbd_dfy_2d [integer] :: Diagnostic IDs.

  • % id_adx_2d [integer] :: Diagnostic IDs.

  • % id_ady_2d [integer] :: Diagnostic IDs.

  • % id_dfx_2d [integer] :: Diagnostic IDs.

  • % id_dfy_2d [integer] :: Diagnostic IDs.

  • % id_adv_xy [integer] :: Diagnostic IDs.

  • % id_adv_xy_2d [integer] :: Diagnostic IDs.

  • % id_dfxy_cont [integer] :: Diagnostic IDs.

  • % id_dfxy_cont_2d [integer] :: Diagnostic IDs.

  • % id_dfxy_conc [integer] :: Diagnostic IDs.

  • % id_lbdxy_cont [integer] :: Diagnostic IDs.

  • % id_lbdxy_cont_2d [integer] :: Diagnostic IDs.

  • % id_lbdxy_conc [integer] :: Diagnostic IDs.

  • % id_remap_conc [integer] :: Diagnostic IDs.

  • % id_remap_cont [integer] :: Diagnostic IDs.

  • % id_remap_cont_2d [integer] :: Diagnostic IDs.

  • % id_tendency [integer] :: Diagnostic IDs.

  • % id_trxh_tendency [integer] :: Diagnostic IDs.

  • % id_trxh_tendency_2d [integer] :: Diagnostic IDs.

  • % id_tr_vardec [integer] :: Diagnostic IDs.

  • % t [real(:,:,:),pointer] :: tracer concentration array [conc]

  • % ad_x [real(:,:,:),pointer] :: diagnostic array for x-advective tracer flux [conc H L2 T-1 ~> conc m3 s-1 or conc kg s-1]

  • % ad_y [real(:,:,:),pointer] :: diagnostic array for y-advective tracer flux [conc H L2 T-1 ~> conc m3 s-1 or conc kg s-1]

  • % ad2d_x [real(:,:),pointer] :: diagnostic vertical sum x-advective tracer flux [conc H L2 T-1 ~> conc m3 s-1 or conc kg s-1]

  • % ad2d_y [real(:,:),pointer] :: diagnostic vertical sum y-advective tracer flux [conc H L2 T-1 ~> conc m3 s-1 or conc kg s-1]

  • % df_x [real(:,:,:),pointer] :: diagnostic array for x-diffusive tracer flux [conc H L2 T-1 ~> conc m3 s-1 or conc kg s-1]

  • % df_y [real(:,:,:),pointer] :: diagnostic array for y-diffusive tracer flux [conc H L2 T-1 ~> conc m3 s-1 or conc kg s-1]

  • % lbd_dfx [real(:,:,:),pointer] :: diagnostic array for x-diffusive tracer flux [conc H L2 T-1 ~> conc m3 s-1 or conc kg s-1]

  • % lbd_dfy [real(:,:,:),pointer] :: diagnostic array for y-diffusive tracer flux [conc H L2 T-1 ~> conc m3 s-1 or conc kg s-1]

  • % lbd_dfx_2d [real(:,:),pointer] :: diagnostic array for x-diffusive tracer flux [conc H L2 T-1 ~> conc m3 s-1 or conc kg s-1]

  • % lbd_dfy_2d [real(:,:),pointer] :: diagnostic array for y-diffusive tracer flux [conc H L2 T-1 ~> conc m3 s-1 or conc kg s-1]

  • % lbd_bulk_df_x [real(:,:),pointer] :: diagnostic array for x-diffusive tracer flux [conc H L2 T-1 ~> conc m3 s-1 or conc kg s-1]

  • % lbd_bulk_df_y [real(:,:),pointer] :: diagnostic array for y-diffusive tracer flux [conc H L2 T-1 ~> conc m3 s-1 or conc kg s-1]

  • % df2d_x [real(:,:),pointer] :: diagnostic vertical sum x-diffusive flux [conc H L2 T-1 ~> conc m3 s-1 or conc kg s-1]

  • % df2d_y [real(:,:),pointer] :: diagnostic vertical sum y-diffusive flux [conc H L2 T-1 ~> conc m3 s-1 or conc kg s-1]

  • % advection_xy [real(:,:,:),pointer] :: convergence of lateral advective tracer fluxes [conc H T-1 ~> conc m s-1 or conc kg m-2 s-1]

  • % t_prev [real(:,:,:),pointer] :: tracer concentration array at a previous timestep used for diagnostics [conc]

  • % trxh_prev [real(:,:,:),pointer] :: layer integrated tracer concentration array at a previous timestep used for diagnostics [conc H ~> conc m or conc kg m-2]

  • % name [character (len=32)] :: tracer name used for diagnostics and error messages

  • % units [character (len=64)] :: Physical dimensions of the tracer concentration.

  • % longname [character (len=240)] :: Long name of the variable.

  • % registry_diags [logical] :: If true, use the registry to set up the diagnostics associated with this tracer.

  • % cmor_name [character (len=64)] :: CMOR name of this tracer.

  • % cmor_units [character (len=64)] :: CMOR physical dimensions of the tracer.

  • % cmor_longname [character (len=240)] :: CMOR long name of the tracer.

  • % flux_nameroot [character (len=32)] :: Short tracer name snippet used construct the names of flux diagnostics.

  • % flux_longname [character (len=64)] :: A word or phrase used construct the long names of flux diagnostics.

  • % flux_scale [real] :: A scaling factor used to convert the fluxes of this tracer to its desired units, including a factor compensating for H scaling.

  • % flux_units [character (len=48)] :: The units for fluxes of this variable.

  • % conv_units [character (len=48)] :: The units for the flux convergence of this tracer.

  • % conv_scale [real] :: A scaling factor used to convert the flux convergence of this tracer to its desired units, including a factor compensating for H scaling.

  • % cmor_tendprefix [character (len=48)] :: The CMOR variable prefix for tendencies of this tracer, required because CMOR does not follow any discernable pattern for these names.

  • % ind_tr_squared [integer] :: The tracer registry index for the square of this tracer.

  • % remap_tr [logical] :: If true, this tracer should be vertically remapped.

  • % diag_form [integer] :: An integer indicating which template is to be used to label diagnostics.

Function/Subroutine Documentation

subroutine mom_tracer_registry/register_tracer(tr_ptr, Reg, param_file, HI, GV, name, longname, units, cmor_name, cmor_units, cmor_longname, tr_desc, OBC_inflow, OBC_in_u, OBC_in_v, ad_x, ad_y, df_x, df_y, ad_2d_x, ad_2d_y, df_2d_x, df_2d_y, advection_xy, registry_diags, flux_nameroot, flux_longname, flux_units, flux_scale, convergence_units, convergence_scale, cmor_tendprefix, diag_form, restart_CS, mandatory)

This subroutine registers a tracer to be advected and laterally diffused.

Parameters
  • hi :: [in] horizontal index type

  • gv :: [in] ocean vertical grid structure

  • reg :: pointer to the tracer registry

  • tr_ptr :: target or pointer to the tracer array

  • param_file :: [in] file to parse for model parameter values

  • name :: [in] Short tracer name

  • longname :: [in] The long tracer name

  • units :: [in] The units of this tracer

  • cmor_name :: [in] CMOR name

  • cmor_units :: [in] CMOR physical dimensions of variable

  • cmor_longname :: [in] CMOR long name

  • tr_desc :: [in] A structure with metadata about the tracer

  • obc_inflow :: [in] the tracer for all inflows via OBC for which OBC_in_u or OBC_in_v are not specified (units of tracer CONC)

  • obc_in_u :: tracer at inflows through u-faces of tracer cells (units of tracer CONC)

  • obc_in_v :: tracer at inflows through v-faces of tracer cells (units of tracer CONC)

  • ad_x :: diagnostic x-advective flux [conc H L2 T-1 ~> CONC m3 s-1 or CONC kg s-1]

  • ad_y :: diagnostic y-advective flux [conc H L2 T-1 ~> CONC m3 s-1 or CONC kg s-1]

  • df_x :: diagnostic x-diffusive flux [conc H L2 T-1 ~> CONC m3 s-1 or CONC kg s-1]

  • df_y :: diagnostic y-diffusive flux [conc H L2 T-1 ~> CONC m3 s-1 or CONC kg s-1]

  • ad_2d_x :: vert sum of diagnostic x-advect flux [conc H L2 T-1 ~> CONC m3 s-1 or CONC kg s-1]

  • ad_2d_y :: vert sum of diagnostic y-advect flux [conc H L2 T-1 ~> CONC m3 s-1 or CONC kg s-1]

  • df_2d_x :: vert sum of diagnostic x-diffuse flux [conc H L2 T-1 ~> CONC m3 s-1 or CONC kg s-1]

  • df_2d_y :: vert sum of diagnostic y-diffuse flux [conc H L2 T-1 ~> CONC m3 s-1 or CONC kg s-1]

  • advection_xy :: convergence of lateral advective tracer fluxes

  • registry_diags :: [in] If present and true, use the registry for the diagnostics of this tracer.

  • flux_nameroot :: [in] Short tracer name snippet used construct the names of flux diagnostics.

  • flux_longname :: [in] A word or phrase used construct the long names of flux diagnostics.

  • flux_units :: [in] The units for the fluxes of this tracer.

  • flux_scale :: [in] A scaling factor used to convert the fluxes of this tracer to its desired units.

  • convergence_units :: [in] The units for the flux convergence of this tracer.

  • convergence_scale :: [in] A scaling factor used to convert the flux convergence of this tracer to its desired units.

  • cmor_tendprefix :: [in] The CMOR name for the layer-integrated tendencies of this tracer.

  • diag_form :: [in] An integer (1 or 2, 1 by default) indicating the character string template to use in labeling diagnostics

  • restart_cs :: A pointer to the restart control structure this tracer will be registered for restarts if this argument is present

  • mandatory :: [in] If true, this tracer must be read from a restart file.

Call to

mom_error_handler::mom_error mom_io::query_vardesc tracer_registry_init

Called from

advection_test_tracer::register_advection_test_tracer boundary_impulse_tracer::register_boundary_impulse_tracer mom_cfc_cap::register_cfc_cap dome_tracer::register_dome_tracer regional_dyes::register_dye_tracer dyed_obc_tracer::register_dyed_obc_tracer ideal_age_example::register_ideal_age_tracer isomip_tracer::register_isomip_tracer mom_generic_tracer::register_mom_generic_tracer nw2_tracers::register_nw2_tracers mom_ocmip2_cfc::register_ocmip2_cfc oil_tracer::register_oil_tracer pseudo_salt_tracer::register_pseudo_salt_tracer rgc_tracer::register_rgc_tracer user_tracer_example::user_register_tracer_example

subroutine mom_tracer_registry/lock_tracer_registry(Reg)

This subroutine locks the tracer registry to prevent the addition of more tracers. After locked=.true., can then register common diagnostics.

Parameters

reg :: pointer to the tracer registry

Call to

mom_error_handler::mom_error

subroutine mom_tracer_registry/register_tracer_diagnostics(Reg, h, Time, diag, G, GV, US, use_ALE)

register_tracer_diagnostics does a set of register_diag_field calls for any previously registered in a tracer registry with a value of registry_diags set to .true.

Parameters
  • g :: [in] The ocean’s grid structure

  • gv :: [in] The ocean’s vertical grid structure

  • us :: [in] A dimensional unit scaling type

  • reg :: pointer to the tracer registry

  • h :: [in] Layer thicknesses [H ~> m or kg m-2]

  • time :: [in] current model time

  • diag :: [in] structure to regulate diagnostic output

  • use_ale :: [in] If true active diagnostics that only apply to ALE configurations

Call to

mom_io::cmor_long_std mom_string_functions::lowercase mom_error_handler::mom_error

subroutine mom_tracer_registry/preale_tracer_diagnostics(Reg, G, GV)
Parameters
  • reg :: pointer to the tracer registry

  • g :: [in] The ocean’s grid structure

  • gv :: [in] ocean vertical grid structure

subroutine mom_tracer_registry/postale_tracer_diagnostics(Reg, G, GV, diag, dt)
Parameters
  • reg :: pointer to the tracer registry

  • g :: [in] The ocean’s grid structure

  • gv :: [in] ocean vertical grid structure

  • diag :: [in] regulates diagnostic output

  • dt :: [in] total time interval for these diagnostics [T ~> s]

Call to

mom_error_handler::mom_error

subroutine mom_tracer_registry/post_tracer_diagnostics_at_sync(Reg, h, diag_prev, diag, G, GV, dt)

Post tracer diganostics when that should only be posted when MOM’s state is self-consistent (also referred to as ‘synchronized’)

Parameters
  • g :: [in] The ocean’s grid structure

  • gv :: [in] The ocean’s vertical grid structure

  • reg :: pointer to the tracer registry

  • h :: [in] Layer thicknesses [H ~> m or kg m-2]

  • diag_prev :: [in] Contains diagnostic grids from previous timestep

  • diag :: [inout] structure to regulate diagnostic output

  • dt :: [in] total time step for tracer updates [T ~> s]

Call to

mom_diag_mediator::diag_copy_storage_to_diag mom_diag_mediator::diag_restore_grids mom_diag_mediator::diag_save_grids

subroutine mom_tracer_registry/post_tracer_transport_diagnostics(G, GV, Reg, h_diag, diag)

Post the advective and diffusive tendencies.

Parameters
  • g :: [in] The ocean’s grid structure

  • gv :: [in] The ocean’s vertical grid structure

  • reg :: pointer to the tracer registry

  • h_diag :: [in] Layer thicknesses on which to post fields [H ~> m or kg m-2]

  • diag :: [in] structure to regulate diagnostic output

Called from

mom_diagnostics::post_transport_diagnostics

subroutine mom_tracer_registry/mom_tracer_chksum(mesg, Tr, ntr, G)

This subroutine writes out chksums for tracers.

Parameters
  • mesg :: [in] message that appears on the chksum lines

  • tr :: [in] array of all of registered tracers

  • ntr :: [in] number of registered tracers

  • g :: [in] ocean grid structure

Called from

mom_offline_main::offline_redistribute_residual mom_tracer_hor_diff::tracer_hordiff

subroutine mom_tracer_registry/mom_tracer_chkinv(mesg, G, GV, h, Tr, ntr)

Calculates and prints the global inventory of all tracers in the registry.

Parameters
  • mesg :: [in] message that appears on the chksum lines

  • g :: [in] ocean grid structure

  • gv :: [in] The ocean’s vertical grid structure

  • tr :: [in] array of all of registered tracers

  • h :: [in] Layer thicknesses [H ~> m or kg m-2]

  • ntr :: [in] number of registered tracers

Called from

mom_ale::ale_offline_inputs mom_offline_main::offline_advection_ale mom_offline_main::offline_diabatic_ale mom_offline_main::offline_fw_fluxes_into_ocean mom_offline_main::offline_fw_fluxes_out_ocean mom_offline_main::offline_redistribute_residual

subroutine mom_tracer_registry/tracer_name_lookup(Reg, tr_ptr, name)

Find a tracer in the tracer registry by name.

Parameters
  • reg :: pointer to tracer registry

  • tr_ptr :: target or pointer to the tracer array

  • name :: [in] tracer name

Call to

mom_string_functions::lowercase

Called from

dome_initialization::dome_set_obc_data mom_open_boundary::register_temp_salt_segments

subroutine mom_tracer_registry/tracer_registry_init(param_file, Reg)

Initialize the tracer registry.

Parameters
  • param_file :: [in] open file to parse for model parameters

  • reg :: pointer to tracer registry

Call to

mom_error_handler::mom_error

Called from

register_tracer

subroutine mom_tracer_registry/tracer_registry_end(Reg)

This routine closes the tracer registry module.

Parameters

reg :: The tracer registry that will be deallocated