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


\doxysubsection{Detailed Description}
Regrid columns for the Hy\+C\+OM coordinate. \doxysubsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
type \mbox{\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}
\doxysubsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \mbox{\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 \mbox{\hyperlink{namespacecoord__hycom_a30900d0417dacf88c60419208a8818e4}{end\+\_\+coord\+\_\+hycom}} (CS)
\begin{DoxyCompactList}\small\item\em This subroutine deallocates memory in the control structure for the \mbox{\hyperlink{namespacecoord__hycom}{coord\+\_\+hycom}} module. \end{DoxyCompactList}\item 
subroutine, public \mbox{\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 \mbox{\hyperlink{namespacecoord__hycom}{coord\+\_\+hycom}} module. \end{DoxyCompactList}\item 
subroutine, public \mbox{\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}


\doxysubsection{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}}
\doxysubsubsection{\texorpdfstring{build\_hycom1\_column()}{build\_hycom1\_column()}}
{\footnotesize\ttfamily subroutine, public coord\+\_\+hycom\+::build\+\_\+hycom1\+\_\+column (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structcoord__hycom_1_1hycom__cs}{hycom\+\_\+cs}}), intent(in)}]{CS,  }\item[{type(\mbox{\hyperlink{structmom__eos_1_1eos__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{\texttt{ in}}  & {\em cs} & Coordinate control structure \\
\hline
 & {\em eqn\+\_\+of\+\_\+state} & Equation of state structure \\
\hline
\mbox{\texttt{ in}}  & {\em nz} & Number of levels \\
\hline
\mbox{\texttt{ in}}  & {\em depth} & Depth of ocean bottom (positive \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}) \\
\hline
\mbox{\texttt{ in}}  & {\em t} & Temperature of column \mbox{[}degC\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em s} & Salinity of column \mbox{[}ppt\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em h} & Layer thicknesses \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em p\+\_\+col} & Layer pressure \mbox{[}R L2 T-\/2 $\sim$$>$ Pa\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em z\+\_\+col} & Interface positions relative to the surface \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]} \\
\hline
\mbox{\texttt{ in,out}}  & {\em z\+\_\+col\+\_\+new} & Absolute positions of interfaces \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]} \\
\hline
\mbox{\texttt{ 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{\texttt{ 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{\texttt{ 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 98 of file coord\+\_\+hycom.\+F90.


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



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


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


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


\begin{DoxyCode}{0}
\DoxyCodeLine{60   \textcolor{keywordtype}{type}(hycom\_CS), \textcolor{keywordtype}{pointer} :: CS\textcolor{comment}{ !< Coordinate control structure}}
\DoxyCodeLine{61 }
\DoxyCodeLine{62   \textcolor{comment}{! nothing to do}}
\DoxyCodeLine{63   \textcolor{keywordflow}{if} (.not. \textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{return}}
\DoxyCodeLine{64   \textcolor{keyword}{deallocate}(cs\%coordinateResolution)}
\DoxyCodeLine{65   \textcolor{keyword}{deallocate}(cs\%target\_density)}
\DoxyCodeLine{66   \textcolor{keywordflow}{if} (\textcolor{keyword}{allocated}(cs\%max\_interface\_depths)) \textcolor{keyword}{deallocate}(cs\%max\_interface\_depths)}
\DoxyCodeLine{67   \textcolor{keywordflow}{if} (\textcolor{keyword}{allocated}(cs\%max\_layer\_thickness)) \textcolor{keyword}{deallocate}(cs\%max\_layer\_thickness)}
\DoxyCodeLine{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}}
\doxysubsubsection{\texorpdfstring{init\_coord\_hycom()}{init\_coord\_hycom()}}
{\footnotesize\ttfamily subroutine, public coord\+\_\+hycom\+::init\+\_\+coord\+\_\+hycom (\begin{DoxyParamCaption}\item[{type(\mbox{\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(\mbox{\hyperlink{structregrid__interp_1_1interp__cs__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{\texttt{ in}}  & {\em nk} & Number of layers in generated grid \\
\hline
\mbox{\texttt{ in}}  & {\em coordinateresolution} & Nominal near-\/surface resolution \mbox{[}Z $\sim$$>$ m\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em target\+\_\+density} & Interface target densities \mbox{[}R $\sim$$>$ kg m-\/3\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em interp\+\_\+cs} & Controls for interpolation \\
\hline
\end{DoxyParams}


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


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



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


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


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


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

\end{DoxyCode}
