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 ::
component[in] The name of the component (e.g., MOM6) to use in messagesdescs ::
descs[in] The descriptions for each combination of unitsweights ::
weights[in] A list of the weights for each described combinationkey ::
key[in] The key for the unit scalingscales ::
scales[in] The powers of 2 that give the scaling for each unit in keymax_powers ::
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::assertencode_dim_powersint_array_msgmom_error_handler::mom_get_verbositymom_error_handler::mom_mesgnon_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 ::
scaling[in] The unit description that will be convertedkey ::
key[in] The key for the unit scalingdim_powers ::
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 ::
scale[in] The scaling factor for each dimensionpow2 ::
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)
Determine from the list of scaling factors and the unit combinations that are in use whether all these combinations scale uniquely.
- Parameters:
scales ::
scales[in] The power of 2 that gives the scaling factor for each dimensionlist ::
list[in] A list of the integers for each scalingdescs ::
descs[in] The unit descriptions that have been convertedweights ::
weights[in] A list of the weights for each scalingsilent ::
silent[in] If present and true, do not write any output.
- Call to:
- Called from:
- function mom_unique_scales/int_array_msg(array)
Return a string the elements of an array of integers.
- Parameters:
array ::
array[in] The array whose values are to be written.- Called from: