This module provides standardized procedures (i.e., functions and subroutines) that serve as reusable building blocks for larger and more complex functionalities elsewhere. Specifically, procedures in this module are intended to be used by the MPAS subdriver and therefore are compiled into the MPAS library ahead of CAM-SIMA.
Computational procedures implement formulas that are universal in atmospheric sciences. They
should be designated as elemental where possible to aid compiler optimizations, such as
vectorization.
Utility procedures implement simple and well-defined operations that can be easily tested.
Test if a is divisible by b, where a and b are both reals.
(KCW, 2024-05-25)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(in) | :: | a | |||
| real(kind=real32), | intent(in) | :: | b |
Test if a is divisible by b, where a and b are both reals.
(KCW, 2024-05-25)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | a | |||
| real(kind=real64), | intent(in) | :: | b |
Test a and b for approximate equality, where a and b are both reals.
(KCW, 2024-05-25)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(in) | :: | a | |||
| real(kind=real32), | intent(in) | :: | b | |||
| real(kind=real32), | intent(in), | optional | :: | absolute_tolerance | ||
| real(kind=real32), | intent(in), | optional | :: | relative_tolerance |
Test a and b for approximate equality, where a and b are both reals.
(KCW, 2024-05-25)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | a | |||
| real(kind=real64), | intent(in) | :: | b | |||
| real(kind=real64), | intent(in), | optional | :: | absolute_tolerance | ||
| real(kind=real64), | intent(in), | optional | :: | relative_tolerance |
Clamp/Limit the value of x to the range of [xmin, xmax], where x, xmin, and xmax are all integers.
No check is performed to ensure xmin < xmax.
(KCW, 2025-07-16)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | x | |||
| integer(kind=int32), | intent(in) | :: | xmin | |||
| integer(kind=int32), | intent(in) | :: | xmax |
Clamp/Limit the value of x to the range of [xmin, xmax], where x, xmin, and xmax are all integers.
No check is performed to ensure xmin < xmax.
(KCW, 2025-07-16)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | x | |||
| integer(kind=int64), | intent(in) | :: | xmin | |||
| integer(kind=int64), | intent(in) | :: | xmax |
Clamp/Limit the value of x to the range of [xmin, xmax], where x, xmin, and xmax are all reals.
No check is performed to ensure xmin < xmax.
(KCW, 2025-07-16)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(in) | :: | x | |||
| real(kind=real32), | intent(in) | :: | xmin | |||
| real(kind=real32), | intent(in) | :: | xmax |
Clamp/Limit the value of x to the range of [xmin, xmax], where x, xmin, and xmax are all reals.
No check is performed to ensure xmin < xmax.
(KCW, 2025-07-16)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | x | |||
| real(kind=real64), | intent(in) | :: | xmin | |||
| real(kind=real64), | intent(in) | :: | xmax |
Test if a is divisible by b, where a and b are both reals.
(KCW, 2024-05-25)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(in) | :: | a | |||
| real(kind=real32), | intent(in) | :: | b |
Test if a is divisible by b, where a and b are both reals.
(KCW, 2024-05-25)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | a | |||
| real(kind=real64), | intent(in) | :: | b |
Test a and b for approximate equality, where a and b are both reals.
(KCW, 2024-05-25)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(in) | :: | a | |||
| real(kind=real32), | intent(in) | :: | b | |||
| real(kind=real32), | intent(in), | optional | :: | absolute_tolerance | ||
| real(kind=real32), | intent(in), | optional | :: | relative_tolerance |
Test a and b for approximate equality, where a and b are both reals.
(KCW, 2024-05-25)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | a | |||
| real(kind=real64), | intent(in) | :: | b | |||
| real(kind=real64), | intent(in), | optional | :: | absolute_tolerance | ||
| real(kind=real64), | intent(in), | optional | :: | relative_tolerance |
Clamp/Limit the value of x to the range of [xmin, xmax], where x, xmin, and xmax are all integers.
No check is performed to ensure xmin < xmax.
(KCW, 2025-07-16)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | x | |||
| integer(kind=int32), | intent(in) | :: | xmin | |||
| integer(kind=int32), | intent(in) | :: | xmax |
Clamp/Limit the value of x to the range of [xmin, xmax], where x, xmin, and xmax are all integers.
No check is performed to ensure xmin < xmax.
(KCW, 2025-07-16)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | x | |||
| integer(kind=int64), | intent(in) | :: | xmin | |||
| integer(kind=int64), | intent(in) | :: | xmax |
Clamp/Limit the value of x to the range of [xmin, xmax], where x, xmin, and xmax are all reals.
No check is performed to ensure xmin < xmax.
(KCW, 2025-07-16)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(in) | :: | x | |||
| real(kind=real32), | intent(in) | :: | xmin | |||
| real(kind=real32), | intent(in) | :: | xmax |
Clamp/Limit the value of x to the range of [xmin, xmax], where x, xmin, and xmax are all reals.
No check is performed to ensure xmin < xmax.
(KCW, 2025-07-16)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | x | |||
| real(kind=real64), | intent(in) | :: | xmin | |||
| real(kind=real64), | intent(in) | :: | xmax |
Return the index of unique elements in array, which can be any intrinsic data types, as an integer array.
Please note that array must only have one dimension, and the unique elements are returned by their first occurrences
in array.
If array contains zero element or is of unsupported data types, an empty integer array is produced.
For example, index_unique([1, 2, 3, 1, 2, 3, 4, 5]) returns [1, 2, 3, 7, 8].
(KCW, 2024-03-22)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(*), | intent(in) | :: | array(:) |
Convert one or more values of any intrinsic data types to a character string for pretty printing.
If value contains more than one element, the elements will be stringified, delimited by separator, then concatenated.
If value contains exactly one element, the element will be stringified without using separator.
If value contains zero element or is of unsupported data types, an empty character string is produced.
If separator is not supplied, it defaults to ", " (i.e., a comma and a space).
(KCW, 2024-02-04)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(*), | intent(in) | :: | value(:) | |||
| character(len=*), | intent(in), | optional | :: | separator |