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


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

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

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


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

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



\subsection{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}}
\subsubsection{\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{\tt in}  & {\em diag\+\_\+field\+\_\+id} & The id for an output variable returned by a previous call to register\+\_\+diag\+\_\+field.\\
\hline
\mbox{\tt in}  & {\em field} & real value being offered for output or averaging\\
\hline
\mbox{\tt in}  & {\em diag\+\_\+cs} & Structure used to regulate diagnostic output\\
\hline
\mbox{\tt 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}
1257   \textcolor{keywordtype}{integer},           \textcolor{keywordtype}{intent(in)} :: diag\_field\_id\textcolor{comment}{ !< The id for an output variable returned by a}
1258 \textcolor{comment}{                                                 !! previous call to register\_diag\_field.}
1259   \textcolor{keywordtype}{real},              \textcolor{keywordtype}{intent(in)} :: field\textcolor{comment}{         !< real value being offered for output or averaging}
1260   \textcolor{keywordtype}{type}(diag\_ctrl), \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(in)} :: diag\_CS\textcolor{comment}{ !< Structure used to regulate diagnostic output}
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.}
1262 
1263   \textcolor{comment}{! Local variables}
1264   \textcolor{keywordtype}{real} :: locfield
1265   \textcolor{keywordtype}{logical} :: used, is\_stat
1266   \textcolor{keywordtype}{type}(diag\_type), \textcolor{keywordtype}{pointer} :: diag => null()
1267 
1268   \textcolor{keywordflow}{if} (id\_clock\_diag\_mediator>0) \textcolor{keyword}{call }cpu\_clock\_begin(id\_clock\_diag\_mediator)
1269   is\_stat = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(is\_static)) is\_stat = is\_static
1270 
1271   \textcolor{comment}{! Iterate over list of diag 'variants', e.g. CMOR aliases, call send\_data}
1272   \textcolor{comment}{! for each one.}
1273   \textcolor{keyword}{call }assert(diag\_field\_id < diag\_cs%next\_free\_diag\_id, &
1274               \textcolor{stringliteral}{'post\_data\_0d: Unregistered diagnostic id'})
1275   diag => diag\_cs%diags(diag\_field\_id)
1276 
1277   \textcolor{keywordflow}{do} \textcolor{keywordflow}{while} (\textcolor{keyword}{associated}(diag))
1278     locfield = field
1279     \textcolor{keywordflow}{if} (diag%conversion\_factor /= 0.) &
1280       locfield = locfield * diag%conversion\_factor
1281 
1282     \textcolor{keywordflow}{if} (diag\_cs%diag\_as\_chksum) \textcolor{keywordflow}{then}
1283       \textcolor{keyword}{call }chksum0(locfield, diag%debug\_str, logunit=diag\_cs%chksum\_iounit)
1284     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (is\_stat) \textcolor{keywordflow}{then}
1285       used = send\_data(diag%fms\_diag\_id, locfield)
1286     \textcolor{keywordflow}{elseif} (diag\_cs%ave\_enabled) \textcolor{keywordflow}{then}
1287       used = send\_data(diag%fms\_diag\_id, locfield, diag\_cs%time\_end)
1288 \textcolor{keywordflow}{    endif}
1289     diag => diag%next
1290 \textcolor{keywordflow}{  enddo}
1291 
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}}
\subsubsection{\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{\tt in}  & {\em diag\+\_\+field\+\_\+id} & The id for an output variable returned by a previous call to register\+\_\+diag\+\_\+field.\\
\hline
\mbox{\tt in}  & {\em field} & 1-\/d array being offered for output or averaging\\
\hline
\mbox{\tt in}  & {\em diag\+\_\+cs} & Structure used to regulate diagnostic output\\
\hline
\mbox{\tt 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}
1297   \textcolor{keywordtype}{integer},           \textcolor{keywordtype}{intent(in)} :: diag\_field\_id\textcolor{comment}{ !< The id for an output variable returned by a}
1298 \textcolor{comment}{                                                 !! previous call to register\_diag\_field.}
1299   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{target},      \textcolor{keywordtype}{intent(in)} :: field(:)\textcolor{comment}{      !< 1-d array being offered for output or averaging}
1300   \textcolor{keywordtype}{type}(diag\_ctrl), \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(in)} :: diag\_CS\textcolor{comment}{ !< Structure used to regulate diagnostic output}
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.}
1302 
1303   \textcolor{comment}{! Local variables}
1304   \textcolor{keywordtype}{logical} :: used  \textcolor{comment}{! The return value of send\_data is not used for anything.}
1305   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{pointer} :: locfield => null()
1306   \textcolor{keywordtype}{logical} :: is\_stat
1307   \textcolor{keywordtype}{integer} :: k, ks, ke
1308   \textcolor{keywordtype}{type}(diag\_type), \textcolor{keywordtype}{pointer} :: diag => null()
1309 
1310   \textcolor{keywordflow}{if} (id\_clock\_diag\_mediator>0) \textcolor{keyword}{call }cpu\_clock\_begin(id\_clock\_diag\_mediator)
1311   is\_stat = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(is\_static)) is\_stat = is\_static
1312 
1313   \textcolor{comment}{! Iterate over list of diag 'variants', e.g. CMOR aliases.}
1314   \textcolor{keyword}{call }assert(diag\_field\_id < diag\_cs%next\_free\_diag\_id, &
1315               \textcolor{stringliteral}{'post\_data\_1d\_k: Unregistered diagnostic id'})
1316   diag => diag\_cs%diags(diag\_field\_id)
1317   \textcolor{keywordflow}{do} \textcolor{keywordflow}{while} (\textcolor{keyword}{associated}(diag))
1318 
1319     \textcolor{keywordflow}{if} ((diag%conversion\_factor /= 0.) .and. (diag%conversion\_factor /= 1.)) \textcolor{keywordflow}{then}
1320       ks = lbound(field,1) ; ke = ubound(field,1)
1321       \textcolor{keyword}{allocate}( locfield( ks:ke ) )
1322 
1323       \textcolor{keywordflow}{do} k=ks,ke
1324         \textcolor{keywordflow}{if} (field(k) == diag\_cs%missing\_value) \textcolor{keywordflow}{then}
1325           locfield(k) = diag\_cs%missing\_value
1326         \textcolor{keywordflow}{else}
1327           locfield(k) = field(k) * diag%conversion\_factor
1328 \textcolor{keywordflow}{        endif}
1329 \textcolor{keywordflow}{      enddo}
1330     \textcolor{keywordflow}{else}
1331       locfield => field
1332 \textcolor{keywordflow}{    endif}
1333 
1334     \textcolor{keywordflow}{if} (diag\_cs%diag\_as\_chksum) \textcolor{keywordflow}{then}
1335       \textcolor{keyword}{call }zchksum(locfield, diag%debug\_str, logunit=diag\_cs%chksum\_iounit)
1336     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (is\_stat) \textcolor{keywordflow}{then}
1337       used = send\_data(diag%fms\_diag\_id, locfield)
1338     \textcolor{keywordflow}{elseif} (diag\_cs%ave\_enabled) \textcolor{keywordflow}{then}
1339       used = send\_data(diag%fms\_diag\_id, locfield, diag\_cs%time\_end, weight=diag\_cs%time\_int)
1340 \textcolor{keywordflow}{    endif}
1341     \textcolor{keywordflow}{if} ((diag%conversion\_factor /= 0.) .and. (diag%conversion\_factor /= 1.)) \textcolor{keyword}{deallocate}( locfield )
1342 
1343     diag => diag%next
1344 \textcolor{keywordflow}{  enddo}
1345 
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}}
\subsubsection{\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{\tt in}  & {\em diag\+\_\+field\+\_\+id} & The id for an output variable returned by a previous call to register\+\_\+diag\+\_\+field.\\
\hline
\mbox{\tt in}  & {\em field} & 2-\/d array being offered for output or averaging\\
\hline
\mbox{\tt in}  & {\em diag\+\_\+cs} & Structure used to regulate diagnostic output\\
\hline
\mbox{\tt in}  & {\em is\+\_\+static} & If true, this is a static field that is always offered.\\
\hline
\mbox{\tt 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}
1351   \textcolor{keywordtype}{integer},           \textcolor{keywordtype}{intent(in)} :: diag\_field\_id\textcolor{comment}{ !< The id for an output variable returned by a}
1352 \textcolor{comment}{                                                 !! previous call to register\_diag\_field.}
1353   \textcolor{keywordtype}{real},              \textcolor{keywordtype}{intent(in)} :: field(:,:)\textcolor{comment}{    !< 2-d array being offered for output or averaging}
1354   \textcolor{keywordtype}{type}(diag\_ctrl), \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(in)} :: diag\_CS\textcolor{comment}{ !< Structure used to regulate diagnostic output}
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.}
1356   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: mask(:,:)\textcolor{comment}{ !< If present, use this real array as the data mask.}
1357 
1358   \textcolor{comment}{! Local variables}
1359   \textcolor{keywordtype}{type}(diag\_type), \textcolor{keywordtype}{pointer} :: diag => null()
1360 
1361   \textcolor{keywordflow}{if} (id\_clock\_diag\_mediator>0) \textcolor{keyword}{call }cpu\_clock\_begin(id\_clock\_diag\_mediator)
1362 
1363   \textcolor{comment}{! Iterate over list of diag 'variants' (e.g. CMOR aliases) and post each.}
1364   \textcolor{keyword}{call }assert(diag\_field\_id < diag\_cs%next\_free\_diag\_id, &
1365               \textcolor{stringliteral}{'post\_data\_2d: Unregistered diagnostic id'})
1366   diag => diag\_cs%diags(diag\_field\_id)
1367   \textcolor{keywordflow}{do} \textcolor{keywordflow}{while} (\textcolor{keyword}{associated}(diag))
1368     \textcolor{keyword}{call }post\_data\_2d\_low(diag, field, diag\_cs, is\_static, mask)
1369     diag => diag%next
1370 \textcolor{keywordflow}{  enddo}
1371 
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}}
\subsubsection{\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{\tt in}  & {\em diag\+\_\+field\+\_\+id} & The id for an output variable returned by a previous call to register\+\_\+diag\+\_\+field.\\
\hline
\mbox{\tt in}  & {\em field} & 3-\/d array being offered for output or averaging\\
\hline
\mbox{\tt in}  & {\em diag\+\_\+cs} & Structure used to regulate diagnostic output\\
\hline
\mbox{\tt in}  & {\em is\+\_\+static} & If true, this is a static field that is always offered.\\
\hline
\mbox{\tt in}  & {\em mask} & If present, use this real array as the data mask.\\
\hline
\mbox{\tt 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}
1522 
1523   \textcolor{keywordtype}{integer},           \textcolor{keywordtype}{intent(in)} :: diag\_field\_id\textcolor{comment}{ !< The id for an output variable returned by a}
1524 \textcolor{comment}{                                                 !! previous call to register\_diag\_field.}
1525   \textcolor{keywordtype}{real},              \textcolor{keywordtype}{intent(in)} :: field(:,:,:)\textcolor{comment}{  !< 3-d array being offered for output or averaging}
1526   \textcolor{keywordtype}{type}(diag\_ctrl), \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(in)} :: diag\_CS\textcolor{comment}{ !< Structure used to regulate diagnostic output}
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.}
1528   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: mask(:,:,:)\textcolor{comment}{ !< If present, use this real array as the data mask.}
1529   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:,:)}, &
1530          \textcolor{keywordtype}{target}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: alt\_h\textcolor{comment}{  !< An alternate thickness to use for vertically}
1531 \textcolor{comment}{                                                !! remapping this diagnostic [H ~> m or kg m-2].}
1532 
1533   \textcolor{comment}{! Local variables}
1534   \textcolor{keywordtype}{type}(diag\_type), \textcolor{keywordtype}{pointer} :: diag => null()
1535   \textcolor{keywordtype}{integer} :: nz, i, j, k
1536   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{allocatable} :: remapped\_field
1537   \textcolor{keywordtype}{logical} :: staggered\_in\_x, staggered\_in\_y
1538   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{pointer} :: h\_diag => null()
1539 
1540   \textcolor{keywordflow}{if} (id\_clock\_diag\_mediator>0) \textcolor{keyword}{call }cpu\_clock\_begin(id\_clock\_diag\_mediator)
1541 
1542   \textcolor{comment}{! For intensive variables only, we can choose to use a different diagnostic grid}
1543   \textcolor{comment}{! to map to}
1544   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(alt\_h)) \textcolor{keywordflow}{then}
1545     h\_diag => alt\_h
1546   \textcolor{keywordflow}{else}
1547     h\_diag => diag\_cs%h
1548 \textcolor{keywordflow}{  endif}
1549 
1550   \textcolor{comment}{! Iterate over list of diag 'variants', e.g. CMOR aliases, different vertical}
1551   \textcolor{comment}{! grids, and post each.}
1552   \textcolor{keyword}{call }assert(diag\_field\_id < diag\_cs%next\_free\_diag\_id, &
1553               \textcolor{stringliteral}{'post\_data\_3d: Unregistered diagnostic id'})
1554   diag => diag\_cs%diags(diag\_field\_id)
1555   \textcolor{keywordflow}{do} \textcolor{keywordflow}{while} (\textcolor{keyword}{associated}(diag))
1556     \textcolor{keyword}{call }assert(\textcolor{keyword}{associated}(diag%axes), \textcolor{stringliteral}{'post\_data\_3d: axes is not associated'})
1557 
1558     staggered\_in\_x = diag%axes%is\_u\_point .or. diag%axes%is\_q\_point
1559     staggered\_in\_y = diag%axes%is\_v\_point .or. diag%axes%is\_q\_point
1560 
1561     \textcolor{keywordflow}{if} (diag%v\_extensive .and. .not.diag%axes%is\_native) \textcolor{keywordflow}{then}
1562       \textcolor{comment}{! The field is vertically integrated and needs to be re-gridded}
1563       \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(mask)) \textcolor{keywordflow}{then}
1564         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"post\_data\_3d: no mask for regridded field."})
1565 \textcolor{keywordflow}{      endif}
1566 
1567       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_begin(id\_clock\_diag\_remap)
1568       \textcolor{keyword}{allocate}(remapped\_field(\textcolor{keyword}{size}(field,1), \textcolor{keyword}{size}(field,2), diag%axes%nz))
1569       \textcolor{keyword}{call }vertically\_reintegrate\_diag\_field(                                    &
1570         diag\_cs%diag\_remap\_cs(diag%axes%vertical\_coordinate\_number), diag\_cs%G,  &
1571         diag\_cs%h\_begin,                                                         &
1572         diag\_cs%diag\_remap\_cs(diag%axes%vertical\_coordinate\_number)%h\_extensive, &
1573         staggered\_in\_x, staggered\_in\_y, diag%axes%mask3d, field, remapped\_field)
1574       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_end(id\_clock\_diag\_remap)
1575       \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(diag%axes%mask3d)) \textcolor{keywordflow}{then}
1576         \textcolor{comment}{! Since 3d masks do not vary in the vertical, just use as much as is}
1577         \textcolor{comment}{! needed.}
1578         \textcolor{keyword}{call }post\_data\_3d\_low(diag, remapped\_field, diag\_cs, is\_static, &
1579                               mask=diag%axes%mask3d)
1580       \textcolor{keywordflow}{else}
1581         \textcolor{keyword}{call }post\_data\_3d\_low(diag, remapped\_field, diag\_cs, is\_static)
1582 \textcolor{keywordflow}{      endif}
1583       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_begin(id\_clock\_diag\_remap)
1584       \textcolor{keyword}{deallocate}(remapped\_field)
1585       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_end(id\_clock\_diag\_remap)
1586     \textcolor{keywordflow}{elseif} (diag%axes%needs\_remapping) \textcolor{keywordflow}{then}
1587       \textcolor{comment}{! Remap this field to another vertical coordinate.}
1588       \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(mask)) \textcolor{keywordflow}{then}
1589         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"post\_data\_3d: no mask for regridded field."})
1590 \textcolor{keywordflow}{      endif}
1591 
1592       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_begin(id\_clock\_diag\_remap)
1593       \textcolor{keyword}{allocate}(remapped\_field(\textcolor{keyword}{size}(field,1), \textcolor{keyword}{size}(field,2), diag%axes%nz))
1594       \textcolor{keyword}{call }diag\_remap\_do\_remap(diag\_cs%diag\_remap\_cs(diag%axes%vertical\_coordinate\_number), &
1595               diag\_cs%G, diag\_cs%GV, h\_diag, staggered\_in\_x, staggered\_in\_y, &
1596               diag%axes%mask3d, field, remapped\_field)
1597       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_end(id\_clock\_diag\_remap)
1598       \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(diag%axes%mask3d)) \textcolor{keywordflow}{then}
1599         \textcolor{comment}{! Since 3d masks do not vary in the vertical, just use as much as is}
1600         \textcolor{comment}{! needed.}
1601         \textcolor{keyword}{call }post\_data\_3d\_low(diag, remapped\_field, diag\_cs, is\_static, &
1602                               mask=diag%axes%mask3d)
1603       \textcolor{keywordflow}{else}
1604         \textcolor{keyword}{call }post\_data\_3d\_low(diag, remapped\_field, diag\_cs, is\_static)
1605 \textcolor{keywordflow}{      endif}
1606       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_begin(id\_clock\_diag\_remap)
1607       \textcolor{keyword}{deallocate}(remapped\_field)
1608       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_end(id\_clock\_diag\_remap)
1609     \textcolor{keywordflow}{elseif} (diag%axes%needs\_interpolating) \textcolor{keywordflow}{then}
1610       \textcolor{comment}{! Interpolate this field to another vertical coordinate.}
1611       \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(mask)) \textcolor{keywordflow}{then}
1612         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"post\_data\_3d: no mask for regridded field."})
1613 \textcolor{keywordflow}{      endif}
1614 
1615       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_begin(id\_clock\_diag\_remap)
1616       \textcolor{keyword}{allocate}(remapped\_field(\textcolor{keyword}{size}(field,1), \textcolor{keyword}{size}(field,2), diag%axes%nz+1))
1617       \textcolor{keyword}{call }vertically\_interpolate\_diag\_field(diag\_cs%diag\_remap\_cs( &
1618               diag%axes%vertical\_coordinate\_number), &
1619               diag\_cs%G, h\_diag, staggered\_in\_x, staggered\_in\_y, &
1620               diag%axes%mask3d, field, remapped\_field)
1621       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_end(id\_clock\_diag\_remap)
1622       \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(diag%axes%mask3d)) \textcolor{keywordflow}{then}
1623         \textcolor{comment}{! Since 3d masks do not vary in the vertical, just use as much as is}
1624         \textcolor{comment}{! needed.}
1625         \textcolor{keyword}{call }post\_data\_3d\_low(diag, remapped\_field, diag\_cs, is\_static, &
1626                               mask=diag%axes%mask3d)
1627       \textcolor{keywordflow}{else}
1628         \textcolor{keyword}{call }post\_data\_3d\_low(diag, remapped\_field, diag\_cs, is\_static)
1629 \textcolor{keywordflow}{      endif}
1630       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_begin(id\_clock\_diag\_remap)
1631       \textcolor{keyword}{deallocate}(remapped\_field)
1632       \textcolor{keywordflow}{if} (id\_clock\_diag\_remap>0) \textcolor{keyword}{call }cpu\_clock\_end(id\_clock\_diag\_remap)
1633     \textcolor{keywordflow}{else}
1634       \textcolor{keyword}{call }post\_data\_3d\_low(diag, field, diag\_cs, is\_static, mask)
1635 \textcolor{keywordflow}{    endif}
1636     diag => diag%next
1637 \textcolor{keywordflow}{  enddo}
1638   \textcolor{keywordflow}{if} (id\_clock\_diag\_mediator>0) \textcolor{keyword}{call }cpu\_clock\_end(id\_clock\_diag\_mediator)
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}
