MOM_unique_scales module reference

This module provides tools that can be used to check the uniqueness of the dimensional scaling factors used by the MOM6 ocean model or other models

Functions/Subroutines

check_scaling_uniqueness

This subroutine does a checks whether the provided dimensional scaling factors give a unique overall scaling for each of the combinations of units in description, and suggests a better combination if it is not unique. However, this subroutine does nothing if the verbosity level for this run is below 3.

encode_dim_powers

Convert a unit scaling descriptor into an array of the dimensions of powers given in the key

scales_to_powers

Find the integer power of two that describe each of the scaling factors, or return 0 for scaling factors that are not exceptionally close to an integer power of 2.

non_unique_scales

Determine from the list of scaling factors and the unit combinations that are in use whether all these combinations scale uniquely.

int_array_msg

Return a string the elements of an array of integers

Functions/Subroutine Documentation

subroutine check_scaling_uniqueness(component, descs, weights, key, scales, max_powers)

This subroutine does a checks whether the provided dimensional scaling factors give a unique overall scaling for each of the combinations of units in description, and suggests a better combination if it is not unique. However, this subroutine does nothing if the verbosity level for this run is below 3.

Parameters
  • component [in]

    The name of the component (e.g., MOM6) to use in messages

  • descs [in]

    The descriptions for each combination of units

  • weights [in]

    A list of the weights for each described combination

  • key [in]

    The key for the unit scaling

  • scales [in]

    The powers of 2 that give the scaling for each unit in key

  • max_powers [in]

    The maximum range of powers of 2 to search for suggestions of better scaling factors, or 0 to avoid suggesting improved factors.

Callees call graph
Callees of mom_unique_scales::check_scaling_uniqueness calls cluster_mom_error_handler MOM_error_handler cluster_mom_unique_scales MOM_unique_scales mom_error_handler::assert assert mom_error_handler::mom_get_verbosity MOM_get_verbosity mom_error_handler::mom_mesg MOM_mesg mom_unique_scales::check_scaling_uniqueness check_scaling_uniqueness mom_unique_scales::check_scaling_uniqueness->mom_error_handler::assert mom_unique_scales::check_scaling_uniqueness->mom_error_handler::mom_get_verbosity mom_unique_scales::check_scaling_uniqueness->mom_error_handler::mom_mesg mom_unique_scales::encode_dim_powers encode_dim_powers [private/internal] mom_unique_scales::check_scaling_uniqueness->mom_unique_scales::encode_dim_powers mom_unique_scales::int_array_msg int_array_msg [private/internal] mom_unique_scales::check_scaling_uniqueness->mom_unique_scales::int_array_msg mom_unique_scales::non_unique_scales non_unique_scales [private/internal] mom_unique_scales::check_scaling_uniqueness->mom_unique_scales::non_unique_scales
Text view
Callers call graph
Callers of mom_unique_scales::check_scaling_uniqueness calls cluster_mom_check_scaling MOM_check_scaling cluster_mom_unique_scales MOM_unique_scales mom_check_scaling::check_mom6_scaling_factors check_MOM6_scaling_factors mom_unique_scales::check_scaling_uniqueness check_scaling_uniqueness mom_check_scaling::check_mom6_scaling_factors->mom_unique_scales::check_scaling_uniqueness
Text view
subroutine encode_dim_powers(scaling, key, dim_powers)

Convert a unit scaling descriptor into an array of the dimensions of powers given in the key

Parameters
  • scaling [in]

    The unit description that will be converted

  • key [in]

    The key for the unit scaling

  • dim_powers [out]

    The dimensions in scaling of each element of they key.

Callers call graph
Callers of mom_unique_scales::encode_dim_powers calls cluster_mom_unique_scales MOM_unique_scales mom_unique_scales::check_scaling_uniqueness check_scaling_uniqueness mom_unique_scales::encode_dim_powers encode_dim_powers [private/internal] mom_unique_scales::check_scaling_uniqueness->mom_unique_scales::encode_dim_powers
Text view
subroutine scales_to_powers(scale, pow2)

Find the integer power of two that describe each of the scaling factors, or return 0 for scaling factors that are not exceptionally close to an integer power of 2.

Parameters
  • scale [in]

    The scaling factor for each dimension

  • pow2 [out]

    The exact powers of 2 for each scale, or 0 for non-exact powers of 2.

Callers call graph
Callers of mom_unique_scales::scales_to_powers calls cluster_mom_check_scaling MOM_check_scaling cluster_mom_unique_scales MOM_unique_scales mom_check_scaling::check_mom6_scaling_factors check_MOM6_scaling_factors mom_unique_scales::scales_to_powers scales_to_powers mom_check_scaling::check_mom6_scaling_factors->mom_unique_scales::scales_to_powers
Text view
integer function non_unique_scales(scales, list, descs, weights, silent)

Determine from the list of scaling factors and the unit combinations that are in use whether all these combinations scale uniquely.

Parameters
  • scales [in]

    The power of 2 that gives the scaling factor for each dimension

  • list [in]

    A list of the integers for each scaling

  • descs [in]

    The unit descriptions that have been converted

  • weights [in]

    A list of the weights for each scaling

  • silent [in]

    If present and true, do not write any output.

Callees call graph
Callees of mom_unique_scales::non_unique_scales calls cluster_mom_error_handler MOM_error_handler cluster_mom_unique_scales MOM_unique_scales mom_error_handler::assert assert mom_error_handler::mom_mesg MOM_mesg mom_unique_scales::non_unique_scales non_unique_scales [private/internal] mom_unique_scales::non_unique_scales->mom_error_handler::assert mom_unique_scales::non_unique_scales->mom_error_handler::mom_mesg
Text view
Callers call graph
Callers of mom_unique_scales::non_unique_scales calls cluster_mom_unique_scales MOM_unique_scales mom_unique_scales::check_scaling_uniqueness check_scaling_uniqueness mom_unique_scales::non_unique_scales non_unique_scales [private/internal] mom_unique_scales::check_scaling_uniqueness->mom_unique_scales::non_unique_scales
Text view
function int_array_msg(array)

Return a string the elements of an array of integers

Parameters
  • array [in]

    The array whose values are to be written.

Callers call graph
Callers of mom_unique_scales::int_array_msg calls cluster_mom_unique_scales MOM_unique_scales mom_unique_scales::check_scaling_uniqueness check_scaling_uniqueness mom_unique_scales::int_array_msg int_array_msg [private/internal] mom_unique_scales::check_scaling_uniqueness->mom_unique_scales::int_array_msg
Text view
API generated with Flint · Rendered from reStructuredText