\hypertarget{interfacemom__diag__mediator_1_1downsample__mask}{}\section{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}}


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

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

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


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

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



\subsection{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}}
\subsubsection{\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{\tt in}  & {\em field\+\_\+in} & Original field to be down sampled\\
\hline
 & {\em field\+\_\+out} & Down sampled field\\
\hline
\mbox{\tt in}  & {\em dl} & Level of down sampling\\
\hline
\mbox{\tt in}  & {\em isc\+\_\+o} & Original i-\/start index\\
\hline
\mbox{\tt in}  & {\em jsc\+\_\+o} & Original j-\/start index\\
\hline
\mbox{\tt in}  & {\em isc\+\_\+d} & Computational i-\/start index of down sampled data\\
\hline
\mbox{\tt in}  & {\em iec\+\_\+d} & Computational i-\/end index of down sampled data\\
\hline
\mbox{\tt in}  & {\em jsc\+\_\+d} & Computational j-\/start index of down sampled data\\
\hline
\mbox{\tt in}  & {\em jec\+\_\+d} & Computational j-\/end index of down sampled data\\
\hline
\mbox{\tt in}  & {\em isd\+\_\+d} & Computational i-\/start index of down sampled data\\
\hline
\mbox{\tt in}  & {\em ied\+\_\+d} & Computational i-\/end index of down sampled data\\
\hline
\mbox{\tt in}  & {\em jsd\+\_\+d} & Computational j-\/start index of down sampled data\\
\hline
\mbox{\tt in}  & {\em jed\+\_\+d} & Computational j-\/end index of down sampled data \\
\hline
\end{DoxyParams}


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


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


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


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