\hypertarget{namespacecoord__hycom}{}\section{coord\+\_\+hycom Module Reference}
\label{namespacecoord__hycom}\index{coord\+\_\+hycom@{coord\+\_\+hycom}}


\subsection{Detailed Description}
Regrid columns for the Hy\+C\+OM coordinate. \subsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
type \hyperlink{structcoord__hycom_1_1hycom__cs}{hycom\+\_\+cs}
\begin{DoxyCompactList}\small\item\em Control structure containing required parameters for the Hy\+C\+OM coordinate. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \hyperlink{namespacecoord__hycom_a061ad214832c7f084fffafbc711c2cc4}{init\+\_\+coord\+\_\+hycom} (CS, nk, coordinate\+Resolution, target\+\_\+density, interp\+\_\+\+CS)
\begin{DoxyCompactList}\small\item\em Initialise a hycom\+\_\+\+CS with pointers to parameters. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacecoord__hycom_a30900d0417dacf88c60419208a8818e4}{end\+\_\+coord\+\_\+hycom} (CS)
\begin{DoxyCompactList}\small\item\em This subroutine deallocates memory in the control structure for the \hyperlink{namespacecoord__hycom}{coord\+\_\+hycom} module. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacecoord__hycom_af1b6262578c0ae1b48d576c9e43712f4}{set\+\_\+hycom\+\_\+params} (CS, max\+\_\+interface\+\_\+depths, max\+\_\+layer\+\_\+thickness, interp\+\_\+\+CS)
\begin{DoxyCompactList}\small\item\em This subroutine can be used to set the parameters for the \hyperlink{namespacecoord__hycom}{coord\+\_\+hycom} module. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacecoord__hycom_aec801ef9df8a887e77b7c1ecf459bd5a}{build\+\_\+hycom1\+\_\+column} (CS, eqn\+\_\+of\+\_\+state, nz, depth, h, T, S, p\+\_\+col, z\+\_\+col, z\+\_\+col\+\_\+new, z\+Scale, h\+\_\+neglect, h\+\_\+neglect\+\_\+edge)
\begin{DoxyCompactList}\small\item\em Build a Hy\+C\+OM coordinate column. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacecoord__hycom_aec801ef9df8a887e77b7c1ecf459bd5a}\label{namespacecoord__hycom_aec801ef9df8a887e77b7c1ecf459bd5a}} 
\index{coord\+\_\+hycom@{coord\+\_\+hycom}!build\+\_\+hycom1\+\_\+column@{build\+\_\+hycom1\+\_\+column}}
\index{build\+\_\+hycom1\+\_\+column@{build\+\_\+hycom1\+\_\+column}!coord\+\_\+hycom@{coord\+\_\+hycom}}
\subsubsection{\texorpdfstring{build\+\_\+hycom1\+\_\+column()}{build\_hycom1\_column()}}
{\footnotesize\ttfamily subroutine, public coord\+\_\+hycom\+::build\+\_\+hycom1\+\_\+column (\begin{DoxyParamCaption}\item[{type(\hyperlink{structcoord__hycom_1_1hycom__cs}{hycom\+\_\+cs}), intent(in)}]{CS,  }\item[{type(eos\+\_\+type), pointer}]{eqn\+\_\+of\+\_\+state,  }\item[{integer, intent(in)}]{nz,  }\item[{real, intent(in)}]{depth,  }\item[{real, dimension(nz), intent(in)}]{h,  }\item[{real, dimension(nz), intent(in)}]{T,  }\item[{real, dimension(nz), intent(in)}]{S,  }\item[{real, dimension(nz), intent(in)}]{p\+\_\+col,  }\item[{real, dimension(nz+1), intent(in)}]{z\+\_\+col,  }\item[{real, dimension(cs\%nk+1), intent(inout)}]{z\+\_\+col\+\_\+new,  }\item[{real, intent(in), optional}]{z\+Scale,  }\item[{real, intent(in), optional}]{h\+\_\+neglect,  }\item[{real, intent(in), optional}]{h\+\_\+neglect\+\_\+edge }\end{DoxyParamCaption})}



Build a Hy\+C\+OM coordinate column. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em cs} & Coordinate control structure\\
\hline
 & {\em eqn\+\_\+of\+\_\+state} & Equation of state structure\\
\hline
\mbox{\tt in}  & {\em nz} & Number of levels\\
\hline
\mbox{\tt in}  & {\em depth} & Depth of ocean bottom (positive \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]})\\
\hline
\mbox{\tt in}  & {\em t} & Temperature of column \mbox{[}degC\mbox{]}\\
\hline
\mbox{\tt in}  & {\em s} & Salinity of column \mbox{[}ppt\mbox{]}\\
\hline
\mbox{\tt in}  & {\em h} & Layer thicknesses \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}\\
\hline
\mbox{\tt in}  & {\em p\+\_\+col} & Layer pressure \mbox{[}R L2 T-\/2 $\sim$$>$ Pa\mbox{]}\\
\hline
\mbox{\tt in}  & {\em z\+\_\+col} & Interface positions relative to the surface \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}\\
\hline
\mbox{\tt in,out}  & {\em z\+\_\+col\+\_\+new} & Absolute positions of interfaces \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}\\
\hline
\mbox{\tt in}  & {\em zscale} & Scaling factor from the input coordinate thicknesses in \mbox{[}Z $\sim$$>$ m\mbox{]} to desired units for z\+Interface, perhaps GVZ\+\_\+to\+\_\+H.\\
\hline
\mbox{\tt in}  & {\em h\+\_\+neglect} & A negligibly small width for the purpose of cell reconstruction \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}\\
\hline
\mbox{\tt in}  & {\em h\+\_\+neglect\+\_\+edge} & A negligibly small width for the purpose of edge value calculation \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]} \\
\hline
\end{DoxyParams}


Definition at line 100 of file coord\+\_\+hycom.\+F90.


\begin{DoxyCode}
100   \textcolor{keywordtype}{type}(hycom\_cs),        \textcolor{keywordtype}{intent(in)}    :: cs\textcolor{comment}{    !< Coordinate control structure}
101   \textcolor{keywordtype}{type}(eos\_type),        \textcolor{keywordtype}{pointer}       :: eqn\_of\_state\textcolor{comment}{ !< Equation of state structure}
102   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{intent(in)}    :: nz\textcolor{comment}{    !< Number of levels}
103   \textcolor{keywordtype}{real},                  \textcolor{keywordtype}{intent(in)}    :: depth\textcolor{comment}{ !< Depth of ocean bottom (positive [H ~> m or kg m-2])}
104   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(nz)},   \textcolor{keywordtype}{intent(in)}    :: t\textcolor{comment}{     !< Temperature of column [degC]}
105   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(nz)},   \textcolor{keywordtype}{intent(in)}    :: s\textcolor{comment}{     !< Salinity of column [ppt]}
106   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(nz)},   \textcolor{keywordtype}{intent(in)}    :: h\textcolor{comment}{     !< Layer thicknesses [H ~> m or kg m-2]}
107   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(nz)},   \textcolor{keywordtype}{intent(in)}    :: p\_col\textcolor{comment}{ !< Layer pressure [R L2 T-2 ~> Pa]}
108   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(nz+1)}, \textcolor{keywordtype}{intent(in)}    :: z\_col\textcolor{comment}{ !< Interface positions relative to the surface [H ~> m or
       kg m-2]}
109   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(CS%nk+1)}, \textcolor{keywordtype}{intent(inout)} :: z\_col\_new\textcolor{comment}{ !< Absolute positions of interfaces [H ~> m or kg
       m-2]}
110   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{optional},        \textcolor{keywordtype}{intent(in)}    :: zscale\textcolor{comment}{ !< Scaling factor from the input coordinate thicknesses in
       [Z ~> m]}
111 \textcolor{comment}{                                                !! to desired units for zInterface, perhaps GV%Z\_to\_H.}
112   \textcolor{keywordtype}{real},        \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: h\_neglect\textcolor{comment}{ !< A negligibly small width for the purpose of}
113 \textcolor{comment}{                                                !! cell reconstruction [H ~> m or kg m-2]}
114   \textcolor{keywordtype}{real},        \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: h\_neglect\_edge\textcolor{comment}{ !< A negligibly small width for the purpose of}
115 \textcolor{comment}{                                                !! edge value calculation [H ~> m or kg m-2]}
116 
117   \textcolor{comment}{! Local variables}
118   \textcolor{keywordtype}{integer}   :: k
119   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(nz)} :: rho\_col \textcolor{comment}{! Layer densities in a column [R ~> kg m-3]}
120   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(CS%nk)} :: h\_col\_new \textcolor{comment}{! New layer thicknesses}
121   \textcolor{keywordtype}{real} :: z\_scale    \textcolor{comment}{! A scaling factor from the input thicknesses to the target thicknesses,}
122                      \textcolor{comment}{! perhaps 1 or a factor in [H Z-1 ~> 1 or kg m-3]}
123   \textcolor{keywordtype}{real} :: stretching \textcolor{comment}{! z* stretching, converts z* to z [nondim].}
124   \textcolor{keywordtype}{real} :: nominal\_z \textcolor{comment}{! Nominal depth of interface when using z* [H ~> m or kg m-2]}
125   \textcolor{keywordtype}{logical} :: maximum\_depths\_set \textcolor{comment}{! If true, the maximum depths of interface have been set.}
126   \textcolor{keywordtype}{logical} :: maximum\_h\_set      \textcolor{comment}{! If true, the maximum layer thicknesses have been set.}
127 
128   maximum\_depths\_set = \textcolor{keyword}{allocated}(cs%max\_interface\_depths)
129   maximum\_h\_set = \textcolor{keyword}{allocated}(cs%max\_layer\_thickness)
130 
131   z\_scale = 1.0 ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(zscale)) z\_scale = zscale
132 
133   \textcolor{comment}{! Work bottom recording potential density}
134   \textcolor{keyword}{call }calculate\_density(t, s, p\_col, rho\_col, eqn\_of\_state)
135   \textcolor{comment}{! This ensures the potential density profile is monotonic}
136   \textcolor{comment}{! although not necessarily single valued.}
137   \textcolor{keywordflow}{do} k = nz-1, 1, -1
138     rho\_col(k) = min( rho\_col(k), rho\_col(k+1) )
139 \textcolor{keywordflow}{  enddo}
140 
141   \textcolor{comment}{! Interpolates for the target interface position with the rho\_col profile}
142   \textcolor{comment}{! Based on global density profile, interpolate to generate a new grid}
143   \textcolor{keyword}{call }build\_and\_interpolate\_grid(cs%interp\_CS, rho\_col, nz, h(:), z\_col, &
144            cs%target\_density, cs%nk, h\_col\_new, z\_col\_new, h\_neglect, h\_neglect\_edge)
145 
146   \textcolor{comment}{! Sweep down the interfaces and make sure that the interface is at least}
147   \textcolor{comment}{! as deep as a nominal target z* grid}
148   nominal\_z = 0.
149   stretching = z\_col(nz+1) / depth \textcolor{comment}{! Stretches z* to z}
150   \textcolor{keywordflow}{do} k = 2, cs%nk+1
151     nominal\_z = nominal\_z + (z\_scale * cs%coordinateResolution(k-1)) * stretching
152     z\_col\_new(k) = max( z\_col\_new(k), nominal\_z )
153     z\_col\_new(k) = min( z\_col\_new(k), z\_col(nz+1) )
154 \textcolor{keywordflow}{  enddo}
155 
156   \textcolor{keywordflow}{if} (maximum\_depths\_set .and. maximum\_h\_set) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{do} k=2,cs%nk
157     \textcolor{comment}{! The loop bounds are 2 & nz so the top and bottom interfaces do not move.}
158     \textcolor{comment}{! Recall that z\_col\_new is positive downward.}
159     z\_col\_new(k) = min(z\_col\_new(k), cs%max\_interface\_depths(k), &
160                        z\_col\_new(k-1) + cs%max\_layer\_thickness(k-1))
161 \textcolor{keywordflow}{  enddo} ; \textcolor{keywordflow}{elseif} (maximum\_depths\_set) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{do} k=2,cs%nk
162     z\_col\_new(k) = min(z\_col\_new(k), cs%max\_interface\_depths(k))
163 \textcolor{keywordflow}{  enddo} ; \textcolor{keywordflow}{elseif} (maximum\_h\_set) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{do} k=2,cs%nk
164     z\_col\_new(k) = min(z\_col\_new(k), z\_col\_new(k-1) + cs%max\_layer\_thickness(k-1))
165 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ endif}
\end{DoxyCode}
\mbox{\Hypertarget{namespacecoord__hycom_a30900d0417dacf88c60419208a8818e4}\label{namespacecoord__hycom_a30900d0417dacf88c60419208a8818e4}} 
\index{coord\+\_\+hycom@{coord\+\_\+hycom}!end\+\_\+coord\+\_\+hycom@{end\+\_\+coord\+\_\+hycom}}
\index{end\+\_\+coord\+\_\+hycom@{end\+\_\+coord\+\_\+hycom}!coord\+\_\+hycom@{coord\+\_\+hycom}}
\subsubsection{\texorpdfstring{end\+\_\+coord\+\_\+hycom()}{end\_coord\_hycom()}}
{\footnotesize\ttfamily subroutine, public coord\+\_\+hycom\+::end\+\_\+coord\+\_\+hycom (\begin{DoxyParamCaption}\item[{type(\hyperlink{structcoord__hycom_1_1hycom__cs}{hycom\+\_\+cs}), pointer}]{CS }\end{DoxyParamCaption})}



This subroutine deallocates memory in the control structure for the \hyperlink{namespacecoord__hycom}{coord\+\_\+hycom} module. 


\begin{DoxyParams}{Parameters}
{\em cs} & Coordinate control structure \\
\hline
\end{DoxyParams}


Definition at line 60 of file coord\+\_\+hycom.\+F90.


\begin{DoxyCode}
60   \textcolor{keywordtype}{type}(hycom\_cs), \textcolor{keywordtype}{pointer} :: cs\textcolor{comment}{ !< Coordinate control structure}
61 
62   \textcolor{comment}{! nothing to do}
63   \textcolor{keywordflow}{if} (.not. \textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{return}
64   \textcolor{keyword}{deallocate}(cs%coordinateResolution)
65   \textcolor{keyword}{deallocate}(cs%target\_density)
66   \textcolor{keywordflow}{if} (\textcolor{keyword}{allocated}(cs%max\_interface\_depths)) \textcolor{keyword}{deallocate}(cs%max\_interface\_depths)
67   \textcolor{keywordflow}{if} (\textcolor{keyword}{allocated}(cs%max\_layer\_thickness)) \textcolor{keyword}{deallocate}(cs%max\_layer\_thickness)
68   \textcolor{keyword}{deallocate}(cs)
\end{DoxyCode}
\mbox{\Hypertarget{namespacecoord__hycom_a061ad214832c7f084fffafbc711c2cc4}\label{namespacecoord__hycom_a061ad214832c7f084fffafbc711c2cc4}} 
\index{coord\+\_\+hycom@{coord\+\_\+hycom}!init\+\_\+coord\+\_\+hycom@{init\+\_\+coord\+\_\+hycom}}
\index{init\+\_\+coord\+\_\+hycom@{init\+\_\+coord\+\_\+hycom}!coord\+\_\+hycom@{coord\+\_\+hycom}}
\subsubsection{\texorpdfstring{init\+\_\+coord\+\_\+hycom()}{init\_coord\_hycom()}}
{\footnotesize\ttfamily subroutine, public coord\+\_\+hycom\+::init\+\_\+coord\+\_\+hycom (\begin{DoxyParamCaption}\item[{type(\hyperlink{structcoord__hycom_1_1hycom__cs}{hycom\+\_\+cs}), pointer}]{CS,  }\item[{integer, intent(in)}]{nk,  }\item[{real, dimension(nk), intent(in)}]{coordinate\+Resolution,  }\item[{real, dimension(nk+1), intent(in)}]{target\+\_\+density,  }\item[{type(interp\+\_\+cs\+\_\+type), intent(in)}]{interp\+\_\+\+CS }\end{DoxyParamCaption})}



Initialise a hycom\+\_\+\+CS with pointers to parameters. 


\begin{DoxyParams}[1]{Parameters}
 & {\em cs} & Unassociated pointer to hold the control structure\\
\hline
\mbox{\tt in}  & {\em nk} & Number of layers in generated grid\\
\hline
\mbox{\tt in}  & {\em coordinateresolution} & Nominal near-\/surface resolution \mbox{[}Z $\sim$$>$ m\mbox{]}\\
\hline
\mbox{\tt in}  & {\em target\+\_\+density} & Interface target densities \mbox{[}R $\sim$$>$ kg m-\/3\mbox{]}\\
\hline
\mbox{\tt in}  & {\em interp\+\_\+cs} & Controls for interpolation \\
\hline
\end{DoxyParams}


Definition at line 40 of file coord\+\_\+hycom.\+F90.


\begin{DoxyCode}
40   \textcolor{keywordtype}{type}(hycom\_cs),       \textcolor{keywordtype}{pointer}    :: cs\textcolor{comment}{ !< Unassociated pointer to hold the control structure}
41   \textcolor{keywordtype}{integer},              \textcolor{keywordtype}{intent(in)} :: nk\textcolor{comment}{ !< Number of layers in generated grid}
42   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(nk)},  \textcolor{keywordtype}{intent(in)} :: coordinateresolution\textcolor{comment}{ !< Nominal near-surface resolution [Z ~> m]}
43   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(nk+1)},\textcolor{keywordtype}{intent(in)} :: target\_density\textcolor{comment}{ !< Interface target densities [R ~> kg m-3]}
44   \textcolor{keywordtype}{type}(interp\_cs\_type), \textcolor{keywordtype}{intent(in)} :: interp\_cs\textcolor{comment}{ !< Controls for interpolation}
45 
46   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"init\_coord\_hycom: CS already associated!"})
47   \textcolor{keyword}{allocate}(cs)
48   \textcolor{keyword}{allocate}(cs%coordinateResolution(nk))
49   \textcolor{keyword}{allocate}(cs%target\_density(nk+1))
50 
51   cs%nk                      = nk
52   cs%coordinateResolution(:) = coordinateresolution(:)
53   cs%target\_density(:)       = target\_density(:)
54   cs%interp\_CS               = interp\_cs
55 
\end{DoxyCode}
\mbox{\Hypertarget{namespacecoord__hycom_af1b6262578c0ae1b48d576c9e43712f4}\label{namespacecoord__hycom_af1b6262578c0ae1b48d576c9e43712f4}} 
\index{coord\+\_\+hycom@{coord\+\_\+hycom}!set\+\_\+hycom\+\_\+params@{set\+\_\+hycom\+\_\+params}}
\index{set\+\_\+hycom\+\_\+params@{set\+\_\+hycom\+\_\+params}!coord\+\_\+hycom@{coord\+\_\+hycom}}
\subsubsection{\texorpdfstring{set\+\_\+hycom\+\_\+params()}{set\_hycom\_params()}}
{\footnotesize\ttfamily subroutine, public coord\+\_\+hycom\+::set\+\_\+hycom\+\_\+params (\begin{DoxyParamCaption}\item[{type(\hyperlink{structcoord__hycom_1_1hycom__cs}{hycom\+\_\+cs}), pointer}]{CS,  }\item[{real, dimension(\+:), intent(in), optional}]{max\+\_\+interface\+\_\+depths,  }\item[{real, dimension(\+:), intent(in), optional}]{max\+\_\+layer\+\_\+thickness,  }\item[{type(interp\+\_\+cs\+\_\+type), intent(in), optional}]{interp\+\_\+\+CS }\end{DoxyParamCaption})}



This subroutine can be used to set the parameters for the \hyperlink{namespacecoord__hycom}{coord\+\_\+hycom} module. 


\begin{DoxyParams}[1]{Parameters}
 & {\em cs} & Coordinate control structure\\
\hline
\mbox{\tt in}  & {\em max\+\_\+interface\+\_\+depths} & Maximum depths of interfaces \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}\\
\hline
\mbox{\tt in}  & {\em max\+\_\+layer\+\_\+thickness} & Maximum thicknesses of layers \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}\\
\hline
\mbox{\tt in}  & {\em interp\+\_\+cs} & Controls for interpolation \\
\hline
\end{DoxyParams}


Definition at line 73 of file coord\+\_\+hycom.\+F90.


\begin{DoxyCode}
73   \textcolor{keywordtype}{type}(hycom\_cs),                 \textcolor{keywordtype}{pointer}    :: cs\textcolor{comment}{ !< Coordinate control structure}
74   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)},   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: max\_interface\_depths\textcolor{comment}{ !< Maximum depths of interfaces [H ~>
       m or kg m-2]}
75   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)},   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: max\_layer\_thickness\textcolor{comment}{  !< Maximum thicknesses of layers [H ~>
       m or kg m-2]}
76   \textcolor{keywordtype}{type}(interp\_cs\_type), \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: interp\_cs\textcolor{comment}{ !< Controls for interpolation}
77 
78   \textcolor{keywordflow}{if} (.not. \textcolor{keyword}{associated}(cs)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"set\_hycom\_params: CS not associated"})
79 
80   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(max\_interface\_depths)) \textcolor{keywordflow}{then}
81     \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(max\_interface\_depths) /= cs%nk+1) &
82       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"set\_hycom\_params: max\_interface\_depths inconsistent size"})
83     \textcolor{keyword}{allocate}(cs%max\_interface\_depths(cs%nk+1))
84     cs%max\_interface\_depths(:) = max\_interface\_depths(:)
85 \textcolor{keywordflow}{  endif}
86 
87   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(max\_layer\_thickness)) \textcolor{keywordflow}{then}
88     \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(max\_layer\_thickness) /= cs%nk) &
89       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"set\_hycom\_params: max\_layer\_thickness inconsistent size"})
90     \textcolor{keyword}{allocate}(cs%max\_layer\_thickness(cs%nk))
91     cs%max\_layer\_thickness(:) = max\_layer\_thickness(:)
92 \textcolor{keywordflow}{  endif}
93 
94   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(interp\_cs)) cs%interp\_CS = interp\_cs
\end{DoxyCode}
