\hypertarget{namespacemom__ice__shelf__initialize}{}\doxysection{mom\+\_\+ice\+\_\+shelf\+\_\+initialize Module Reference}
\label{namespacemom__ice__shelf__initialize}\index{mom\_ice\_shelf\_initialize@{mom\_ice\_shelf\_initialize}}


\doxysubsection{Detailed Description}
Initialize ice shelf variables. \doxysubsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \mbox{\hyperlink{namespacemom__ice__shelf__initialize_a1a45ca83d02a01108e202584a95e7527}{initialize\+\_\+ice\+\_\+thickness}} (h\+\_\+shelf, area\+\_\+shelf\+\_\+h, hmask, G, US, PF)
\begin{DoxyCompactList}\small\item\em Initialize ice shelf thickness. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__ice__shelf__initialize_a5020446bea2cb08a690a26e9c1a2941f}{initialize\+\_\+ice\+\_\+thickness\+\_\+from\+\_\+file}} (h\+\_\+shelf, area\+\_\+shelf\+\_\+h, hmask, G, US, PF)
\begin{DoxyCompactList}\small\item\em Initialize ice shelf thickness from file. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__ice__shelf__initialize_a4c4079406cd67e29d511f48311dcc02d}{initialize\+\_\+ice\+\_\+thickness\+\_\+channel}} (h\+\_\+shelf, area\+\_\+shelf\+\_\+h, hmask, G, US, PF)
\begin{DoxyCompactList}\small\item\em Initialize ice shelf thickness for a channel configuration. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacemom__ice__shelf__initialize_a1a45ca83d02a01108e202584a95e7527}\label{namespacemom__ice__shelf__initialize_a1a45ca83d02a01108e202584a95e7527}} 
\index{mom\_ice\_shelf\_initialize@{mom\_ice\_shelf\_initialize}!initialize\_ice\_thickness@{initialize\_ice\_thickness}}
\index{initialize\_ice\_thickness@{initialize\_ice\_thickness}!mom\_ice\_shelf\_initialize@{mom\_ice\_shelf\_initialize}}
\doxysubsubsection{\texorpdfstring{initialize\_ice\_thickness()}{initialize\_ice\_thickness()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+ice\+\_\+shelf\+\_\+initialize\+::initialize\+\_\+ice\+\_\+thickness (\begin{DoxyParamCaption}\item[{real, dimension(szdi\+\_\+(g),szdj\+\_\+(g)), intent(inout)}]{h\+\_\+shelf,  }\item[{real, dimension(szdi\+\_\+(g),szdj\+\_\+(g)), intent(inout)}]{area\+\_\+shelf\+\_\+h,  }\item[{real, dimension(szdi\+\_\+(g),szdj\+\_\+(g)), intent(inout)}]{hmask,  }\item[{type(\mbox{\hyperlink{structmom__grid_1_1ocean__grid__type}{ocean\+\_\+grid\+\_\+type}}), intent(in)}]{G,  }\item[{type(\mbox{\hyperlink{structmom__unit__scaling_1_1unit__scale__type}{unit\+\_\+scale\+\_\+type}}), intent(in)}]{US,  }\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{PF }\end{DoxyParamCaption})}



Initialize ice shelf thickness. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em g} & The ocean\textquotesingle{}s grid structure \\
\hline
\mbox{\texttt{ in,out}}  & {\em h\+\_\+shelf} & The ice shelf thickness \mbox{[}Z $\sim$$>$ m\mbox{]}. \\
\hline
\mbox{\texttt{ in,out}}  & {\em area\+\_\+shelf\+\_\+h} & The area per cell covered by the ice shelf \mbox{[}L2 $\sim$$>$ m2\mbox{]}. \\
\hline
\mbox{\texttt{ in,out}}  & {\em hmask} & A mask indicating which tracer points are \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A structure containing unit conversion factors \\
\hline
\mbox{\texttt{ in}}  & {\em pf} & A structure to parse for run-\/time parameters \\
\hline
\end{DoxyParams}


Definition at line 28 of file M\+O\+M\+\_\+ice\+\_\+shelf\+\_\+initialize.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{29   \textcolor{keywordtype}{type}(ocean\_grid\_type), \textcolor{keywordtype}{intent(in)}    :: G\textcolor{comment}{    !< The ocean's grid structure}}
\DoxyCodeLine{30 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, \&}
\DoxyCodeLine{31                          \textcolor{keywordtype}{intent(inout)} :: h\_shelf\textcolor{comment}{ !< The ice shelf thickness [Z \string~> m].}}
\DoxyCodeLine{32 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, \&}
\DoxyCodeLine{33                          \textcolor{keywordtype}{intent(inout)} :: area\_shelf\_h\textcolor{comment}{ !< The area per cell covered by the ice shelf [L2 \string~> m2].}}
\DoxyCodeLine{34 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, \&}
\DoxyCodeLine{35                          \textcolor{keywordtype}{intent(inout)} :: hmask\textcolor{comment}{ !< A mask indicating which tracer points are}}
\DoxyCodeLine{36 \textcolor{comment}{                                             !! partly or fully covered by an ice-\/shelf}}
\DoxyCodeLine{37   \textcolor{keywordtype}{type}(unit\_scale\_type), \textcolor{keywordtype}{intent(in)}    :: US\textcolor{comment}{ !< A structure containing unit conversion factors}}
\DoxyCodeLine{38   \textcolor{keywordtype}{type}(param\_file\_type), \textcolor{keywordtype}{intent(in)}    :: PF\textcolor{comment}{ !< A structure to parse for run-\/time parameters}}
\DoxyCodeLine{39 }
\DoxyCodeLine{40   \textcolor{keywordtype}{integer} :: i, j}
\DoxyCodeLine{41   \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"{}initialize\_ice\_thickness"{}} \textcolor{comment}{! This subroutine's name.}}
\DoxyCodeLine{42   \textcolor{keywordtype}{character(len=200)} :: config}
\DoxyCodeLine{43 }
\DoxyCodeLine{44   \textcolor{keyword}{call }get\_param(pf, mdl, \textcolor{stringliteral}{"{}ICE\_PROFILE\_CONFIG"{}}, config, \&}
\DoxyCodeLine{45                  \textcolor{stringliteral}{"{}This specifies how the initial ice profile is specified. "{}}//\&}
\DoxyCodeLine{46                  \textcolor{stringliteral}{"{}Valid values are: CHANNEL, FILE, and USER."{}}, \&}
\DoxyCodeLine{47                  fail\_if\_missing=.true.)}
\DoxyCodeLine{48 }
\DoxyCodeLine{49   \textcolor{keywordflow}{select case} ( trim(config) )}
\DoxyCodeLine{50   \textcolor{keywordflow}{case} (\textcolor{stringliteral}{"{}CHANNEL"{}}); \textcolor{keyword}{call }initialize\_ice\_thickness\_channel (h\_shelf, area\_shelf\_h, hmask, g, us, pf)}
\DoxyCodeLine{51   \textcolor{keywordflow}{case} (\textcolor{stringliteral}{"{}FILE"{}});  \textcolor{keyword}{call }initialize\_ice\_thickness\_from\_file (h\_shelf, area\_shelf\_h, hmask, g, us, pf)}
\DoxyCodeLine{52   \textcolor{keywordflow}{case} (\textcolor{stringliteral}{"{}USER"{}});  \textcolor{keyword}{call }user\_init\_ice\_thickness (h\_shelf, area\_shelf\_h, hmask, g, us, pf)}
\DoxyCodeLine{53 \textcolor{keywordflow}{  case default} ;  \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"{}MOM\_initialize: "{}}// \&}
\DoxyCodeLine{54     \textcolor{stringliteral}{"{}Unrecognized ice profile setup "{}}//trim(config))}
\DoxyCodeLine{55 \textcolor{keywordflow}{  end select}}
\DoxyCodeLine{56 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__ice__shelf__initialize_a4c4079406cd67e29d511f48311dcc02d}\label{namespacemom__ice__shelf__initialize_a4c4079406cd67e29d511f48311dcc02d}} 
\index{mom\_ice\_shelf\_initialize@{mom\_ice\_shelf\_initialize}!initialize\_ice\_thickness\_channel@{initialize\_ice\_thickness\_channel}}
\index{initialize\_ice\_thickness\_channel@{initialize\_ice\_thickness\_channel}!mom\_ice\_shelf\_initialize@{mom\_ice\_shelf\_initialize}}
\doxysubsubsection{\texorpdfstring{initialize\_ice\_thickness\_channel()}{initialize\_ice\_thickness\_channel()}}
{\footnotesize\ttfamily subroutine mom\+\_\+ice\+\_\+shelf\+\_\+initialize\+::initialize\+\_\+ice\+\_\+thickness\+\_\+channel (\begin{DoxyParamCaption}\item[{real, dimension(szdi\+\_\+(g),szdj\+\_\+(g)), intent(inout)}]{h\+\_\+shelf,  }\item[{real, dimension(szdi\+\_\+(g),szdj\+\_\+(g)), intent(inout)}]{area\+\_\+shelf\+\_\+h,  }\item[{real, dimension(szdi\+\_\+(g),szdj\+\_\+(g)), intent(inout)}]{hmask,  }\item[{type(\mbox{\hyperlink{structmom__grid_1_1ocean__grid__type}{ocean\+\_\+grid\+\_\+type}}), intent(in)}]{G,  }\item[{type(\mbox{\hyperlink{structmom__unit__scaling_1_1unit__scale__type}{unit\+\_\+scale\+\_\+type}}), intent(in)}]{US,  }\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{PF }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Initialize ice shelf thickness for a channel configuration. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em g} & The ocean\textquotesingle{}s grid structure \\
\hline
\mbox{\texttt{ in,out}}  & {\em h\+\_\+shelf} & The ice shelf thickness \mbox{[}Z $\sim$$>$ m\mbox{]}. \\
\hline
\mbox{\texttt{ in,out}}  & {\em area\+\_\+shelf\+\_\+h} & The area per cell covered by the ice shelf \mbox{[}L2 $\sim$$>$ m2\mbox{]}. \\
\hline
\mbox{\texttt{ in,out}}  & {\em hmask} & A mask indicating which tracer points are \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A structure containing unit conversion factors \\
\hline
\mbox{\texttt{ in}}  & {\em pf} & A structure to parse for run-\/time parameters \\
\hline
\end{DoxyParams}


Definition at line 146 of file M\+O\+M\+\_\+ice\+\_\+shelf\+\_\+initialize.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{147   \textcolor{keywordtype}{type}(ocean\_grid\_type), \textcolor{keywordtype}{intent(in)}    :: G\textcolor{comment}{    !< The ocean's grid structure}}
\DoxyCodeLine{148 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, \&}
\DoxyCodeLine{149                          \textcolor{keywordtype}{intent(inout)} :: h\_shelf\textcolor{comment}{ !< The ice shelf thickness [Z \string~> m].}}
\DoxyCodeLine{150 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, \&}
\DoxyCodeLine{151                          \textcolor{keywordtype}{intent(inout)} :: area\_shelf\_h\textcolor{comment}{ !< The area per cell covered by the ice shelf [L2 \string~> m2].}}
\DoxyCodeLine{152 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, \&}
\DoxyCodeLine{153                          \textcolor{keywordtype}{intent(inout)} :: hmask\textcolor{comment}{ !< A mask indicating which tracer points are}}
\DoxyCodeLine{154 \textcolor{comment}{                                             !! partly or fully covered by an ice-\/shelf}}
\DoxyCodeLine{155   \textcolor{keywordtype}{type}(unit\_scale\_type), \textcolor{keywordtype}{intent(in)}    :: US\textcolor{comment}{ !< A structure containing unit conversion factors}}
\DoxyCodeLine{156   \textcolor{keywordtype}{type}(param\_file\_type), \textcolor{keywordtype}{intent(in)}    :: PF\textcolor{comment}{ !< A structure to parse for run-\/time parameters}}
\DoxyCodeLine{157 }
\DoxyCodeLine{158   \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"{}initialize\_ice\_shelf\_thickness\_channel"{}} \textcolor{comment}{! This subroutine's name.}}
\DoxyCodeLine{159 \textcolor{keywordtype}{  real} :: max\_draft, min\_draft, flat\_shelf\_width, c1, slope\_pos}
\DoxyCodeLine{160 \textcolor{keywordtype}{  real} :: edge\_pos, shelf\_slope\_scale, Rho\_ocean}
\DoxyCodeLine{161   \textcolor{keywordtype}{integer} :: i, j, jsc, jec, jsd, jed, jedg, nyh, isc, iec, isd, ied}
\DoxyCodeLine{162   \textcolor{keywordtype}{integer} :: j\_off}
\DoxyCodeLine{163 }
\DoxyCodeLine{164   jsc = g\%jsc ; jec = g\%jec ; isc = g\%isc ; iec = g\%iec}
\DoxyCodeLine{165   jsd = g\%jsd ; jed = g\%jed ; isd = g\%isd ; ied = g\%ied}
\DoxyCodeLine{166   nyh = g\%domain\%njhalo ; jedg = g\%domain\%njglobal+nyh}
\DoxyCodeLine{167   j\_off = g\%jdg\_offset}
\DoxyCodeLine{168 }
\DoxyCodeLine{169   \textcolor{keyword}{call }mom\_mesg(mdl//\textcolor{stringliteral}{"{}: setting thickness"{}})}
\DoxyCodeLine{170 }
\DoxyCodeLine{171   \textcolor{keyword}{call }get\_param(pf, mdl, \textcolor{stringliteral}{"{}SHELF\_MAX\_DRAFT"{}}, max\_draft, \&}
\DoxyCodeLine{172                  units=\textcolor{stringliteral}{"{}m"{}}, default=1.0, scale=us\%m\_to\_Z)}
\DoxyCodeLine{173   \textcolor{keyword}{call }get\_param(pf, mdl, \textcolor{stringliteral}{"{}SHELF\_MIN\_DRAFT"{}}, min\_draft, \&}
\DoxyCodeLine{174                  units=\textcolor{stringliteral}{"{}m"{}}, default=1.0, scale=us\%m\_to\_Z)}
\DoxyCodeLine{175   \textcolor{keyword}{call }get\_param(pf, mdl, \textcolor{stringliteral}{"{}FLAT\_SHELF\_WIDTH"{}}, flat\_shelf\_width, \&}
\DoxyCodeLine{176                  units=\textcolor{stringliteral}{"{}axis\_units"{}}, default=0.0)}
\DoxyCodeLine{177   \textcolor{keyword}{call }get\_param(pf, mdl, \textcolor{stringliteral}{"{}SHELF\_SLOPE\_SCALE"{}}, shelf\_slope\_scale, \&}
\DoxyCodeLine{178                  units=\textcolor{stringliteral}{"{}axis\_units"{}}, default=0.0)}
\DoxyCodeLine{179   \textcolor{keyword}{call }get\_param(pf, mdl, \textcolor{stringliteral}{"{}SHELF\_EDGE\_POS\_0"{}}, edge\_pos, \&}
\DoxyCodeLine{180                  units=\textcolor{stringliteral}{"{}axis\_units"{}}, default=0.0)}
\DoxyCodeLine{181 \textcolor{comment}{!  call get\_param(param\_file, mdl, "{}RHO\_0"{}, Rho\_ocean, \&}}
\DoxyCodeLine{182 \textcolor{comment}{!                 "{}The mean ocean density used with BOUSSINESQ true to "{}//\&}}
\DoxyCodeLine{183 \textcolor{comment}{!                 "{}calculate accelerations and the mass for conservation "{}//\&}}
\DoxyCodeLine{184 \textcolor{comment}{!                 "{}properties, or with BOUSSINSEQ false to convert some "{}//\&}}
\DoxyCodeLine{185 \textcolor{comment}{!                 "{}parameters from vertical units of m to kg m-\/2."{}, \&}}
\DoxyCodeLine{186 \textcolor{comment}{!                 units="{}kg m-\/3"{}, default=1035.0, scale=US\%Z\_to\_m)}}
\DoxyCodeLine{187 }
\DoxyCodeLine{188   slope\_pos = edge\_pos -\/ flat\_shelf\_width}
\DoxyCodeLine{189   c1 = 0.0 ; \textcolor{keywordflow}{if} (shelf\_slope\_scale > 0.0) c1 = 1.0 / shelf\_slope\_scale}
\DoxyCodeLine{190 }
\DoxyCodeLine{191 }
\DoxyCodeLine{192   \textcolor{keywordflow}{do} j=g\%jsd,g\%jed}
\DoxyCodeLine{193 }
\DoxyCodeLine{194   \textcolor{keywordflow}{if} (((j+j\_off) <= jedg) .AND. ((j+j\_off) >= nyh+1)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{195 }
\DoxyCodeLine{196     \textcolor{keywordflow}{do} i=g\%isc,g\%iec}
\DoxyCodeLine{197 }
\DoxyCodeLine{198       \textcolor{keywordflow}{if} ((j >= jsc) .and. (j <= jec)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{199 }
\DoxyCodeLine{200         \textcolor{keywordflow}{if} (g\%geoLonCu(i-\/1,j) >= edge\_pos) \textcolor{keywordflow}{then}}
\DoxyCodeLine{201         \textcolor{comment}{! Everything past the edge is open ocean.}}
\DoxyCodeLine{202 \textcolor{comment}{!            mass\_shelf(i,j) = 0.0}}
\DoxyCodeLine{203           area\_shelf\_h(i,j) = 0.0}
\DoxyCodeLine{204           hmask(i,j) = 0.0}
\DoxyCodeLine{205           h\_shelf(i,j) = 0.0}
\DoxyCodeLine{206         \textcolor{keywordflow}{else}}
\DoxyCodeLine{207           \textcolor{keywordflow}{if} (g\%geoLonCu(i,j) > edge\_pos) \textcolor{keywordflow}{then}}
\DoxyCodeLine{208             area\_shelf\_h(i,j) = g\%areaT(i,j) * (edge\_pos -\/ g\%geoLonCu(i-\/1,j)) / \&}
\DoxyCodeLine{209                                 (g\%geoLonCu(i,j) -\/ g\%geoLonCu(i-\/1,j))}
\DoxyCodeLine{210             hmask(i,j) = 2.0}
\DoxyCodeLine{211           \textcolor{keywordflow}{else}}
\DoxyCodeLine{212             area\_shelf\_h(i,j) = g\%areaT(i,j)}
\DoxyCodeLine{213             hmask(i,j) = 1.0}
\DoxyCodeLine{214 \textcolor{keywordflow}{          endif}}
\DoxyCodeLine{215 }
\DoxyCodeLine{216           \textcolor{keywordflow}{if} (g\%geoLonT(i,j) > slope\_pos) \textcolor{keywordflow}{then}}
\DoxyCodeLine{217             h\_shelf(i,j) = min\_draft}
\DoxyCodeLine{218 \textcolor{comment}{!              mass\_shelf(i,j) = Rho\_ocean * min\_draft}}
\DoxyCodeLine{219           \textcolor{keywordflow}{else}}
\DoxyCodeLine{220 \textcolor{comment}{!              mass\_shelf(i,j) = Rho\_ocean * (min\_draft + \&}}
\DoxyCodeLine{221 \textcolor{comment}{!                 (CS\%max\_draft -\/ CS\%min\_draft) * \&}}
\DoxyCodeLine{222 \textcolor{comment}{!                 min(1.0, (c1*(slope\_pos -\/ G\%geoLonT(i,j)))**2) )}}
\DoxyCodeLine{223             h\_shelf(i,j) = (min\_draft + \&}
\DoxyCodeLine{224                (max\_draft -\/ min\_draft) * \&}
\DoxyCodeLine{225                min(1.0, (c1*(slope\_pos -\/ g\%geoLonT(i,j)))**2) )}
\DoxyCodeLine{226 \textcolor{keywordflow}{          endif}}
\DoxyCodeLine{227 }
\DoxyCodeLine{228 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{229 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{230 }
\DoxyCodeLine{231       \textcolor{keywordflow}{if} ((i+g\%idg\_offset) == g\%domain\%nihalo+1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{232         hmask(i-\/1,j) = 3.0}
\DoxyCodeLine{233 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{234 }
\DoxyCodeLine{235 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{236 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{237 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__ice__shelf__initialize_a5020446bea2cb08a690a26e9c1a2941f}\label{namespacemom__ice__shelf__initialize_a5020446bea2cb08a690a26e9c1a2941f}} 
\index{mom\_ice\_shelf\_initialize@{mom\_ice\_shelf\_initialize}!initialize\_ice\_thickness\_from\_file@{initialize\_ice\_thickness\_from\_file}}
\index{initialize\_ice\_thickness\_from\_file@{initialize\_ice\_thickness\_from\_file}!mom\_ice\_shelf\_initialize@{mom\_ice\_shelf\_initialize}}
\doxysubsubsection{\texorpdfstring{initialize\_ice\_thickness\_from\_file()}{initialize\_ice\_thickness\_from\_file()}}
{\footnotesize\ttfamily subroutine mom\+\_\+ice\+\_\+shelf\+\_\+initialize\+::initialize\+\_\+ice\+\_\+thickness\+\_\+from\+\_\+file (\begin{DoxyParamCaption}\item[{real, dimension(szdi\+\_\+(g),szdj\+\_\+(g)), intent(inout)}]{h\+\_\+shelf,  }\item[{real, dimension(szdi\+\_\+(g),szdj\+\_\+(g)), intent(inout)}]{area\+\_\+shelf\+\_\+h,  }\item[{real, dimension(szdi\+\_\+(g),szdj\+\_\+(g)), intent(inout)}]{hmask,  }\item[{type(\mbox{\hyperlink{structmom__grid_1_1ocean__grid__type}{ocean\+\_\+grid\+\_\+type}}), intent(in)}]{G,  }\item[{type(\mbox{\hyperlink{structmom__unit__scaling_1_1unit__scale__type}{unit\+\_\+scale\+\_\+type}}), intent(in)}]{US,  }\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{PF }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Initialize ice shelf thickness from file. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em g} & The ocean\textquotesingle{}s grid structure \\
\hline
\mbox{\texttt{ in,out}}  & {\em h\+\_\+shelf} & The ice shelf thickness \mbox{[}Z $\sim$$>$ m\mbox{]}. \\
\hline
\mbox{\texttt{ in,out}}  & {\em area\+\_\+shelf\+\_\+h} & The area per cell covered by the ice shelf \mbox{[}L2 $\sim$$>$ m2\mbox{]}. \\
\hline
\mbox{\texttt{ in,out}}  & {\em hmask} & A mask indicating which tracer points are \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A structure containing unit conversion factors \\
\hline
\mbox{\texttt{ in}}  & {\em pf} & A structure to parse for run-\/time parameters \\
\hline
\end{DoxyParams}


Definition at line 60 of file M\+O\+M\+\_\+ice\+\_\+shelf\+\_\+initialize.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{61   \textcolor{keywordtype}{type}(ocean\_grid\_type), \textcolor{keywordtype}{intent(in)}    :: G\textcolor{comment}{    !< The ocean's grid structure}}
\DoxyCodeLine{62 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, \&}
\DoxyCodeLine{63                          \textcolor{keywordtype}{intent(inout)} :: h\_shelf\textcolor{comment}{ !< The ice shelf thickness [Z \string~> m].}}
\DoxyCodeLine{64 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, \&}
\DoxyCodeLine{65                          \textcolor{keywordtype}{intent(inout)} :: area\_shelf\_h\textcolor{comment}{ !< The area per cell covered by the ice shelf [L2 \string~> m2].}}
\DoxyCodeLine{66 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, \&}
\DoxyCodeLine{67                          \textcolor{keywordtype}{intent(inout)} :: hmask\textcolor{comment}{ !< A mask indicating which tracer points are}}
\DoxyCodeLine{68 \textcolor{comment}{                                             !! partly or fully covered by an ice-\/shelf}}
\DoxyCodeLine{69   \textcolor{keywordtype}{type}(unit\_scale\_type), \textcolor{keywordtype}{intent(in)}    :: US\textcolor{comment}{ !< A structure containing unit conversion factors}}
\DoxyCodeLine{70   \textcolor{keywordtype}{type}(param\_file\_type), \textcolor{keywordtype}{intent(in)}    :: PF\textcolor{comment}{ !< A structure to parse for run-\/time parameters}}
\DoxyCodeLine{71 }
\DoxyCodeLine{72   \textcolor{comment}{!  This subroutine reads ice thickness and area from a file and puts it into}}
\DoxyCodeLine{73   \textcolor{comment}{!  h\_shelf [Z \string~> m] and area\_shelf\_h [L2 \string~> m2] (and dimensionless) and updates hmask}}
\DoxyCodeLine{74   \textcolor{keywordtype}{character(len=200)} :: filename,thickness\_file,inputdir \textcolor{comment}{! Strings for file/path}}
\DoxyCodeLine{75   \textcolor{keywordtype}{character(len=200)} :: thickness\_varname, area\_varname  \textcolor{comment}{! Variable name in file}}
\DoxyCodeLine{76   \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"{}initialize\_ice\_thickness\_from\_file"{}} \textcolor{comment}{! This subroutine's name.}}
\DoxyCodeLine{77   \textcolor{keywordtype}{integer} :: i, j, isc, jsc, iec, jec}
\DoxyCodeLine{78 \textcolor{keywordtype}{  real} :: len\_sidestress, mask, udh}
\DoxyCodeLine{79 }
\DoxyCodeLine{80   \textcolor{keyword}{call }mom\_mesg(\textcolor{stringliteral}{"{}  MOM\_ice\_shelf\_init\_profile.F90, initialize\_thickness\_from\_file: reading thickness"{}})}
\DoxyCodeLine{81 }
\DoxyCodeLine{82   \textcolor{keyword}{call }get\_param(pf, mdl, \textcolor{stringliteral}{"{}INPUTDIR"{}}, inputdir, default=\textcolor{stringliteral}{"{}."{}})}
\DoxyCodeLine{83   inputdir = slasher(inputdir)}
\DoxyCodeLine{84   \textcolor{keyword}{call }get\_param(pf, mdl, \textcolor{stringliteral}{"{}ICE\_THICKNESS\_FILE"{}}, thickness\_file, \&}
\DoxyCodeLine{85                  \textcolor{stringliteral}{"{}The file from which the bathymetry is read."{}}, \&}
\DoxyCodeLine{86                  default=\textcolor{stringliteral}{"{}ice\_shelf\_h.nc"{}})}
\DoxyCodeLine{87   \textcolor{keyword}{call }get\_param(pf, mdl, \textcolor{stringliteral}{"{}LEN\_SIDE\_STRESS"{}}, len\_sidestress, \&}
\DoxyCodeLine{88                  \textcolor{stringliteral}{"{}position past which shelf sides are stress free."{}}, \&}
\DoxyCodeLine{89                  default=0.0, units=\textcolor{stringliteral}{"{}axis\_units"{}})}
\DoxyCodeLine{90 }
\DoxyCodeLine{91   filename = trim(inputdir)//trim(thickness\_file)}
\DoxyCodeLine{92   \textcolor{keyword}{call }log\_param(pf, mdl, \textcolor{stringliteral}{"{}INPUTDIR/THICKNESS\_FILE"{}}, filename)}
\DoxyCodeLine{93   \textcolor{keyword}{call }get\_param(pf, mdl, \textcolor{stringliteral}{"{}ICE\_THICKNESS\_VARNAME"{}}, thickness\_varname, \&}
\DoxyCodeLine{94                  \textcolor{stringliteral}{"{}The name of the thickness variable in ICE\_THICKNESS\_FILE."{}}, \&}
\DoxyCodeLine{95                  default=\textcolor{stringliteral}{"{}h\_shelf"{}})}
\DoxyCodeLine{96   \textcolor{keyword}{call }get\_param(pf, mdl, \textcolor{stringliteral}{"{}ICE\_AREA\_VARNAME"{}}, area\_varname, \&}
\DoxyCodeLine{97                  \textcolor{stringliteral}{"{}The name of the area variable in ICE\_THICKNESS\_FILE."{}}, \&}
\DoxyCodeLine{98                  default=\textcolor{stringliteral}{"{}area\_shelf\_h"{}})}
\DoxyCodeLine{99 }
\DoxyCodeLine{100   \textcolor{keywordflow}{if} (.not.file\_exists(filename, g\%Domain)) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{101        \textcolor{stringliteral}{"{} initialize\_topography\_from\_file: Unable to open "{}}//trim(filename))}
\DoxyCodeLine{102 }
\DoxyCodeLine{103   \textcolor{keyword}{call }mom\_read\_data(filename, trim(thickness\_varname), h\_shelf, g\%Domain, scale=us\%m\_to\_Z)}
\DoxyCodeLine{104   \textcolor{keyword}{call }mom\_read\_data(filename,trim(area\_varname), area\_shelf\_h, g\%Domain, scale=us\%m\_to\_L**2)}
\DoxyCodeLine{105 }
\DoxyCodeLine{106 \textcolor{comment}{!  call get\_param(PF, mdl, "{}ICE\_BOUNDARY\_CONFIG"{}, config, \&}}
\DoxyCodeLine{107 \textcolor{comment}{!                 "{}This specifies how the ice domain boundary is specified"{}, \&}}
\DoxyCodeLine{108 \textcolor{comment}{!                 fail\_if\_missing=.true.)}}
\DoxyCodeLine{109 }
\DoxyCodeLine{110   isc = g\%isc ; jsc = g\%jsc ; iec = g\%iec ; jec = g\%jec}
\DoxyCodeLine{111 }
\DoxyCodeLine{112   \textcolor{keywordflow}{do} j=jsc,jec}
\DoxyCodeLine{113     \textcolor{keywordflow}{do} i=isc,iec}
\DoxyCodeLine{114 }
\DoxyCodeLine{115       \textcolor{comment}{! taper ice shelf in area where there is no sidestress -\/}}
\DoxyCodeLine{116       \textcolor{comment}{! but do not interfere with hmask}}
\DoxyCodeLine{117 }
\DoxyCodeLine{118       \textcolor{keywordflow}{if} ((g\%geoLonCv(i,j) > len\_sidestress).and. \&}
\DoxyCodeLine{119           (len\_sidestress > 0.)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{120         udh = exp(-\/(g\%geoLonCv(i,j)-\/len\_sidestress)/5.0) * h\_shelf(i,j)}
\DoxyCodeLine{121         \textcolor{keywordflow}{if} (udh <= 25.0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{122           h\_shelf(i,j) = 0.0}
\DoxyCodeLine{123           area\_shelf\_h(i,j) = 0.0}
\DoxyCodeLine{124         \textcolor{keywordflow}{else}}
\DoxyCodeLine{125           h\_shelf(i,j) = udh}
\DoxyCodeLine{126 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{127 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{128 }
\DoxyCodeLine{129       \textcolor{comment}{! update thickness mask}}
\DoxyCodeLine{130 }
\DoxyCodeLine{131       \textcolor{keywordflow}{if} (area\_shelf\_h(i,j) >= g\%areaT(i,j)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{132         hmask(i,j) = 1.}
\DoxyCodeLine{133       \textcolor{keywordflow}{elseif} (area\_shelf\_h(i,j) == 0.0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{134         hmask(i,j) = 0.}
\DoxyCodeLine{135       \textcolor{keywordflow}{elseif} ((area\_shelf\_h(i,j) > 0) .and. (area\_shelf\_h(i,j) <= g\%areaT(i,j))) \textcolor{keywordflow}{then}}
\DoxyCodeLine{136         hmask(i,j) = 2.}
\DoxyCodeLine{137       \textcolor{keywordflow}{else}}
\DoxyCodeLine{138         \textcolor{keyword}{call }mom\_error(fatal,mdl// \textcolor{stringliteral}{"{} AREA IN CELL OUT OF RANGE"{}})}
\DoxyCodeLine{139 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{140 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{141 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{142 }

\end{DoxyCode}
