\hypertarget{namespacemom__array__transform}{}\section{mom\+\_\+array\+\_\+transform Module Reference}
\label{namespacemom__array__transform}\index{mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}}


\subsection{Detailed Description}
Module for supporting the rotation of a field\textquotesingle{}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. \subsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
interface \mbox{\hyperlink{interfacemom__array__transform_1_1allocate__rotated__array}{allocate\+\_\+rotated\+\_\+array}}
\begin{DoxyCompactList}\small\item\em Allocate an array based on the rotated index map of an unrotated reference array. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__array__transform_1_1rotate__array}{rotate\+\_\+array}}
\begin{DoxyCompactList}\small\item\em Rotate the elements of an array to the rotated set of indices. Rotation is applied across the first and second axes of the array. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__array__transform_1_1rotate__array__pair}{rotate\+\_\+array\+\_\+pair}}
\begin{DoxyCompactList}\small\item\em 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. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__array__transform_1_1rotate__vector}{rotate\+\_\+vector}}
\begin{DoxyCompactList}\small\item\em 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. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\hyperlink{namespacemom__array__transform_a9e696dd46cc0215ce5361a27b873e78a}{rotate\+\_\+array\+\_\+real\+\_\+2d}} (A\+\_\+in, turns, A)
\begin{DoxyCompactList}\small\item\em Rotate the elements of a 2d real array along first and second axes. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__array__transform_a653d3acfc23fc5aee9a4fdf2f3f21ce0}{rotate\+\_\+array\+\_\+real\+\_\+3d}} (A\+\_\+in, turns, A)
\begin{DoxyCompactList}\small\item\em Rotate the elements of a 3d real array along first and second axes. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__array__transform_a5da99484437f154ab75dfac799b2dca2}{rotate\+\_\+array\+\_\+real\+\_\+4d}} (A\+\_\+in, turns, A)
\begin{DoxyCompactList}\small\item\em Rotate the elements of a 4d real array along first and second axes. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__array__transform_a3d81d37c217c006bceb044788852328f}{rotate\+\_\+array\+\_\+integer}} (A\+\_\+in, turns, A)
\begin{DoxyCompactList}\small\item\em Rotate the elements of a 2d integer array along first and second axes. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__array__transform_acbc7da0bb01abfaf85cd259fcb7b2479}{rotate\+\_\+array\+\_\+logical}} (A\+\_\+in, turns, A)
\begin{DoxyCompactList}\small\item\em Rotate the elements of a 2d logical array along first and second axes. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__array__transform_a5ea1687ec970a76638528bbf6c0c0dff}{rotate\+\_\+array\+\_\+pair\+\_\+real\+\_\+2d}} (A\+\_\+in, B\+\_\+in, turns, A, B)
\begin{DoxyCompactList}\small\item\em Rotate the elements of a 2d real array pair along first and second axes. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__array__transform_a61738c50a6259d7a24454b55d7cee327}{rotate\+\_\+array\+\_\+pair\+\_\+real\+\_\+3d}} (A\+\_\+in, B\+\_\+in, turns, A, B)
\begin{DoxyCompactList}\small\item\em Rotate the elements of a 3d real array pair along first and second axes. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__array__transform_a3e81187b32b90f2790162fada0f2a37d}{rotate\+\_\+array\+\_\+pair\+\_\+integer}} (A\+\_\+in, B\+\_\+in, turns, A, B)
\begin{DoxyCompactList}\small\item\em Rotate the elements of a 4d real array pair along first and second axes. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__array__transform_a9ed7c50abbc455ea4d719d08c23f3684}{rotate\+\_\+vector\+\_\+real\+\_\+2d}} (A\+\_\+in, B\+\_\+in, turns, A, B)
\begin{DoxyCompactList}\small\item\em Rotate the elements of a 2d real vector along first and second axes. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__array__transform_a6f1366396c79e58ae22aac41cba11404}{rotate\+\_\+vector\+\_\+real\+\_\+3d}} (A\+\_\+in, B\+\_\+in, turns, A, B)
\begin{DoxyCompactList}\small\item\em Rotate the elements of a 3d real vector along first and second axes. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__array__transform_a4f9b5997a21b429887ebb4e598d8779a}{rotate\+\_\+vector\+\_\+real\+\_\+4d}} (A\+\_\+in, B\+\_\+in, turns, A, B)
\begin{DoxyCompactList}\small\item\em Rotate the elements of a 4d real vector along first and second axes. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__array__transform_a449d5739f47d0171ba6f73034159d002}{allocate\+\_\+rotated\+\_\+array\+\_\+real\+\_\+2d}} (A\+\_\+in, lb, turns, A)
\begin{DoxyCompactList}\small\item\em Allocate a 2d real array on the rotated index map of a reference array. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__array__transform_a5b9bce35c3396379229c4c1007e29c34}{allocate\+\_\+rotated\+\_\+array\+\_\+real\+\_\+3d}} (A\+\_\+in, lb, turns, A)
\begin{DoxyCompactList}\small\item\em Allocate a 3d real array on the rotated index map of a reference array. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__array__transform_ae8b3fdcc0d725f9f516c2af0fc16d21b}{allocate\+\_\+rotated\+\_\+array\+\_\+real\+\_\+4d}} (A\+\_\+in, lb, turns, A)
\begin{DoxyCompactList}\small\item\em Allocate a 4d real array on the rotated index map of a reference array. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__array__transform_a0ecc1ce64f7ebd17b906fd267c171369}{allocate\+\_\+rotated\+\_\+array\+\_\+integer}} (A\+\_\+in, lb, turns, A)
\begin{DoxyCompactList}\small\item\em Allocate a 2d integer array on the rotated index map of a reference array. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacemom__array__transform_a0ecc1ce64f7ebd17b906fd267c171369}\label{namespacemom__array__transform_a0ecc1ce64f7ebd17b906fd267c171369}} 
\index{mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}!allocate\+\_\+rotated\+\_\+array\+\_\+integer@{allocate\+\_\+rotated\+\_\+array\+\_\+integer}}
\index{allocate\+\_\+rotated\+\_\+array\+\_\+integer@{allocate\+\_\+rotated\+\_\+array\+\_\+integer}!mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}}
\subsubsection{\texorpdfstring{allocate\+\_\+rotated\+\_\+array\+\_\+integer()}{allocate\_rotated\_array\_integer()}}
{\footnotesize\ttfamily subroutine mom\+\_\+array\+\_\+transform\+::allocate\+\_\+rotated\+\_\+array\+\_\+integer (\begin{DoxyParamCaption}\item[{integer, dimension(lb(1)\+:,lb(2)\+:), intent(in)}]{A\+\_\+in,  }\item[{integer, dimension(2), intent(in)}]{lb,  }\item[{integer, intent(in)}]{turns,  }\item[{integer, dimension(\+:,\+:), intent(inout), allocatable}]{A }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



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


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em lb} & Lower index bounds of A\+\_\+in\\
\hline
\mbox{\tt in}  & {\em a\+\_\+in} & Reference array\\
\hline
\mbox{\tt in}  & {\em turns} & Number of quarter turns\\
\hline
\mbox{\tt in,out}  & {\em a} & Array on rotated index \\
\hline
\end{DoxyParams}


Definition at line 342 of file M\+O\+M\+\_\+array\+\_\+transform.\+F90.


\begin{DoxyCode}
342   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: lb(2)\textcolor{comment}{                  !< Lower index bounds of A\_in}
343   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: A\_in(lb(1):,lb(2):)\textcolor{comment}{    !< Reference array}
344   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{                  !< Number of quarter turns}
345   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{intent(inout)} :: A(:,:)\textcolor{comment}{ !< Array on rotated index}
346 
347   \textcolor{keywordtype}{integer} :: ub(2)
348 
349   ub(:) = ubound(a\_in)
350 
351   \textcolor{keywordflow}{if} (modulo(turns, 2) /= 0) \textcolor{keywordflow}{then}
352     \textcolor{keyword}{allocate}(a(lb(2):ub(2), lb(1):ub(1)))
353   \textcolor{keywordflow}{else}
354     \textcolor{keyword}{allocate}(a(lb(1):ub(1), lb(2):ub(2)))
355 \textcolor{keywordflow}{  endif}
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__array__transform_a449d5739f47d0171ba6f73034159d002}\label{namespacemom__array__transform_a449d5739f47d0171ba6f73034159d002}} 
\index{mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}!allocate\+\_\+rotated\+\_\+array\+\_\+real\+\_\+2d@{allocate\+\_\+rotated\+\_\+array\+\_\+real\+\_\+2d}}
\index{allocate\+\_\+rotated\+\_\+array\+\_\+real\+\_\+2d@{allocate\+\_\+rotated\+\_\+array\+\_\+real\+\_\+2d}!mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}}
\subsubsection{\texorpdfstring{allocate\+\_\+rotated\+\_\+array\+\_\+real\+\_\+2d()}{allocate\_rotated\_array\_real\_2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+array\+\_\+transform\+::allocate\+\_\+rotated\+\_\+array\+\_\+real\+\_\+2d (\begin{DoxyParamCaption}\item[{real, dimension(lb(1)\+:, lb(2)\+:), intent(in)}]{A\+\_\+in,  }\item[{integer, dimension(2), intent(in)}]{lb,  }\item[{integer, intent(in)}]{turns,  }\item[{real, dimension(\+:,\+:), intent(inout), allocatable}]{A }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



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


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em lb} & Lower index bounds of A\+\_\+in\\
\hline
\mbox{\tt in}  & {\em a\+\_\+in} & Reference array\\
\hline
\mbox{\tt in}  & {\em turns} & Number of quarter turns\\
\hline
\mbox{\tt in,out}  & {\em a} & Array on rotated index \\
\hline
\end{DoxyParams}


Definition at line 282 of file M\+O\+M\+\_\+array\+\_\+transform.\+F90.


\begin{DoxyCode}
282   \textcolor{comment}{! NOTE: lb must be declared before A\_in}
283   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: lb(2)\textcolor{comment}{                !< Lower index bounds of A\_in}
284   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: A\_in(lb(1):, lb(2):)\textcolor{comment}{    !< Reference array}
285   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{                !< Number of quarter turns}
286   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{intent(inout)} :: A(:,:)\textcolor{comment}{  !< Array on rotated index}
287 
288   \textcolor{keywordtype}{integer} :: ub(2)
289 
290   ub(:) = ubound(a\_in)
291 
292   \textcolor{keywordflow}{if} (modulo(turns, 2) /= 0) \textcolor{keywordflow}{then}
293     \textcolor{keyword}{allocate}(a(lb(2):ub(2), lb(1):ub(1)))
294   \textcolor{keywordflow}{else}
295     \textcolor{keyword}{allocate}(a(lb(1):ub(1), lb(2):ub(2)))
296 \textcolor{keywordflow}{  endif}
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__array__transform_a5b9bce35c3396379229c4c1007e29c34}\label{namespacemom__array__transform_a5b9bce35c3396379229c4c1007e29c34}} 
\index{mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}!allocate\+\_\+rotated\+\_\+array\+\_\+real\+\_\+3d@{allocate\+\_\+rotated\+\_\+array\+\_\+real\+\_\+3d}}
\index{allocate\+\_\+rotated\+\_\+array\+\_\+real\+\_\+3d@{allocate\+\_\+rotated\+\_\+array\+\_\+real\+\_\+3d}!mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}}
\subsubsection{\texorpdfstring{allocate\+\_\+rotated\+\_\+array\+\_\+real\+\_\+3d()}{allocate\_rotated\_array\_real\_3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+array\+\_\+transform\+::allocate\+\_\+rotated\+\_\+array\+\_\+real\+\_\+3d (\begin{DoxyParamCaption}\item[{real, dimension(lb(1)\+:, lb(2)\+:, lb(3)\+:), intent(in)}]{A\+\_\+in,  }\item[{integer, dimension(3), intent(in)}]{lb,  }\item[{integer, intent(in)}]{turns,  }\item[{real, dimension(\+:,\+:,\+:), intent(inout), allocatable}]{A }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



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


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em lb} & Lower index bounds of A\+\_\+in\\
\hline
\mbox{\tt in}  & {\em a\+\_\+in} & Reference array\\
\hline
\mbox{\tt in}  & {\em turns} & Number of quarter turns\\
\hline
\mbox{\tt in,out}  & {\em a} & Array on rotated index \\
\hline
\end{DoxyParams}


Definition at line 302 of file M\+O\+M\+\_\+array\+\_\+transform.\+F90.


\begin{DoxyCode}
302   \textcolor{comment}{! NOTE: lb must be declared before A\_in}
303   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: lb(3)\textcolor{comment}{                    !< Lower index bounds of A\_in}
304   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: A\_in(lb(1):, lb(2):, lb(3):)\textcolor{comment}{  !< Reference array}
305   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{                    !< Number of quarter turns}
306   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{intent(inout)} :: A(:,:,:)\textcolor{comment}{    !< Array on rotated index}
307 
308   \textcolor{keywordtype}{integer} :: ub(3)
309 
310   ub(:) = ubound(a\_in)
311 
312   \textcolor{keywordflow}{if} (modulo(turns, 2) /= 0) \textcolor{keywordflow}{then}
313     \textcolor{keyword}{allocate}(a(lb(2):ub(2), lb(1):ub(1), lb(3):ub(3)))
314   \textcolor{keywordflow}{else}
315     \textcolor{keyword}{allocate}(a(lb(1):ub(1), lb(2):ub(2), lb(3):ub(3)))
316 \textcolor{keywordflow}{  endif}
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__array__transform_ae8b3fdcc0d725f9f516c2af0fc16d21b}\label{namespacemom__array__transform_ae8b3fdcc0d725f9f516c2af0fc16d21b}} 
\index{mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}!allocate\+\_\+rotated\+\_\+array\+\_\+real\+\_\+4d@{allocate\+\_\+rotated\+\_\+array\+\_\+real\+\_\+4d}}
\index{allocate\+\_\+rotated\+\_\+array\+\_\+real\+\_\+4d@{allocate\+\_\+rotated\+\_\+array\+\_\+real\+\_\+4d}!mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}}
\subsubsection{\texorpdfstring{allocate\+\_\+rotated\+\_\+array\+\_\+real\+\_\+4d()}{allocate\_rotated\_array\_real\_4d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+array\+\_\+transform\+::allocate\+\_\+rotated\+\_\+array\+\_\+real\+\_\+4d (\begin{DoxyParamCaption}\item[{real, dimension(lb(1)\+:,lb(2)\+:,lb(3)\+:,lb(4)\+:), intent(in)}]{A\+\_\+in,  }\item[{integer, dimension(4), intent(in)}]{lb,  }\item[{integer, intent(in)}]{turns,  }\item[{real, dimension(\+:,\+:,\+:,\+:), intent(inout), allocatable}]{A }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



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


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em lb} & Lower index bounds of A\+\_\+in\\
\hline
\mbox{\tt in}  & {\em a\+\_\+in} & Reference array\\
\hline
\mbox{\tt in}  & {\em turns} & Number of quarter turns\\
\hline
\mbox{\tt in,out}  & {\em a} & Array on rotated index \\
\hline
\end{DoxyParams}


Definition at line 322 of file M\+O\+M\+\_\+array\+\_\+transform.\+F90.


\begin{DoxyCode}
322   \textcolor{comment}{! NOTE: lb must be declared before A\_in}
323   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: lb(4)\textcolor{comment}{                    !< Lower index bounds of A\_in}
324   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: A\_in(lb(1):,lb(2):,lb(3):,lb(4):)\textcolor{comment}{ !< Reference array}
325   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{                    !< Number of quarter turns}
326   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{intent(inout)} :: A(:,:,:,:)\textcolor{comment}{  !< Array on rotated index}
327 
328   \textcolor{keywordtype}{integer}:: ub(4)
329 
330   ub(:) = ubound(a\_in)
331 
332   \textcolor{keywordflow}{if} (modulo(turns, 2) /= 0) \textcolor{keywordflow}{then}
333     \textcolor{keyword}{allocate}(a(lb(2):ub(2), lb(1):ub(1), lb(3):ub(3), lb(4):ub(4)))
334   \textcolor{keywordflow}{else}
335     \textcolor{keyword}{allocate}(a(lb(1):ub(1), lb(2):ub(2), lb(3):ub(3), lb(4):ub(4)))
336 \textcolor{keywordflow}{  endif}
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__array__transform_a3d81d37c217c006bceb044788852328f}\label{namespacemom__array__transform_a3d81d37c217c006bceb044788852328f}} 
\index{mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}!rotate\+\_\+array\+\_\+integer@{rotate\+\_\+array\+\_\+integer}}
\index{rotate\+\_\+array\+\_\+integer@{rotate\+\_\+array\+\_\+integer}!mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}}
\subsubsection{\texorpdfstring{rotate\+\_\+array\+\_\+integer()}{rotate\_array\_integer()}}
{\footnotesize\ttfamily subroutine mom\+\_\+array\+\_\+transform\+::rotate\+\_\+array\+\_\+integer (\begin{DoxyParamCaption}\item[{integer, dimension(\+:,\+:), intent(in)}]{A\+\_\+in,  }\item[{integer, intent(in)}]{turns,  }\item[{integer, dimension(\+:,\+:), intent(out)}]{A }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



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


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em a\+\_\+in} & Unrotated array\\
\hline
\mbox{\tt in}  & {\em turns} & Number of quarter turns\\
\hline
\mbox{\tt out}  & {\em a} & Rotated array \\
\hline
\end{DoxyParams}


Definition at line 128 of file M\+O\+M\+\_\+array\+\_\+transform.\+F90.


\begin{DoxyCode}
128   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: A\_in(:,:)\textcolor{comment}{  !< Unrotated array}
129   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{      !< Number of quarter turns}
130   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: A(:,:)\textcolor{comment}{    !< Rotated array}
131 
132   \textcolor{keywordtype}{integer} :: m, n
133 
134   m = \textcolor{keyword}{size}(a\_in, 1)
135   n = \textcolor{keyword}{size}(a\_in, 2)
136 
137   \textcolor{keywordflow}{select case} (modulo(turns, 4))
138     \textcolor{keywordflow}{case}(0)
139       a(:,:) = a\_in(:,:)
140     \textcolor{keywordflow}{case}(1)
141       a(:,:) = transpose(a\_in)
142       a(:,:) = a(n:1:-1, :)
143     \textcolor{keywordflow}{case}(2)
144       a(:,:) = a\_in(m:1:-1, n:1:-1)
145     \textcolor{keywordflow}{case}(3)
146       a(:,:) = transpose(a\_in(m:1:-1, :))
147 \textcolor{keywordflow}{  end select}
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__array__transform_acbc7da0bb01abfaf85cd259fcb7b2479}\label{namespacemom__array__transform_acbc7da0bb01abfaf85cd259fcb7b2479}} 
\index{mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}!rotate\+\_\+array\+\_\+logical@{rotate\+\_\+array\+\_\+logical}}
\index{rotate\+\_\+array\+\_\+logical@{rotate\+\_\+array\+\_\+logical}!mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}}
\subsubsection{\texorpdfstring{rotate\+\_\+array\+\_\+logical()}{rotate\_array\_logical()}}
{\footnotesize\ttfamily subroutine mom\+\_\+array\+\_\+transform\+::rotate\+\_\+array\+\_\+logical (\begin{DoxyParamCaption}\item[{logical, dimension(\+:,\+:), intent(in)}]{A\+\_\+in,  }\item[{integer, intent(in)}]{turns,  }\item[{logical, dimension(\+:,\+:), intent(out)}]{A }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



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


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em a\+\_\+in} & Unrotated array\\
\hline
\mbox{\tt in}  & {\em turns} & Number of quarter turns\\
\hline
\mbox{\tt out}  & {\em a} & Rotated array \\
\hline
\end{DoxyParams}


Definition at line 153 of file M\+O\+M\+\_\+array\+\_\+transform.\+F90.


\begin{DoxyCode}
153   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)} :: A\_in(:,:)\textcolor{comment}{  !< Unrotated array}
154   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{      !< Number of quarter turns}
155   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)} :: A(:,:)\textcolor{comment}{    !< Rotated array}
156 
157   \textcolor{keywordtype}{integer} :: m, n
158 
159   m = \textcolor{keyword}{size}(a\_in, 1)
160   n = \textcolor{keyword}{size}(a\_in, 2)
161 
162   \textcolor{keywordflow}{select case} (modulo(turns, 4))
163     \textcolor{keywordflow}{case}(0)
164       a(:,:) = a\_in(:,:)
165     \textcolor{keywordflow}{case}(1)
166       a(:,:) = transpose(a\_in)
167       a(:,:) = a(n:1:-1, :)
168     \textcolor{keywordflow}{case}(2)
169       a(:,:) = a\_in(m:1:-1, n:1:-1)
170     \textcolor{keywordflow}{case}(3)
171       a(:,:) = transpose(a\_in(m:1:-1, :))
172 \textcolor{keywordflow}{  end select}
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__array__transform_a3e81187b32b90f2790162fada0f2a37d}\label{namespacemom__array__transform_a3e81187b32b90f2790162fada0f2a37d}} 
\index{mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}!rotate\+\_\+array\+\_\+pair\+\_\+integer@{rotate\+\_\+array\+\_\+pair\+\_\+integer}}
\index{rotate\+\_\+array\+\_\+pair\+\_\+integer@{rotate\+\_\+array\+\_\+pair\+\_\+integer}!mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}}
\subsubsection{\texorpdfstring{rotate\+\_\+array\+\_\+pair\+\_\+integer()}{rotate\_array\_pair\_integer()}}
{\footnotesize\ttfamily subroutine mom\+\_\+array\+\_\+transform\+::rotate\+\_\+array\+\_\+pair\+\_\+integer (\begin{DoxyParamCaption}\item[{integer, dimension(\+:,\+:), intent(in)}]{A\+\_\+in,  }\item[{integer, dimension(\+:,\+:), intent(in)}]{B\+\_\+in,  }\item[{integer, intent(in)}]{turns,  }\item[{integer, dimension(\+:,\+:), intent(out)}]{A,  }\item[{integer, dimension(\+:,\+:), intent(out)}]{B }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



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


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em a\+\_\+in} & Unrotated scalar array pair\\
\hline
\mbox{\tt in}  & {\em b\+\_\+in} & Unrotated scalar array pair\\
\hline
\mbox{\tt in}  & {\em turns} & Number of quarter turns\\
\hline
\mbox{\tt out}  & {\em a} & Rotated scalar array pair\\
\hline
\mbox{\tt out}  & {\em b} & Rotated scalar array pair \\
\hline
\end{DoxyParams}


Definition at line 213 of file M\+O\+M\+\_\+array\+\_\+transform.\+F90.


\begin{DoxyCode}
213   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: A\_in(:,:)\textcolor{comment}{  !< Unrotated scalar array pair}
214   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: B\_in(:,:)\textcolor{comment}{  !< Unrotated scalar array pair}
215   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{      !< Number of quarter turns}
216   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: A(:,:)\textcolor{comment}{    !< Rotated scalar array pair}
217   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: B(:,:)\textcolor{comment}{    !< Rotated scalar array pair}
218 
219   \textcolor{keywordflow}{if} (modulo(turns, 2) /= 0) \textcolor{keywordflow}{then}
220     \textcolor{keyword}{call }rotate\_array(b\_in, turns, a)
221     \textcolor{keyword}{call }rotate\_array(a\_in, turns, b)
222   \textcolor{keywordflow}{else}
223     \textcolor{keyword}{call }rotate\_array(a\_in, turns, a)
224     \textcolor{keyword}{call }rotate\_array(b\_in, turns, b)
225 \textcolor{keywordflow}{  endif}
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__array__transform_a5ea1687ec970a76638528bbf6c0c0dff}\label{namespacemom__array__transform_a5ea1687ec970a76638528bbf6c0c0dff}} 
\index{mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}!rotate\+\_\+array\+\_\+pair\+\_\+real\+\_\+2d@{rotate\+\_\+array\+\_\+pair\+\_\+real\+\_\+2d}}
\index{rotate\+\_\+array\+\_\+pair\+\_\+real\+\_\+2d@{rotate\+\_\+array\+\_\+pair\+\_\+real\+\_\+2d}!mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}}
\subsubsection{\texorpdfstring{rotate\+\_\+array\+\_\+pair\+\_\+real\+\_\+2d()}{rotate\_array\_pair\_real\_2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+array\+\_\+transform\+::rotate\+\_\+array\+\_\+pair\+\_\+real\+\_\+2d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:), intent(in)}]{A\+\_\+in,  }\item[{real, dimension(\+:,\+:), intent(in)}]{B\+\_\+in,  }\item[{integer, intent(in)}]{turns,  }\item[{real, dimension(\+:,\+:), intent(out)}]{A,  }\item[{real, dimension(\+:,\+:), intent(out)}]{B }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



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


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em a\+\_\+in} & Unrotated scalar array pair\\
\hline
\mbox{\tt in}  & {\em b\+\_\+in} & Unrotated scalar array pair\\
\hline
\mbox{\tt in}  & {\em turns} & Number of quarter turns\\
\hline
\mbox{\tt out}  & {\em a} & Rotated scalar array pair\\
\hline
\mbox{\tt out}  & {\em b} & Rotated scalar array pair \\
\hline
\end{DoxyParams}


Definition at line 178 of file M\+O\+M\+\_\+array\+\_\+transform.\+F90.


\begin{DoxyCode}
178   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: A\_in(:,:)\textcolor{comment}{   !< Unrotated scalar array pair}
179   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: B\_in(:,:)\textcolor{comment}{   !< Unrotated scalar array pair}
180   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{    !< Number of quarter turns}
181   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(out)} :: A(:,:)\textcolor{comment}{     !< Rotated scalar array pair}
182   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(out)} :: B(:,:)\textcolor{comment}{     !< Rotated scalar array pair}
183 
184   \textcolor{keywordflow}{if} (modulo(turns, 2) /= 0) \textcolor{keywordflow}{then}
185     \textcolor{keyword}{call }rotate\_array(b\_in, turns, a)
186     \textcolor{keyword}{call }rotate\_array(a\_in, turns, b)
187   \textcolor{keywordflow}{else}
188     \textcolor{keyword}{call }rotate\_array(a\_in, turns, a)
189     \textcolor{keyword}{call }rotate\_array(b\_in, turns, b)
190 \textcolor{keywordflow}{  endif}
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__array__transform_a61738c50a6259d7a24454b55d7cee327}\label{namespacemom__array__transform_a61738c50a6259d7a24454b55d7cee327}} 
\index{mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}!rotate\+\_\+array\+\_\+pair\+\_\+real\+\_\+3d@{rotate\+\_\+array\+\_\+pair\+\_\+real\+\_\+3d}}
\index{rotate\+\_\+array\+\_\+pair\+\_\+real\+\_\+3d@{rotate\+\_\+array\+\_\+pair\+\_\+real\+\_\+3d}!mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}}
\subsubsection{\texorpdfstring{rotate\+\_\+array\+\_\+pair\+\_\+real\+\_\+3d()}{rotate\_array\_pair\_real\_3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+array\+\_\+transform\+::rotate\+\_\+array\+\_\+pair\+\_\+real\+\_\+3d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:,\+:), intent(in)}]{A\+\_\+in,  }\item[{real, dimension(\+:,\+:,\+:), intent(in)}]{B\+\_\+in,  }\item[{integer, intent(in)}]{turns,  }\item[{real, dimension(\+:,\+:,\+:), intent(out)}]{A,  }\item[{real, dimension(\+:,\+:,\+:), intent(out)}]{B }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



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


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em a\+\_\+in} & Unrotated scalar array pair\\
\hline
\mbox{\tt in}  & {\em b\+\_\+in} & Unrotated scalar array pair\\
\hline
\mbox{\tt in}  & {\em turns} & Number of quarter turns\\
\hline
\mbox{\tt out}  & {\em a} & Rotated scalar array pair\\
\hline
\mbox{\tt out}  & {\em b} & Rotated scalar array pair \\
\hline
\end{DoxyParams}


Definition at line 196 of file M\+O\+M\+\_\+array\+\_\+transform.\+F90.


\begin{DoxyCode}
196   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: A\_in(:,:,:)\textcolor{comment}{   !< Unrotated scalar array pair}
197   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: B\_in(:,:,:)\textcolor{comment}{   !< Unrotated scalar array pair}
198   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{      !< Number of quarter turns}
199   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(out)} :: A(:,:,:)\textcolor{comment}{     !< Rotated scalar array pair}
200   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(out)} :: B(:,:,:)\textcolor{comment}{     !< Rotated scalar array pair}
201 
202   \textcolor{keywordtype}{integer} :: k
203 
204   \textcolor{keywordflow}{do} k = 1, \textcolor{keyword}{size}(a\_in, 3)
205     \textcolor{keyword}{call }rotate\_array\_pair(a\_in(:,:,k), b\_in(:,:,k), turns, &
206         a(:,:,k), b(:,:,k))
207 \textcolor{keywordflow}{  enddo}
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__array__transform_a9e696dd46cc0215ce5361a27b873e78a}\label{namespacemom__array__transform_a9e696dd46cc0215ce5361a27b873e78a}} 
\index{mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}!rotate\+\_\+array\+\_\+real\+\_\+2d@{rotate\+\_\+array\+\_\+real\+\_\+2d}}
\index{rotate\+\_\+array\+\_\+real\+\_\+2d@{rotate\+\_\+array\+\_\+real\+\_\+2d}!mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}}
\subsubsection{\texorpdfstring{rotate\+\_\+array\+\_\+real\+\_\+2d()}{rotate\_array\_real\_2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+array\+\_\+transform\+::rotate\+\_\+array\+\_\+real\+\_\+2d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:), intent(in)}]{A\+\_\+in,  }\item[{integer, intent(in)}]{turns,  }\item[{real, dimension(\+:,\+:), intent(out)}]{A }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



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


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em a\+\_\+in} & Unrotated array\\
\hline
\mbox{\tt in}  & {\em turns} & Number of quarter turns\\
\hline
\mbox{\tt out}  & {\em a} & Rotated array \\
\hline
\end{DoxyParams}


Definition at line 75 of file M\+O\+M\+\_\+array\+\_\+transform.\+F90.


\begin{DoxyCode}
75   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: A\_in(:,:)\textcolor{comment}{ !< Unrotated array}
76   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{  !< Number of quarter turns}
77   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(out)} :: A(:,:)\textcolor{comment}{   !< Rotated array}
78 
79   \textcolor{keywordtype}{integer} :: m, n
80 
81   m = \textcolor{keyword}{size}(a\_in, 1)
82   n = \textcolor{keyword}{size}(a\_in, 2)
83 
84   \textcolor{keywordflow}{select case} (modulo(turns, 4))
85     \textcolor{keywordflow}{case}(0)
86       a(:,:) = a\_in(:,:)
87     \textcolor{keywordflow}{case}(1)
88       a(:,:) = transpose(a\_in)
89       a(:,:) = a(n:1:-1, :)
90     \textcolor{keywordflow}{case}(2)
91       a(:,:) = a\_in(m:1:-1, n:1:-1)
92     \textcolor{keywordflow}{case}(3)
93       a(:,:) = transpose(a\_in(m:1:-1, :))
94 \textcolor{keywordflow}{  end select}
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__array__transform_a653d3acfc23fc5aee9a4fdf2f3f21ce0}\label{namespacemom__array__transform_a653d3acfc23fc5aee9a4fdf2f3f21ce0}} 
\index{mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}!rotate\+\_\+array\+\_\+real\+\_\+3d@{rotate\+\_\+array\+\_\+real\+\_\+3d}}
\index{rotate\+\_\+array\+\_\+real\+\_\+3d@{rotate\+\_\+array\+\_\+real\+\_\+3d}!mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}}
\subsubsection{\texorpdfstring{rotate\+\_\+array\+\_\+real\+\_\+3d()}{rotate\_array\_real\_3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+array\+\_\+transform\+::rotate\+\_\+array\+\_\+real\+\_\+3d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:,\+:), intent(in)}]{A\+\_\+in,  }\item[{integer, intent(in)}]{turns,  }\item[{real, dimension(\+:,\+:,\+:), intent(out)}]{A }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



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


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em a\+\_\+in} & Unrotated array\\
\hline
\mbox{\tt in}  & {\em turns} & Number of quarter turns\\
\hline
\mbox{\tt out}  & {\em a} & Rotated array \\
\hline
\end{DoxyParams}


Definition at line 100 of file M\+O\+M\+\_\+array\+\_\+transform.\+F90.


\begin{DoxyCode}
100   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: A\_in(:,:,:)\textcolor{comment}{ !< Unrotated array}
101   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{    !< Number of quarter turns}
102   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(out)} :: A(:,:,:)\textcolor{comment}{   !< Rotated array}
103 
104   \textcolor{keywordtype}{integer} :: k
105 
106   \textcolor{keywordflow}{do} k = 1, \textcolor{keyword}{size}(a\_in, 3)
107     \textcolor{keyword}{call }rotate\_array(a\_in(:,:,k), turns, a(:,:,k))
108 \textcolor{keywordflow}{  enddo}
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__array__transform_a5da99484437f154ab75dfac799b2dca2}\label{namespacemom__array__transform_a5da99484437f154ab75dfac799b2dca2}} 
\index{mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}!rotate\+\_\+array\+\_\+real\+\_\+4d@{rotate\+\_\+array\+\_\+real\+\_\+4d}}
\index{rotate\+\_\+array\+\_\+real\+\_\+4d@{rotate\+\_\+array\+\_\+real\+\_\+4d}!mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}}
\subsubsection{\texorpdfstring{rotate\+\_\+array\+\_\+real\+\_\+4d()}{rotate\_array\_real\_4d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+array\+\_\+transform\+::rotate\+\_\+array\+\_\+real\+\_\+4d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:,\+:,\+:), intent(in)}]{A\+\_\+in,  }\item[{integer, intent(in)}]{turns,  }\item[{real, dimension(\+:,\+:,\+:,\+:), intent(out)}]{A }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



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


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em a\+\_\+in} & Unrotated array\\
\hline
\mbox{\tt in}  & {\em turns} & Number of quarter turns\\
\hline
\mbox{\tt out}  & {\em a} & Rotated array \\
\hline
\end{DoxyParams}


Definition at line 114 of file M\+O\+M\+\_\+array\+\_\+transform.\+F90.


\begin{DoxyCode}
114   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: A\_in(:,:,:,:)\textcolor{comment}{ !< Unrotated array}
115   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{      !< Number of quarter turns}
116   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(out)} :: A(:,:,:,:)\textcolor{comment}{   !< Rotated array}
117 
118   \textcolor{keywordtype}{integer} :: n
119 
120   \textcolor{keywordflow}{do} n = 1, \textcolor{keyword}{size}(a\_in, 4)
121     \textcolor{keyword}{call }rotate\_array(a\_in(:,:,:,n), turns, a(:,:,:,n))
122 \textcolor{keywordflow}{  enddo}
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__array__transform_a9ed7c50abbc455ea4d719d08c23f3684}\label{namespacemom__array__transform_a9ed7c50abbc455ea4d719d08c23f3684}} 
\index{mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}!rotate\+\_\+vector\+\_\+real\+\_\+2d@{rotate\+\_\+vector\+\_\+real\+\_\+2d}}
\index{rotate\+\_\+vector\+\_\+real\+\_\+2d@{rotate\+\_\+vector\+\_\+real\+\_\+2d}!mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}}
\subsubsection{\texorpdfstring{rotate\+\_\+vector\+\_\+real\+\_\+2d()}{rotate\_vector\_real\_2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+array\+\_\+transform\+::rotate\+\_\+vector\+\_\+real\+\_\+2d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:), intent(in)}]{A\+\_\+in,  }\item[{real, dimension(\+:,\+:), intent(in)}]{B\+\_\+in,  }\item[{integer, intent(in)}]{turns,  }\item[{real, dimension(\+:,\+:), intent(out)}]{A,  }\item[{real, dimension(\+:,\+:), intent(out)}]{B }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



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


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em a\+\_\+in} & First component of unrotated vector\\
\hline
\mbox{\tt in}  & {\em b\+\_\+in} & Second component of unrotated vector\\
\hline
\mbox{\tt in}  & {\em turns} & Number of quarter turns\\
\hline
\mbox{\tt out}  & {\em a} & First component of rotated vector\\
\hline
\mbox{\tt out}  & {\em b} & Second component of unrotated vector \\
\hline
\end{DoxyParams}


Definition at line 231 of file M\+O\+M\+\_\+array\+\_\+transform.\+F90.


\begin{DoxyCode}
231   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: A\_in(:,:)\textcolor{comment}{ !< First component of unrotated vector}
232   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: B\_in(:,:)\textcolor{comment}{ !< Second component of unrotated vector}
233   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{  !< Number of quarter turns}
234   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(out)} :: A(:,:)\textcolor{comment}{   !< First component of rotated vector}
235   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(out)} :: B(:,:)\textcolor{comment}{   !< Second component of unrotated vector}
236 
237   \textcolor{keyword}{call }rotate\_array\_pair(a\_in, b\_in, turns, a, b)
238 
239   \textcolor{keywordflow}{if} (modulo(turns, 4) == 1 .or. modulo(turns, 4) == 2) &
240     a(:,:) = -a(:,:)
241 
242   \textcolor{keywordflow}{if} (modulo(turns, 4) == 2 .or. modulo(turns, 4) == 3) &
243     b(:,:) = -b(:,:)
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__array__transform_a6f1366396c79e58ae22aac41cba11404}\label{namespacemom__array__transform_a6f1366396c79e58ae22aac41cba11404}} 
\index{mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}!rotate\+\_\+vector\+\_\+real\+\_\+3d@{rotate\+\_\+vector\+\_\+real\+\_\+3d}}
\index{rotate\+\_\+vector\+\_\+real\+\_\+3d@{rotate\+\_\+vector\+\_\+real\+\_\+3d}!mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}}
\subsubsection{\texorpdfstring{rotate\+\_\+vector\+\_\+real\+\_\+3d()}{rotate\_vector\_real\_3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+array\+\_\+transform\+::rotate\+\_\+vector\+\_\+real\+\_\+3d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:,\+:), intent(in)}]{A\+\_\+in,  }\item[{real, dimension(\+:,\+:,\+:), intent(in)}]{B\+\_\+in,  }\item[{integer, intent(in)}]{turns,  }\item[{real, dimension(\+:,\+:,\+:), intent(out)}]{A,  }\item[{real, dimension(\+:,\+:,\+:), intent(out)}]{B }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



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


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em a\+\_\+in} & First component of unrotated vector\\
\hline
\mbox{\tt in}  & {\em b\+\_\+in} & Second component of unrotated vector\\
\hline
\mbox{\tt in}  & {\em turns} & Number of quarter turns\\
\hline
\mbox{\tt out}  & {\em a} & First component of rotated vector\\
\hline
\mbox{\tt out}  & {\em b} & Second component of unrotated vector \\
\hline
\end{DoxyParams}


Definition at line 249 of file M\+O\+M\+\_\+array\+\_\+transform.\+F90.


\begin{DoxyCode}
249   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: A\_in(:,:,:)\textcolor{comment}{ !< First component of unrotated vector}
250   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: B\_in(:,:,:)\textcolor{comment}{ !< Second component of unrotated vector}
251   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{    !< Number of quarter turns}
252   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(out)} :: A(:,:,:)\textcolor{comment}{   !< First component of rotated vector}
253   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(out)} :: B(:,:,:)\textcolor{comment}{   !< Second component of unrotated vector}
254 
255   \textcolor{keywordtype}{integer} :: k
256 
257   \textcolor{keywordflow}{do} k = 1, \textcolor{keyword}{size}(a\_in, 3)
258     \textcolor{keyword}{call }rotate\_vector(a\_in(:,:,k), b\_in(:,:,k), turns, a(:,:,k), b(:,:,k))
259 \textcolor{keywordflow}{  enddo}
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__array__transform_a4f9b5997a21b429887ebb4e598d8779a}\label{namespacemom__array__transform_a4f9b5997a21b429887ebb4e598d8779a}} 
\index{mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}!rotate\+\_\+vector\+\_\+real\+\_\+4d@{rotate\+\_\+vector\+\_\+real\+\_\+4d}}
\index{rotate\+\_\+vector\+\_\+real\+\_\+4d@{rotate\+\_\+vector\+\_\+real\+\_\+4d}!mom\+\_\+array\+\_\+transform@{mom\+\_\+array\+\_\+transform}}
\subsubsection{\texorpdfstring{rotate\+\_\+vector\+\_\+real\+\_\+4d()}{rotate\_vector\_real\_4d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+array\+\_\+transform\+::rotate\+\_\+vector\+\_\+real\+\_\+4d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:,\+:,\+:), intent(in)}]{A\+\_\+in,  }\item[{real, dimension(\+:,\+:,\+:,\+:), intent(in)}]{B\+\_\+in,  }\item[{integer, intent(in)}]{turns,  }\item[{real, dimension(\+:,\+:,\+:,\+:), intent(out)}]{A,  }\item[{real, dimension(\+:,\+:,\+:,\+:), intent(out)}]{B }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



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


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em a\+\_\+in} & First component of unrotated vector\\
\hline
\mbox{\tt in}  & {\em b\+\_\+in} & Second component of unrotated vector\\
\hline
\mbox{\tt in}  & {\em turns} & Number of quarter turns\\
\hline
\mbox{\tt out}  & {\em a} & First component of rotated vector\\
\hline
\mbox{\tt out}  & {\em b} & Second component of unrotated vector \\
\hline
\end{DoxyParams}


Definition at line 265 of file M\+O\+M\+\_\+array\+\_\+transform.\+F90.


\begin{DoxyCode}
265   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: A\_in(:,:,:,:)\textcolor{comment}{ !< First component of unrotated vector}
266   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: B\_in(:,:,:,:)\textcolor{comment}{ !< Second component of unrotated vector}
267   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{      !< Number of quarter turns}
268   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(out)} :: A(:,:,:,:)\textcolor{comment}{   !< First component of rotated vector}
269   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(out)} :: B(:,:,:,:)\textcolor{comment}{   !< Second component of unrotated vector}
270 
271   \textcolor{keywordtype}{integer} :: n
272 
273   \textcolor{keywordflow}{do} n = 1, \textcolor{keyword}{size}(a\_in, 4)
274     \textcolor{keyword}{call }rotate\_vector(a\_in(:,:,:,n), b\_in(:,:,:,n), turns, &
275         a(:,:,:,n), b(:,:,:,n))
276 \textcolor{keywordflow}{  enddo}
\end{DoxyCode}
