mom_array_transform module reference

Module for supporting the rotation of a field’s index map. The implementation of each angle is described below.

More…

Functions/Subroutines

rotate_array_real_2d()

Rotate the elements of a 2d real array along first and second axes.

rotate_array_real_3d()

Rotate the elements of a 3d real array along first and second axes.

rotate_array_real_4d()

Rotate the elements of a 4d real array along first and second axes.

rotate_array_integer()

Rotate the elements of a 2d integer array along first and second axes.

rotate_array_logical()

Rotate the elements of a 2d logical array along first and second axes.

rotate_array_pair_real_2d()

Rotate the elements of a 2d real array pair along first and second axes.

rotate_array_pair_real_3d()

Rotate the elements of a 3d real array pair along first and second axes.

rotate_array_pair_integer()

Rotate the elements of a 4d real array pair along first and second axes.

rotate_vector_real_2d()

Rotate the elements of a 2d real vector along first and second axes.

rotate_vector_real_3d()

Rotate the elements of a 3d real vector along first and second axes.

rotate_vector_real_4d()

Rotate the elements of a 4d real vector along first and second axes.

allocate_rotated_array_real_2d()

Allocate a 2d real array on the rotated index map of a reference array.

allocate_rotated_array_real_3d()

Allocate a 3d real array on the rotated index map of a reference array.

allocate_rotated_array_real_4d()

Allocate a 4d real array on the rotated index map of a reference array.

allocate_rotated_array_integer()

Allocate a 2d integer array on the rotated index map of a reference array.

symmetric_sum_1d()

Do a rotationally symmetric sum of a 1-d array.

symmetric_sum_2d()

Do a rotationally symmetric sum of a 2-d array using a recursive "Union-Jack" pattern of addition.

naive_sum_2d()

Do a naive non-rotationally symmetric sum of a 2-d array.

symmetric_sum_unit_tests()

Returns true if a unit test of the symmetric sums fails.

Detailed Description

+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. functions to do a rotationally invariant sum of the contents of a 1d or 2d array.

Function/Subroutine Documentation

subroutine mom_array_transform/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 :: turns [in] Number of quarter turns

  • a :: [out] Rotated array [arbitrary]

Called from:

symmetric_sum_unit_tests

[source]

subroutine mom_array_transform/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 :: turns [in] Number of quarter turns

  • a :: [out] Rotated array [arbitrary]

[source]

subroutine mom_array_transform/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 :: turns [in] Number of quarter turns

  • a :: [out] Rotated array [arbitrary]

[source]

subroutine mom_array_transform/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 :: turns [in] Number of quarter turns

  • a :: [out] Rotated array

[source]

subroutine mom_array_transform/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 :: turns [in] Number of quarter turns

  • a :: [out] Rotated array

[source]

subroutine mom_array_transform/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 :: turns [in] Number of quarter turns

  • a :: [out] Rotated scalar array pair [arbitrary]

  • b :: [out] Rotated scalar array pair [arbitrary]

[source]

subroutine mom_array_transform/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 :: turns [in] Number of quarter turns

  • a :: [out] Rotated scalar array pair [arbitrary]

  • b :: [out] Rotated scalar array pair [arbitrary]

[source]

subroutine mom_array_transform/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 :: turns [in] Number of quarter turns

  • a :: [out] Rotated scalar array pair

  • b :: [out] Rotated scalar array pair

[source]

subroutine mom_array_transform/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 :: turns [in] Number of quarter turns

  • a :: [out] First component of rotated vector [arbitrary]

  • b :: [out] Second component of unrotated vector [arbitrary]

[source]

subroutine mom_array_transform/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 :: turns [in] Number of quarter turns

  • a :: [out] First component of rotated vector [arbitrary]

  • b :: [out] Second component of unrotated vector [arbitrary]

[source]

subroutine mom_array_transform/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 :: turns [in] Number of quarter turns

  • a :: [out] First component of rotated vector [arbitrary]

  • b :: [out] Second component of unrotated vector [arbitrary]

[source]

subroutine mom_array_transform/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 :: lb [in] Lower index bounds of A_in

  • a_in :: [in] Reference array [arbitrary]

  • turns :: turns [in] Number of quarter turns

  • a :: [inout] Array on rotated index [arbitrary]

[source]

subroutine mom_array_transform/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 :: lb [in] Lower index bounds of A_in

  • a_in :: [in] Reference array [arbitrary]

  • turns :: turns [in] Number of quarter turns

  • a :: [inout] Array on rotated index [arbitrary]

[source]

subroutine mom_array_transform/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 :: lb [in] Lower index bounds of A_in

  • a_in :: [in] Reference array [arbitrary]

  • turns :: turns [in] Number of quarter turns

  • a :: [inout] Array on rotated index [arbitrary]

[source]

subroutine mom_array_transform/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 :: lb [in] Lower index bounds of A_in

  • a_in :: [in] Reference array

  • turns :: turns [in] Number of quarter turns

  • a :: [inout] Array on rotated index

[source]

function  mom_array_transform/symmetric_sum_1d(field)

Do a rotationally symmetric sum of a 1-d array.

Parameters:

field :: field [in] The field to sum in arbitrary units [A ~> a]

Return:

undefined :: The rotationally symmetric sum of the entries in field [A ~> a]

Called from:

mom_array_transform::symmetric_sum::symmetric_sum_2d

[source]

function  mom_array_transform/symmetric_sum_2d(field)

Do a rotationally symmetric sum of a 2-d array using a recursive “Union-Jack” pattern of addition.

Parameters:

field :: field [in] The field to sum in arbitrary units [A ~> a]

Return:

undefined :: The rotationally symmetric sum of the entries in field [A ~> a]

Called from:

mom_array_transform::symmetric_sum::symmetric_sum_2d

[source]

function  mom_array_transform/naive_sum_2d(field, abs_val)

Do a naive non-rotationally symmetric sum of a 2-d array. This function is only here for testing.

Parameters:
  • field :: field [in] The field to sum in arbitrary units [A ~> a]

  • abs_val :: abs_val [in] If present and true, sum the absolute values

Return:

undefined :: The rotation dependent sum of the entries in field [A ~> a]

Called from:

symmetric_sum_unit_tests

[source]

function  mom_array_transform/symmetric_sum_unit_tests(verbose)

Returns true if a unit test of the symmetric sums fails.

Parameters:

verbose :: verbose [in] If true, write results to stdout

Call to:

naive_sum_2d rotate_array_real_2d

Called from:

mom_unit_tests::unit_tests

[source]

[source]