mom_diagnostics module reference

Calculates any requested diagnostic quantities that are not calculated in the various subroutines. Diagnostic quantities are requested by allocating them memory.

More…

Data Types

diagnostics_cs

The control structure for the MOM_diagnostics module.

surface_diag_ids

A structure with diagnostic IDs of the surface and integrated variables.

transport_diag_ids

A structure with diagnostic IDs of mass transport related diagnostics.

Functions/Subroutines

calculate_diagnostic_fields()

Diagnostics not more naturally calculated elsewhere are computed here.

find_weights()

This subroutine finds the location of R_in in an increasing ordered list, Rlist, returning as k the element such that Rlist(k) <= R_in < Rlist(k+1), and where wt and wt_p are the linear weights that should be assigned to elements k and k+1.

calculate_vertical_integrals()

This subroutine calculates vertical integrals of several tracers, along with the mass-weight of these tracers, the total column mass, and the carefully calculated column height.

calculate_energy_diagnostics()

This subroutine calculates terms in the mechanical energy budget.

register_time_deriv()

This subroutine registers fields to calculate a diagnostic time derivative.

calculate_derivs()

This subroutine calculates all registered time derivatives.

post_surface_dyn_diags()

This routine posts diagnostics of various dynamic ocean surface quantities, including velocities, speed and sea surface height, at the time the ocean state is reported back to the caller.

post_surface_thermo_diags()

This routine posts diagnostics of various ocean surface and integrated quantities at the time the ocean state is reported back to the caller.

post_transport_diagnostics()

This routine posts diagnostics of the transports, including the subgridscale contributions.

mom_diagnostics_init()

This subroutine registers various diagnostics and allocates space for fields that other diagnostics depend upon.

register_surface_diags()

Register diagnostics of the surface state and integrated quantities.

register_transport_diags()

Register certain diagnostics related to transports.

write_static_fields()

Offers the static fields in the ocean grid type for output via the diag_manager.

set_dependent_diagnostics()

This subroutine sets up diagnostics upon which other diagnostics depend.

mom_diagnostics_end()

Deallocate memory associated with the diagnostics module.

Detailed Description

Calculates any requested diagnostic quantities that are not calculated in the various subroutines. Diagnostic quantities are requested by allocating them memory.

Type Documentation

type  mom_diagnostics/diagnostics_cs

The control structure for the MOM_diagnostics module.

Type fields:
  • % id_u :: integer Diagnostic IDs.

  • % id_v :: integer Diagnostic IDs.

  • % id_h :: integer Diagnostic IDs.

  • % id_usq :: integer Diagnostic IDs.

  • % id_vsq :: integer Diagnostic IDs.

  • % id_uv :: integer Diagnostic IDs.

  • % id_e :: integer Diagnostic IDs.

  • % id_e_d :: integer Diagnostic IDs.

  • % id_du_dt :: integer Diagnostic IDs.

  • % id_dv_dt :: integer Diagnostic IDs.

  • % id_h_du_dt :: integer Diagnostic IDs.

  • % id_h_dv_dt :: integer Diagnostic IDs.

  • % id_hf_du_dt_2d :: integer Diagnostic IDs.

  • % id_hf_dv_dt_2d :: integer Diagnostic IDs.

  • % id_col_ht :: integer Diagnostic IDs.

  • % id_dh_dt :: integer Diagnostic IDs.

  • % id_ke :: integer Diagnostic IDs.

  • % id_dkedt :: integer Diagnostic IDs.

  • % id_pe_to_ke :: integer Diagnostic IDs.

  • % id_ke_bt :: integer Diagnostic IDs.

  • % id_ke_sal :: integer Diagnostic IDs.

  • % id_ke_tides :: integer Diagnostic IDs.

  • % id_ke_bt_pf :: integer Diagnostic IDs.

  • % id_ke_bt_cf :: integer Diagnostic IDs.

  • % id_ke_bt_wd :: integer Diagnostic IDs.

  • % id_pe_to_ke_btbc :: integer Diagnostic IDs.

  • % id_ke_coradv_btbc :: integer Diagnostic IDs.

  • % id_ke_coradv :: integer Diagnostic IDs.

  • % id_ke_adv :: integer Diagnostic IDs.

  • % id_ke_visc :: integer Diagnostic IDs.

  • % id_ke_stress :: integer Diagnostic IDs.

  • % id_ke_visc_gl90 :: integer Diagnostic IDs.

  • % id_ke_horvisc :: integer Diagnostic IDs.

  • % id_ke_dia :: integer Diagnostic IDs.

  • % id_uh_rlay :: integer Diagnostic IDs.

  • % id_vh_rlay :: integer Diagnostic IDs.

  • % id_uhgm_rlay :: integer Diagnostic IDs.

  • % id_vhgm_rlay :: integer Diagnostic IDs.

  • % id_h_rlay :: integer Diagnostic IDs.

  • % id_rd1 :: integer Diagnostic IDs.

  • % id_rml :: integer Diagnostic IDs.

  • % id_rcv :: integer Diagnostic IDs.

  • % id_cg1 :: integer Diagnostic IDs.

  • % id_cfl_cg1 :: integer Diagnostic IDs.

  • % id_cfl_cg1_x :: integer Diagnostic IDs.

  • % id_cfl_cg1_y :: integer Diagnostic IDs.

  • % id_cg_ebt :: integer Diagnostic IDs.

  • % id_rd_ebt :: integer Diagnostic IDs.

  • % id_p_ebt :: integer Diagnostic IDs.

  • % id_temp_int :: integer Diagnostic IDs.

  • % id_salt_int :: integer Diagnostic IDs.

  • % id_absscint :: integer Diagnostic IDs.

  • % id_pfscint :: integer Diagnostic IDs.

  • % id_scint :: integer Diagnostic IDs.

  • % id_chcint :: integer Diagnostic IDs.

  • % id_phcint :: integer Diagnostic IDs.

  • % id_mass_wt :: integer Diagnostic IDs.

  • % id_col_mass :: integer Diagnostic IDs.

  • % id_masscello :: integer Diagnostic IDs.

  • % id_masso :: integer Diagnostic IDs.

  • % id_volcello :: integer Diagnostic IDs.

  • % id_tpot :: integer Diagnostic IDs.

  • % id_sprac :: integer Diagnostic IDs.

  • % id_tob :: integer Diagnostic IDs.

  • % id_sob :: integer Diagnostic IDs.

  • % id_thetaoga :: integer Diagnostic IDs.

  • % id_soga :: integer Diagnostic IDs.

  • % id_bigthetaoga :: integer Diagnostic IDs.

  • % id_abssoga :: integer Diagnostic IDs.

  • % id_sosga :: integer Diagnostic IDs.

  • % id_tosga :: integer Diagnostic IDs.

  • % id_abssosga :: integer Diagnostic IDs.

  • % id_bigtosga :: integer Diagnostic IDs.

  • % id_temp_layer_ave :: integer Diagnostic IDs.

  • % id_salt_layer_ave :: integer Diagnostic IDs.

  • % id_bigtemp_layer_ave :: integer Diagnostic IDs.

  • % id_abssalt_layer_ave :: integer Diagnostic IDs.

  • % id_pbo :: integer Diagnostic IDs.

  • % id_thkcello :: integer Diagnostic IDs.

  • % id_rhoinsitu :: integer Diagnostic IDs.

  • % id_rhopot0 :: integer Diagnostic IDs.

  • % id_rhopot2 :: integer Diagnostic IDs.

  • % id_drho_dt :: integer Diagnostic IDs.

  • % id_drho_ds :: integer Diagnostic IDs.

  • % id_h_pre_sync :: integer Diagnostic IDs.

  • % id_tosq :: integer Diagnostic IDs.

  • % id_sosq :: integer Diagnostic IDs.

  • % id_t20d :: integer Diagnostic IDs.

  • % id_t17d :: integer Diagnostic IDs.

  • % initialized :: logical True if this control structure has been initialized.

  • % mono_n2_column_fraction :: real The lower fraction of water column over which N2 is limited as monotonic for the purposes of calculating the equivalent barotropic wave speed [nondim].

  • % mono_n2_depth :: real The depth below which N2 is limited as monotonic for the purposes of calculating the equivalent barotropic wave speed [H ~> m or kg m-2].

  • % accurate_thick_cello :: logical If true, use the same careful integrals to find the diagnosed non-Boussinesq layer thicknesses as are used to find the free surface height, instead of using an approximate thickness based on division by the mid-layer density.

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

  • % du_dt :: real, dimension(:,:,:), allocatable net i-acceleration [L T-2 ~> m s-2]

  • % dv_dt :: real, dimension(:,:,:), allocatable net j-acceleration [L T-2 ~> m s-2]

  • % dh_dt :: real, dimension(:,:,:), allocatable thickness rate of change [H T-1 ~> m s-1 or kg m-2 s-1]

  • % ke_term_on :: logical If true, at least one diagnostic term in the KE budget is in use.

  • % wave_speed :: type(wave_speed_cs) Wave speed control struct.

  • % var_ptr :: type(p3d), dimension(50) pointers to variables used in the calculation of time derivatives

  • % deriv :: type(p3d), dimension(50) Time derivatives of various fields.

  • % prev_val :: type(p3d), dimension(50) Previous values of variables used in the calculation of time derivatives previous values of variables used in calculation of time derivatives.

  • % nlay :: integer, dimension(50) The number of layers in each diagnostics.

  • % num_time_deriv :: integer The number of time derivative diagnostics.

  • % pass_ke_uv :: type(group_pass_type) A handle used for group halo passes.

[source]

type  mom_diagnostics/surface_diag_ids

A structure with diagnostic IDs of the surface and integrated variables.

Type fields:
  • % id_zos :: integer Diagnostic IDs for 2-d surface and bottom flux and state fields.

  • % id_zossq :: integer Diagnostic IDs for 2-d surface and bottom flux and state fields.

  • % id_volo :: integer Diagnostic IDs for 2-d surface and bottom flux and state fields.

  • % id_speed :: integer Diagnostic IDs for 2-d surface and bottom flux and state fields.

  • % id_ssh :: integer Diagnostic IDs for 2-d surface and bottom flux and state fields.

  • % id_ssh_ga :: integer Diagnostic IDs for 2-d surface and bottom flux and state fields.

  • % id_sst :: integer Diagnostic IDs for 2-d surface and bottom flux and state fields.

  • % id_sst_sq :: integer Diagnostic IDs for 2-d surface and bottom flux and state fields.

  • % id_sstcon :: integer Diagnostic IDs for 2-d surface and bottom flux and state fields.

  • % id_sss :: integer Diagnostic IDs for 2-d surface and bottom flux and state fields.

  • % id_sss_sq :: integer Diagnostic IDs for 2-d surface and bottom flux and state fields.

  • % id_sssabs :: integer Diagnostic IDs for 2-d surface and bottom flux and state fields.

  • % id_ssu :: integer Diagnostic IDs for 2-d surface and bottom flux and state fields.

  • % id_ssv :: integer Diagnostic IDs for 2-d surface and bottom flux and state fields.

  • % id_ssu_east :: integer Diagnostic IDs for 2-d surface and bottom flux and state fields.

  • % id_ssv_north :: integer Diagnostic IDs for 2-d surface and bottom flux and state fields.

  • % id_fraz :: integer Diagnostic IDs for 2-d surface and bottom flux and state fields.

  • % id_salt_deficit :: integer Diagnostic IDs for 2-d surface and bottom flux and state fields.

  • % id_heat_pme :: integer Diagnostic IDs for 2-d surface and bottom flux and state fields.

  • % id_intern_heat :: integer Diagnostic IDs for 2-d surface and bottom flux and state fields.

[source]

type  mom_diagnostics/transport_diag_ids

A structure with diagnostic IDs of mass transport related diagnostics.

Type fields:
  • % id_uhtr :: integer Diagnostics for tracer horizontal transport.

  • % id_umo :: integer Diagnostics for tracer horizontal transport.

  • % id_umo_2d :: integer Diagnostics for tracer horizontal transport.

  • % id_vhtr :: integer Diagnostics for tracer horizontal transport.

  • % id_vmo :: integer Diagnostics for tracer horizontal transport.

  • % id_vmo_2d :: integer Diagnostics for tracer horizontal transport.

  • % id_dynamics_h :: integer Diagnostics for tracer horizontal transport.

  • % id_dynamics_h_tendency :: integer Diagnostics for tracer horizontal transport.

[source]

Function/Subroutine Documentation

subroutine mom_diagnostics/calculate_diagnostic_fields(u, v, h, uh, vh, tv, ADp, CDp, p_surf, dt, diag_pre_sync, G, GV, US, CS)

Diagnostics not more naturally calculated elsewhere are computed here.

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

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

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

  • u :: u [in] The zonal velocity [L T-1 ~> m s-1].

  • v :: v [in] The meridional velocity [L T-1 ~> m s-1].

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

  • uh :: uh [in] Transport through zonal faces = u*h*dy,

  • vh :: vh [in] Transport through meridional faces = v*h*dx,

  • tv :: tv [in] A structure pointing to various thermodynamic variables.

  • adp :: [in] structure with pointers to accelerations in momentum equation.

  • cdp :: [in] structure with pointers to terms in continuity equation.

  • p_surf :: p_surf A pointer to the surface pressure [R L2 T-2 ~> Pa]. If p_surf is not associated, it is the same as setting the surface pressure to 0.

  • dt :: dt [in] The time difference since the last call to this subroutine [T ~> s].

  • diag_pre_sync :: diag_pre_sync [in] Target grids from previous timestep

  • cs :: [inout] Control structure returned by a previous call to diagnostics_init.

Call to:

mom_eos::abs_saln_to_prac_saln calculate_derivs calculate_energy_diagnostics calculate_vertical_integrals mom_diag_mediator::diag_copy_storage_to_diag mom_diag_mediator::diag_restore_grids mom_diag_mediator::diag_save_grids mom_interface_heights::find_dz_for_eta find_weights mom_spatial_means::global_volume_mean mom_error_handler::mom_error mom_wave_speed::wave_speed

[source]

subroutine mom_diagnostics/find_weights(Rlist, R_in, k, nz, wt, wt_p)

This subroutine finds the location of R_in in an increasing ordered list, Rlist, returning as k the element such that Rlist(k) <= R_in < Rlist(k+1), and where wt and wt_p are the linear weights that should be assigned to elements k and k+1.

Parameters:
  • rlist :: [in] The list of target densities [R ~> kg m-3]

  • r_in :: [in] The density being inserted into Rlist [R ~> kg m-3]

  • k :: k [inout] The value of k such that Rlist(k) <= R_in < Rlist(k+1) The input value is a first guess

  • nz :: nz [in] The number of layers in Rlist

  • wt :: wt [out] The weight of layer k for interpolation [nondim]

  • wt_p :: wt_p [out] The weight of layer k+1 for interpolation [nondim]

Called from:

calculate_diagnostic_fields

[source]

subroutine mom_diagnostics/calculate_vertical_integrals(h, tv, p_surf, G, GV, US, CS)

This subroutine calculates vertical integrals of several tracers, along with the mass-weight of these tracers, the total column mass, and the carefully calculated column height.

Parameters:
  • g :: [inout] 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].

  • tv :: tv [in] A structure pointing to various thermodynamic variables.

  • p_surf :: p_surf A pointer to the surface pressure [R L2 T-2 ~> Pa]. If p_surf is not associated, it is the same as setting the surface pressure to 0.

  • cs :: [inout] Control structure returned by a previous call to diagnostics_init.

Call to:

mom_eos::abs_saln_to_prac_saln mom_interface_heights::find_col_mass mom_eos::prac_saln_to_abs_saln

Called from:

calculate_diagnostic_fields

[source]

subroutine mom_diagnostics/calculate_energy_diagnostics(u, v, h, uh, vh, ADp, CDp, G, GV, US, CS)

This subroutine calculates terms in the mechanical energy budget.

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

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

  • u :: u [in] The zonal velocity [L T-1 ~> m s-1].

  • v :: v [in] The meridional velocity [L T-1 ~> m s-1].

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

  • uh :: uh [in] Transport through zonal faces=u*h*dy,

  • vh :: vh [in] Transport through merid faces=v*h*dx,

  • adp :: [in] Structure pointing to accelerations in momentum equation.

  • cdp :: [in] Structure pointing to terms in continuity equations.

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

  • cs :: [inout] Control structure returned by a previous call to diagnostics_init.

Called from:

calculate_diagnostic_fields

[source]

subroutine mom_diagnostics/register_time_deriv(lb, f_ptr, deriv_ptr, CS)

This subroutine registers fields to calculate a diagnostic time derivative.

Parameters:
  • lb :: lb [in] Lower index bound of f_ptr

  • f_ptr :: f_ptr Time derivative operand, in arbitrary units [A ~> a]

  • deriv_ptr :: deriv_ptr Time derivative of f_ptr, in units derived from the arbitrary units of f_ptr [A T-1 ~> a s-1]

  • cs :: [inout] Control structure returned by previous call to diagnostics_init.

Call to:

mom_error_handler::mom_error

Called from:

set_dependent_diagnostics

[source]

subroutine mom_diagnostics/calculate_derivs(dt, G, CS)

This subroutine calculates all registered time derivatives.

Parameters:
  • dt :: dt [in] The time interval over which differences occur [T ~> s].

  • g :: [inout] The ocean’s grid structure.

  • cs :: [inout] Control structure returned by previous call to diagnostics_init.

Called from:

calculate_diagnostic_fields

[source]

subroutine mom_diagnostics/post_surface_dyn_diags(IDs, G, diag, sfc_state, ssh)

This routine posts diagnostics of various dynamic ocean surface quantities, including velocities, speed and sea surface height, at the time the ocean state is reported back to the caller.

Parameters:
  • ids :: [in] A structure with the diagnostic IDs.

  • g :: [in] ocean grid structure

  • diag :: diag [in] regulates diagnostic output

  • sfc_state :: sfc_state [in] structure describing the ocean surface state

  • ssh :: ssh [in] Time mean surface height without corrections

[source]

subroutine mom_diagnostics/post_surface_thermo_diags(IDs, G, GV, US, diag, dt_int, sfc_state, tv, ssh, ssh_ibc)

This routine posts diagnostics of various ocean surface and integrated quantities at the time the ocean state is reported back to the caller.

Parameters:
  • ids :: [in] A structure with the diagnostic IDs.

  • g :: [in] ocean grid structure

  • gv :: [in] ocean vertical grid structure

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

  • diag :: diag [in] regulates diagnostic output

  • dt_int :: dt_int [in] total time step associated with these diagnostics [T ~> s].

  • sfc_state :: sfc_state [in] structure describing the ocean surface state

  • tv :: tv [in] A structure pointing to various thermodynamic variables

  • ssh :: ssh [in] Time mean surface height without corrections for ice displacement [Z ~> m]

  • ssh_ibc :: ssh_ibc [in] Time mean surface height with corrections for ice displacement and the inverse barometer [Z ~> m]

Call to:

mom_eos::abs_saln_to_prac_saln mom_coupler_types::coupler_type_send_data mom_spatial_means::global_area_integral

[source]

subroutine mom_diagnostics/post_transport_diagnostics(G, GV, US, uhtr, vhtr, h, IDs, diag_pre_dyn, diag, dt_trans, Reg)

This routine posts diagnostics of the transports, including the subgridscale contributions.

Parameters:
  • g :: [inout] ocean grid structure

  • gv :: [in] ocean vertical grid structure

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

  • uhtr :: uhtr [in] Accumulated zonal thickness fluxes used to advect tracers [H L2 ~> m3 or kg]

  • vhtr :: vhtr [in] Accumulated meridional thickness fluxes used to advect tracers [H L2 ~> m3 or kg]

  • h :: h [in] The updated layer thicknesses [H ~> m or kg m-2]

  • ids :: [in] A structure with the diagnostic IDs.

  • diag_pre_dyn :: diag_pre_dyn [inout] Stored grids from before dynamics

  • diag :: diag [inout] regulates diagnostic output

  • dt_trans :: dt_trans [in] total time step associated with the transports [T ~> s].

  • reg :: Pointer to the tracer registry

Call to:

mom_diag_mediator::diag_copy_storage_to_diag mom_diag_mediator::diag_restore_grids mom_diag_mediator::diag_save_grids mom_tracer_registry::post_tracer_transport_diagnostics

[source]

subroutine mom_diagnostics/mom_diagnostics_init(MIS, ADp, CDp, Time, G, GV, US, param_file, diag, CS, tv)

This subroutine registers various diagnostics and allocates space for fields that other diagnostics depend upon.

Parameters:
  • mis :: [in] For “MOM Internal State” a set of pointers to the fields and accelerations that make up the ocean’s internal physical state.

  • adp :: [inout] Structure with pointers to momentum equation terms.

  • cdp :: [inout] Structure with pointers to continuity equation terms.

  • time :: [in] Current model time.

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

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

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

  • param_file :: param_file [in] A structure to parse for run-time parameters.

  • diag :: diag [inout] Structure to regulate diagnostic output.

  • cs :: [inout] Diagnostic control struct

  • tv :: tv [in] A structure pointing to various thermodynamic variables.

Call to:

mom_verticalgrid::get_flux_units mom_verticalgrid::get_thickness_units set_dependent_diagnostics mom_wave_speed::wave_speed_init

[source]

subroutine mom_diagnostics/register_surface_diags(Time, G, US, IDs, diag, tv)

Register diagnostics of the surface state and integrated quantities.

Parameters:
  • time :: [in] current model time

  • g :: [in] ocean grid structure

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

  • ids :: [inout] A structure with the diagnostic IDs.

  • diag :: diag [inout] regulates diagnostic output

  • tv :: tv [in] A structure pointing to various thermodynamic variables

[source]

subroutine mom_diagnostics/register_transport_diags(Time, G, GV, US, IDs, diag)

Register certain diagnostics related to transports.

Parameters:
  • time :: [in] current model time

  • g :: [in] ocean grid structure

  • gv :: [in] ocean vertical grid structure

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

  • ids :: [inout] A structure with the diagnostic IDs.

  • diag :: diag [inout] regulates diagnostic output

Call to:

mom_verticalgrid::get_thickness_units

[source]

subroutine mom_diagnostics/write_static_fields(G, GV, US, tv, diag)

Offers the static fields in the ocean grid type for output via the diag_manager.

Parameters:
  • g :: [in] ocean grid structure

  • gv :: [in] ocean vertical grid structure

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

  • tv :: tv [in] A structure pointing to various thermodynamic variables

  • diag :: diag [inout] regulates diagnostic output

[source]

subroutine mom_diagnostics/set_dependent_diagnostics(MIS, ADp, CDp, G, GV, CS)

This subroutine sets up diagnostics upon which other diagnostics depend.

Parameters:
  • mis :: [in] For “MOM Internal State” a set of pointers to the fields and accelerations making up ocean internal physical state.

  • adp :: [inout] Structure pointing to accelerations in momentum equation.

  • cdp :: [inout] Structure pointing to terms in continuity equation.

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

  • gv :: [in] ocean vertical grid structure

  • cs :: [inout] Pointer to the control structure for this module.

Call to:

register_time_deriv

Called from:

mom_diagnostics_init

[source]

subroutine mom_diagnostics/mom_diagnostics_end(CS, ADp, CDp)

Deallocate memory associated with the diagnostics module.

Parameters:
  • cs :: [inout] Control structure returned by a previous call to diagnostics_init.

  • adp :: [inout] structure with pointers to accelerations in momentum equation.

  • cdp :: [inout] Structure pointing to terms in continuity equation.

Called from:

mom::mom_end

[source]

[source]