\hypertarget{interfacemom__diag__mediator_1_1post__data}{}\doxysection{mom\+\_\+diag\+\_\+mediator\+::post\+\_\+data Interface Reference}
\label{interfacemom__diag__mediator_1_1post__data}\index{mom\_diag\_mediator::post\_data@{mom\_diag\_mediator::post\_data}}


\doxysubsection{Detailed Description}
Make a diagnostic available for averaging or output. 

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

\doxysubsection*{Private functions}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\hyperlink{interfacemom__diag__mediator_1_1post__data_a77f7a51366e47f94062ea5e966b52d81}{post\+\_\+data\+\_\+3d}} (diag\+\_\+field\+\_\+id, field, diag\+\_\+cs, is\+\_\+static, mask, alt\+\_\+h)
\begin{DoxyCompactList}\small\item\em Make a real 3-\/d array diagnostic available for averaging or output. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{interfacemom__diag__mediator_1_1post__data_a8a7f007ee2b01dafae5d25830756d6ed}{post\+\_\+data\+\_\+2d}} (diag\+\_\+field\+\_\+id, field, diag\+\_\+cs, is\+\_\+static, mask)
\begin{DoxyCompactList}\small\item\em Make a real 2-\/d array diagnostic available for averaging or output. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{interfacemom__diag__mediator_1_1post__data_aff9dff3143647733d9240499d6cb7a41}{post\+\_\+data\+\_\+1d\+\_\+k}} (diag\+\_\+field\+\_\+id, field, diag\+\_\+cs, is\+\_\+static)
\begin{DoxyCompactList}\small\item\em Make a real 1-\/d array diagnostic available for averaging or output. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{interfacemom__diag__mediator_1_1post__data_a43362c3a9cb4631f1c366782cc559c72}{post\+\_\+data\+\_\+0d}} (diag\+\_\+field\+\_\+id, field, diag\+\_\+cs, is\+\_\+static)
\begin{DoxyCompactList}\small\item\em Make a real scalar diagnostic available for averaging or output. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Make a diagnostic available for averaging or output. 

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



\doxysubsection{Functions and subroutines}
\mbox{\Hypertarget{interfacemom__diag__mediator_1_1post__data_a43362c3a9cb4631f1c366782cc559c72}\label{interfacemom__diag__mediator_1_1post__data_a43362c3a9cb4631f1c366782cc559c72}} 
\index{mom\_diag\_mediator::post\_data@{mom\_diag\_mediator::post\_data}!post\_data\_0d@{post\_data\_0d}}
\index{post\_data\_0d@{post\_data\_0d}!mom\_diag\_mediator::post\_data@{mom\_diag\_mediator::post\_data}}
\doxysubsubsection{\texorpdfstring{post\_data\_0d()}{post\_data\_0d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+diag\+\_\+mediator\+::post\+\_\+data\+::post\+\_\+data\+\_\+0d (\begin{DoxyParamCaption}\item[{integer, intent(in)}]{diag\+\_\+field\+\_\+id,  }\item[{real, intent(in)}]{field,  }\item[{type(\mbox{\hyperlink{structmom__diag__mediator_1_1diag__ctrl}{diag\+\_\+ctrl}}), intent(in), target}]{diag\+\_\+cs,  }\item[{logical, intent(in), optional}]{is\+\_\+static }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Make a real scalar diagnostic available for averaging or output. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em diag\+\_\+field\+\_\+id} & The id for an output variable returned by a previous call to register\+\_\+diag\+\_\+field. \\
\hline
\mbox{\texttt{ in}}  & {\em field} & real value being offered for output or averaging \\
\hline
\mbox{\texttt{ in}}  & {\em diag\+\_\+cs} & Structure used to regulate diagnostic output \\
\hline
\mbox{\texttt{ in}}  & {\em is\+\_\+static} & If true, this is a static field that is always offered. \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{1257   \textcolor{keywordtype}{integer},           \textcolor{keywordtype}{intent(in)} :: diag\_field\_id\textcolor{comment}{ !< The id for an output variable returned by a}}
\DoxyCodeLine{1258 \textcolor{comment}{                                                 !! previous call to register\_diag\_field.}}
\DoxyCodeLine{1259 \textcolor{keywordtype}{  real},              \textcolor{keywordtype}{intent(in)} :: field\textcolor{comment}{         !< real value being offered for output or averaging}}
\DoxyCodeLine{1260   \textcolor{keywordtype}{type}(diag\_ctrl), \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(in)} :: diag\_CS\textcolor{comment}{ !< Structure used to regulate diagnostic output}}
\DoxyCodeLine{1261   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: is\_static\textcolor{comment}{ !< If true, this is a static field that is always offered.}}
\DoxyCodeLine{1262 }
\DoxyCodeLine{1263   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1264 \textcolor{keywordtype}{  real} :: locfield}
\DoxyCodeLine{1265   \textcolor{keywordtype}{logical} :: used, is\_stat}
\DoxyCodeLine{1266   \textcolor{keywordtype}{type}(diag\_type), \textcolor{keywordtype}{pointer} :: diag => null()}
\DoxyCodeLine{1267 }
\DoxyCodeLine{1268   \textcolor{keywordflow}{if} (id\_clock\_diag\_mediator>0) \textcolor{keyword}{call }cpu\_clock\_begin(id\_clock\_diag\_mediator)}
\DoxyCodeLine{1269   is\_stat = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(is\_static)) is\_stat = is\_static}
\DoxyCodeLine{1270 }
\DoxyCodeLine{1271   \textcolor{comment}{! Iterate over list of diag 'variants', e.g. CMOR aliases, call send\_data}}
\DoxyCodeLine{1272   \textcolor{comment}{! for each one.}}
\DoxyCodeLine{1273   \textcolor{keyword}{call }assert(diag\_field\_id < diag\_cs\%next\_free\_diag\_id, \&}
\DoxyCodeLine{1274               \textcolor{stringliteral}{'post\_data\_0d: Unregistered diagnostic id'})}
\DoxyCodeLine{1275   diag => diag\_cs\%diags(diag\_field\_id)}
\DoxyCodeLine{1276 }
\DoxyCodeLine{1277   \textcolor{keywordflow}{do} \textcolor{keywordflow}{while} (\textcolor{keyword}{associated}(diag))}
\DoxyCodeLine{1278     locfield = field}
\DoxyCodeLine{1279     \textcolor{keywordflow}{if} (diag\%conversion\_factor /= 0.) \&}
\DoxyCodeLine{1280       locfield = locfield * diag\%conversion\_factor}
\DoxyCodeLine{1281 }
\DoxyCodeLine{1282     \textcolor{keywordflow}{if} (diag\_cs\%diag\_as\_chksum) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1283       \textcolor{keyword}{call }chksum0(locfield, diag\%debug\_str, logunit=diag\_cs\%chksum\_iounit)}
\DoxyCodeLine{1284     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (is\_stat) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1285       used = send\_data(diag\%fms\_diag\_id, locfield)}
\DoxyCodeLine{1286     \textcolor{keywordflow}{elseif} (diag\_cs\%ave\_enabled) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1287       used = send\_data(diag\%fms\_diag\_id, locfield, diag\_cs\%time\_end)}
\DoxyCodeLine{1288 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1289     diag => diag\%next}
\DoxyCodeLine{1290 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{1291 }
\DoxyCodeLine{1292   \textcolor{keywordflow}{if} (id\_clock\_diag\_mediator>0) \textcolor{keyword}{call }cpu\_clock\_end(id\_clock\_diag\_mediator)}

\end{DoxyCode}
\mbox{\Hypertarget{interfacemom__diag__mediator_1_1post__data_aff9dff3143647733d9240499d6cb7a41}\label{interfacemom__diag__mediator_1_1post__data_aff9dff3143647733d9240499d6cb7a41}} 
\index{mom\_diag\_mediator::post\_data@{mom\_diag\_mediator::post\_data}!post\_data\_1d\_k@{post\_data\_1d\_k}}
\index{post\_data\_1d\_k@{post\_data\_1d\_k}!mom\_diag\_mediator::post\_data@{mom\_diag\_mediator::post\_data}}
\doxysubsubsection{\texorpdfstring{post\_data\_1d\_k()}{post\_data\_1d\_k()}}
{\footnotesize\ttfamily subroutine mom\+\_\+diag\+\_\+mediator\+::post\+\_\+data\+::post\+\_\+data\+\_\+1d\+\_\+k (\begin{DoxyParamCaption}\item[{integer, intent(in)}]{diag\+\_\+field\+\_\+id,  }\item[{real, dimension(\+:), intent(in), target}]{field,  }\item[{type(\mbox{\hyperlink{structmom__diag__mediator_1_1diag__ctrl}{diag\+\_\+ctrl}}), intent(in), target}]{diag\+\_\+cs,  }\item[{logical, intent(in), optional}]{is\+\_\+static }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Make a real 1-\/d array diagnostic available for averaging or output. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em diag\+\_\+field\+\_\+id} & The id for an output variable returned by a previous call to register\+\_\+diag\+\_\+field. \\
\hline
\mbox{\texttt{ in}}  & {\em field} & 1-\/d array being offered for output or averaging \\
\hline
\mbox{\texttt{ in}}  & {\em diag\+\_\+cs} & Structure used to regulate diagnostic output \\
\hline
\mbox{\texttt{ in}}  & {\em is\+\_\+static} & If true, this is a static field that is always offered. \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{1297   \textcolor{keywordtype}{integer},           \textcolor{keywordtype}{intent(in)} :: diag\_field\_id\textcolor{comment}{ !< The id for an output variable returned by a}}
\DoxyCodeLine{1298 \textcolor{comment}{                                                 !! previous call to register\_diag\_field.}}
\DoxyCodeLine{1299 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{target},      \textcolor{keywordtype}{intent(in)} :: field(:)\textcolor{comment}{      !< 1-\/d array being offered for output or averaging}}
\DoxyCodeLine{1300   \textcolor{keywordtype}{type}(diag\_ctrl), \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(in)} :: diag\_CS\textcolor{comment}{ !< Structure used to regulate diagnostic output}}
\DoxyCodeLine{1301   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: is\_static\textcolor{comment}{ !< If true, this is a static field that is always offered.}}
\DoxyCodeLine{1302 }
\DoxyCodeLine{1303   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1304   \textcolor{keywordtype}{logical} :: used  \textcolor{comment}{! The return value of send\_data is not used for anything.}}
\DoxyCodeLine{1305 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{pointer} :: locfield => null()}
\DoxyCodeLine{1306   \textcolor{keywordtype}{logical} :: is\_stat}
\DoxyCodeLine{1307   \textcolor{keywordtype}{integer} :: k, ks, ke}
\DoxyCodeLine{1308   \textcolor{keywordtype}{type}(diag\_type), \textcolor{keywordtype}{pointer} :: diag => null()}
\DoxyCodeLine{1309 }
\DoxyCodeLine{1310   \textcolor{keywordflow}{if} (id\_clock\_diag\_mediator>0) \textcolor{keyword}{call }cpu\_clock\_begin(id\_clock\_diag\_mediator)}
\DoxyCodeLine{1311   is\_stat = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(is\_static)) is\_stat = is\_static}
\DoxyCodeLine{1312 }
\DoxyCodeLine{1313   \textcolor{comment}{! Iterate over list of diag 'variants', e.g. CMOR aliases.}}
\DoxyCodeLine{1314   \textcolor{keyword}{call }assert(diag\_field\_id < diag\_cs\%next\_free\_diag\_id, \&}
\DoxyCodeLine{1315               \textcolor{stringliteral}{'post\_data\_1d\_k: Unregistered diagnostic id'})}
\DoxyCodeLine{1316   diag => diag\_cs\%diags(diag\_field\_id)}
\DoxyCodeLine{1317   \textcolor{keywordflow}{do} \textcolor{keywordflow}{while} (\textcolor{keyword}{associated}(diag))}
\DoxyCodeLine{1318 }
\DoxyCodeLine{1319     \textcolor{keywordflow}{if} ((diag\%conversion\_factor /= 0.) .and. (diag\%conversion\_factor /= 1.)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1320       ks = lbound(field,1) ; ke = ubound(field,1)}
\DoxyCodeLine{1321       \textcolor{keyword}{allocate}( locfield( ks:ke ) )}
\DoxyCodeLine{1322 }
\DoxyCodeLine{1323       \textcolor{keywordflow}{do} k=ks,ke}
\DoxyCodeLine{1324         \textcolor{keywordflow}{if} (field(k) == diag\_cs\%missing\_value) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1325           locfield(k) = diag\_cs\%missing\_value}
\DoxyCodeLine{1326         \textcolor{keywordflow}{else}}
\DoxyCodeLine{1327           locfield(k) = field(k) * diag\%conversion\_factor}
\DoxyCodeLine{1328 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{1329 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{1330     \textcolor{keywordflow}{else}}
\DoxyCodeLine{1331       locfield => field}
\DoxyCodeLine{1332 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1333 }
\DoxyCodeLine{1334     \textcolor{keywordflow}{if} (diag\_cs\%diag\_as\_chksum) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1335       \textcolor{keyword}{call }zchksum(locfield, diag\%debug\_str, logunit=diag\_cs\%chksum\_iounit)}
\DoxyCodeLine{1336     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (is\_stat) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1337       used = send\_data(diag\%fms\_diag\_id, locfield)}
\DoxyCodeLine{1338     \textcolor{keywordflow}{elseif} (diag\_cs\%ave\_enabled) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1339       used = send\_data(diag\%fms\_diag\_id, locfield, diag\_cs\%time\_end, weight=diag\_cs\%time\_int)}
\DoxyCodeLine{1340 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1341     \textcolor{keywordflow}{if} ((diag\%conversion\_factor /= 0.) .and. (diag\%conversion\_factor /= 1.)) \textcolor{keyword}{deallocate}( locfield )}
\DoxyCodeLine{1342 }
\DoxyCodeLine{1343     diag => diag\%next}
\DoxyCodeLine{1344 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{1345 }
\DoxyCodeLine{1346   \textcolor{keywordflow}{if} (id\_clock\_diag\_mediator>0) \textcolor{keyword}{call }cpu\_clock\_end(id\_clock\_diag\_mediator)}

\end{DoxyCode}
\mbox{\Hypertarget{interfacemom__diag__mediator_1_1post__data_a8a7f007ee2b01dafae5d25830756d6ed}\label{interfacemom__diag__mediator_1_1post__data_a8a7f007ee2b01dafae5d25830756d6ed}} 
\index{mom\_diag\_mediator::post\_data@{mom\_diag\_mediator::post\_data}!post\_data\_2d@{post\_data\_2d}}
\index{post\_data\_2d@{post\_data\_2d}!mom\_diag\_mediator::post\_data@{mom\_diag\_mediator::post\_data}}
\doxysubsubsection{\texorpdfstring{post\_data\_2d()}{post\_data\_2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+diag\+\_\+mediator\+::post\+\_\+data\+::post\+\_\+data\+\_\+2d (\begin{DoxyParamCaption}\item[{integer, intent(in)}]{diag\+\_\+field\+\_\+id,  }\item[{real, dimension(\+:,\+:), intent(in)}]{field,  }\item[{type(\mbox{\hyperlink{structmom__diag__mediator_1_1diag__ctrl}{diag\+\_\+ctrl}}), intent(in), target}]{diag\+\_\+cs,  }\item[{logical, intent(in), optional}]{is\+\_\+static,  }\item[{real, dimension(\+:,\+:), intent(in), optional}]{mask }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Make a real 2-\/d array diagnostic available for averaging or output. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em diag\+\_\+field\+\_\+id} & The id for an output variable returned by a previous call to register\+\_\+diag\+\_\+field. \\
\hline
\mbox{\texttt{ in}}  & {\em field} & 2-\/d array being offered for output or averaging \\
\hline
\mbox{\texttt{ in}}  & {\em diag\+\_\+cs} & Structure used to regulate diagnostic output \\
\hline
\mbox{\texttt{ in}}  & {\em is\+\_\+static} & If true, this is a static field that is always offered. \\
\hline
\mbox{\texttt{ in}}  & {\em mask} & If present, use this real array as the data mask. \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{1351   \textcolor{keywordtype}{integer},           \textcolor{keywordtype}{intent(in)} :: diag\_field\_id\textcolor{comment}{ !< The id for an output variable returned by a}}
\DoxyCodeLine{1352 \textcolor{comment}{                                                 !! previous call to register\_diag\_field.}}
\DoxyCodeLine{1353 \textcolor{keywordtype}{  real},              \textcolor{keywordtype}{intent(in)} :: field(:,:)\textcolor{comment}{    !< 2-\/d array being offered for output or averaging}}
\DoxyCodeLine{1354   \textcolor{keywordtype}{type}(diag\_ctrl), \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(in)} :: diag\_CS\textcolor{comment}{ !< Structure used to regulate diagnostic output}}
\DoxyCodeLine{1355   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: is\_static\textcolor{comment}{ !< If true, this is a static field that is always offered.}}
\DoxyCodeLine{1356 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: mask(:,:)\textcolor{comment}{ !< If present, use this real array as the data mask.}}
\DoxyCodeLine{1357 }
\DoxyCodeLine{1358   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1359   \textcolor{keywordtype}{type}(diag\_type), \textcolor{keywordtype}{pointer} :: diag => null()}
\DoxyCodeLine{1360 }
\DoxyCodeLine{1361   \textcolor{keywordflow}{if} (id\_clock\_diag\_mediator>0) \textcolor{keyword}{call }cpu\_clock\_begin(id\_clock\_diag\_mediator)}
\DoxyCodeLine{1362 }
\DoxyCodeLine{1363   \textcolor{comment}{! Iterate over list of diag 'variants' (e.g. CMOR aliases) and post each.}}
\DoxyCodeLine{1364   \textcolor{keyword}{call }assert(diag\_field\_id < diag\_cs\%next\_free\_diag\_id, \&}
\DoxyCodeLine{1365               \textcolor{stringliteral}{'post\_data\_2d: Unregistered diagnostic id'})}
\DoxyCodeLine{1366   diag => diag\_cs\%diags(diag\_field\_id)}
\DoxyCodeLine{1367   \textcolor{keywordflow}{do} \textcolor{keywordflow}{while} (\textcolor{keyword}{associated}(diag))}
\DoxyCodeLine{1368     \textcolor{keyword}{call }post\_data\_2d\_low(diag, field, diag\_cs, is\_static, mask)}
\DoxyCodeLine{1369     diag => diag\%next}
\DoxyCodeLine{1370 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{1371 }
\DoxyCodeLine{1372   \textcolor{keywordflow}{if} (id\_clock\_diag\_mediator>0) \textcolor{keyword}{call }cpu\_clock\_end(id\_clock\_diag\_mediator)}

\end{DoxyCode}
\mbox{\Hypertarget{interfacemom__diag__mediator_1_1post__data_a77f7a51366e47f94062ea5e966b52d81}\label{interfacemom__diag__mediator_1_1post__data_a77f7a51366e47f94062ea5e966b52d81}} 
\index{mom\_diag\_mediator::post\_data@{mom\_diag\_mediator::post\_data}!post\_data\_3d@{post\_data\_3d}}
\index{post\_data\_3d@{post\_data\_3d}!mom\_diag\_mediator::post\_data@{mom\_diag\_mediator::post\_data}}
\doxysubsubsection{\texorpdfstring{post\_data\_3d()}{post\_data\_3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+diag\+\_\+mediator\+::post\+\_\+data\+::post\+\_\+data\+\_\+3d (\begin{DoxyParamCaption}\item[{integer, intent(in)}]{diag\+\_\+field\+\_\+id,  }\item[{real, dimension(\+:,\+:,\+:), intent(in)}]{field,  }\item[{type(\mbox{\hyperlink{structmom__diag__mediator_1_1diag__ctrl}{diag\+\_\+ctrl}}), intent(in), target}]{diag\+\_\+cs,  }\item[{logical, intent(in), optional}]{is\+\_\+static,  }\item[{real, dimension(\+:,\+:,\+:), intent(in), optional}]{mask,  }\item[{real, dimension(\+:,\+:,\+:), intent(in), optional, target}]{alt\+\_\+h }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Make a real 3-\/d array diagnostic available for averaging or output. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em diag\+\_\+field\+\_\+id} & The id for an output variable returned by a previous call to register\+\_\+diag\+\_\+field. \\
\hline
\mbox{\texttt{ in}}  & {\em field} & 3-\/d array being offered for output or averaging \\
\hline
\mbox{\texttt{ in}}  & {\em diag\+\_\+cs} & Structure used to regulate diagnostic output \\
\hline
\mbox{\texttt{ in}}  & {\em is\+\_\+static} & If true, this is a static field that is always offered. \\
\hline
\mbox{\texttt{ in}}  & {\em mask} & If present, use this real array as the data mask. \\
\hline
\mbox{\texttt{ in}}  & {\em alt\+\_\+h} & An alternate thickness to use for vertically \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{1522 }
\DoxyCodeLine{1523   \textcolor{keywordtype}{integer},           \textcolor{keywordtype}{intent(in)} :: diag\_field\_id\textcolor{comment}{ !< The id for an output variable returned by a}}
\DoxyCodeLine{1524 \textcolor{comment}{                                                 !! previous call to register\_diag\_field.}}
\DoxyCodeLine{1525 \textcolor{keywordtype}{  real},              \textcolor{keywordtype}{intent(in)} :: field(:,:,:)\textcolor{comment}{  !< 3-\/d array being offered for output or averaging}}
\DoxyCodeLine{1526   \textcolor{keywordtype}{type}(diag\_ctrl), \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(in)} :: diag\_CS\textcolor{comment}{ !< Structure used to regulate diagnostic output}}
\DoxyCodeLine{1527   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: is\_static\textcolor{comment}{ !< If true, this is a static field that is always offered.}}
\DoxyCodeLine{1528 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: mask(:,:,:)\textcolor{comment}{ !< If present, use this real array as the data mask.}}
\DoxyCodeLine{1529 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \&}
\DoxyCodeLine{1530          \textcolor{keywordtype}{target}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: alt\_h\textcolor{comment}{  !< An alternate thickness to use for vertically}}
\DoxyCodeLine{1531 \textcolor{comment}{                                                !! remapping this diagnostic [H ~> m or kg m-\/2].}}
\DoxyCodeLine{1532 }
\DoxyCodeLine{1533   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1534   \textcolor{keywordtype}{type}(diag\_type), \textcolor{keywordtype}{pointer} :: diag => null()}
\DoxyCodeLine{1535   \textcolor{keywordtype}{integer} :: nz, i, j, k}
\DoxyCodeLine{1536 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{allocatable} :: remapped\_field}
\DoxyCodeLine{1537   \textcolor{keywordtype}{logical} :: staggered\_in\_x, staggered\_in\_y}
\DoxyCodeLine{1538 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{pointer} :: h\_diag => null()}
\DoxyCodeLine{1539 }
\DoxyCodeLine{1540   \textcolor{keywordflow}{if} (id\_clock\_diag\_mediator>0) \textcolor{keyword}{call }cpu\_clock\_begin(id\_clock\_diag\_mediator)}
\DoxyCodeLine{1541 }
\DoxyCodeLine{1542   \textcolor{comment}{! For intensive variables only, we can choose to use a different diagnostic grid}}
\DoxyCodeLine{1543   \textcolor{comment}{! to map to}}
\DoxyCodeLine{1544   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(alt\_h)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1545     h\_diag => alt\_h}
\DoxyCodeLine{1546   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1547     h\_diag => diag\_cs\%h}
\DoxyCodeLine{1548 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1549 }
\DoxyCodeLine{1550   \textcolor{comment}{! Iterate over list of diag 'variants', e.g. CMOR aliases, different vertical}}
\DoxyCodeLine{1551   \textcolor{comment}{! grids, and post each.}}
\DoxyCodeLine{1552   \textcolor{keyword}{call }assert(diag\_field\_id < diag\_cs\%next\_free\_diag\_id, \&}
\DoxyCodeLine{1553               \textcolor{stringliteral}{'post\_data\_3d: Unregistered diagnostic id'})}
\DoxyCodeLine{1554   diag => diag\_cs\%diags(diag\_field\_id)}
\DoxyCodeLine{1555   \textcolor{keywordflow}{do} \textcolor{keywordflow}{while} (\textcolor{keyword}{associated}(diag))}
\DoxyCodeLine{1556     \textcolor{keyword}{call }assert(\textcolor{keyword}{associated}(diag\%axes), \textcolor{stringliteral}{'post\_data\_3d: axes is not associated'})}
\DoxyCodeLine{1557 }
\DoxyCodeLine{1558     staggered\_in\_x = diag\%axes\%is\_u\_point .or. diag\%axes\%is\_q\_point}
\DoxyCodeLine{1559     staggered\_in\_y = diag\%axes\%is\_v\_point .or. diag\%axes\%is\_q\_point}
\DoxyCodeLine{1560 }
\DoxyCodeLine{1561     \textcolor{keywordflow}{if} (diag\%v\_extensive .and. .not.diag\%axes\%is\_native) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1562       \textcolor{comment}{! The field is vertically integrated and needs to be re-\/gridded}}
\DoxyCodeLine{1563       \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(mask)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1564         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"post\_data\_3d: no mask for regridded field."})}
\DoxyCodeLine{1565 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1566 }
\DoxyCodeLine{1567       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_begin(id\_clock\_diag\_remap)}
\DoxyCodeLine{1568       \textcolor{keyword}{allocate}(remapped\_field(\textcolor{keyword}{size}(field,1), \textcolor{keyword}{size}(field,2), diag\%axes\%nz))}
\DoxyCodeLine{1569       \textcolor{keyword}{call }vertically\_reintegrate\_diag\_field(                                    \&}
\DoxyCodeLine{1570         diag\_cs\%diag\_remap\_cs(diag\%axes\%vertical\_coordinate\_number), diag\_cs\%G,  \&}
\DoxyCodeLine{1571         diag\_cs\%h\_begin,                                                         \&}
\DoxyCodeLine{1572         diag\_cs\%diag\_remap\_cs(diag\%axes\%vertical\_coordinate\_number)\%h\_extensive, \&}
\DoxyCodeLine{1573         staggered\_in\_x, staggered\_in\_y, diag\%axes\%mask3d, field, remapped\_field)}
\DoxyCodeLine{1574       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_end(id\_clock\_diag\_remap)}
\DoxyCodeLine{1575       \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(diag\%axes\%mask3d)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1576         \textcolor{comment}{! Since 3d masks do not vary in the vertical, just use as much as is}}
\DoxyCodeLine{1577         \textcolor{comment}{! needed.}}
\DoxyCodeLine{1578         \textcolor{keyword}{call }post\_data\_3d\_low(diag, remapped\_field, diag\_cs, is\_static, \&}
\DoxyCodeLine{1579                               mask=diag\%axes\%mask3d)}
\DoxyCodeLine{1580       \textcolor{keywordflow}{else}}
\DoxyCodeLine{1581         \textcolor{keyword}{call }post\_data\_3d\_low(diag, remapped\_field, diag\_cs, is\_static)}
\DoxyCodeLine{1582 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1583       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_begin(id\_clock\_diag\_remap)}
\DoxyCodeLine{1584       \textcolor{keyword}{deallocate}(remapped\_field)}
\DoxyCodeLine{1585       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_end(id\_clock\_diag\_remap)}
\DoxyCodeLine{1586     \textcolor{keywordflow}{elseif} (diag\%axes\%needs\_remapping) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1587       \textcolor{comment}{! Remap this field to another vertical coordinate.}}
\DoxyCodeLine{1588       \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(mask)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1589         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"post\_data\_3d: no mask for regridded field."})}
\DoxyCodeLine{1590 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1591 }
\DoxyCodeLine{1592       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_begin(id\_clock\_diag\_remap)}
\DoxyCodeLine{1593       \textcolor{keyword}{allocate}(remapped\_field(\textcolor{keyword}{size}(field,1), \textcolor{keyword}{size}(field,2), diag\%axes\%nz))}
\DoxyCodeLine{1594       \textcolor{keyword}{call }diag\_remap\_do\_remap(diag\_cs\%diag\_remap\_cs(diag\%axes\%vertical\_coordinate\_number), \&}
\DoxyCodeLine{1595               diag\_cs\%G, diag\_cs\%GV, h\_diag, staggered\_in\_x, staggered\_in\_y, \&}
\DoxyCodeLine{1596               diag\%axes\%mask3d, field, remapped\_field)}
\DoxyCodeLine{1597       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_end(id\_clock\_diag\_remap)}
\DoxyCodeLine{1598       \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(diag\%axes\%mask3d)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1599         \textcolor{comment}{! Since 3d masks do not vary in the vertical, just use as much as is}}
\DoxyCodeLine{1600         \textcolor{comment}{! needed.}}
\DoxyCodeLine{1601         \textcolor{keyword}{call }post\_data\_3d\_low(diag, remapped\_field, diag\_cs, is\_static, \&}
\DoxyCodeLine{1602                               mask=diag\%axes\%mask3d)}
\DoxyCodeLine{1603       \textcolor{keywordflow}{else}}
\DoxyCodeLine{1604         \textcolor{keyword}{call }post\_data\_3d\_low(diag, remapped\_field, diag\_cs, is\_static)}
\DoxyCodeLine{1605 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1606       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_begin(id\_clock\_diag\_remap)}
\DoxyCodeLine{1607       \textcolor{keyword}{deallocate}(remapped\_field)}
\DoxyCodeLine{1608       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_end(id\_clock\_diag\_remap)}
\DoxyCodeLine{1609     \textcolor{keywordflow}{elseif} (diag\%axes\%needs\_interpolating) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1610       \textcolor{comment}{! Interpolate this field to another vertical coordinate.}}
\DoxyCodeLine{1611       \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(mask)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1612         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"post\_data\_3d: no mask for regridded field."})}
\DoxyCodeLine{1613 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1614 }
\DoxyCodeLine{1615       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_begin(id\_clock\_diag\_remap)}
\DoxyCodeLine{1616       \textcolor{keyword}{allocate}(remapped\_field(\textcolor{keyword}{size}(field,1), \textcolor{keyword}{size}(field,2), diag\%axes\%nz+1))}
\DoxyCodeLine{1617       \textcolor{keyword}{call }vertically\_interpolate\_diag\_field(diag\_cs\%diag\_remap\_cs( \&}
\DoxyCodeLine{1618               diag\%axes\%vertical\_coordinate\_number), \&}
\DoxyCodeLine{1619               diag\_cs\%G, h\_diag, staggered\_in\_x, staggered\_in\_y, \&}
\DoxyCodeLine{1620               diag\%axes\%mask3d, field, remapped\_field)}
\DoxyCodeLine{1621       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_end(id\_clock\_diag\_remap)}
\DoxyCodeLine{1622       \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(diag\%axes\%mask3d)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1623         \textcolor{comment}{! Since 3d masks do not vary in the vertical, just use as much as is}}
\DoxyCodeLine{1624         \textcolor{comment}{! needed.}}
\DoxyCodeLine{1625         \textcolor{keyword}{call }post\_data\_3d\_low(diag, remapped\_field, diag\_cs, is\_static, \&}
\DoxyCodeLine{1626                               mask=diag\%axes\%mask3d)}
\DoxyCodeLine{1627       \textcolor{keywordflow}{else}}
\DoxyCodeLine{1628         \textcolor{keyword}{call }post\_data\_3d\_low(diag, remapped\_field, diag\_cs, is\_static)}
\DoxyCodeLine{1629 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1630       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_begin(id\_clock\_diag\_remap)}
\DoxyCodeLine{1631       \textcolor{keyword}{deallocate}(remapped\_field)}
\DoxyCodeLine{1632       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_end(id\_clock\_diag\_remap)}
\DoxyCodeLine{1633     \textcolor{keywordflow}{else}}
\DoxyCodeLine{1634       \textcolor{keyword}{call }post\_data\_3d\_low(diag, field, diag\_cs, is\_static, mask)}
\DoxyCodeLine{1635 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1636     diag => diag\%next}
\DoxyCodeLine{1637 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{1638   \textcolor{keywordflow}{if} (id\_clock\_diag\_mediator>0) \textcolor{keyword}{call }cpu\_clock\_end(id\_clock\_diag\_mediator)}
\DoxyCodeLine{1639 }

\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}
