\hypertarget{namespacemom__array__transform}{}\doxysection{mom\+\_\+array\+\_\+transform Module Reference}
\label{namespacemom__array__transform}\index{mom\_array\_transform@{mom\_array\_transform}}


\doxysubsection{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. \doxysubsection*{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}
\doxysubsection*{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}


\doxysubsection{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}}
\doxysubsubsection{\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{\texttt{ in}}  & {\em lb} & Lower index bounds of A\+\_\+in \\
\hline
\mbox{\texttt{ in}}  & {\em a\+\_\+in} & Reference array \\
\hline
\mbox{\texttt{ in}}  & {\em turns} & Number of quarter turns \\
\hline
\mbox{\texttt{ in,out}}  & {\em a} & Array on rotated index \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{342   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: lb(2)\textcolor{comment}{                  !< Lower index bounds of A\_in}}
\DoxyCodeLine{343   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: A\_in(lb(1):,lb(2):)\textcolor{comment}{    !< Reference array}}
\DoxyCodeLine{344   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{                  !< Number of quarter turns}}
\DoxyCodeLine{345   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{intent(inout)} :: A(:,:)\textcolor{comment}{ !< Array on rotated index}}
\DoxyCodeLine{346 }
\DoxyCodeLine{347   \textcolor{keywordtype}{integer} :: ub(2)}
\DoxyCodeLine{348 }
\DoxyCodeLine{349   ub(:) = ubound(a\_in)}
\DoxyCodeLine{350 }
\DoxyCodeLine{351   \textcolor{keywordflow}{if} (modulo(turns, 2) /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{352     \textcolor{keyword}{allocate}(a(lb(2):ub(2), lb(1):ub(1)))}
\DoxyCodeLine{353   \textcolor{keywordflow}{else}}
\DoxyCodeLine{354     \textcolor{keyword}{allocate}(a(lb(1):ub(1), lb(2):ub(2)))}
\DoxyCodeLine{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}}
\doxysubsubsection{\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{\texttt{ in}}  & {\em lb} & Lower index bounds of A\+\_\+in \\
\hline
\mbox{\texttt{ in}}  & {\em a\+\_\+in} & Reference array \\
\hline
\mbox{\texttt{ in}}  & {\em turns} & Number of quarter turns \\
\hline
\mbox{\texttt{ in,out}}  & {\em a} & Array on rotated index \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{282   \textcolor{comment}{! NOTE: lb must be declared before A\_in}}
\DoxyCodeLine{283   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: lb(2)\textcolor{comment}{                !< Lower index bounds of A\_in}}
\DoxyCodeLine{284 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: A\_in(lb(1):, lb(2):)\textcolor{comment}{    !< Reference array}}
\DoxyCodeLine{285   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{                !< Number of quarter turns}}
\DoxyCodeLine{286 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{intent(inout)} :: A(:,:)\textcolor{comment}{  !< Array on rotated index}}
\DoxyCodeLine{287 }
\DoxyCodeLine{288   \textcolor{keywordtype}{integer} :: ub(2)}
\DoxyCodeLine{289 }
\DoxyCodeLine{290   ub(:) = ubound(a\_in)}
\DoxyCodeLine{291 }
\DoxyCodeLine{292   \textcolor{keywordflow}{if} (modulo(turns, 2) /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{293     \textcolor{keyword}{allocate}(a(lb(2):ub(2), lb(1):ub(1)))}
\DoxyCodeLine{294   \textcolor{keywordflow}{else}}
\DoxyCodeLine{295     \textcolor{keyword}{allocate}(a(lb(1):ub(1), lb(2):ub(2)))}
\DoxyCodeLine{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}}
\doxysubsubsection{\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{\texttt{ in}}  & {\em lb} & Lower index bounds of A\+\_\+in \\
\hline
\mbox{\texttt{ in}}  & {\em a\+\_\+in} & Reference array \\
\hline
\mbox{\texttt{ in}}  & {\em turns} & Number of quarter turns \\
\hline
\mbox{\texttt{ in,out}}  & {\em a} & Array on rotated index \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{302   \textcolor{comment}{! NOTE: lb must be declared before A\_in}}
\DoxyCodeLine{303   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: lb(3)\textcolor{comment}{                    !< Lower index bounds of A\_in}}
\DoxyCodeLine{304 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: A\_in(lb(1):, lb(2):, lb(3):)\textcolor{comment}{  !< Reference array}}
\DoxyCodeLine{305   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{                    !< Number of quarter turns}}
\DoxyCodeLine{306 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{intent(inout)} :: A(:,:,:)\textcolor{comment}{    !< Array on rotated index}}
\DoxyCodeLine{307 }
\DoxyCodeLine{308   \textcolor{keywordtype}{integer} :: ub(3)}
\DoxyCodeLine{309 }
\DoxyCodeLine{310   ub(:) = ubound(a\_in)}
\DoxyCodeLine{311 }
\DoxyCodeLine{312   \textcolor{keywordflow}{if} (modulo(turns, 2) /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{313     \textcolor{keyword}{allocate}(a(lb(2):ub(2), lb(1):ub(1), lb(3):ub(3)))}
\DoxyCodeLine{314   \textcolor{keywordflow}{else}}
\DoxyCodeLine{315     \textcolor{keyword}{allocate}(a(lb(1):ub(1), lb(2):ub(2), lb(3):ub(3)))}
\DoxyCodeLine{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}}
\doxysubsubsection{\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{\texttt{ in}}  & {\em lb} & Lower index bounds of A\+\_\+in \\
\hline
\mbox{\texttt{ in}}  & {\em a\+\_\+in} & Reference array \\
\hline
\mbox{\texttt{ in}}  & {\em turns} & Number of quarter turns \\
\hline
\mbox{\texttt{ in,out}}  & {\em a} & Array on rotated index \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{322   \textcolor{comment}{! NOTE: lb must be declared before A\_in}}
\DoxyCodeLine{323   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: lb(4)\textcolor{comment}{                    !< Lower index bounds of A\_in}}
\DoxyCodeLine{324 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: A\_in(lb(1):,lb(2):,lb(3):,lb(4):)\textcolor{comment}{ !< Reference array}}
\DoxyCodeLine{325   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{                    !< Number of quarter turns}}
\DoxyCodeLine{326 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{intent(inout)} :: A(:,:,:,:)\textcolor{comment}{  !< Array on rotated index}}
\DoxyCodeLine{327 }
\DoxyCodeLine{328   \textcolor{keywordtype}{integer}:: ub(4)}
\DoxyCodeLine{329 }
\DoxyCodeLine{330   ub(:) = ubound(a\_in)}
\DoxyCodeLine{331 }
\DoxyCodeLine{332   \textcolor{keywordflow}{if} (modulo(turns, 2) /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{333     \textcolor{keyword}{allocate}(a(lb(2):ub(2), lb(1):ub(1), lb(3):ub(3), lb(4):ub(4)))}
\DoxyCodeLine{334   \textcolor{keywordflow}{else}}
\DoxyCodeLine{335     \textcolor{keyword}{allocate}(a(lb(1):ub(1), lb(2):ub(2), lb(3):ub(3), lb(4):ub(4)))}
\DoxyCodeLine{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}}
\doxysubsubsection{\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{\texttt{ in}}  & {\em a\+\_\+in} & Unrotated array \\
\hline
\mbox{\texttt{ in}}  & {\em turns} & Number of quarter turns \\
\hline
\mbox{\texttt{ out}}  & {\em a} & Rotated array \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{128   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: A\_in(:,:)\textcolor{comment}{  !< Unrotated array}}
\DoxyCodeLine{129   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{      !< Number of quarter turns}}
\DoxyCodeLine{130   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: A(:,:)\textcolor{comment}{    !< Rotated array}}
\DoxyCodeLine{131 }
\DoxyCodeLine{132   \textcolor{keywordtype}{integer} :: m, n}
\DoxyCodeLine{133 }
\DoxyCodeLine{134   m = \textcolor{keyword}{size}(a\_in, 1)}
\DoxyCodeLine{135   n = \textcolor{keyword}{size}(a\_in, 2)}
\DoxyCodeLine{136 }
\DoxyCodeLine{137   \textcolor{keywordflow}{select case} (modulo(turns, 4))}
\DoxyCodeLine{138     \textcolor{keywordflow}{case}(0)}
\DoxyCodeLine{139       a(:,:) = a\_in(:,:)}
\DoxyCodeLine{140     \textcolor{keywordflow}{case}(1)}
\DoxyCodeLine{141       a(:,:) = transpose(a\_in)}
\DoxyCodeLine{142       a(:,:) = a(n:1:-\/1, :)}
\DoxyCodeLine{143     \textcolor{keywordflow}{case}(2)}
\DoxyCodeLine{144       a(:,:) = a\_in(m:1:-\/1, n:1:-\/1)}
\DoxyCodeLine{145     \textcolor{keywordflow}{case}(3)}
\DoxyCodeLine{146       a(:,:) = transpose(a\_in(m:1:-\/1, :))}
\DoxyCodeLine{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}}
\doxysubsubsection{\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{\texttt{ in}}  & {\em a\+\_\+in} & Unrotated array \\
\hline
\mbox{\texttt{ in}}  & {\em turns} & Number of quarter turns \\
\hline
\mbox{\texttt{ out}}  & {\em a} & Rotated array \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{153   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)} :: A\_in(:,:)\textcolor{comment}{  !< Unrotated array}}
\DoxyCodeLine{154   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{      !< Number of quarter turns}}
\DoxyCodeLine{155   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)} :: A(:,:)\textcolor{comment}{    !< Rotated array}}
\DoxyCodeLine{156 }
\DoxyCodeLine{157   \textcolor{keywordtype}{integer} :: m, n}
\DoxyCodeLine{158 }
\DoxyCodeLine{159   m = \textcolor{keyword}{size}(a\_in, 1)}
\DoxyCodeLine{160   n = \textcolor{keyword}{size}(a\_in, 2)}
\DoxyCodeLine{161 }
\DoxyCodeLine{162   \textcolor{keywordflow}{select case} (modulo(turns, 4))}
\DoxyCodeLine{163     \textcolor{keywordflow}{case}(0)}
\DoxyCodeLine{164       a(:,:) = a\_in(:,:)}
\DoxyCodeLine{165     \textcolor{keywordflow}{case}(1)}
\DoxyCodeLine{166       a(:,:) = transpose(a\_in)}
\DoxyCodeLine{167       a(:,:) = a(n:1:-\/1, :)}
\DoxyCodeLine{168     \textcolor{keywordflow}{case}(2)}
\DoxyCodeLine{169       a(:,:) = a\_in(m:1:-\/1, n:1:-\/1)}
\DoxyCodeLine{170     \textcolor{keywordflow}{case}(3)}
\DoxyCodeLine{171       a(:,:) = transpose(a\_in(m:1:-\/1, :))}
\DoxyCodeLine{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}}
\doxysubsubsection{\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{\texttt{ in}}  & {\em a\+\_\+in} & Unrotated scalar array pair \\
\hline
\mbox{\texttt{ in}}  & {\em b\+\_\+in} & Unrotated scalar array pair \\
\hline
\mbox{\texttt{ in}}  & {\em turns} & Number of quarter turns \\
\hline
\mbox{\texttt{ out}}  & {\em a} & Rotated scalar array pair \\
\hline
\mbox{\texttt{ out}}  & {\em b} & Rotated scalar array pair \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{213   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: A\_in(:,:)\textcolor{comment}{  !< Unrotated scalar array pair}}
\DoxyCodeLine{214   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: B\_in(:,:)\textcolor{comment}{  !< Unrotated scalar array pair}}
\DoxyCodeLine{215   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{      !< Number of quarter turns}}
\DoxyCodeLine{216   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: A(:,:)\textcolor{comment}{    !< Rotated scalar array pair}}
\DoxyCodeLine{217   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: B(:,:)\textcolor{comment}{    !< Rotated scalar array pair}}
\DoxyCodeLine{218 }
\DoxyCodeLine{219   \textcolor{keywordflow}{if} (modulo(turns, 2) /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{220     \textcolor{keyword}{call }rotate\_array(b\_in, turns, a)}
\DoxyCodeLine{221     \textcolor{keyword}{call }rotate\_array(a\_in, turns, b)}
\DoxyCodeLine{222   \textcolor{keywordflow}{else}}
\DoxyCodeLine{223     \textcolor{keyword}{call }rotate\_array(a\_in, turns, a)}
\DoxyCodeLine{224     \textcolor{keyword}{call }rotate\_array(b\_in, turns, b)}
\DoxyCodeLine{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}}
\doxysubsubsection{\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{\texttt{ in}}  & {\em a\+\_\+in} & Unrotated scalar array pair \\
\hline
\mbox{\texttt{ in}}  & {\em b\+\_\+in} & Unrotated scalar array pair \\
\hline
\mbox{\texttt{ in}}  & {\em turns} & Number of quarter turns \\
\hline
\mbox{\texttt{ out}}  & {\em a} & Rotated scalar array pair \\
\hline
\mbox{\texttt{ out}}  & {\em b} & Rotated scalar array pair \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{178 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: A\_in(:,:)\textcolor{comment}{   !< Unrotated scalar array pair}}
\DoxyCodeLine{179 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: B\_in(:,:)\textcolor{comment}{   !< Unrotated scalar array pair}}
\DoxyCodeLine{180   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{    !< Number of quarter turns}}
\DoxyCodeLine{181 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)} :: A(:,:)\textcolor{comment}{     !< Rotated scalar array pair}}
\DoxyCodeLine{182 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)} :: B(:,:)\textcolor{comment}{     !< Rotated scalar array pair}}
\DoxyCodeLine{183 }
\DoxyCodeLine{184   \textcolor{keywordflow}{if} (modulo(turns, 2) /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{185     \textcolor{keyword}{call }rotate\_array(b\_in, turns, a)}
\DoxyCodeLine{186     \textcolor{keyword}{call }rotate\_array(a\_in, turns, b)}
\DoxyCodeLine{187   \textcolor{keywordflow}{else}}
\DoxyCodeLine{188     \textcolor{keyword}{call }rotate\_array(a\_in, turns, a)}
\DoxyCodeLine{189     \textcolor{keyword}{call }rotate\_array(b\_in, turns, b)}
\DoxyCodeLine{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}}
\doxysubsubsection{\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{\texttt{ in}}  & {\em a\+\_\+in} & Unrotated scalar array pair \\
\hline
\mbox{\texttt{ in}}  & {\em b\+\_\+in} & Unrotated scalar array pair \\
\hline
\mbox{\texttt{ in}}  & {\em turns} & Number of quarter turns \\
\hline
\mbox{\texttt{ out}}  & {\em a} & Rotated scalar array pair \\
\hline
\mbox{\texttt{ out}}  & {\em b} & Rotated scalar array pair \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{196 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: A\_in(:,:,:)\textcolor{comment}{   !< Unrotated scalar array pair}}
\DoxyCodeLine{197 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: B\_in(:,:,:)\textcolor{comment}{   !< Unrotated scalar array pair}}
\DoxyCodeLine{198   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{      !< Number of quarter turns}}
\DoxyCodeLine{199 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)} :: A(:,:,:)\textcolor{comment}{     !< Rotated scalar array pair}}
\DoxyCodeLine{200 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)} :: B(:,:,:)\textcolor{comment}{     !< Rotated scalar array pair}}
\DoxyCodeLine{201 }
\DoxyCodeLine{202   \textcolor{keywordtype}{integer} :: k}
\DoxyCodeLine{203 }
\DoxyCodeLine{204   \textcolor{keywordflow}{do} k = 1, \textcolor{keyword}{size}(a\_in, 3)}
\DoxyCodeLine{205     \textcolor{keyword}{call }rotate\_array\_pair(a\_in(:,:,k), b\_in(:,:,k), turns, \&}
\DoxyCodeLine{206         a(:,:,k), b(:,:,k))}
\DoxyCodeLine{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}}
\doxysubsubsection{\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{\texttt{ in}}  & {\em a\+\_\+in} & Unrotated array \\
\hline
\mbox{\texttt{ in}}  & {\em turns} & Number of quarter turns \\
\hline
\mbox{\texttt{ out}}  & {\em a} & Rotated array \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{75 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: A\_in(:,:)\textcolor{comment}{ !< Unrotated array}}
\DoxyCodeLine{76   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{  !< Number of quarter turns}}
\DoxyCodeLine{77 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)} :: A(:,:)\textcolor{comment}{   !< Rotated array}}
\DoxyCodeLine{78 }
\DoxyCodeLine{79   \textcolor{keywordtype}{integer} :: m, n}
\DoxyCodeLine{80 }
\DoxyCodeLine{81   m = \textcolor{keyword}{size}(a\_in, 1)}
\DoxyCodeLine{82   n = \textcolor{keyword}{size}(a\_in, 2)}
\DoxyCodeLine{83 }
\DoxyCodeLine{84   \textcolor{keywordflow}{select case} (modulo(turns, 4))}
\DoxyCodeLine{85     \textcolor{keywordflow}{case}(0)}
\DoxyCodeLine{86       a(:,:) = a\_in(:,:)}
\DoxyCodeLine{87     \textcolor{keywordflow}{case}(1)}
\DoxyCodeLine{88       a(:,:) = transpose(a\_in)}
\DoxyCodeLine{89       a(:,:) = a(n:1:-\/1, :)}
\DoxyCodeLine{90     \textcolor{keywordflow}{case}(2)}
\DoxyCodeLine{91       a(:,:) = a\_in(m:1:-\/1, n:1:-\/1)}
\DoxyCodeLine{92     \textcolor{keywordflow}{case}(3)}
\DoxyCodeLine{93       a(:,:) = transpose(a\_in(m:1:-\/1, :))}
\DoxyCodeLine{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}}
\doxysubsubsection{\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{\texttt{ in}}  & {\em a\+\_\+in} & Unrotated array \\
\hline
\mbox{\texttt{ in}}  & {\em turns} & Number of quarter turns \\
\hline
\mbox{\texttt{ out}}  & {\em a} & Rotated array \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{100 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: A\_in(:,:,:)\textcolor{comment}{ !< Unrotated array}}
\DoxyCodeLine{101   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{    !< Number of quarter turns}}
\DoxyCodeLine{102 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)} :: A(:,:,:)\textcolor{comment}{   !< Rotated array}}
\DoxyCodeLine{103 }
\DoxyCodeLine{104   \textcolor{keywordtype}{integer} :: k}
\DoxyCodeLine{105 }
\DoxyCodeLine{106   \textcolor{keywordflow}{do} k = 1, \textcolor{keyword}{size}(a\_in, 3)}
\DoxyCodeLine{107     \textcolor{keyword}{call }rotate\_array(a\_in(:,:,k), turns, a(:,:,k))}
\DoxyCodeLine{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}}
\doxysubsubsection{\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{\texttt{ in}}  & {\em a\+\_\+in} & Unrotated array \\
\hline
\mbox{\texttt{ in}}  & {\em turns} & Number of quarter turns \\
\hline
\mbox{\texttt{ out}}  & {\em a} & Rotated array \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{114 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: A\_in(:,:,:,:)\textcolor{comment}{ !< Unrotated array}}
\DoxyCodeLine{115   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{      !< Number of quarter turns}}
\DoxyCodeLine{116 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)} :: A(:,:,:,:)\textcolor{comment}{   !< Rotated array}}
\DoxyCodeLine{117 }
\DoxyCodeLine{118   \textcolor{keywordtype}{integer} :: n}
\DoxyCodeLine{119 }
\DoxyCodeLine{120   \textcolor{keywordflow}{do} n = 1, \textcolor{keyword}{size}(a\_in, 4)}
\DoxyCodeLine{121     \textcolor{keyword}{call }rotate\_array(a\_in(:,:,:,n), turns, a(:,:,:,n))}
\DoxyCodeLine{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}}
\doxysubsubsection{\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{\texttt{ in}}  & {\em a\+\_\+in} & First component of unrotated vector \\
\hline
\mbox{\texttt{ in}}  & {\em b\+\_\+in} & Second component of unrotated vector \\
\hline
\mbox{\texttt{ in}}  & {\em turns} & Number of quarter turns \\
\hline
\mbox{\texttt{ out}}  & {\em a} & First component of rotated vector \\
\hline
\mbox{\texttt{ out}}  & {\em b} & Second component of unrotated vector \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{231 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: A\_in(:,:)\textcolor{comment}{ !< First component of unrotated vector}}
\DoxyCodeLine{232 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: B\_in(:,:)\textcolor{comment}{ !< Second component of unrotated vector}}
\DoxyCodeLine{233   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{  !< Number of quarter turns}}
\DoxyCodeLine{234 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)} :: A(:,:)\textcolor{comment}{   !< First component of rotated vector}}
\DoxyCodeLine{235 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)} :: B(:,:)\textcolor{comment}{   !< Second component of unrotated vector}}
\DoxyCodeLine{236 }
\DoxyCodeLine{237   \textcolor{keyword}{call }rotate\_array\_pair(a\_in, b\_in, turns, a, b)}
\DoxyCodeLine{238 }
\DoxyCodeLine{239   \textcolor{keywordflow}{if} (modulo(turns, 4) == 1 .or. modulo(turns, 4) == 2) \&}
\DoxyCodeLine{240     a(:,:) = -\/a(:,:)}
\DoxyCodeLine{241 }
\DoxyCodeLine{242   \textcolor{keywordflow}{if} (modulo(turns, 4) == 2 .or. modulo(turns, 4) == 3) \&}
\DoxyCodeLine{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}}
\doxysubsubsection{\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{\texttt{ in}}  & {\em a\+\_\+in} & First component of unrotated vector \\
\hline
\mbox{\texttt{ in}}  & {\em b\+\_\+in} & Second component of unrotated vector \\
\hline
\mbox{\texttt{ in}}  & {\em turns} & Number of quarter turns \\
\hline
\mbox{\texttt{ out}}  & {\em a} & First component of rotated vector \\
\hline
\mbox{\texttt{ out}}  & {\em b} & Second component of unrotated vector \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{249 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: A\_in(:,:,:)\textcolor{comment}{ !< First component of unrotated vector}}
\DoxyCodeLine{250 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: B\_in(:,:,:)\textcolor{comment}{ !< Second component of unrotated vector}}
\DoxyCodeLine{251   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{    !< Number of quarter turns}}
\DoxyCodeLine{252 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)} :: A(:,:,:)\textcolor{comment}{   !< First component of rotated vector}}
\DoxyCodeLine{253 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)} :: B(:,:,:)\textcolor{comment}{   !< Second component of unrotated vector}}
\DoxyCodeLine{254 }
\DoxyCodeLine{255   \textcolor{keywordtype}{integer} :: k}
\DoxyCodeLine{256 }
\DoxyCodeLine{257   \textcolor{keywordflow}{do} k = 1, \textcolor{keyword}{size}(a\_in, 3)}
\DoxyCodeLine{258     \textcolor{keyword}{call }rotate\_vector(a\_in(:,:,k), b\_in(:,:,k), turns, a(:,:,k), b(:,:,k))}
\DoxyCodeLine{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}}
\doxysubsubsection{\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{\texttt{ in}}  & {\em a\+\_\+in} & First component of unrotated vector \\
\hline
\mbox{\texttt{ in}}  & {\em b\+\_\+in} & Second component of unrotated vector \\
\hline
\mbox{\texttt{ in}}  & {\em turns} & Number of quarter turns \\
\hline
\mbox{\texttt{ out}}  & {\em a} & First component of rotated vector \\
\hline
\mbox{\texttt{ out}}  & {\em b} & Second component of unrotated vector \\
\hline
\end{DoxyParams}


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


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

\end{DoxyCode}
