MOM6
mom_array_transform::rotate_array Interface Reference

Detailed Description

Rotate the elements of an array to the rotated set of indices. Rotation is applied across the first and second axes of the array.

Definition at line 27 of file MOM_array_transform.F90.

Private functions

subroutine rotate_array_real_2d (A_in, turns, A)
 Rotate the elements of a 2d real array along first and second axes. More...
 
subroutine rotate_array_real_3d (A_in, turns, A)
 Rotate the elements of a 3d real array along first and second axes. More...
 
subroutine rotate_array_real_4d (A_in, turns, A)
 Rotate the elements of a 4d real array along first and second axes. More...
 
subroutine rotate_array_integer (A_in, turns, A)
 Rotate the elements of a 2d integer array along first and second axes. More...
 
subroutine rotate_array_logical (A_in, turns, A)
 Rotate the elements of a 2d logical array along first and second axes. More...
 

Detailed Description

Rotate the elements of an array to the rotated set of indices. Rotation is applied across the first and second axes of the array.

Definition at line 27 of file MOM_array_transform.F90.

Functions and subroutines

◆ rotate_array_integer()

subroutine mom_array_transform::rotate_array::rotate_array_integer ( integer, dimension(:,:), intent(in)  A_in,
integer, intent(in)  turns,
integer, dimension(:,:), intent(out)  A 
)
private

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

Parameters
[in]a_inUnrotated array
[in]turnsNumber of quarter turns
[out]aRotated array

Definition at line 127 of file MOM_array_transform.F90.

128  integer, intent(in) :: A_in(:,:) !< Unrotated array
129  integer, intent(in) :: turns !< Number of quarter turns
130  integer, intent(out) :: A(:,:) !< Rotated array
131 
132  integer :: m, n
133 
134  m = size(a_in, 1)
135  n = size(a_in, 2)
136 
137  select case (modulo(turns, 4))
138  case(0)
139  a(:,:) = a_in(:,:)
140  case(1)
141  a(:,:) = transpose(a_in)
142  a(:,:) = a(n:1:-1, :)
143  case(2)
144  a(:,:) = a_in(m:1:-1, n:1:-1)
145  case(3)
146  a(:,:) = transpose(a_in(m:1:-1, :))
147  end select

◆ rotate_array_logical()

subroutine mom_array_transform::rotate_array::rotate_array_logical ( logical, dimension(:,:), intent(in)  A_in,
integer, intent(in)  turns,
logical, dimension(:,:), intent(out)  A 
)
private

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

Parameters
[in]a_inUnrotated array
[in]turnsNumber of quarter turns
[out]aRotated array

Definition at line 152 of file MOM_array_transform.F90.

153  logical, intent(in) :: A_in(:,:) !< Unrotated array
154  integer, intent(in) :: turns !< Number of quarter turns
155  logical, intent(out) :: A(:,:) !< Rotated array
156 
157  integer :: m, n
158 
159  m = size(a_in, 1)
160  n = size(a_in, 2)
161 
162  select case (modulo(turns, 4))
163  case(0)
164  a(:,:) = a_in(:,:)
165  case(1)
166  a(:,:) = transpose(a_in)
167  a(:,:) = a(n:1:-1, :)
168  case(2)
169  a(:,:) = a_in(m:1:-1, n:1:-1)
170  case(3)
171  a(:,:) = transpose(a_in(m:1:-1, :))
172  end select

◆ rotate_array_real_2d()

subroutine mom_array_transform::rotate_array::rotate_array_real_2d ( real, dimension(:,:), intent(in)  A_in,
integer, intent(in)  turns,
real, dimension(:,:), intent(out)  A 
)
private

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

Parameters
[in]a_inUnrotated array
[in]turnsNumber of quarter turns
[out]aRotated array

Definition at line 74 of file MOM_array_transform.F90.

75  real, intent(in) :: A_in(:,:) !< Unrotated array
76  integer, intent(in) :: turns !< Number of quarter turns
77  real, intent(out) :: A(:,:) !< Rotated array
78 
79  integer :: m, n
80 
81  m = size(a_in, 1)
82  n = size(a_in, 2)
83 
84  select case (modulo(turns, 4))
85  case(0)
86  a(:,:) = a_in(:,:)
87  case(1)
88  a(:,:) = transpose(a_in)
89  a(:,:) = a(n:1:-1, :)
90  case(2)
91  a(:,:) = a_in(m:1:-1, n:1:-1)
92  case(3)
93  a(:,:) = transpose(a_in(m:1:-1, :))
94  end select

◆ rotate_array_real_3d()

subroutine mom_array_transform::rotate_array::rotate_array_real_3d ( real, dimension(:,:,:), intent(in)  A_in,
integer, intent(in)  turns,
real, dimension(:,:,:), intent(out)  A 
)
private

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

Parameters
[in]a_inUnrotated array
[in]turnsNumber of quarter turns
[out]aRotated array

Definition at line 99 of file MOM_array_transform.F90.

100  real, intent(in) :: A_in(:,:,:) !< Unrotated array
101  integer, intent(in) :: turns !< Number of quarter turns
102  real, intent(out) :: A(:,:,:) !< Rotated array
103 
104  integer :: k
105 
106  do k = 1, size(a_in, 3)
107  call rotate_array(a_in(:,:,k), turns, a(:,:,k))
108  enddo

◆ rotate_array_real_4d()

subroutine mom_array_transform::rotate_array::rotate_array_real_4d ( real, dimension(:,:,:,:), intent(in)  A_in,
integer, intent(in)  turns,
real, dimension(:,:,:,:), intent(out)  A 
)
private

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

Parameters
[in]a_inUnrotated array
[in]turnsNumber of quarter turns
[out]aRotated array

Definition at line 113 of file MOM_array_transform.F90.

114  real, intent(in) :: A_in(:,:,:,:) !< Unrotated array
115  integer, intent(in) :: turns !< Number of quarter turns
116  real, intent(out) :: A(:,:,:,:) !< Rotated array
117 
118  integer :: n
119 
120  do n = 1, size(a_in, 4)
121  call rotate_array(a_in(:,:,:,n), turns, a(:,:,:,n))
122  enddo

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