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¶
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. |
|
Convert a unit scaling descriptor into an array of the dimensions of powers given in the key. |
|
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. |
|
Determine from the list of scaling factors and the unit combinations that are in use whether all these combinations scale uniquely. |
|
Return a string the elements of an array of integers. |
Detailed Description¶
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.
Function/Subroutine Documentation¶
-
subroutine
mom_unique_scales/
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.
- Call to:
mom_error_handler::assert
encode_dim_powers
int_array_msg
mom_error_handler::mom_get_verbosity
mom_error_handler::mom_mesg
non_unique_scales
- Called from:
-
subroutine
mom_unique_scales/
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.
- Called from:
-
subroutine
mom_unique_scales/
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.
- Called from:
-
function
mom_unique_scales/
non_unique_scales
(scales, list, descs, weights, silent) [integer]¶ 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.
- Call to:
- Called from:
-
function
mom_unique_scales/
int_array_msg
(array) [character(len=16*size(array))]¶ Return a string the elements of an array of integers.
- Parameters:
array :: [in] The array whose values are to be written.
- Called from: