MOM6
mom_array_transform::rotate_array_pair Interface Reference

Detailed Description

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.

Definition at line 41 of file MOM_array_transform.F90.

Private functions

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. More...
 
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. More...
 
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. More...
 

Detailed Description

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.

Definition at line 41 of file MOM_array_transform.F90.

Functions and subroutines

◆ rotate_array_pair_integer()

subroutine mom_array_transform::rotate_array_pair::rotate_array_pair_integer ( integer, dimension(:,:), intent(in)  A_in,
integer, dimension(:,:), intent(in)  B_in,
integer, intent(in)  turns,
integer, dimension(:,:), intent(out)  A,
integer, dimension(:,:), intent(out)  B 
)
private

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

Parameters
[in]a_inUnrotated scalar array pair
[in]b_inUnrotated scalar array pair
[in]turnsNumber of quarter turns
[out]aRotated scalar array pair
[out]bRotated scalar array pair

Definition at line 213 of file MOM_array_transform.F90.

213  integer, intent(in) :: A_in(:,:) !< Unrotated scalar array pair
214  integer, intent(in) :: B_in(:,:) !< Unrotated scalar array pair
215  integer, intent(in) :: turns !< Number of quarter turns
216  integer, intent(out) :: A(:,:) !< Rotated scalar array pair
217  integer, intent(out) :: B(:,:) !< Rotated scalar array pair
218 
219  if (modulo(turns, 2) /= 0) then
220  call rotate_array(b_in, turns, a)
221  call rotate_array(a_in, turns, b)
222  else
223  call rotate_array(a_in, turns, a)
224  call rotate_array(b_in, turns, b)
225  endif

◆ rotate_array_pair_real_2d()

subroutine mom_array_transform::rotate_array_pair::rotate_array_pair_real_2d ( real, dimension(:,:), intent(in)  A_in,
real, dimension(:,:), intent(in)  B_in,
integer, intent(in)  turns,
real, dimension(:,:), intent(out)  A,
real, dimension(:,:), intent(out)  B 
)
private

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

Parameters
[in]a_inUnrotated scalar array pair
[in]b_inUnrotated scalar array pair
[in]turnsNumber of quarter turns
[out]aRotated scalar array pair
[out]bRotated scalar array pair

Definition at line 178 of file MOM_array_transform.F90.

178  real, intent(in) :: A_in(:,:) !< Unrotated scalar array pair
179  real, intent(in) :: B_in(:,:) !< Unrotated scalar array pair
180  integer, intent(in) :: turns !< Number of quarter turns
181  real, intent(out) :: A(:,:) !< Rotated scalar array pair
182  real, intent(out) :: B(:,:) !< Rotated scalar array pair
183 
184  if (modulo(turns, 2) /= 0) then
185  call rotate_array(b_in, turns, a)
186  call rotate_array(a_in, turns, b)
187  else
188  call rotate_array(a_in, turns, a)
189  call rotate_array(b_in, turns, b)
190  endif

◆ rotate_array_pair_real_3d()

subroutine mom_array_transform::rotate_array_pair::rotate_array_pair_real_3d ( real, dimension(:,:,:), intent(in)  A_in,
real, dimension(:,:,:), intent(in)  B_in,
integer, intent(in)  turns,
real, dimension(:,:,:), intent(out)  A,
real, dimension(:,:,:), intent(out)  B 
)
private

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

Parameters
[in]a_inUnrotated scalar array pair
[in]b_inUnrotated scalar array pair
[in]turnsNumber of quarter turns
[out]aRotated scalar array pair
[out]bRotated scalar array pair

Definition at line 196 of file MOM_array_transform.F90.

196  real, intent(in) :: A_in(:,:,:) !< Unrotated scalar array pair
197  real, intent(in) :: B_in(:,:,:) !< Unrotated scalar array pair
198  integer, intent(in) :: turns !< Number of quarter turns
199  real, intent(out) :: A(:,:,:) !< Rotated scalar array pair
200  real, intent(out) :: B(:,:,:) !< Rotated scalar array pair
201 
202  integer :: k
203 
204  do k = 1, size(a_in, 3)
205  call rotate_array_pair(a_in(:,:,k), b_in(:,:,k), turns, &
206  a(:,:,k), b(:,:,k))
207  enddo

The documentation for this interface was generated from the following file: