\hypertarget{namespaceuser__shelf__init}{}\doxysection{user\+\_\+shelf\+\_\+init Module Reference}
\label{namespaceuser__shelf__init}\index{user\_shelf\_init@{user\_shelf\_init}}


\doxysubsection{Detailed Description}
This module specifies the initial values and evolving properties of the M\+O\+M6 ice shelf, using user-\/provided code. \doxysubsection*{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}
\doxysubsection*{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}


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


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


\begin{DoxyCode}{0}
\DoxyCodeLine{103   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(in)}  :: G\textcolor{comment}{    !< The ocean's grid structure}}
\DoxyCodeLine{104 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, \&}
\DoxyCodeLine{105                            \textcolor{keywordtype}{intent(out)} :: h\_shelf\textcolor{comment}{ !< The ice shelf thickness [m].}}
\DoxyCodeLine{106 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, \&}
\DoxyCodeLine{107                            \textcolor{keywordtype}{intent(out)} :: area\_shelf\_h\textcolor{comment}{ !< The area per cell covered by the ice shelf [L2 \string~> m2].}}
\DoxyCodeLine{108 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZDI\_(G),SZDJ\_(G))}, \&}
\DoxyCodeLine{109                            \textcolor{keywordtype}{intent(out)} :: hmask\textcolor{comment}{ !< A mask indicating which tracer points are}}
\DoxyCodeLine{110 \textcolor{comment}{                                                !! partly or fully covered by an ice-\/shelf}}
\DoxyCodeLine{111   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)}  :: US\textcolor{comment}{    !< A structure containing unit conversion factors}}
\DoxyCodeLine{112   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(in)}  :: param\_file\textcolor{comment}{ !< A structure to parse for run-\/time parameters}}
\DoxyCodeLine{113 }
\DoxyCodeLine{114   \textcolor{comment}{! This subroutine initializes the ice shelf thickness.  Currently it does so}}
\DoxyCodeLine{115   \textcolor{comment}{! calling USER\_initialize\_shelf\_mass, but this can be revised as needed.}}
\DoxyCodeLine{116 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G))} :: mass\_shelf}
\DoxyCodeLine{117   \textcolor{keywordtype}{type}(user\_ice\_shelf\_CS), \textcolor{keywordtype}{pointer} :: CS => null()}
\DoxyCodeLine{118 }
\DoxyCodeLine{119   \textcolor{keyword}{call }user\_initialize\_shelf\_mass(mass\_shelf, area\_shelf\_h, h\_shelf, hmask, g, us, cs, param\_file, .true.)}
\DoxyCodeLine{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}}
\doxysubsubsection{\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{\texttt{ in}}  & {\em g} & The ocean\textquotesingle{}s grid structure \\
\hline
\mbox{\texttt{ out}}  & {\em mass\+\_\+shelf} & The ice shelf mass per unit area averaged \\
\hline
\mbox{\texttt{ out}}  & {\em h\+\_\+shelf} & The ice shelf thickness \mbox{[}Z $\sim$$>$ m\mbox{]}. \\
\hline
\mbox{\texttt{ out}}  & {\em area\+\_\+shelf\+\_\+h} & The area per cell covered by the ice shelf \mbox{[}L2 $\sim$$>$ m2\mbox{]}. \\
\hline
\mbox{\texttt{ out}}  & {\em hmask} & A mask indicating which tracer points are \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A structure containing unit conversion factors \\
\hline
 & {\em cs} & A pointer to the user ice shelf control structure \\
\hline
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & A structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ 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 43 of file user\+\_\+shelf\+\_\+init.\+F90.


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


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


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


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


\begin{DoxyCode}{0}
\DoxyCodeLine{202   \textcolor{keywordtype}{type}(param\_file\_type), \textcolor{keywordtype}{intent(in)} :: param\_file\textcolor{comment}{ !< A structure to parse for run-\/time parameters}}
\DoxyCodeLine{203 }
\DoxyCodeLine{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 \$'}}
\DoxyCodeLine{205   \textcolor{keywordtype}{character(len=128)} :: tagname = \textcolor{stringliteral}{'\$Name: MOM\_ogrp \$'}}
\DoxyCodeLine{206   \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"user\_shelf\_init"} \textcolor{comment}{! This module's name.}}
\DoxyCodeLine{207 }
\DoxyCodeLine{208   \textcolor{keyword}{call }log\_version(param\_file, mdl, version, tagname)}
\DoxyCodeLine{209 }

\end{DoxyCode}
