\hypertarget{interfacemom__ale__sponge_1_1initialize__ale__sponge}{}\doxysection{mom\+\_\+ale\+\_\+sponge\+::initialize\+\_\+ale\+\_\+sponge Interface Reference}
\label{interfacemom__ale__sponge_1_1initialize__ale__sponge}\index{mom\_ale\_sponge::initialize\_ale\_sponge@{mom\_ale\_sponge::initialize\_ale\_sponge}}


\doxysubsection{Detailed Description}
Ddetermine the number of points which are within sponges in this computational domain. 

Only points that have positive values of Iresttime and which mask2dT indicates are ocean points are included in the sponges. It also stores the target interface heights. 

Definition at line 49 of file M\+O\+M\+\_\+\+A\+L\+E\+\_\+sponge.\+F90.

\doxysubsection*{Private functions}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\hyperlink{interfacemom__ale__sponge_1_1initialize__ale__sponge_a463cd22c6fdd61d2e0918bb6c830c570}{initialize\+\_\+ale\+\_\+sponge\+\_\+fixed}} (Iresttime, G, param\+\_\+file, CS, data\+\_\+h, nz\+\_\+data)
\begin{DoxyCompactList}\small\item\em This subroutine determines the number of points which are within sponges in this computational domain. Only points that have positive values of Iresttime and which mask2dT indicates are ocean points are included in the sponges. It also stores the target interface heights. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{interfacemom__ale__sponge_1_1initialize__ale__sponge_a11a5638d0ed823f984ff4dbdfdc8f354}{initialize\+\_\+ale\+\_\+sponge\+\_\+varying}} (Iresttime, G, param\+\_\+file, CS)
\begin{DoxyCompactList}\small\item\em This subroutine determines the number of points which are to be restoref in the computational domain. Only points that have positive values of Iresttime and which mask2dT indicates are ocean points are included in the sponges. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Ddetermine the number of points which are within sponges in this computational domain. 

Only points that have positive values of Iresttime and which mask2dT indicates are ocean points are included in the sponges. It also stores the target interface heights. 

Definition at line 49 of file M\+O\+M\+\_\+\+A\+L\+E\+\_\+sponge.\+F90.



\doxysubsection{Functions and subroutines}
\mbox{\Hypertarget{interfacemom__ale__sponge_1_1initialize__ale__sponge_a463cd22c6fdd61d2e0918bb6c830c570}\label{interfacemom__ale__sponge_1_1initialize__ale__sponge_a463cd22c6fdd61d2e0918bb6c830c570}} 
\index{mom\_ale\_sponge::initialize\_ale\_sponge@{mom\_ale\_sponge::initialize\_ale\_sponge}!initialize\_ale\_sponge\_fixed@{initialize\_ale\_sponge\_fixed}}
\index{initialize\_ale\_sponge\_fixed@{initialize\_ale\_sponge\_fixed}!mom\_ale\_sponge::initialize\_ale\_sponge@{mom\_ale\_sponge::initialize\_ale\_sponge}}
\doxysubsubsection{\texorpdfstring{initialize\_ale\_sponge\_fixed()}{initialize\_ale\_sponge\_fixed()}}
{\footnotesize\ttfamily subroutine mom\+\_\+ale\+\_\+sponge\+::initialize\+\_\+ale\+\_\+sponge\+::initialize\+\_\+ale\+\_\+sponge\+\_\+fixed (\begin{DoxyParamCaption}\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g)), intent(in)}]{Iresttime,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{type(\mbox{\hyperlink{structmom__ale__sponge_1_1ale__sponge__cs}{ale\+\_\+sponge\+\_\+cs}}), pointer}]{CS,  }\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g),nz\+\_\+data), intent(in)}]{data\+\_\+h,  }\item[{integer, intent(in)}]{nz\+\_\+data }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine determines the number of points which are within sponges in this computational domain. Only points that have positive values of Iresttime and which mask2dT indicates are ocean points are included in the sponges. It also stores the target interface heights. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em g} & The ocean\textquotesingle{}s grid structure. \\
\hline
\mbox{\texttt{ in}}  & {\em nz\+\_\+data} & The total number of sponge input layers. \\
\hline
\mbox{\texttt{ in}}  & {\em iresttime} & The inverse of the restoring time \mbox{[}T-\/1 $\sim$$>$ s-\/1\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & A structure indicating the open file to parse for model parameter values. \\
\hline
 & {\em cs} & A pointer that is set to point to the control structure for this module (in/out). \\
\hline
\mbox{\texttt{ in}}  & {\em data\+\_\+h} & The thicknesses of the sponge input layers \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}. \\
\hline
\end{DoxyParams}


Definition at line 148 of file M\+O\+M\+\_\+\+A\+L\+E\+\_\+sponge.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{149 }
\DoxyCodeLine{150   \textcolor{keywordtype}{type}(ocean\_grid\_type),            \textcolor{keywordtype}{intent(in)} :: G\textcolor{comment}{ !< The ocean's grid structure.}}
\DoxyCodeLine{151   \textcolor{keywordtype}{integer},                          \textcolor{keywordtype}{intent(in)} :: nz\_data\textcolor{comment}{ !< The total number of sponge input layers.}}
\DoxyCodeLine{152 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G))}, \textcolor{keywordtype}{intent(in)} :: Iresttime\textcolor{comment}{ !< The inverse of the restoring time [T-\/1 \string~> s-\/1].}}
\DoxyCodeLine{153   \textcolor{keywordtype}{type}(param\_file\_type),            \textcolor{keywordtype}{intent(in)} :: param\_file\textcolor{comment}{ !< A structure indicating the open file}}
\DoxyCodeLine{154 \textcolor{comment}{                                                             !! to parse for model parameter values.}}
\DoxyCodeLine{155   \textcolor{keywordtype}{type}(ALE\_sponge\_CS),              \textcolor{keywordtype}{pointer}    :: CS\textcolor{comment}{ !< A pointer that is set to point to the control}}
\DoxyCodeLine{156 \textcolor{comment}{                                                     !! structure for this module (in/out).}}
\DoxyCodeLine{157 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),nz\_data)}, \textcolor{keywordtype}{intent(in)} :: data\_h\textcolor{comment}{ !< The thicknesses of the sponge}}
\DoxyCodeLine{158 \textcolor{comment}{                                                     !! input layers [H \string~> m or kg m-\/2].}}
\DoxyCodeLine{159 }
\DoxyCodeLine{160 }
\DoxyCodeLine{161 \textcolor{comment}{! This include declares and sets the variable "version".}}
\DoxyCodeLine{162 \textcolor{preprocessor}{\#include "version\_variable.h"}}
\DoxyCodeLine{163 \textcolor{preprocessor}{}  \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"MOM\_sponge"}  \textcolor{comment}{! This module's name.}}
\DoxyCodeLine{164   \textcolor{keywordtype}{logical} :: use\_sponge}
\DoxyCodeLine{165 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{dimension(:,:,:)} :: data\_hu\textcolor{comment}{ !< thickness at u points [H \string~> m or kg m-\/2]}}
\DoxyCodeLine{166 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{dimension(:,:,:)} :: data\_hv\textcolor{comment}{ !< thickness at v points [H \string~> m or kg m-\/2]}}
\DoxyCodeLine{167 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{dimension(:,:)} :: Iresttime\_u\textcolor{comment}{ !< inverse of the restoring time at u points [T-\/1 \string~> s-\/1]}}
\DoxyCodeLine{168 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{dimension(:,:)} :: Iresttime\_v\textcolor{comment}{ !< inverse of the restoring time at v points [T-\/1 \string~> s-\/1]}}
\DoxyCodeLine{169   \textcolor{keywordtype}{logical} :: bndExtrapolation = .true. \textcolor{comment}{! If true, extrapolate boundaries}}
\DoxyCodeLine{170   \textcolor{keywordtype}{logical} :: default\_2018\_answers}
\DoxyCodeLine{171   \textcolor{keywordtype}{integer} :: i, j, k, col, total\_sponge\_cols, total\_sponge\_cols\_u, total\_sponge\_cols\_v}
\DoxyCodeLine{172   \textcolor{keywordtype}{character(len=10)}  :: remapScheme}
\DoxyCodeLine{173   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{174     \textcolor{keyword}{call }mom\_error(warning, \textcolor{stringliteral}{"initialize\_ALE\_sponge\_fixed called with an associated "}// \&}
\DoxyCodeLine{175                             \textcolor{stringliteral}{"control structure."})}
\DoxyCodeLine{176     \textcolor{keywordflow}{return}}
\DoxyCodeLine{177 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{178 }
\DoxyCodeLine{179 \textcolor{comment}{! Set default, read and log parameters}}
\DoxyCodeLine{180   \textcolor{keyword}{call }log\_version(param\_file, mdl, version, \textcolor{stringliteral}{""})}
\DoxyCodeLine{181   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"SPONGE"}, use\_sponge, \&}
\DoxyCodeLine{182                  \textcolor{stringliteral}{"If true, sponges may be applied anywhere in the domain. "}//\&}
\DoxyCodeLine{183                  \textcolor{stringliteral}{"The exact location and properties of those sponges are "}//\&}
\DoxyCodeLine{184                  \textcolor{stringliteral}{"specified from MOM\_initialization.F90."}, default=.false.)}
\DoxyCodeLine{185 }
\DoxyCodeLine{186   \textcolor{keywordflow}{if} (.not.use\_sponge) \textcolor{keywordflow}{return}}
\DoxyCodeLine{187 }
\DoxyCodeLine{188   \textcolor{keyword}{allocate}(cs)}
\DoxyCodeLine{189 }
\DoxyCodeLine{190   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"SPONGE\_UV"}, cs\%sponge\_uv, \&}
\DoxyCodeLine{191                  \textcolor{stringliteral}{"Apply sponges in u and v, in addition to tracers."}, \&}
\DoxyCodeLine{192                  default=.false.)}
\DoxyCodeLine{193 }
\DoxyCodeLine{194   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"REMAPPING\_SCHEME"}, remapscheme, \&}
\DoxyCodeLine{195                  \textcolor{stringliteral}{"This sets the reconstruction scheme used "}//\&}
\DoxyCodeLine{196                  \textcolor{stringliteral}{" for vertical remapping for all variables."}, \&}
\DoxyCodeLine{197                  default=\textcolor{stringliteral}{"PLM"}, do\_not\_log=.true.)}
\DoxyCodeLine{198 }
\DoxyCodeLine{199   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"BOUNDARY\_EXTRAPOLATION"}, bndextrapolation, \&}
\DoxyCodeLine{200                  \textcolor{stringliteral}{"When defined, a proper high-\/order reconstruction "}//\&}
\DoxyCodeLine{201                  \textcolor{stringliteral}{"scheme is used within boundary cells rather "}//\&}
\DoxyCodeLine{202                  \textcolor{stringliteral}{"than PCM. E.g., if PPM is used for remapping, a "}//\&}
\DoxyCodeLine{203                  \textcolor{stringliteral}{"PPM reconstruction will also be used within boundary cells."}, \&}
\DoxyCodeLine{204                  default=.false., do\_not\_log=.true.)}
\DoxyCodeLine{205   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"DEFAULT\_2018\_ANSWERS"}, default\_2018\_answers, \&}
\DoxyCodeLine{206                  \textcolor{stringliteral}{"This sets the default value for the various \_2018\_ANSWERS parameters."}, \&}
\DoxyCodeLine{207                  default=.false.)}
\DoxyCodeLine{208   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"REMAPPING\_2018\_ANSWERS"}, cs\%remap\_answers\_2018, \&}
\DoxyCodeLine{209                  \textcolor{stringliteral}{"If true, use the order of arithmetic and expressions that recover the "}//\&}
\DoxyCodeLine{210                  \textcolor{stringliteral}{"answers from the end of 2018.  Otherwise, use updated and more robust "}//\&}
\DoxyCodeLine{211                  \textcolor{stringliteral}{"forms of the same expressions."}, default=default\_2018\_answers)}
\DoxyCodeLine{212   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"HOR\_REGRID\_2018\_ANSWERS"}, cs\%hor\_regrid\_answers\_2018, \&}
\DoxyCodeLine{213                  \textcolor{stringliteral}{"If true, use the order of arithmetic for horizonal regridding that recovers "}//\&}
\DoxyCodeLine{214                  \textcolor{stringliteral}{"the answers from the end of 2018.  Otherwise, use rotationally symmetric "}//\&}
\DoxyCodeLine{215                  \textcolor{stringliteral}{"forms of the same expressions."}, default=default\_2018\_answers)}
\DoxyCodeLine{216 }
\DoxyCodeLine{217   cs\%time\_varying\_sponges = .false.}
\DoxyCodeLine{218   cs\%nz = g\%ke}
\DoxyCodeLine{219   cs\%isc = g\%isc ; cs\%iec = g\%iec ; cs\%jsc = g\%jsc ; cs\%jec = g\%jec}
\DoxyCodeLine{220   cs\%isd = g\%isd ; cs\%ied = g\%ied ; cs\%jsd = g\%jsd ; cs\%jed = g\%jed}
\DoxyCodeLine{221   cs\%iscB = g\%iscB ; cs\%iecB = g\%iecB; cs\%jscB = g\%jscB ; cs\%jecB = g\%jecB}
\DoxyCodeLine{222 }
\DoxyCodeLine{223   \textcolor{comment}{! number of columns to be restored}}
\DoxyCodeLine{224   cs\%num\_col = 0 ; cs\%fldno = 0}
\DoxyCodeLine{225   \textcolor{keywordflow}{do} j=g\%jsc,g\%jec ; \textcolor{keywordflow}{do} i=g\%isc,g\%iec}
\DoxyCodeLine{226     \textcolor{keywordflow}{if} ((iresttime(i,j)>0.0) .and. (g\%mask2dT(i,j)>0)) \&}
\DoxyCodeLine{227       cs\%num\_col = cs\%num\_col + 1}
\DoxyCodeLine{228 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{229 }
\DoxyCodeLine{230   \textcolor{keywordflow}{if} (cs\%num\_col > 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{231     \textcolor{keyword}{allocate}(cs\%Iresttime\_col(cs\%num\_col)) ; cs\%Iresttime\_col = 0.0}
\DoxyCodeLine{232     \textcolor{keyword}{allocate}(cs\%col\_i(cs\%num\_col))         ; cs\%col\_i = 0}
\DoxyCodeLine{233     \textcolor{keyword}{allocate}(cs\%col\_j(cs\%num\_col))         ; cs\%col\_j = 0}
\DoxyCodeLine{234     \textcolor{comment}{! pass indices, restoring time to the CS structure}}
\DoxyCodeLine{235     col = 1}
\DoxyCodeLine{236     \textcolor{keywordflow}{do} j=g\%jsc,g\%jec ; \textcolor{keywordflow}{do} i=g\%isc,g\%iec}
\DoxyCodeLine{237       \textcolor{keywordflow}{if} ((iresttime(i,j)>0.0) .and. (g\%mask2dT(i,j)>0)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{238         cs\%col\_i(col) = i ; cs\%col\_j(col) = j}
\DoxyCodeLine{239         cs\%Iresttime\_col(col) = iresttime(i,j)}
\DoxyCodeLine{240         col = col +1}
\DoxyCodeLine{241 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{242 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{243     \textcolor{comment}{! same for total number of arbritary layers and correspondent data}}
\DoxyCodeLine{244     cs\%nz\_data = nz\_data}
\DoxyCodeLine{245     \textcolor{keyword}{allocate}(cs\%Ref\_h\%p(cs\%nz\_data,cs\%num\_col))}
\DoxyCodeLine{246     \textcolor{keywordflow}{do} col=1,cs\%num\_col ; \textcolor{keywordflow}{do} k=1,cs\%nz\_data}
\DoxyCodeLine{247       cs\%Ref\_h\%p(k,col) = data\_h(cs\%col\_i(col),cs\%col\_j(col),k)}
\DoxyCodeLine{248 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{249 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{250 }
\DoxyCodeLine{251   total\_sponge\_cols = cs\%num\_col}
\DoxyCodeLine{252   \textcolor{keyword}{call }sum\_across\_pes(total\_sponge\_cols)}
\DoxyCodeLine{253 }
\DoxyCodeLine{254 \textcolor{comment}{! Call the constructor for remapping control structure}}
\DoxyCodeLine{255   \textcolor{keyword}{call }initialize\_remapping(cs\%remap\_cs, remapscheme, boundary\_extrapolation=bndextrapolation, \&}
\DoxyCodeLine{256                             answers\_2018=cs\%remap\_answers\_2018)}
\DoxyCodeLine{257 }
\DoxyCodeLine{258   \textcolor{keyword}{call }log\_param(param\_file, mdl, \textcolor{stringliteral}{"!Total sponge columns at h points"}, total\_sponge\_cols, \&}
\DoxyCodeLine{259                  \textcolor{stringliteral}{"The total number of columns where sponges are applied at h points."}, like\_default=.true.)}
\DoxyCodeLine{260 }
\DoxyCodeLine{261   \textcolor{keywordflow}{if} (cs\%sponge\_uv) \textcolor{keywordflow}{then}}
\DoxyCodeLine{262 }
\DoxyCodeLine{263     \textcolor{keyword}{allocate}(data\_hu(g\%isdB:g\%iedB,g\%jsd:g\%jed,nz\_data)) ; data\_hu(:,:,:) = 0.0}
\DoxyCodeLine{264     \textcolor{keyword}{allocate}(data\_hv(g\%isd:g\%ied,g\%jsdB:g\%jedB,nz\_data)) ; data\_hv(:,:,:) = 0.0}
\DoxyCodeLine{265     \textcolor{keyword}{allocate}(iresttime\_u(g\%isdB:g\%iedB,g\%jsd:g\%jed)) ; iresttime\_u(:,:) = 0.0}
\DoxyCodeLine{266     \textcolor{keyword}{allocate}(iresttime\_v(g\%isd:g\%ied,g\%jsdB:g\%jedB)) ; iresttime\_v(:,:) = 0.0}
\DoxyCodeLine{267 }
\DoxyCodeLine{268     \textcolor{comment}{! u points}}
\DoxyCodeLine{269     cs\%num\_col\_u = 0 ; \textcolor{comment}{!CS\%fldno\_u = 0}}
\DoxyCodeLine{270     \textcolor{keywordflow}{do} j=cs\%jsc,cs\%jec ; \textcolor{keywordflow}{do} i=cs\%iscB,cs\%iecB}
\DoxyCodeLine{271        data\_hu(i,j,:) = 0.5 * (data\_h(i,j,:) + data\_h(i+1,j,:))}
\DoxyCodeLine{272        iresttime\_u(i,j) = 0.5 * (iresttime(i,j) + iresttime(i+1,j))}
\DoxyCodeLine{273        \textcolor{keywordflow}{if} ((iresttime\_u(i,j)>0.0) .and. (g\%mask2dCu(i,j)>0)) \&}
\DoxyCodeLine{274           cs\%num\_col\_u = cs\%num\_col\_u + 1}
\DoxyCodeLine{275 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{276 }
\DoxyCodeLine{277     \textcolor{keywordflow}{if} (cs\%num\_col\_u > 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{278 }
\DoxyCodeLine{279        \textcolor{keyword}{allocate}(cs\%Iresttime\_col\_u(cs\%num\_col\_u)) ; cs\%Iresttime\_col\_u(:) = 0.0}
\DoxyCodeLine{280        \textcolor{keyword}{allocate}(cs\%col\_i\_u(cs\%num\_col\_u))         ; cs\%col\_i\_u(:) = 0}
\DoxyCodeLine{281        \textcolor{keyword}{allocate}(cs\%col\_j\_u(cs\%num\_col\_u))         ; cs\%col\_j\_u(:) = 0}
\DoxyCodeLine{282 }
\DoxyCodeLine{283        \textcolor{comment}{! pass indices, restoring time to the CS structure}}
\DoxyCodeLine{284        col = 1}
\DoxyCodeLine{285        \textcolor{keywordflow}{do} j=cs\%jsc,cs\%jec ; \textcolor{keywordflow}{do} i=cs\%iscB,cs\%iecB}
\DoxyCodeLine{286          \textcolor{keywordflow}{if} ((iresttime\_u(i,j)>0.0) .and. (g\%mask2dCu(i,j)>0)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{287            cs\%col\_i\_u(col) = i ; cs\%col\_j\_u(col) = j}
\DoxyCodeLine{288            cs\%Iresttime\_col\_u(col) = iresttime\_u(i,j)}
\DoxyCodeLine{289            col = col + 1}
\DoxyCodeLine{290 \textcolor{keywordflow}{         endif}}
\DoxyCodeLine{291 \textcolor{keywordflow}{       enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{292 }
\DoxyCodeLine{293        \textcolor{comment}{! same for total number of arbritary layers and correspondent data}}
\DoxyCodeLine{294 }
\DoxyCodeLine{295        \textcolor{keyword}{allocate}(cs\%Ref\_hu\%p(cs\%nz\_data,cs\%num\_col\_u))}
\DoxyCodeLine{296        \textcolor{keywordflow}{do} col=1,cs\%num\_col\_u ; \textcolor{keywordflow}{do} k=1,cs\%nz\_data}
\DoxyCodeLine{297          cs\%Ref\_hu\%p(k,col) = data\_hu(cs\%col\_i\_u(col),cs\%col\_j\_u(col),k)}
\DoxyCodeLine{298 \textcolor{keywordflow}{       enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{299 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{300     total\_sponge\_cols\_u = cs\%num\_col\_u}
\DoxyCodeLine{301     \textcolor{keyword}{call }sum\_across\_pes(total\_sponge\_cols\_u)}
\DoxyCodeLine{302     \textcolor{keyword}{call }log\_param(param\_file, mdl, \textcolor{stringliteral}{"!Total sponge columns at u points"}, total\_sponge\_cols\_u, \&}
\DoxyCodeLine{303                 \textcolor{stringliteral}{"The total number of columns where sponges are applied at u points."}, like\_default=.true.)}
\DoxyCodeLine{304 }
\DoxyCodeLine{305     \textcolor{comment}{! v points}}
\DoxyCodeLine{306     cs\%num\_col\_v = 0 ; \textcolor{comment}{!CS\%fldno\_v = 0}}
\DoxyCodeLine{307     \textcolor{keywordflow}{do} j=cs\%jscB,cs\%jecB; \textcolor{keywordflow}{do} i=cs\%isc,cs\%iec}
\DoxyCodeLine{308       data\_hv(i,j,:) = 0.5 * (data\_h(i,j,:) + data\_h(i,j+1,:))}
\DoxyCodeLine{309       iresttime\_v(i,j) = 0.5 * (iresttime(i,j) + iresttime(i,j+1))}
\DoxyCodeLine{310       \textcolor{keywordflow}{if} ((iresttime\_v(i,j)>0.0) .and. (g\%mask2dCv(i,j)>0)) \&}
\DoxyCodeLine{311         cs\%num\_col\_v = cs\%num\_col\_v + 1}
\DoxyCodeLine{312 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{313 }
\DoxyCodeLine{314     \textcolor{keywordflow}{if} (cs\%num\_col\_v > 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{315 }
\DoxyCodeLine{316       \textcolor{keyword}{allocate}(cs\%Iresttime\_col\_v(cs\%num\_col\_v)) ; cs\%Iresttime\_col\_v = 0.0}
\DoxyCodeLine{317       \textcolor{keyword}{allocate}(cs\%col\_i\_v(cs\%num\_col\_v))         ; cs\%col\_i\_v = 0}
\DoxyCodeLine{318       \textcolor{keyword}{allocate}(cs\%col\_j\_v(cs\%num\_col\_v))         ; cs\%col\_j\_v = 0}
\DoxyCodeLine{319 }
\DoxyCodeLine{320       \textcolor{comment}{! pass indices, restoring time to the CS structure}}
\DoxyCodeLine{321       col = 1}
\DoxyCodeLine{322       \textcolor{keywordflow}{do} j=cs\%jscB,cs\%jecB ; \textcolor{keywordflow}{do} i=cs\%isc,cs\%iec}
\DoxyCodeLine{323         \textcolor{keywordflow}{if} ((iresttime\_v(i,j)>0.0) .and. (g\%mask2dCv(i,j)>0)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{324           cs\%col\_i\_v(col) = i ; cs\%col\_j\_v(col) = j}
\DoxyCodeLine{325           cs\%Iresttime\_col\_v(col) = iresttime\_v(i,j)}
\DoxyCodeLine{326           col = col + 1}
\DoxyCodeLine{327 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{328 \textcolor{keywordflow}{      enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{329 }
\DoxyCodeLine{330       \textcolor{comment}{! same for total number of arbritary layers and correspondent data}}
\DoxyCodeLine{331       \textcolor{keyword}{allocate}(cs\%Ref\_hv\%p(cs\%nz\_data,cs\%num\_col\_v))}
\DoxyCodeLine{332       \textcolor{keywordflow}{do} col=1,cs\%num\_col\_v ; \textcolor{keywordflow}{do} k=1,cs\%nz\_data}
\DoxyCodeLine{333         cs\%Ref\_hv\%p(k,col) = data\_hv(cs\%col\_i\_v(col),cs\%col\_j\_v(col),k)}
\DoxyCodeLine{334 \textcolor{keywordflow}{      enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{335 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{336     total\_sponge\_cols\_v = cs\%num\_col\_v}
\DoxyCodeLine{337     \textcolor{keyword}{call }sum\_across\_pes(total\_sponge\_cols\_v)}
\DoxyCodeLine{338     \textcolor{keyword}{call }log\_param(param\_file, mdl, \textcolor{stringliteral}{"!Total sponge columns at v points"}, total\_sponge\_cols\_v, \&}
\DoxyCodeLine{339                  \textcolor{stringliteral}{"The total number of columns where sponges are applied at v points."}, like\_default=.true.)}
\DoxyCodeLine{340 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{341 }

\end{DoxyCode}
\mbox{\Hypertarget{interfacemom__ale__sponge_1_1initialize__ale__sponge_a11a5638d0ed823f984ff4dbdfdc8f354}\label{interfacemom__ale__sponge_1_1initialize__ale__sponge_a11a5638d0ed823f984ff4dbdfdc8f354}} 
\index{mom\_ale\_sponge::initialize\_ale\_sponge@{mom\_ale\_sponge::initialize\_ale\_sponge}!initialize\_ale\_sponge\_varying@{initialize\_ale\_sponge\_varying}}
\index{initialize\_ale\_sponge\_varying@{initialize\_ale\_sponge\_varying}!mom\_ale\_sponge::initialize\_ale\_sponge@{mom\_ale\_sponge::initialize\_ale\_sponge}}
\doxysubsubsection{\texorpdfstring{initialize\_ale\_sponge\_varying()}{initialize\_ale\_sponge\_varying()}}
{\footnotesize\ttfamily subroutine mom\+\_\+ale\+\_\+sponge\+::initialize\+\_\+ale\+\_\+sponge\+::initialize\+\_\+ale\+\_\+sponge\+\_\+varying (\begin{DoxyParamCaption}\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed), intent(in)}]{Iresttime,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{type(\mbox{\hyperlink{structmom__ale__sponge_1_1ale__sponge__cs}{ale\+\_\+sponge\+\_\+cs}}), pointer}]{CS }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine determines the number of points which are to be restoref in the computational domain. Only points that have positive values of Iresttime and which mask2dT indicates are ocean points are included in the sponges. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em g} & The ocean\textquotesingle{}s grid structure. \\
\hline
\mbox{\texttt{ in}}  & {\em iresttime} & The inverse of the restoring time \mbox{[}T-\/1 $\sim$$>$ s-\/1\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & A structure indicating the open file to parse for model parameter values. \\
\hline
 & {\em cs} & A pointer that is set to point to the control structure for this module (in/out). \\
\hline
\end{DoxyParams}


Definition at line 396 of file M\+O\+M\+\_\+\+A\+L\+E\+\_\+sponge.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{397 }
\DoxyCodeLine{398   \textcolor{keywordtype}{type}(ocean\_grid\_type),            \textcolor{keywordtype}{intent(in)} :: G\textcolor{comment}{ !< The ocean's grid structure.}}
\DoxyCodeLine{399 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G))}, \textcolor{keywordtype}{intent(in)} :: Iresttime\textcolor{comment}{ !< The inverse of the restoring time [T-\/1 \string~> s-\/1].}}
\DoxyCodeLine{400   \textcolor{keywordtype}{type}(param\_file\_type),            \textcolor{keywordtype}{intent(in)} :: param\_file\textcolor{comment}{ !< A structure indicating the open file to parse}}
\DoxyCodeLine{401 \textcolor{comment}{                                                             !! for model parameter values.}}
\DoxyCodeLine{402   \textcolor{keywordtype}{type}(ALE\_sponge\_CS),              \textcolor{keywordtype}{pointer}    :: CS\textcolor{comment}{ !< A pointer that is set to point to the control}}
\DoxyCodeLine{403 \textcolor{comment}{                                                     !! structure for this module (in/out).}}
\DoxyCodeLine{404 }
\DoxyCodeLine{405 \textcolor{comment}{! This include declares and sets the variable "version".}}
\DoxyCodeLine{406 \textcolor{preprocessor}{\#include "version\_variable.h"}}
\DoxyCodeLine{407 \textcolor{preprocessor}{}  \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"MOM\_sponge"}  \textcolor{comment}{! This module's name.}}
\DoxyCodeLine{408   \textcolor{keywordtype}{logical} :: use\_sponge}
\DoxyCodeLine{409 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{dimension(:,:)} :: Iresttime\_u\textcolor{comment}{ !< inverse of the restoring time at u points [T-\/1 \string~> s-\/1]}}
\DoxyCodeLine{410 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{dimension(:,:)} :: Iresttime\_v\textcolor{comment}{ !< inverse of the restoring time at v points [T-\/1 \string~> s-\/1]}}
\DoxyCodeLine{411   \textcolor{keywordtype}{logical} :: bndExtrapolation = .true. \textcolor{comment}{! If true, extrapolate boundaries}}
\DoxyCodeLine{412   \textcolor{keywordtype}{logical} :: default\_2018\_answers}
\DoxyCodeLine{413   \textcolor{keywordtype}{logical} :: spongeDataOngrid = .false.}
\DoxyCodeLine{414   \textcolor{keywordtype}{integer} :: i, j, k, col, total\_sponge\_cols, total\_sponge\_cols\_u, total\_sponge\_cols\_v}
\DoxyCodeLine{415   \textcolor{keywordtype}{character(len=10)}  :: remapScheme}
\DoxyCodeLine{416 }
\DoxyCodeLine{417   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{418     \textcolor{keyword}{call }mom\_error(warning, \textcolor{stringliteral}{"initialize\_ALE\_sponge\_varying called with an associated "}// \&}
\DoxyCodeLine{419                             \textcolor{stringliteral}{"control structure."})}
\DoxyCodeLine{420     \textcolor{keywordflow}{return}}
\DoxyCodeLine{421 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{422 \textcolor{comment}{! Set default, read and log parameters}}
\DoxyCodeLine{423   \textcolor{keyword}{call }log\_version(param\_file, mdl, version, \textcolor{stringliteral}{""})}
\DoxyCodeLine{424   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"SPONGE"}, use\_sponge, \&}
\DoxyCodeLine{425                  \textcolor{stringliteral}{"If true, sponges may be applied anywhere in the domain. "}//\&}
\DoxyCodeLine{426                  \textcolor{stringliteral}{"The exact location and properties of those sponges are "}//\&}
\DoxyCodeLine{427                  \textcolor{stringliteral}{"specified from MOM\_initialization.F90."}, default=.false.)}
\DoxyCodeLine{428   \textcolor{keywordflow}{if} (.not.use\_sponge) \textcolor{keywordflow}{return}}
\DoxyCodeLine{429   \textcolor{keyword}{allocate}(cs)}
\DoxyCodeLine{430   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"SPONGE\_UV"}, cs\%sponge\_uv, \&}
\DoxyCodeLine{431                  \textcolor{stringliteral}{"Apply sponges in u and v, in addition to tracers."}, \&}
\DoxyCodeLine{432                  default=.false.)}
\DoxyCodeLine{433   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"REMAPPING\_SCHEME"}, remapscheme, \&}
\DoxyCodeLine{434                  \textcolor{stringliteral}{"This sets the reconstruction scheme used "}//\&}
\DoxyCodeLine{435                  \textcolor{stringliteral}{" for vertical remapping for all variables."}, \&}
\DoxyCodeLine{436                  default=\textcolor{stringliteral}{"PLM"}, do\_not\_log=.true.)}
\DoxyCodeLine{437   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"BOUNDARY\_EXTRAPOLATION"}, bndextrapolation, \&}
\DoxyCodeLine{438                  \textcolor{stringliteral}{"When defined, a proper high-\/order reconstruction "}//\&}
\DoxyCodeLine{439                  \textcolor{stringliteral}{"scheme is used within boundary cells rather "}//\&}
\DoxyCodeLine{440                  \textcolor{stringliteral}{"than PCM. E.g., if PPM is used for remapping, a "}//\&}
\DoxyCodeLine{441                  \textcolor{stringliteral}{"PPM reconstruction will also be used within boundary cells."}, \&}
\DoxyCodeLine{442                  default=.false., do\_not\_log=.true.)}
\DoxyCodeLine{443   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"DEFAULT\_2018\_ANSWERS"}, default\_2018\_answers, \&}
\DoxyCodeLine{444                  \textcolor{stringliteral}{"This sets the default value for the various \_2018\_ANSWERS parameters."}, \&}
\DoxyCodeLine{445                  default=.false.)}
\DoxyCodeLine{446   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"REMAPPING\_2018\_ANSWERS"}, cs\%remap\_answers\_2018, \&}
\DoxyCodeLine{447                  \textcolor{stringliteral}{"If true, use the order of arithmetic and expressions that recover the "}//\&}
\DoxyCodeLine{448                  \textcolor{stringliteral}{"answers from the end of 2018.  Otherwise, use updated and more robust "}//\&}
\DoxyCodeLine{449                  \textcolor{stringliteral}{"forms of the same expressions."}, default=default\_2018\_answers)}
\DoxyCodeLine{450   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"SPONGE\_DATA\_ONGRID"}, cs\%spongeDataOngrid, \&}
\DoxyCodeLine{451                  \textcolor{stringliteral}{"When defined, the incoming sponge data are "}//\&}
\DoxyCodeLine{452                  \textcolor{stringliteral}{"assumed to be on the model grid "} , \&}
\DoxyCodeLine{453                  default=.false.)}
\DoxyCodeLine{454   cs\%time\_varying\_sponges = .true.}
\DoxyCodeLine{455   cs\%nz = g\%ke}
\DoxyCodeLine{456   cs\%isc = g\%isc ; cs\%iec = g\%iec ; cs\%jsc = g\%jsc ; cs\%jec = g\%jec}
\DoxyCodeLine{457   cs\%isd = g\%isd ; cs\%ied = g\%ied ; cs\%jsd = g\%jsd ; cs\%jed = g\%jed}
\DoxyCodeLine{458   cs\%iscB = g\%iscB ; cs\%iecB = g\%iecB; cs\%jscB = g\%jscB ; cs\%jecB = g\%jecB}
\DoxyCodeLine{459 }
\DoxyCodeLine{460   \textcolor{comment}{! number of columns to be restored}}
\DoxyCodeLine{461   cs\%num\_col = 0 ; cs\%fldno = 0}
\DoxyCodeLine{462   \textcolor{keywordflow}{do} j=g\%jsc,g\%jec ; \textcolor{keywordflow}{do} i=g\%isc,g\%iec}
\DoxyCodeLine{463     \textcolor{keywordflow}{if} ((iresttime(i,j)>0.0) .and. (g\%mask2dT(i,j)>0)) \&}
\DoxyCodeLine{464       cs\%num\_col = cs\%num\_col + 1}
\DoxyCodeLine{465 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{466   \textcolor{keywordflow}{if} (cs\%num\_col > 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{467     \textcolor{keyword}{allocate}(cs\%Iresttime\_col(cs\%num\_col)) ; cs\%Iresttime\_col = 0.0}
\DoxyCodeLine{468     \textcolor{keyword}{allocate}(cs\%col\_i(cs\%num\_col))         ; cs\%col\_i = 0}
\DoxyCodeLine{469     \textcolor{keyword}{allocate}(cs\%col\_j(cs\%num\_col))         ; cs\%col\_j = 0}
\DoxyCodeLine{470     \textcolor{comment}{! pass indices, restoring time to the CS structure}}
\DoxyCodeLine{471     col = 1}
\DoxyCodeLine{472     \textcolor{keywordflow}{do} j=g\%jsc,g\%jec ; \textcolor{keywordflow}{do} i=g\%isc,g\%iec}
\DoxyCodeLine{473       \textcolor{keywordflow}{if} ((iresttime(i,j)>0.0) .and. (g\%mask2dT(i,j)>0)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{474         cs\%col\_i(col) = i ; cs\%col\_j(col) = j}
\DoxyCodeLine{475         cs\%Iresttime\_col(col) = iresttime(i,j)}
\DoxyCodeLine{476         col = col +1}
\DoxyCodeLine{477 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{478 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{479 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{480   total\_sponge\_cols = cs\%num\_col}
\DoxyCodeLine{481   \textcolor{keyword}{call }sum\_across\_pes(total\_sponge\_cols)}
\DoxyCodeLine{482 }
\DoxyCodeLine{483 \textcolor{comment}{! Call the constructor for remapping control structure}}
\DoxyCodeLine{484   \textcolor{keyword}{call }initialize\_remapping(cs\%remap\_cs, remapscheme, boundary\_extrapolation=bndextrapolation, \&}
\DoxyCodeLine{485                             answers\_2018=cs\%remap\_answers\_2018)}
\DoxyCodeLine{486   \textcolor{keyword}{call }log\_param(param\_file, mdl, \textcolor{stringliteral}{"!Total sponge columns at h points"}, total\_sponge\_cols, \&}
\DoxyCodeLine{487                  \textcolor{stringliteral}{"The total number of columns where sponges are applied at h points."}, like\_default=.true.)}
\DoxyCodeLine{488   \textcolor{keywordflow}{if} (cs\%sponge\_uv) \textcolor{keywordflow}{then}}
\DoxyCodeLine{489     \textcolor{keyword}{allocate}(iresttime\_u(g\%isdB:g\%iedB,g\%jsd:g\%jed)) ; iresttime\_u(:,:) = 0.0}
\DoxyCodeLine{490     \textcolor{keyword}{allocate}(iresttime\_v(g\%isd:g\%ied,g\%jsdB:g\%jedB)) ; iresttime\_v(:,:) = 0.0}
\DoxyCodeLine{491     \textcolor{comment}{! u points}}
\DoxyCodeLine{492     cs\%num\_col\_u = 0 ; \textcolor{comment}{!CS\%fldno\_u = 0}}
\DoxyCodeLine{493     \textcolor{keywordflow}{do} j=cs\%jsc,cs\%jec; \textcolor{keywordflow}{do} i=cs\%iscB,cs\%iecB}
\DoxyCodeLine{494       iresttime\_u(i,j) = 0.5 * (iresttime(i,j) + iresttime(i+1,j))}
\DoxyCodeLine{495       \textcolor{keywordflow}{if} ((iresttime\_u(i,j)>0.0) .and. (g\%mask2dCu(i,j)>0)) \&}
\DoxyCodeLine{496         cs\%num\_col\_u = cs\%num\_col\_u + 1}
\DoxyCodeLine{497 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{498     \textcolor{keywordflow}{if} (cs\%num\_col\_u > 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{499       \textcolor{keyword}{allocate}(cs\%Iresttime\_col\_u(cs\%num\_col\_u)) ; cs\%Iresttime\_col\_u = 0.0}
\DoxyCodeLine{500       \textcolor{keyword}{allocate}(cs\%col\_i\_u(cs\%num\_col\_u))         ; cs\%col\_i\_u = 0}
\DoxyCodeLine{501       \textcolor{keyword}{allocate}(cs\%col\_j\_u(cs\%num\_col\_u))         ; cs\%col\_j\_u = 0}
\DoxyCodeLine{502       \textcolor{comment}{! pass indices, restoring time to the CS structure}}
\DoxyCodeLine{503       col = 1}
\DoxyCodeLine{504       \textcolor{keywordflow}{do} j=cs\%jsc,cs\%jec ; \textcolor{keywordflow}{do} i=cs\%iscB,cs\%iecB}
\DoxyCodeLine{505         \textcolor{keywordflow}{if} ((iresttime\_u(i,j)>0.0) .and. (g\%mask2dCu(i,j)>0)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{506           cs\%col\_i\_u(col) = i ; cs\%col\_j\_u(col) = j}
\DoxyCodeLine{507           cs\%Iresttime\_col\_u(col) = iresttime\_u(i,j)}
\DoxyCodeLine{508           col = col +1}
\DoxyCodeLine{509 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{510 \textcolor{keywordflow}{      enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{511       \textcolor{comment}{! same for total number of arbritary layers and correspondent data}}
\DoxyCodeLine{512 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{513     total\_sponge\_cols\_u = cs\%num\_col\_u}
\DoxyCodeLine{514     \textcolor{keyword}{call }sum\_across\_pes(total\_sponge\_cols\_u)}
\DoxyCodeLine{515     \textcolor{keyword}{call }log\_param(param\_file, mdl, \textcolor{stringliteral}{"!Total sponge columns at u points"}, total\_sponge\_cols\_u, \&}
\DoxyCodeLine{516                 \textcolor{stringliteral}{"The total number of columns where sponges are applied at u points."}, like\_default=.true.)}
\DoxyCodeLine{517     \textcolor{comment}{! v points}}
\DoxyCodeLine{518     cs\%num\_col\_v = 0 ; \textcolor{comment}{!CS\%fldno\_v = 0}}
\DoxyCodeLine{519     \textcolor{keywordflow}{do} j=cs\%jscB,cs\%jecB; \textcolor{keywordflow}{do} i=cs\%isc,cs\%iec}
\DoxyCodeLine{520       iresttime\_v(i,j) = 0.5 * (iresttime(i,j) + iresttime(i,j+1))}
\DoxyCodeLine{521       \textcolor{keywordflow}{if} ((iresttime\_v(i,j)>0.0) .and. (g\%mask2dCv(i,j)>0)) \&}
\DoxyCodeLine{522         cs\%num\_col\_v = cs\%num\_col\_v + 1}
\DoxyCodeLine{523 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{524     \textcolor{keywordflow}{if} (cs\%num\_col\_v > 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{525       \textcolor{keyword}{allocate}(cs\%Iresttime\_col\_v(cs\%num\_col\_v)) ; cs\%Iresttime\_col\_v = 0.0}
\DoxyCodeLine{526       \textcolor{keyword}{allocate}(cs\%col\_i\_v(cs\%num\_col\_v))         ; cs\%col\_i\_v = 0}
\DoxyCodeLine{527       \textcolor{keyword}{allocate}(cs\%col\_j\_v(cs\%num\_col\_v))         ; cs\%col\_j\_v = 0}
\DoxyCodeLine{528       \textcolor{comment}{! pass indices, restoring time to the CS structure}}
\DoxyCodeLine{529       col = 1}
\DoxyCodeLine{530       \textcolor{keywordflow}{do} j=cs\%jscB,cs\%jecB ; \textcolor{keywordflow}{do} i=cs\%isc,cs\%iec}
\DoxyCodeLine{531         \textcolor{keywordflow}{if} ((iresttime\_v(i,j)>0.0) .and. (g\%mask2dCv(i,j)>0)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{532           cs\%col\_i\_v(col) = i ; cs\%col\_j\_v(col) = j}
\DoxyCodeLine{533           cs\%Iresttime\_col\_v(col) = iresttime\_v(i,j)}
\DoxyCodeLine{534           col = col +1}
\DoxyCodeLine{535 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{536 \textcolor{keywordflow}{      enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{537 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{538     total\_sponge\_cols\_v = cs\%num\_col\_v}
\DoxyCodeLine{539     \textcolor{keyword}{call }sum\_across\_pes(total\_sponge\_cols\_v)}
\DoxyCodeLine{540     \textcolor{keyword}{call }log\_param(param\_file, mdl, \textcolor{stringliteral}{"!Total sponge columns at v points"}, total\_sponge\_cols\_v, \&}
\DoxyCodeLine{541                 \textcolor{stringliteral}{"The total number of columns where sponges are applied at v points."}, like\_default=.true.)}
\DoxyCodeLine{542 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{543 }

\end{DoxyCode}


The documentation for this interface was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
/home/cermak/src/\+M\+O\+M6.\+devrob/src/parameterizations/vertical/M\+O\+M\+\_\+\+A\+L\+E\+\_\+sponge.\+F90\end{DoxyCompactItemize}
