\hypertarget{namespaceuser__shelf__init}{}\section{user\+\_\+shelf\+\_\+init Module Reference}
\label{namespaceuser__shelf__init}\index{user\+\_\+shelf\+\_\+init@{user\+\_\+shelf\+\_\+init}}


\subsection{Detailed Description}
This module specifies the initial values and evolving properties of the M\+O\+M6 ice shelf, using user-\/provided code. \subsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
type \mbox{\hyperlink{structuser__shelf__init_1_1user__ice__shelf__cs}{user\+\_\+ice\+\_\+shelf\+\_\+cs}}
\begin{DoxyCompactList}\small\item\em The control structure for the user\+\_\+ice\+\_\+shelf module. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \mbox{\hyperlink{namespaceuser__shelf__init_abfa7467860df5279c0c9f95d79cb51cf}{user\+\_\+initialize\+\_\+shelf\+\_\+mass}} (mass\+\_\+shelf, area\+\_\+shelf\+\_\+h, h\+\_\+shelf, hmask, G, US, CS, param\+\_\+file, new\+\_\+sim)
\begin{DoxyCompactList}\small\item\em This subroutine sets up the initial mass and area covered by the ice shelf, based on user-\/provided code. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespaceuser__shelf__init_a2e30414d0486dbf423978be7eea677bd}{user\+\_\+init\+\_\+ice\+\_\+thickness}} (h\+\_\+shelf, area\+\_\+shelf\+\_\+h, hmask, G, US, param\+\_\+file)
\begin{DoxyCompactList}\small\item\em This subroutine updates the ice shelf thickness, as specified by user-\/provided code. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespaceuser__shelf__init_abd99438d24c4a57aa3fbab3b067a7c81}{user\+\_\+update\+\_\+shelf\+\_\+mass}} (mass\+\_\+shelf, area\+\_\+shelf\+\_\+h, h\+\_\+shelf, hmask, G, CS, Time, new\+\_\+sim)
\begin{DoxyCompactList}\small\item\em This subroutine updates the ice shelf mass, as specified by user-\/provided code. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespaceuser__shelf__init_a04dc4958214e8b07da385f8be785d706}{write\+\_\+user\+\_\+log}} (param\+\_\+file)
\begin{DoxyCompactList}\small\item\em This subroutine writes out the user ice shelf code version number to the model log. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespaceuser__shelf__init_a2e30414d0486dbf423978be7eea677bd}\label{namespaceuser__shelf__init_a2e30414d0486dbf423978be7eea677bd}} 
\index{user\+\_\+shelf\+\_\+init@{user\+\_\+shelf\+\_\+init}!user\+\_\+init\+\_\+ice\+\_\+thickness@{user\+\_\+init\+\_\+ice\+\_\+thickness}}
\index{user\+\_\+init\+\_\+ice\+\_\+thickness@{user\+\_\+init\+\_\+ice\+\_\+thickness}!user\+\_\+shelf\+\_\+init@{user\+\_\+shelf\+\_\+init}}
\subsubsection{\texorpdfstring{user\+\_\+init\+\_\+ice\+\_\+thickness()}{user\_init\_ice\_thickness()}}
{\footnotesize\ttfamily subroutine, public user\+\_\+shelf\+\_\+init\+::user\+\_\+init\+\_\+ice\+\_\+thickness (\begin{DoxyParamCaption}\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed), intent(out)}]{h\+\_\+shelf,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed), intent(out)}]{area\+\_\+shelf\+\_\+h,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed), intent(out)}]{hmask,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file }\end{DoxyParamCaption})}



This subroutine updates the ice shelf thickness, as specified by user-\/provided code. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt out}  & {\em h\+\_\+shelf} & The ice shelf thickness \mbox{[}m\mbox{]}.\\
\hline
\mbox{\tt out}  & {\em area\+\_\+shelf\+\_\+h} & The area per cell covered by the ice shelf \mbox{[}L2 $\sim$$>$ m2\mbox{]}.\\
\hline
\mbox{\tt 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 param\+\_\+file} & A structure to parse for run-\/time parameters \\
\hline
\end{DoxyParams}


Definition at line 103 of file user\+\_\+shelf\+\_\+init.\+F90.


\begin{DoxyCode}
103   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(in)}  :: G\textcolor{comment}{    !< The ocean's grid structure}
104   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, &
105                            \textcolor{keywordtype}{intent(out)} :: h\_shelf\textcolor{comment}{ !< The ice shelf thickness [m].}
106   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, &
107                            \textcolor{keywordtype}{intent(out)} :: area\_shelf\_h\textcolor{comment}{ !< The area per cell covered by the ice shelf [L2 ~>
       m2].}
108   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, &
109                            \textcolor{keywordtype}{intent(out)} :: hmask\textcolor{comment}{ !< A mask indicating which tracer points are}
110 \textcolor{comment}{                                                !! partly or fully covered by an ice-shelf}
111   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)}  :: US\textcolor{comment}{    !< A structure containing unit conversion factors}
112   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(in)}  :: param\_file\textcolor{comment}{ !< A structure to parse for run-time parameters}
113 
114   \textcolor{comment}{! This subroutine initializes the ice shelf thickness.  Currently it does so}
115   \textcolor{comment}{! calling USER\_initialize\_shelf\_mass, but this can be revised as needed.}
116   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G))} :: mass\_shelf
117   \textcolor{keywordtype}{type}(user\_ice\_shelf\_CS), \textcolor{keywordtype}{pointer} :: CS => null()
118 
119   \textcolor{keyword}{call }user\_initialize\_shelf\_mass(mass\_shelf, area\_shelf\_h, h\_shelf, hmask, g, us, cs, param\_file, .true.)
120 
\end{DoxyCode}
\mbox{\Hypertarget{namespaceuser__shelf__init_abfa7467860df5279c0c9f95d79cb51cf}\label{namespaceuser__shelf__init_abfa7467860df5279c0c9f95d79cb51cf}} 
\index{user\+\_\+shelf\+\_\+init@{user\+\_\+shelf\+\_\+init}!user\+\_\+initialize\+\_\+shelf\+\_\+mass@{user\+\_\+initialize\+\_\+shelf\+\_\+mass}}
\index{user\+\_\+initialize\+\_\+shelf\+\_\+mass@{user\+\_\+initialize\+\_\+shelf\+\_\+mass}!user\+\_\+shelf\+\_\+init@{user\+\_\+shelf\+\_\+init}}
\subsubsection{\texorpdfstring{user\+\_\+initialize\+\_\+shelf\+\_\+mass()}{user\_initialize\_shelf\_mass()}}
{\footnotesize\ttfamily subroutine, public user\+\_\+shelf\+\_\+init\+::user\+\_\+initialize\+\_\+shelf\+\_\+mass (\begin{DoxyParamCaption}\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed), intent(out)}]{mass\+\_\+shelf,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed), intent(out)}]{area\+\_\+shelf\+\_\+h,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed), intent(out)}]{h\+\_\+shelf,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed), intent(out)}]{hmask,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{type(\mbox{\hyperlink{structuser__shelf__init_1_1user__ice__shelf__cs}{user\+\_\+ice\+\_\+shelf\+\_\+cs}}), pointer}]{CS,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{logical, intent(in)}]{new\+\_\+sim }\end{DoxyParamCaption})}



This subroutine sets up the initial mass and area covered by the ice shelf, based on user-\/provided code. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt out}  & {\em mass\+\_\+shelf} & The ice shelf mass per unit area averaged\\
\hline
\mbox{\tt out}  & {\em h\+\_\+shelf} & The ice shelf thickness \mbox{[}Z $\sim$$>$ m\mbox{]}.\\
\hline
\mbox{\tt out}  & {\em area\+\_\+shelf\+\_\+h} & The area per cell covered by the ice shelf \mbox{[}L2 $\sim$$>$ m2\mbox{]}.\\
\hline
\mbox{\tt out}  & {\em hmask} & A mask indicating which tracer points are\\
\hline
\mbox{\tt in}  & {\em us} & A structure containing unit conversion factors\\
\hline
 & {\em cs} & A pointer to the user ice shelf control structure\\
\hline
\mbox{\tt in}  & {\em param\+\_\+file} & A structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em new\+\_\+sim} & If true, this is a new run; otherwise it is being started from a restart file. \\
\hline
\end{DoxyParams}


Definition at line 44 of file user\+\_\+shelf\+\_\+init.\+F90.


\begin{DoxyCode}
44 
45   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(in)}  :: G\textcolor{comment}{    !< The ocean's grid structure}
46   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, &
47                            \textcolor{keywordtype}{intent(out)} :: mass\_shelf\textcolor{comment}{ !< The ice shelf mass per unit area averaged}
48 \textcolor{comment}{                                                  !! over the full ocean cell [R Z ~> kg m-2].}
49   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, &
50                            \textcolor{keywordtype}{intent(out)} :: h\_shelf\textcolor{comment}{ !< The ice shelf thickness [Z ~> m].}
51   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, &
52                            \textcolor{keywordtype}{intent(out)} :: area\_shelf\_h\textcolor{comment}{ !< The area per cell covered by the ice shelf [L2 ~>
       m2].}
53   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, &
54                            \textcolor{keywordtype}{intent(out)} :: hmask\textcolor{comment}{ !< A mask indicating which tracer points are}
55 \textcolor{comment}{                                                !! partly or fully covered by an ice-shelf}
56   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)}  :: US\textcolor{comment}{    !< A structure containing unit conversion factors}
57   \textcolor{keywordtype}{type}(user\_ice\_shelf\_CS), \textcolor{keywordtype}{pointer}     :: CS\textcolor{comment}{    !< A pointer to the user ice shelf control structure}
58   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(in)}  :: param\_file\textcolor{comment}{ !< A structure to parse for run-time parameters}
59   \textcolor{keywordtype}{logical},                 \textcolor{keywordtype}{intent(in)}  :: new\_sim\textcolor{comment}{  !< If true, this is a new run; otherwise it is}
60 \textcolor{comment}{                                                   !! being started from a restart file.}
61 
62 \textcolor{comment}{! This subroutine sets up the initial mass and area covered by the ice shelf.}
63   \textcolor{keywordtype}{real} :: max\_draft  \textcolor{comment}{! The maximum ocean draft of the ice shelf [Z ~> m].}
64   \textcolor{keywordtype}{real} :: min\_draft  \textcolor{comment}{! The minimum ocean draft of the ice shelf [Z ~> m].}
65   \textcolor{keywordtype}{real} :: flat\_shelf\_width \textcolor{comment}{! The range over which the shelf is min\_draft thick.}
66   \textcolor{keywordtype}{real} :: c1 \textcolor{comment}{! The maximum depths in m.}
67   \textcolor{keywordtype}{character(len=40)} :: mdl = \textcolor{stringliteral}{"USER\_initialize\_shelf\_mass"} \textcolor{comment}{! This subroutine's name.}
68   \textcolor{keywordtype}{integer} :: i, j
69 
70   \textcolor{comment}{! call MOM\_error(FATAL, "USER\_shelf\_init.F90, USER\_set\_shelf\_mass: " // &}
71   \textcolor{comment}{!  "Unmodified user routine called - you must edit the routine to use it")}
72 
73   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(cs)) \textcolor{keyword}{allocate}(cs)
74 
75   \textcolor{comment}{! Read all relevant parameters and write them to the model log.}
76   \textcolor{keywordflow}{if} (cs%first\_call) \textcolor{keyword}{call }write\_user\_log(param\_file)
77   cs%first\_call = .false.
78   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"RHO\_0"}, cs%Rho\_ocean, &
79                  \textcolor{stringliteral}{"The mean ocean density used with BOUSSINESQ true to "}//&
80                  \textcolor{stringliteral}{"calculate accelerations and the mass for conservation "}//&
81                  \textcolor{stringliteral}{"properties, or with BOUSSINSEQ false to convert some "}//&
82                  \textcolor{stringliteral}{"parameters from vertical units of m to kg m-2."}, &
83                  units=\textcolor{stringliteral}{"kg m-3"}, default=1035.0, scale=us%kg\_m3\_to\_R)
84   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"SHELF\_MAX\_DRAFT"}, cs%max\_draft, &
85                  units=\textcolor{stringliteral}{"m"}, default=1.0, scale=us%m\_to\_Z)
86   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"SHELF\_MIN\_DRAFT"}, cs%min\_draft, &
87                  units=\textcolor{stringliteral}{"m"}, default=1.0, scale=us%m\_to\_Z)
88   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"FLAT\_SHELF\_WIDTH"}, cs%flat\_shelf\_width, &
89                  units=\textcolor{stringliteral}{"axis\_units"}, default=0.0)
90   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"SHELF\_SLOPE\_SCALE"}, cs%shelf\_slope\_scale, &
91                  units=\textcolor{stringliteral}{"axis\_units"}, default=0.0)
92   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"SHELF\_EDGE\_POS\_0"}, cs%pos\_shelf\_edge\_0, &
93                  units=\textcolor{stringliteral}{"axis\_units"}, default=0.0)
94   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"SHELF\_SPEED"}, cs%shelf\_speed, &
95                  units=\textcolor{stringliteral}{"axis\_units day-1"}, default=0.0)
96 
97   \textcolor{keyword}{call }user\_update\_shelf\_mass(mass\_shelf, area\_shelf\_h, h\_shelf, hmask, g, cs, set\_time(0,0), new\_sim)
98 
\end{DoxyCode}
\mbox{\Hypertarget{namespaceuser__shelf__init_abd99438d24c4a57aa3fbab3b067a7c81}\label{namespaceuser__shelf__init_abd99438d24c4a57aa3fbab3b067a7c81}} 
\index{user\+\_\+shelf\+\_\+init@{user\+\_\+shelf\+\_\+init}!user\+\_\+update\+\_\+shelf\+\_\+mass@{user\+\_\+update\+\_\+shelf\+\_\+mass}}
\index{user\+\_\+update\+\_\+shelf\+\_\+mass@{user\+\_\+update\+\_\+shelf\+\_\+mass}!user\+\_\+shelf\+\_\+init@{user\+\_\+shelf\+\_\+init}}
\subsubsection{\texorpdfstring{user\+\_\+update\+\_\+shelf\+\_\+mass()}{user\_update\_shelf\_mass()}}
{\footnotesize\ttfamily subroutine, public user\+\_\+shelf\+\_\+init\+::user\+\_\+update\+\_\+shelf\+\_\+mass (\begin{DoxyParamCaption}\item[{real, dimension(szdi\+\_\+(g),szdj\+\_\+(g)), intent(inout)}]{mass\+\_\+shelf,  }\item[{real, dimension(szdi\+\_\+(g),szdj\+\_\+(g)), intent(inout)}]{area\+\_\+shelf\+\_\+h,  }\item[{real, dimension(szdi\+\_\+(g),szdj\+\_\+(g)), intent(inout)}]{h\+\_\+shelf,  }\item[{real, dimension(szdi\+\_\+(g),szdj\+\_\+(g)), intent(inout)}]{hmask,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(\mbox{\hyperlink{structuser__shelf__init_1_1user__ice__shelf__cs}{user\+\_\+ice\+\_\+shelf\+\_\+cs}}), pointer}]{CS,  }\item[{type(time\+\_\+type), intent(in)}]{Time,  }\item[{logical, intent(in)}]{new\+\_\+sim }\end{DoxyParamCaption})}



This subroutine updates the ice shelf mass, as specified by user-\/provided code. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt in,out}  & {\em mass\+\_\+shelf} & The ice shelf mass per unit area averaged\\
\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 h\+\_\+shelf} & The ice shelf thickness \mbox{[}Z $\sim$$>$ m\mbox{]}.\\
\hline
\mbox{\tt in,out}  & {\em hmask} & A mask indicating which tracer points are\\
\hline
 & {\em cs} & A pointer to the user ice shelf control structure\\
\hline
\mbox{\tt in}  & {\em time} & The current model time\\
\hline
\mbox{\tt in}  & {\em new\+\_\+sim} & If true, this the start of a new run. \\
\hline
\end{DoxyParams}


Definition at line 125 of file user\+\_\+shelf\+\_\+init.\+F90.


\begin{DoxyCode}
125   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(in)}    :: G\textcolor{comment}{    !< The ocean's grid structure}
126   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, &
127                            \textcolor{keywordtype}{intent(inout)} :: mass\_shelf\textcolor{comment}{ !< The ice shelf mass per unit area averaged}
128 \textcolor{comment}{                                                  !! over the full ocean cell [R Z ~> kg m-2].}
129   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, &
130                            \textcolor{keywordtype}{intent(inout)} :: area\_shelf\_h\textcolor{comment}{ !< The area per cell covered by the ice shelf [L2
       ~> m2].}
131   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, &
132                            \textcolor{keywordtype}{intent(inout)} :: h\_shelf\textcolor{comment}{ !< The ice shelf thickness [Z ~> m].}
133   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, &
134                            \textcolor{keywordtype}{intent(inout)} :: hmask\textcolor{comment}{ !< A mask indicating which tracer points are}
135 \textcolor{comment}{                                                !! partly or fully covered by an ice-shelf}
136   \textcolor{keywordtype}{type}(user\_ice\_shelf\_CS), \textcolor{keywordtype}{pointer}       :: CS\textcolor{comment}{   !< A pointer to the user ice shelf control structure}
137   \textcolor{keywordtype}{type}(time\_type),         \textcolor{keywordtype}{intent(in)}    :: Time\textcolor{comment}{ !< The current model time}
138   \textcolor{keywordtype}{logical},                 \textcolor{keywordtype}{intent(in)}    :: new\_sim\textcolor{comment}{ !< If true, this the start of a new run.}
139 
140 
141   \textcolor{keywordtype}{real} :: c1, edge\_pos, slope\_pos
142   \textcolor{keywordtype}{integer} :: i, j
143 
144   edge\_pos = cs%pos\_shelf\_edge\_0 + cs%shelf\_speed*(time\_type\_to\_real(time) / 86400.0)
145 
146   slope\_pos = edge\_pos - cs%flat\_shelf\_width
147   c1 = 0.0 ; \textcolor{keywordflow}{if} (cs%shelf\_slope\_scale > 0.0) c1 = 1.0 / cs%shelf\_slope\_scale
148 
149 
150   \textcolor{keywordflow}{do} j=g%jsd,g%jed
151 
152    \textcolor{keywordflow}{if} (((j+g%jdg\_offset) <= g%domain%njglobal+g%domain%njhalo) .AND. &
153        ((j+g%jdg\_offset) >= g%domain%njhalo+1)) \textcolor{keywordflow}{then}
154 
155     \textcolor{keywordflow}{do} i=g%isc,g%iec
156 
157 \textcolor{comment}{!    if (((i+G%idg\_offset) <= G%domain%niglobal+G%domain%nihalo) .AND. &}
158 \textcolor{comment}{!           ((i+G%idg\_offset) >= G%domain%nihalo+1)) then}
159 
160     \textcolor{keywordflow}{if} ((j >= g%jsc) .and. (j <= g%jec)) \textcolor{keywordflow}{then}
161 
162       \textcolor{keywordflow}{if} (new\_sim) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (g%geoLonCu(i-1,j) >= edge\_pos) \textcolor{keywordflow}{then}
163         \textcolor{comment}{! Everything past the edge is open ocean.}
164         mass\_shelf(i,j) = 0.0
165         area\_shelf\_h(i,j) = 0.0
166         hmask(i,j) = 0.0
167         h\_shelf(i,j) = 0.0
168       \textcolor{keywordflow}{else}
169         \textcolor{keywordflow}{if} (g%geoLonCu(i,j) > edge\_pos) \textcolor{keywordflow}{then}
170           area\_shelf\_h(i,j) = g%areaT(i,j) * (edge\_pos - g%geoLonCu(i-1,j)) / &
171                               (g%geoLonCu(i,j) - g%geoLonCu(i-1,j))
172           hmask(i,j) = 2.0
173         \textcolor{keywordflow}{else}
174           area\_shelf\_h(i,j) = g%areaT(i,j)
175           hmask(i,j) = 1.0
176 \textcolor{keywordflow}{        endif}
177 
178         \textcolor{keywordflow}{if} (g%geoLonT(i,j) > slope\_pos) \textcolor{keywordflow}{then}
179           h\_shelf(i,j) = cs%min\_draft
180           mass\_shelf(i,j) = cs%Rho\_ocean * cs%min\_draft
181         \textcolor{keywordflow}{else}
182           mass\_shelf(i,j) = cs%Rho\_ocean * (cs%min\_draft + &
183                  (cs%max\_draft - cs%min\_draft) * &
184                  min(1.0, (c1*(slope\_pos - g%geoLonT(i,j)))**2) )
185           h\_shelf(i,j) = (cs%min\_draft + &
186                  (cs%max\_draft - cs%min\_draft) * &
187                  min(1.0, (c1*(slope\_pos - g%geoLonT(i,j)))**2) )
188 \textcolor{keywordflow}{        endif}
189 
190 \textcolor{keywordflow}{    endif} ;\textcolor{keywordflow}{ endif} ;\textcolor{keywordflow}{ endif}
191 
192     \textcolor{keywordflow}{if} ((i+g%idg\_offset) == g%domain%nihalo+1) \textcolor{keywordflow}{then}
193       hmask(i-1,j) = 3.0
194 \textcolor{keywordflow}{    endif}
195 
196 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ endif} ;\textcolor{keywordflow}{ enddo}
197 
\end{DoxyCode}
\mbox{\Hypertarget{namespaceuser__shelf__init_a04dc4958214e8b07da385f8be785d706}\label{namespaceuser__shelf__init_a04dc4958214e8b07da385f8be785d706}} 
\index{user\+\_\+shelf\+\_\+init@{user\+\_\+shelf\+\_\+init}!write\+\_\+user\+\_\+log@{write\+\_\+user\+\_\+log}}
\index{write\+\_\+user\+\_\+log@{write\+\_\+user\+\_\+log}!user\+\_\+shelf\+\_\+init@{user\+\_\+shelf\+\_\+init}}
\subsubsection{\texorpdfstring{write\+\_\+user\+\_\+log()}{write\_user\_log()}}
{\footnotesize\ttfamily subroutine user\+\_\+shelf\+\_\+init\+::write\+\_\+user\+\_\+log (\begin{DoxyParamCaption}\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine writes out the user ice shelf code version number to the model log. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em param\+\_\+file} & A structure to parse for run-\/time parameters \\
\hline
\end{DoxyParams}


Definition at line 202 of file user\+\_\+shelf\+\_\+init.\+F90.


\begin{DoxyCode}
202   \textcolor{keywordtype}{type}(param\_file\_type), \textcolor{keywordtype}{intent(in)} :: param\_file\textcolor{comment}{ !< A structure to parse for run-time parameters}
203 
204   \textcolor{keywordtype}{character(len=128)} :: version = \textcolor{stringliteral}{'$Id: user\_shelf\_init.F90,v 1.1.2.7 2012/06/19 22:15:52 Robert.Hallberg
       Exp $'}
205   \textcolor{keywordtype}{character(len=128)} :: tagname = \textcolor{stringliteral}{'$Name: MOM\_ogrp $'}
206   \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"user\_shelf\_init"} \textcolor{comment}{! This module's name.}
207 
208   \textcolor{keyword}{call }log\_version(param\_file, mdl, version, tagname)
209 
\end{DoxyCode}
