MOM_array_transform module reference
Module for supporting the rotation of a field's index map. The implementation of each angle is described below.
+90deg: B(i,j) = A(n-j,i) = transpose, then row reverse 180deg: B(i,j) = A(m-i,n-j) = row reversal + column reversal -90deg: B(i,j) = A(j,m-i) = row reverse, then transpose
90 degree rotations change the shape of the field, and are handled separately from 180 degree rotations.
It also provides the symmetric_sum functions to do a rotationally invariant sum of the contents of a 1d or 2d array.
Generic Interfaces
Rotate the elements of an array to the rotated set of indices. Rotation is applied across the first and second axes of the array. |
|
Rotate a pair of arrays which map to a rotated set of indices. Rotation is applied across the first and second axes of the array. This rotation should be applied when one field is mapped onto the other. For example, a tracer indexed along u or v face points will map from one to the other after a quarter turn, and back onto itself after a half turn. |
|
Rotate an array pair representing the components of a vector. Rotation is applied across the first and second axes of the array. This rotation should be applied when the fields satisfy vector transformation rules. For example, the u and v components of a velocity will map from one to the other for quarter turns, with a sign change in one component. A half turn will map elements onto themselves with sign changes in both components. |
|
Allocate an array based on the rotated index map of an unrotated reference array. |
|
Return a rotationally symmetric sum of the elements of an array. |
Functions/Subroutines
Rotate the elements of a 2d real array along first and second axes. |
|
Rotate the elements of a 3d real array along first and second axes. |
|
Rotate the elements of a 4d real array along first and second axes. |
|
Rotate the elements of a 2d integer array along first and second axes. |
|
Rotate the elements of a 2d logical array along first and second axes. |
|
Rotate the elements of a 2d real array pair along first and second axes. |
|
Rotate the elements of a 3d real array pair along first and second axes. |
|
Rotate the elements of a 4d real array pair along first and second axes. |
|
Rotate the elements of a 2d real vector along first and second axes. |
|
Rotate the elements of a 3d real vector along first and second axes. |
|
Rotate the elements of a 4d real vector along first and second axes. |
|
Allocate a 2d real array on the rotated index map of a reference array. |
|
Allocate a 3d real array on the rotated index map of a reference array. |
|
Allocate a 4d real array on the rotated index map of a reference array. |
|
Allocate a 2d integer array on the rotated index map of a reference array. |
|
Do a rotationally symmetric sum of a 1-d array |
|
Do a rotationally symmetric sum of a 2-d array using a recursive "Union-Jack" pattern of addition. |
|
Do a naive non-rotationally symmetric sum of a 2-d array. This function is only here for testing. |
|
Returns true if a unit test of the symmetric sums fails. |
Generic Interface Documentation
- interface rotate_array
Rotate the elements of an array to the rotated set of indices. Rotation is applied across the first and second axes of the array.
Callers call graph
Text view
mom::initialize_mom → mom_array_transform::interface::rotate_array
mom::rotate_initial_state → mom_array_transform::interface::rotate_array
mom_ale_sponge::rotate_ale_sponge → mom_array_transform::interface::rotate_array
mom_array_transform::rotate_array_pair_integer → mom_array_transform::interface::rotate_array
mom_array_transform::rotate_array_pair_real_2d → mom_array_transform::interface::rotate_array
mom_array_transform::rotate_array_real_3d → mom_array_transform::interface::rotate_array
mom_array_transform::rotate_array_real_4d → mom_array_transform::interface::rotate_array
mom_checksums::chksum_b_2d → mom_array_transform::interface::rotate_array
mom_checksums::chksum_b_3d → mom_array_transform::interface::rotate_array
mom_checksums::chksum_h_2d → mom_array_transform::interface::rotate_array
mom_checksums::chksum_h_3d → mom_array_transform::interface::rotate_array
mom_checksums::chksum_u_2d → mom_array_transform::interface::rotate_array
mom_checksums::chksum_u_3d → mom_array_transform::interface::rotate_array
mom_checksums::chksum_v_2d → mom_array_transform::interface::rotate_array
mom_checksums::chksum_v_3d → mom_array_transform::interface::rotate_array
mom_checksums::field_checksum_real_2d → mom_array_transform::interface::rotate_array
mom_checksums::field_checksum_real_3d → mom_array_transform::interface::rotate_array
mom_checksums::field_checksum_real_4d → mom_array_transform::interface::rotate_array
mom_coupler_types::extract_coupler_type_data → mom_array_transform::interface::rotate_array
mom_coupler_types::set_coupler_type_data → mom_array_transform::interface::rotate_array
mom_dyn_horgrid::rotate_dyn_horgrid → mom_array_transform::interface::rotate_array
mom_forcing_type::rotate_forcing → mom_array_transform::interface::rotate_array
mom_forcing_type::rotate_mech_forcing → mom_array_transform::interface::rotate_array
mom_ice_shelf::initialize_ice_shelf → mom_array_transform::interface::rotate_array
mom_ice_shelf::update_shelf_mass → mom_array_transform::interface::rotate_array
mom_ice_shelf_initialize::initialize_ice_thickness → mom_array_transform::interface::rotate_array
mom_interpolate::time_interp_external_2d → mom_array_transform::interface::rotate_array
mom_interpolate::time_interp_external_3d → mom_array_transform::interface::rotate_array
mom_io::mom_read_data_2d → mom_array_transform::interface::rotate_array
mom_io::mom_read_data_2d_region → mom_array_transform::interface::rotate_array
mom_io::mom_read_data_3d → mom_array_transform::interface::rotate_array
mom_io::mom_read_data_3d_region → mom_array_transform::interface::rotate_array
mom_io::mom_read_data_4d → mom_array_transform::interface::rotate_array
mom_io::mom_write_field_2d → mom_array_transform::interface::rotate_array
mom_io::mom_write_field_3d → mom_array_transform::interface::rotate_array
mom_io::mom_write_field_4d → mom_array_transform::interface::rotate_array
mom_io::mom_write_field_legacy_2d → mom_array_transform::interface::rotate_array
mom_io::mom_write_field_legacy_3d → mom_array_transform::interface::rotate_array
mom_io::mom_write_field_legacy_4d → mom_array_transform::interface::rotate_array
mom_io::read_netcdf_data_2d → mom_array_transform::interface::rotate_array
mom_open_boundary::read_obc_field_data → mom_array_transform::interface::rotate_array
mom_restart::copy_restart_var_3d → mom_array_transform::interface::rotate_array
mom_variables::rotate_surface_state → mom_array_transform::interface::rotate_array
- interface rotate_array_pair
Rotate a pair of arrays which map to a rotated set of indices. Rotation is applied across the first and second axes of the array. This rotation should be applied when one field is mapped onto the other. For example, a tracer indexed along u or v face points will map from one to the other after a quarter turn, and back onto itself after a half turn.
Callers call graph
Text view
mom_array_transform::rotate_array_pair_real_3d → mom_array_transform::interface::rotate_array_pair
mom_array_transform::rotate_vector_real_2d → mom_array_transform::interface::rotate_array_pair
mom_checksums::chksum_pair_b_2d → mom_array_transform::interface::rotate_array_pair
mom_checksums::chksum_pair_b_3d → mom_array_transform::interface::rotate_array_pair
mom_checksums::chksum_pair_h_2d → mom_array_transform::interface::rotate_array_pair
mom_checksums::chksum_pair_h_3d → mom_array_transform::interface::rotate_array_pair
mom_checksums::chksum_uv_2d → mom_array_transform::interface::rotate_array_pair
mom_checksums::chksum_uv_3d → mom_array_transform::interface::rotate_array_pair
mom_dyn_horgrid::rotate_dyn_horgrid → mom_array_transform::interface::rotate_array_pair
mom_forcing_type::rotate_mech_forcing → mom_array_transform::interface::rotate_array_pair
mom_io::mom_read_vector_2d → mom_array_transform::interface::rotate_array_pair
mom_io::mom_read_vector_3d → mom_array_transform::interface::rotate_array_pair
mom_open_boundary::rotate_obc_config → mom_array_transform::interface::rotate_array_pair
mom_restart::copy_restart_vector_3d → mom_array_transform::interface::rotate_array_pair
- interface rotate_vector
Rotate an array pair representing the components of a vector. Rotation is applied across the first and second axes of the array. This rotation should be applied when the fields satisfy vector transformation rules. For example, the u and v components of a velocity will map from one to the other for quarter turns, with a sign change in one component. A half turn will map elements onto themselves with sign changes in both components.
Callers call graph
Text view
mom::rotate_initial_state → mom_array_transform::interface::rotate_vector
mom_array_transform::rotate_vector_real_3d → mom_array_transform::interface::rotate_vector
mom_array_transform::rotate_vector_real_4d → mom_array_transform::interface::rotate_vector
mom_checksums::chksum_pair_b_2d → mom_array_transform::interface::rotate_vector
mom_checksums::chksum_pair_b_3d → mom_array_transform::interface::rotate_vector
mom_checksums::chksum_pair_h_2d → mom_array_transform::interface::rotate_vector
mom_checksums::chksum_pair_h_3d → mom_array_transform::interface::rotate_vector
mom_checksums::chksum_uv_2d → mom_array_transform::interface::rotate_vector
mom_checksums::chksum_uv_3d → mom_array_transform::interface::rotate_vector
mom_forcing_type::rotate_mech_forcing → mom_array_transform::interface::rotate_vector
mom_io::mom_read_vector_2d → mom_array_transform::interface::rotate_vector
mom_io::mom_read_vector_3d → mom_array_transform::interface::rotate_vector
mom_restart::copy_restart_vector_3d → mom_array_transform::interface::rotate_vector
mom_variables::rotate_surface_state → mom_array_transform::interface::rotate_vector
- interface allocate_rotated_array
Allocate an array based on the rotated index map of an unrotated reference array.
Callers call graph
Text view
mom_checksums::field_checksum_real_2d → mom_array_transform::interface::allocate_rotated_array
mom_checksums::field_checksum_real_3d → mom_array_transform::interface::allocate_rotated_array
mom_checksums::field_checksum_real_4d → mom_array_transform::interface::allocate_rotated_array
mom_coupler_types::extract_coupler_type_data → mom_array_transform::interface::allocate_rotated_array
mom_coupler_types::set_coupler_type_data → mom_array_transform::interface::allocate_rotated_array
mom_interpolate::time_interp_external_2d → mom_array_transform::interface::allocate_rotated_array
mom_interpolate::time_interp_external_3d → mom_array_transform::interface::allocate_rotated_array
mom_io::mom_read_data_2d → mom_array_transform::interface::allocate_rotated_array
mom_io::mom_read_data_2d_region → mom_array_transform::interface::allocate_rotated_array
mom_io::mom_read_data_3d → mom_array_transform::interface::allocate_rotated_array
mom_io::mom_read_data_3d_region → mom_array_transform::interface::allocate_rotated_array
mom_io::mom_read_data_4d → mom_array_transform::interface::allocate_rotated_array
mom_io::mom_read_vector_2d → mom_array_transform::interface::allocate_rotated_array
mom_io::mom_read_vector_3d → mom_array_transform::interface::allocate_rotated_array
mom_io::mom_write_field_2d → mom_array_transform::interface::allocate_rotated_array
mom_io::mom_write_field_3d → mom_array_transform::interface::allocate_rotated_array
mom_io::mom_write_field_4d → mom_array_transform::interface::allocate_rotated_array
mom_io::mom_write_field_legacy_2d → mom_array_transform::interface::allocate_rotated_array
mom_io::mom_write_field_legacy_3d → mom_array_transform::interface::allocate_rotated_array
mom_io::mom_write_field_legacy_4d → mom_array_transform::interface::allocate_rotated_array
mom_io::read_netcdf_data_2d → mom_array_transform::interface::allocate_rotated_array
- interface symmetric_sum
Return a rotationally symmetric sum of the elements of an array.
Functions/Subroutine Documentation
- subroutine rotate_array_real_2d(A_in, turns, A)
Rotate the elements of a 2d real array along first and second axes.
- Parameters
A_in [in]
Unrotated array [arbitrary]
turns [in]
Number of quarter turns
A [out]
Rotated array [arbitrary]
Callers call graph
- subroutine rotate_array_real_3d(A_in, turns, A)
Rotate the elements of a 3d real array along first and second axes.
- Parameters
A_in [in]
Unrotated array [arbitrary]
turns [in]
Number of quarter turns
A [out]
Rotated array [arbitrary]
Callees call graph
- subroutine rotate_array_real_4d(A_in, turns, A)
Rotate the elements of a 4d real array along first and second axes.
- Parameters
A_in [in]
Unrotated array [arbitrary]
turns [in]
Number of quarter turns
A [out]
Rotated array [arbitrary]
Callees call graph
- subroutine rotate_array_integer(A_in, turns, A)
Rotate the elements of a 2d integer array along first and second axes.
- Parameters
A_in [in]
Unrotated array
turns [in]
Number of quarter turns
A [out]
Rotated array
- subroutine rotate_array_logical(A_in, turns, A)
Rotate the elements of a 2d logical array along first and second axes.
- Parameters
A_in [in]
Unrotated array
turns [in]
Number of quarter turns
A [out]
Rotated array
- subroutine rotate_array_pair_real_2d(A_in, B_in, turns, A, B)
Rotate the elements of a 2d real array pair along first and second axes.
- Parameters
A_in [in]
Unrotated scalar array pair [arbitrary]
B_in [in]
Unrotated scalar array pair [arbitrary]
turns [in]
Number of quarter turns
A [out]
Rotated scalar array pair [arbitrary]
B [out]
Rotated scalar array pair [arbitrary]
Callees call graph
- subroutine rotate_array_pair_real_3d(A_in, B_in, turns, A, B)
Rotate the elements of a 3d real array pair along first and second axes.
- Parameters
A_in [in]
Unrotated scalar array pair [arbitrary]
B_in [in]
Unrotated scalar array pair [arbitrary]
turns [in]
Number of quarter turns
A [out]
Rotated scalar array pair [arbitrary]
B [out]
Rotated scalar array pair [arbitrary]
Callees call graph
- subroutine rotate_array_pair_integer(A_in, B_in, turns, A, B)
Rotate the elements of a 4d real array pair along first and second axes.
- Parameters
A_in [in]
Unrotated scalar array pair
B_in [in]
Unrotated scalar array pair
turns [in]
Number of quarter turns
A [out]
Rotated scalar array pair
B [out]
Rotated scalar array pair
Callees call graph
- subroutine rotate_vector_real_2d(A_in, B_in, turns, A, B)
Rotate the elements of a 2d real vector along first and second axes.
- Parameters
A_in [in]
First component of unrotated vector [arbitrary]
B_in [in]
Second component of unrotated vector [arbitrary]
turns [in]
Number of quarter turns
A [out]
First component of rotated vector [arbitrary]
B [out]
Second component of unrotated vector [arbitrary]
Callees call graph
- subroutine rotate_vector_real_3d(A_in, B_in, turns, A, B)
Rotate the elements of a 3d real vector along first and second axes.
- Parameters
A_in [in]
First component of unrotated vector [arbitrary]
B_in [in]
Second component of unrotated vector [arbitrary]
turns [in]
Number of quarter turns
A [out]
First component of rotated vector [arbitrary]
B [out]
Second component of unrotated vector [arbitrary]
Callees call graph
- subroutine rotate_vector_real_4d(A_in, B_in, turns, A, B)
Rotate the elements of a 4d real vector along first and second axes.
- Parameters
A_in [in]
First component of unrotated vector [arbitrary]
B_in [in]
Second component of unrotated vector [arbitrary]
turns [in]
Number of quarter turns
A [out]
First component of rotated vector [arbitrary]
B [out]
Second component of unrotated vector [arbitrary]
Callees call graph
- subroutine allocate_rotated_array_real_2d(A_in, lb, turns, A)
Allocate a 2d real array on the rotated index map of a reference array.
- Parameters
lb [in]
Lower index bounds of A_in
A_in [in]
Reference array [arbitrary]
turns [in]
Number of quarter turns
A [inout]
Array on rotated index [arbitrary]
- subroutine allocate_rotated_array_real_3d(A_in, lb, turns, A)
Allocate a 3d real array on the rotated index map of a reference array.
- Parameters
lb [in]
Lower index bounds of A_in
A_in [in]
Reference array [arbitrary]
turns [in]
Number of quarter turns
A [inout]
Array on rotated index [arbitrary]
- subroutine allocate_rotated_array_real_4d(A_in, lb, turns, A)
Allocate a 4d real array on the rotated index map of a reference array.
- Parameters
lb [in]
Lower index bounds of A_in
A_in [in]
Reference array [arbitrary]
turns [in]
Number of quarter turns
A [inout]
Array on rotated index [arbitrary]
- subroutine allocate_rotated_array_integer(A_in, lb, turns, A)
Allocate a 2d integer array on the rotated index map of a reference array.
- Parameters
lb [in]
Lower index bounds of A_in
A_in [in]
Reference array
turns [in]
Number of quarter turns
A [inout]
Array on rotated index
- function symmetric_sum_1d(field) result(sum)
Do a rotationally symmetric sum of a 1-d array
- Parameters
field [in]
The field to sum in arbitrary units [A ~> a]
sum
The rotationally symmetric sum of the entries in field [A ~> a]
Callers call graph
- recursive function symmetric_sum_2d(field) result(sum)
Do a rotationally symmetric sum of a 2-d array using a recursive "Union-Jack" pattern of addition.
- Parameters
field [in]
The field to sum in arbitrary units [A ~> a]
sum
The rotationally symmetric sum of the entries in field [A ~> a]
Callees call graph
Callers call graph
- function naive_sum_2d(field, abs_val) result(sum)
Do a naive non-rotationally symmetric sum of a 2-d array. This function is only here for testing.
- Parameters
field [in]
The field to sum in arbitrary units [A ~> a]
abs_val [in]
If present and true, sum the absolute values
sum
The rotation dependent sum of the entries in field [A ~> a]
Callers call graph
- logical function symmetric_sum_unit_tests(verbose)
Returns true if a unit test of the symmetric sums fails.
- Parameters
verbose [in]
If true, write results to stdout
fail_message
Blank or a description of the first failed test.