\hypertarget{interfacemom__diag__mediator_1_1downsample__mask}{}\doxysection{mom\+\_\+diag\+\_\+mediator\+::downsample\+\_\+mask Interface Reference}
\label{interfacemom__diag__mediator_1_1downsample__mask}\index{mom\_diag\_mediator::downsample\_mask@{mom\_diag\_mediator::downsample\_mask}}


\doxysubsection{Detailed Description}
Down sample the mask of a field. 

Definition at line 80 of file M\+O\+M\+\_\+diag\+\_\+mediator.\+F90.

\doxysubsection*{Private functions}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\hyperlink{interfacemom__diag__mediator_1_1downsample__mask_a68698c1ec117b83acdc977eccfe19d2a}{downsample\+\_\+mask\+\_\+2d}} (field\+\_\+in, field\+\_\+out, dl, isc\+\_\+o, jsc\+\_\+o, isc\+\_\+d, iec\+\_\+d, jsc\+\_\+d, jec\+\_\+d, isd\+\_\+d, ied\+\_\+d, jsd\+\_\+d, jed\+\_\+d)
\begin{DoxyCompactList}\small\item\em Allocate and compute the 2d down sampled mask The masks are down sampled based on a minority rule, i.\+e., a coarse cell is open (1) if at least one of the sub-\/cells are open, otherwise it\textquotesingle{}s closed (0) \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{interfacemom__diag__mediator_1_1downsample__mask_a3995e3eba36a70ae9796ddd5b8f786d3}{downsample\+\_\+mask\+\_\+3d}} (field\+\_\+in, field\+\_\+out, dl, isc\+\_\+o, jsc\+\_\+o, isc\+\_\+d, iec\+\_\+d, jsc\+\_\+d, jec\+\_\+d, isd\+\_\+d, ied\+\_\+d, jsd\+\_\+d, jed\+\_\+d)
\begin{DoxyCompactList}\small\item\em Allocate and compute the 3d down sampled mask The masks are down sampled based on a minority rule, i.\+e., a coarse cell is open (1) if at least one of the sub-\/cells are open, otherwise it\textquotesingle{}s closed (0) \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Down sample the mask of a field. 

Definition at line 80 of file M\+O\+M\+\_\+diag\+\_\+mediator.\+F90.



\doxysubsection{Functions and subroutines}
\mbox{\Hypertarget{interfacemom__diag__mediator_1_1downsample__mask_a68698c1ec117b83acdc977eccfe19d2a}\label{interfacemom__diag__mediator_1_1downsample__mask_a68698c1ec117b83acdc977eccfe19d2a}} 
\index{mom\_diag\_mediator::downsample\_mask@{mom\_diag\_mediator::downsample\_mask}!downsample\_mask\_2d@{downsample\_mask\_2d}}
\index{downsample\_mask\_2d@{downsample\_mask\_2d}!mom\_diag\_mediator::downsample\_mask@{mom\_diag\_mediator::downsample\_mask}}
\doxysubsubsection{\texorpdfstring{downsample\_mask\_2d()}{downsample\_mask\_2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+diag\+\_\+mediator\+::downsample\+\_\+mask\+::downsample\+\_\+mask\+\_\+2d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:), intent(in)}]{field\+\_\+in,  }\item[{real, dimension(\+:,\+:), pointer}]{field\+\_\+out,  }\item[{integer, intent(in)}]{dl,  }\item[{integer, intent(in)}]{isc\+\_\+o,  }\item[{integer, intent(in)}]{jsc\+\_\+o,  }\item[{integer, intent(in)}]{isc\+\_\+d,  }\item[{integer, intent(in)}]{iec\+\_\+d,  }\item[{integer, intent(in)}]{jsc\+\_\+d,  }\item[{integer, intent(in)}]{jec\+\_\+d,  }\item[{integer, intent(in)}]{isd\+\_\+d,  }\item[{integer, intent(in)}]{ied\+\_\+d,  }\item[{integer, intent(in)}]{jsd\+\_\+d,  }\item[{integer, intent(in)}]{jed\+\_\+d }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Allocate and compute the 2d down sampled mask The masks are down sampled based on a minority rule, i.\+e., a coarse cell is open (1) if at least one of the sub-\/cells are open, otherwise it\textquotesingle{}s closed (0) 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em field\+\_\+in} & Original field to be down sampled \\
\hline
 & {\em field\+\_\+out} & Down sampled field \\
\hline
\mbox{\texttt{ in}}  & {\em dl} & Level of down sampling \\
\hline
\mbox{\texttt{ in}}  & {\em isc\+\_\+o} & Original i-\/start index \\
\hline
\mbox{\texttt{ in}}  & {\em jsc\+\_\+o} & Original j-\/start index \\
\hline
\mbox{\texttt{ in}}  & {\em isc\+\_\+d} & Computational i-\/start index of down sampled data \\
\hline
\mbox{\texttt{ in}}  & {\em iec\+\_\+d} & Computational i-\/end index of down sampled data \\
\hline
\mbox{\texttt{ in}}  & {\em jsc\+\_\+d} & Computational j-\/start index of down sampled data \\
\hline
\mbox{\texttt{ in}}  & {\em jec\+\_\+d} & Computational j-\/end index of down sampled data \\
\hline
\mbox{\texttt{ in}}  & {\em isd\+\_\+d} & Computational i-\/start index of down sampled data \\
\hline
\mbox{\texttt{ in}}  & {\em ied\+\_\+d} & Computational i-\/end index of down sampled data \\
\hline
\mbox{\texttt{ in}}  & {\em jsd\+\_\+d} & Computational j-\/start index of down sampled data \\
\hline
\mbox{\texttt{ in}}  & {\em jed\+\_\+d} & Computational j-\/end index of down sampled data \\
\hline
\end{DoxyParams}


Definition at line 4251 of file M\+O\+M\+\_\+diag\+\_\+mediator.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{4253 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)}, \textcolor{keywordtype}{intent(in)} :: field\_in\textcolor{comment}{ !< Original field to be down sampled}}
\DoxyCodeLine{4254 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)}, \textcolor{keywordtype}{pointer} :: field\_out\textcolor{comment}{   !< Down sampled field}}
\DoxyCodeLine{4255   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: dl\textcolor{comment}{    !< Level of down sampling}}
\DoxyCodeLine{4256   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: isc\_o\textcolor{comment}{ !< Original i-\/start index}}
\DoxyCodeLine{4257   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: jsc\_o\textcolor{comment}{ !< Original j-\/start index}}
\DoxyCodeLine{4258   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: isc\_d\textcolor{comment}{ !< Computational i-\/start index of down sampled data}}
\DoxyCodeLine{4259   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: iec\_d\textcolor{comment}{ !< Computational i-\/end index of down sampled data}}
\DoxyCodeLine{4260   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: jsc\_d\textcolor{comment}{ !< Computational j-\/start index of down sampled data}}
\DoxyCodeLine{4261   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: jec\_d\textcolor{comment}{ !< Computational j-\/end index of down sampled data}}
\DoxyCodeLine{4262   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: isd\_d\textcolor{comment}{ !< Computational i-\/start index of down sampled data}}
\DoxyCodeLine{4263   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: ied\_d\textcolor{comment}{ !< Computational i-\/end index of down sampled data}}
\DoxyCodeLine{4264   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: jsd\_d\textcolor{comment}{ !< Computational j-\/start index of down sampled data}}
\DoxyCodeLine{4265   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: jed\_d\textcolor{comment}{ !< Computational j-\/end index of down sampled data}}
\DoxyCodeLine{4266   \textcolor{comment}{! Locals}}
\DoxyCodeLine{4267   \textcolor{keywordtype}{integer} :: i,j,ii,jj,i0,j0}
\DoxyCodeLine{4268 \textcolor{keywordtype}{  real}    :: tot\_non\_zero}
\DoxyCodeLine{4269   \textcolor{comment}{! down sampled mask = 0 unless the mask value of one of the down sampling cells is 1}}
\DoxyCodeLine{4270   \textcolor{keyword}{allocate}(field\_out(isd\_d:ied\_d,jsd\_d:jed\_d))}
\DoxyCodeLine{4271   field\_out(:,:) = 0.0}
\DoxyCodeLine{4272   \textcolor{keywordflow}{do} j=jsc\_d,jec\_d ; \textcolor{keywordflow}{do} i=isc\_d,iec\_d}
\DoxyCodeLine{4273      i0 = isc\_o+dl*(i-\/isc\_d)}
\DoxyCodeLine{4274      j0 = jsc\_o+dl*(j-\/jsc\_d)}
\DoxyCodeLine{4275      tot\_non\_zero = 0.0}
\DoxyCodeLine{4276      \textcolor{keywordflow}{do} jj=j0,j0+dl-\/1 ; \textcolor{keywordflow}{do} ii=i0,i0+dl-\/1}
\DoxyCodeLine{4277         tot\_non\_zero = tot\_non\_zero + field\_in(ii,jj)}
\DoxyCodeLine{4278      enddo;\textcolor{keywordflow}{enddo}}
\DoxyCodeLine{4279      \textcolor{keywordflow}{if}(tot\_non\_zero > 0.0) field\_out(i,j)=1.0}
\DoxyCodeLine{4280   enddo;\textcolor{keywordflow}{ enddo}}

\end{DoxyCode}
\mbox{\Hypertarget{interfacemom__diag__mediator_1_1downsample__mask_a3995e3eba36a70ae9796ddd5b8f786d3}\label{interfacemom__diag__mediator_1_1downsample__mask_a3995e3eba36a70ae9796ddd5b8f786d3}} 
\index{mom\_diag\_mediator::downsample\_mask@{mom\_diag\_mediator::downsample\_mask}!downsample\_mask\_3d@{downsample\_mask\_3d}}
\index{downsample\_mask\_3d@{downsample\_mask\_3d}!mom\_diag\_mediator::downsample\_mask@{mom\_diag\_mediator::downsample\_mask}}
\doxysubsubsection{\texorpdfstring{downsample\_mask\_3d()}{downsample\_mask\_3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+diag\+\_\+mediator\+::downsample\+\_\+mask\+::downsample\+\_\+mask\+\_\+3d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:,\+:), intent(in)}]{field\+\_\+in,  }\item[{real, dimension(\+:,\+:,\+:), pointer}]{field\+\_\+out,  }\item[{integer, intent(in)}]{dl,  }\item[{integer, intent(in)}]{isc\+\_\+o,  }\item[{integer, intent(in)}]{jsc\+\_\+o,  }\item[{integer, intent(in)}]{isc\+\_\+d,  }\item[{integer, intent(in)}]{iec\+\_\+d,  }\item[{integer, intent(in)}]{jsc\+\_\+d,  }\item[{integer, intent(in)}]{jec\+\_\+d,  }\item[{integer, intent(in)}]{isd\+\_\+d,  }\item[{integer, intent(in)}]{ied\+\_\+d,  }\item[{integer, intent(in)}]{jsd\+\_\+d,  }\item[{integer, intent(in)}]{jed\+\_\+d }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Allocate and compute the 3d down sampled mask The masks are down sampled based on a minority rule, i.\+e., a coarse cell is open (1) if at least one of the sub-\/cells are open, otherwise it\textquotesingle{}s closed (0) 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em field\+\_\+in} & Original field to be down sampled \\
\hline
 & {\em field\+\_\+out} & down sampled field \\
\hline
\mbox{\texttt{ in}}  & {\em dl} & Level of down sampling \\
\hline
\mbox{\texttt{ in}}  & {\em isc\+\_\+o} & Original i-\/start index \\
\hline
\mbox{\texttt{ in}}  & {\em jsc\+\_\+o} & Original j-\/start index \\
\hline
\mbox{\texttt{ in}}  & {\em isc\+\_\+d} & Computational i-\/start index of down sampled data \\
\hline
\mbox{\texttt{ in}}  & {\em iec\+\_\+d} & Computational i-\/end index of down sampled data \\
\hline
\mbox{\texttt{ in}}  & {\em jsc\+\_\+d} & Computational j-\/start index of down sampled data \\
\hline
\mbox{\texttt{ in}}  & {\em jec\+\_\+d} & Computational j-\/end index of down sampled data \\
\hline
\mbox{\texttt{ in}}  & {\em isd\+\_\+d} & Computational i-\/start index of down sampled data \\
\hline
\mbox{\texttt{ in}}  & {\em ied\+\_\+d} & Computational i-\/end index of down sampled data \\
\hline
\mbox{\texttt{ in}}  & {\em jsd\+\_\+d} & Computational j-\/start index of down sampled data \\
\hline
\mbox{\texttt{ in}}  & {\em jed\+\_\+d} & Computational j-\/end index of down sampled data \\
\hline
\end{DoxyParams}


Definition at line 4286 of file M\+O\+M\+\_\+diag\+\_\+mediator.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{4288 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(in)} :: field\_in\textcolor{comment}{ !< Original field to be down sampled}}
\DoxyCodeLine{4289 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{pointer} :: field\_out\textcolor{comment}{   !< down sampled field}}
\DoxyCodeLine{4290   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: dl\textcolor{comment}{    !< Level of down sampling}}
\DoxyCodeLine{4291   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: isc\_o\textcolor{comment}{ !< Original i-\/start index}}
\DoxyCodeLine{4292   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: jsc\_o\textcolor{comment}{ !< Original j-\/start index}}
\DoxyCodeLine{4293   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: isc\_d\textcolor{comment}{ !< Computational i-\/start index of down sampled data}}
\DoxyCodeLine{4294   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: iec\_d\textcolor{comment}{ !< Computational i-\/end index of down sampled data}}
\DoxyCodeLine{4295   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: jsc\_d\textcolor{comment}{ !< Computational j-\/start index of down sampled data}}
\DoxyCodeLine{4296   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: jec\_d\textcolor{comment}{ !< Computational j-\/end index of down sampled data}}
\DoxyCodeLine{4297   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: isd\_d\textcolor{comment}{ !< Computational i-\/start index of down sampled data}}
\DoxyCodeLine{4298   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: ied\_d\textcolor{comment}{ !< Computational i-\/end index of down sampled data}}
\DoxyCodeLine{4299   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: jsd\_d\textcolor{comment}{ !< Computational j-\/start index of down sampled data}}
\DoxyCodeLine{4300   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: jed\_d\textcolor{comment}{ !< Computational j-\/end index of down sampled data}}
\DoxyCodeLine{4301   \textcolor{comment}{! Locals}}
\DoxyCodeLine{4302   \textcolor{keywordtype}{integer} :: i,j,ii,jj,i0,j0,k,ks,ke}
\DoxyCodeLine{4303 \textcolor{keywordtype}{  real}    :: tot\_non\_zero}
\DoxyCodeLine{4304   \textcolor{comment}{! down sampled mask = 0 unless the mask value of one of the down sampling cells is 1}}
\DoxyCodeLine{4305   ks = lbound(field\_in,3) ; ke = ubound(field\_in,3)}
\DoxyCodeLine{4306   \textcolor{keyword}{allocate}(field\_out(isd\_d:ied\_d,jsd\_d:jed\_d,ks:ke))}
\DoxyCodeLine{4307   field\_out(:,:,:) = 0.0}
\DoxyCodeLine{4308   \textcolor{keywordflow}{do} k= ks,ke ; \textcolor{keywordflow}{do} j=jsc\_d,jec\_d ; \textcolor{keywordflow}{do} i=isc\_d,iec\_d}
\DoxyCodeLine{4309      i0 = isc\_o+dl*(i-\/isc\_d)}
\DoxyCodeLine{4310      j0 = jsc\_o+dl*(j-\/jsc\_d)}
\DoxyCodeLine{4311      tot\_non\_zero = 0.0}
\DoxyCodeLine{4312      \textcolor{keywordflow}{do} jj=j0,j0+dl-\/1 ; \textcolor{keywordflow}{do} ii=i0,i0+dl-\/1}
\DoxyCodeLine{4313         tot\_non\_zero = tot\_non\_zero + field\_in(ii,jj,k)}
\DoxyCodeLine{4314      enddo;\textcolor{keywordflow}{enddo}}
\DoxyCodeLine{4315      \textcolor{keywordflow}{if}(tot\_non\_zero > 0.0) field\_out(i,j,k)=1.0}
\DoxyCodeLine{4316   enddo; enddo;\textcolor{keywordflow}{ enddo}}

\end{DoxyCode}


The documentation for this interface was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
/home/cermak/src/\+M\+O\+M6.\+devrob/src/framework/M\+O\+M\+\_\+diag\+\_\+mediator.\+F90\end{DoxyCompactItemize}
