\hypertarget{namespacemom__ice__shelf__initialize}{}\section{mom\+\_\+ice\+\_\+shelf\+\_\+initialize Module Reference}
\label{namespacemom__ice__shelf__initialize}\index{mom\+\_\+ice\+\_\+shelf\+\_\+initialize@{mom\+\_\+ice\+\_\+shelf\+\_\+initialize}}


\subsection{Detailed Description}
Initialize ice shelf variables. \subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \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 \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 \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}


\subsection{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}}
\subsubsection{\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(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{PF }\end{DoxyParamCaption})}



Initialize ice shelf thickness. 


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


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


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


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


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


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


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