\hypertarget{namespacedumbbell__surface__forcing}{}\section{dumbbell\+\_\+surface\+\_\+forcing Module Reference}
\label{namespacedumbbell__surface__forcing}\index{dumbbell\+\_\+surface\+\_\+forcing@{dumbbell\+\_\+surface\+\_\+forcing}}


\subsection{Detailed Description}
Surface forcing for the dumbbell test case. \subsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
type \hyperlink{structdumbbell__surface__forcing_1_1dumbbell__surface__forcing__cs}{dumbbell\+\_\+surface\+\_\+forcing\+\_\+cs}
\begin{DoxyCompactList}\small\item\em Control structure for the dumbbell test case forcing. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \hyperlink{namespacedumbbell__surface__forcing_afe54ddb38a7f5b3fa914cd6abc9865e3}{dumbbell\+\_\+buoyancy\+\_\+forcing} (sfc\+\_\+state, fluxes, day, dt, G, US, CS)
\begin{DoxyCompactList}\small\item\em Surface buoyancy (heat and fresh water) fluxes for the dumbbell test case. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacedumbbell__surface__forcing_ae28ac9160579667217d24e8ac4001cff}{dumbbell\+\_\+dynamic\+\_\+forcing} (sfc\+\_\+state, fluxes, day, dt, G, CS)
\begin{DoxyCompactList}\small\item\em Dynamic forcing for the dumbbell test case. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacedumbbell__surface__forcing_a555241e1be1a78c0f9016012b5cfbbf7}{dumbbell\+\_\+surface\+\_\+forcing\+\_\+init} (Time, G, US, param\+\_\+file, diag, CS)
\begin{DoxyCompactList}\small\item\em Reads and sets up the forcing for the dumbbell test case. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacedumbbell__surface__forcing_afe54ddb38a7f5b3fa914cd6abc9865e3}\label{namespacedumbbell__surface__forcing_afe54ddb38a7f5b3fa914cd6abc9865e3}} 
\index{dumbbell\+\_\+surface\+\_\+forcing@{dumbbell\+\_\+surface\+\_\+forcing}!dumbbell\+\_\+buoyancy\+\_\+forcing@{dumbbell\+\_\+buoyancy\+\_\+forcing}}
\index{dumbbell\+\_\+buoyancy\+\_\+forcing@{dumbbell\+\_\+buoyancy\+\_\+forcing}!dumbbell\+\_\+surface\+\_\+forcing@{dumbbell\+\_\+surface\+\_\+forcing}}
\subsubsection{\texorpdfstring{dumbbell\+\_\+buoyancy\+\_\+forcing()}{dumbbell\_buoyancy\_forcing()}}
{\footnotesize\ttfamily subroutine, public dumbbell\+\_\+surface\+\_\+forcing\+::dumbbell\+\_\+buoyancy\+\_\+forcing (\begin{DoxyParamCaption}\item[{type(surface), intent(inout)}]{sfc\+\_\+state,  }\item[{type(forcing), intent(inout)}]{fluxes,  }\item[{type(time\+\_\+type), intent(in)}]{day,  }\item[{real, intent(in)}]{dt,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{type(\hyperlink{structdumbbell__surface__forcing_1_1dumbbell__surface__forcing__cs}{dumbbell\+\_\+surface\+\_\+forcing\+\_\+cs}), pointer}]{CS }\end{DoxyParamCaption})}



Surface buoyancy (heat and fresh water) fluxes for the dumbbell test case. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in,out}  & {\em sfc\+\_\+state} & A structure containing fields that describe the surface state of the ocean.\\
\hline
\mbox{\tt in,out}  & {\em fluxes} & A structure containing pointers to any possible forcing fields. Unused fields have N\+U\+LL ptrs.\\
\hline
\mbox{\tt in}  & {\em day} & Time of the fluxes.\\
\hline
\mbox{\tt in}  & {\em dt} & The amount of time over which the fluxes apply \mbox{[}s\mbox{]}\\
\hline
\mbox{\tt in}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt in}  & {\em us} & A dimensional unit scaling type\\
\hline
 & {\em cs} & A control structure returned by a previous call to dumbbell\+\_\+surface\+\_\+forcing\+\_\+init \\
\hline
\end{DoxyParams}


Definition at line 49 of file dumbbell\+\_\+surface\+\_\+forcing.\+F90.


\begin{DoxyCode}
49   \textcolor{keywordtype}{type}(surface),                 \textcolor{keywordtype}{intent(inout)} :: sfc\_state\textcolor{comment}{  !< A structure containing fields that}
50 \textcolor{comment}{                                                         !! describe the surface state of the ocean.}
51   \textcolor{keywordtype}{type}(forcing),                 \textcolor{keywordtype}{intent(inout)} :: fluxes\textcolor{comment}{ !< A structure containing pointers to any}
52 \textcolor{comment}{                                                         !! possible forcing fields. Unused fields}
53 \textcolor{comment}{                                                         !! have NULL ptrs.}
54   \textcolor{keywordtype}{type}(time\_type),               \textcolor{keywordtype}{intent(in)}    :: day\textcolor{comment}{    !< Time of the fluxes.}
55   \textcolor{keywordtype}{real},                          \textcolor{keywordtype}{intent(in)}    :: dt\textcolor{comment}{     !< The amount of time over which}
56 \textcolor{comment}{                                                         !! the fluxes apply [s]}
57   \textcolor{keywordtype}{type}(ocean\_grid\_type),         \textcolor{keywordtype}{intent(in)}    :: g\textcolor{comment}{      !< The ocean's grid structure}
58   \textcolor{keywordtype}{type}(unit\_scale\_type),         \textcolor{keywordtype}{intent(in)}    :: us\textcolor{comment}{     !< A dimensional unit scaling type}
59   \textcolor{keywordtype}{type}(dumbbell\_surface\_forcing\_cs),  \textcolor{keywordtype}{pointer}  :: cs\textcolor{comment}{     !< A control structure returned by a previous}
60 \textcolor{comment}{                                                         !! call to dumbbell\_surface\_forcing\_init}
61   \textcolor{comment}{! Local variables}
62   \textcolor{keywordtype}{real} :: temp\_restore   \textcolor{comment}{! The temperature that is being restored toward [degC].}
63   \textcolor{keywordtype}{real} :: salin\_restore  \textcolor{comment}{! The salinity that is being restored toward [ppt].}
64   \textcolor{keywordtype}{integer} :: i, j, is, ie, js, je
65   \textcolor{keywordtype}{integer} :: isd, ied, jsd, jed
66 
67   is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec
68   isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
69 
70 
71   \textcolor{comment}{! Allocate and zero out the forcing arrays, as necessary.}
72   \textcolor{keywordflow}{if} (cs%use\_temperature) \textcolor{keywordflow}{then}
73     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes%evap, isd, ied, jsd, jed)
74     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes%lprec, isd, ied, jsd, jed)
75     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes%fprec, isd, ied, jsd, jed)
76     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes%lrunoff, isd, ied, jsd, jed)
77     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes%frunoff, isd, ied, jsd, jed)
78     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes%vprec, isd, ied, jsd, jed)
79 
80     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes%sw, isd, ied, jsd, jed)
81     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes%lw, isd, ied, jsd, jed)
82     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes%latent, isd, ied, jsd, jed)
83     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes%sens, isd, ied, jsd, jed)
84   \textcolor{keywordflow}{else} \textcolor{comment}{! This is the buoyancy only mode.}
85     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes%buoy, isd, ied, jsd, jed)
86 \textcolor{keywordflow}{  endif}
87 
88 
89   \textcolor{comment}{! MODIFY THE CODE IN THE FOLLOWING LOOPS TO SET THE BUOYANCY FORCING TERMS.}
90 
91   \textcolor{keywordflow}{if} ( cs%use\_temperature ) \textcolor{keywordflow}{then}
92     \textcolor{comment}{! Set whichever fluxes are to be used here.  Any fluxes that}
93     \textcolor{comment}{! are always zero do not need to be changed here.}
94     \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie
95       \textcolor{comment}{! Fluxes of fresh water through the surface are in units of [R Z T-1 ~> kg m-2 s-1]}
96       \textcolor{comment}{! and are positive downward - i.e. evaporation should be negative.}
97       fluxes%evap(i,j) = -0.0 * g%mask2dT(i,j)
98       fluxes%lprec(i,j) = 0.0 * g%mask2dT(i,j)
99 
100       \textcolor{comment}{! vprec will be set later, if it is needed for salinity restoring.}
101       fluxes%vprec(i,j) = 0.0
102 
103       \textcolor{comment}{! Heat fluxes are in units of [Q R Z T-1 ~> W m-2] and are positive into the ocean.}
104       fluxes%lw(i,j) = 0.0 * g%mask2dT(i,j)
105       fluxes%latent(i,j) = 0.0 * g%mask2dT(i,j)
106       fluxes%sens(i,j) = 0.0 * g%mask2dT(i,j)
107       fluxes%sw(i,j) = 0.0 * g%mask2dT(i,j)
108 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}
109   \textcolor{keywordflow}{else} \textcolor{comment}{! This is the buoyancy only mode.}
110     \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie
111       \textcolor{comment}{!   fluxes%buoy is the buoyancy flux into the ocean [L2 T-3 ~> m2 s-3].  A positive}
112       \textcolor{comment}{! buoyancy flux is of the same sign as heating the ocean.}
113       fluxes%buoy(i,j) = 0.0 * g%mask2dT(i,j)
114 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}
115 \textcolor{keywordflow}{  endif}
116 
117   \textcolor{keywordflow}{if} (cs%use\_temperature .and. cs%restorebuoy) \textcolor{keywordflow}{then}
118     \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie
119       \textcolor{keywordflow}{if} (cs%forcing\_mask(i,j)>0.) \textcolor{keywordflow}{then}
120         fluxes%vprec(i,j) = - (g%mask2dT(i,j) * (cs%Rho0*cs%Flux\_const)) * &
121                 ((cs%S\_restore(i,j) - sfc\_state%SSS(i,j)) /  (0.5 * (cs%S\_restore(i,j) + sfc\_state%SSS(i,j)
      )))
122 
123 \textcolor{keywordflow}{      endif}
124 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}
125 \textcolor{keywordflow}{  endif}
126 
\end{DoxyCode}
\mbox{\Hypertarget{namespacedumbbell__surface__forcing_ae28ac9160579667217d24e8ac4001cff}\label{namespacedumbbell__surface__forcing_ae28ac9160579667217d24e8ac4001cff}} 
\index{dumbbell\+\_\+surface\+\_\+forcing@{dumbbell\+\_\+surface\+\_\+forcing}!dumbbell\+\_\+dynamic\+\_\+forcing@{dumbbell\+\_\+dynamic\+\_\+forcing}}
\index{dumbbell\+\_\+dynamic\+\_\+forcing@{dumbbell\+\_\+dynamic\+\_\+forcing}!dumbbell\+\_\+surface\+\_\+forcing@{dumbbell\+\_\+surface\+\_\+forcing}}
\subsubsection{\texorpdfstring{dumbbell\+\_\+dynamic\+\_\+forcing()}{dumbbell\_dynamic\_forcing()}}
{\footnotesize\ttfamily subroutine, public dumbbell\+\_\+surface\+\_\+forcing\+::dumbbell\+\_\+dynamic\+\_\+forcing (\begin{DoxyParamCaption}\item[{type(surface), intent(inout)}]{sfc\+\_\+state,  }\item[{type(forcing), intent(inout)}]{fluxes,  }\item[{type(time\+\_\+type), intent(in)}]{day,  }\item[{real, intent(in)}]{dt,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(\hyperlink{structdumbbell__surface__forcing_1_1dumbbell__surface__forcing__cs}{dumbbell\+\_\+surface\+\_\+forcing\+\_\+cs}), pointer}]{CS }\end{DoxyParamCaption})}



Dynamic forcing for the dumbbell test case. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in,out}  & {\em sfc\+\_\+state} & A structure containing fields that describe the surface state of the ocean.\\
\hline
\mbox{\tt in,out}  & {\em fluxes} & A structure containing pointers to any possible forcing fields. Unused fields have N\+U\+LL ptrs.\\
\hline
\mbox{\tt in}  & {\em day} & Time of the fluxes.\\
\hline
\mbox{\tt in}  & {\em dt} & The amount of time over which the fluxes apply \mbox{[}s\mbox{]}\\
\hline
\mbox{\tt in}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
 & {\em cs} & A control structure returned by a previous call to dumbbell\+\_\+surface\+\_\+forcing\+\_\+init \\
\hline
\end{DoxyParams}


Definition at line 131 of file dumbbell\+\_\+surface\+\_\+forcing.\+F90.


\begin{DoxyCode}
131   \textcolor{keywordtype}{type}(surface),                 \textcolor{keywordtype}{intent(inout)} :: sfc\_state\textcolor{comment}{  !< A structure containing fields that}
132 \textcolor{comment}{                                                       !! describe the surface state of the ocean.}
133   \textcolor{keywordtype}{type}(forcing),                 \textcolor{keywordtype}{intent(inout)} :: fluxes\textcolor{comment}{ !< A structure containing pointers to any}
134 \textcolor{comment}{                                                       !! possible forcing fields. Unused fields}
135 \textcolor{comment}{                                                       !! have NULL ptrs.}
136   \textcolor{keywordtype}{type}(time\_type),               \textcolor{keywordtype}{intent(in)}    :: day\textcolor{comment}{  !< Time of the fluxes.}
137   \textcolor{keywordtype}{real},                          \textcolor{keywordtype}{intent(in)}    :: dt\textcolor{comment}{   !< The amount of time over which}
138 \textcolor{comment}{                                                       !! the fluxes apply [s]}
139   \textcolor{keywordtype}{type}(ocean\_grid\_type),         \textcolor{keywordtype}{intent(in)}    :: g\textcolor{comment}{    !< The ocean's grid structure}
140   \textcolor{keywordtype}{type}(dumbbell\_surface\_forcing\_cs),  \textcolor{keywordtype}{pointer}  :: cs\textcolor{comment}{   !< A control structure returned by a previous}
141 \textcolor{comment}{                                                       !! call to dumbbell\_surface\_forcing\_init}
142   \textcolor{comment}{! Local variables}
143   \textcolor{keywordtype}{integer} :: i, j, is, ie, js, je
144   \textcolor{keywordtype}{integer} :: isd, ied, jsd, jed
145   \textcolor{keywordtype}{integer} :: idays, isecs
146   \textcolor{keywordtype}{real} :: deg\_rad, rdays
147 
148 
149   is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec
150   isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
151 
152   deg\_rad = atan(1.0)*4.0/180.
153 
154   \textcolor{keyword}{call }get\_time(day,isecs,idays)
155   rdays = \textcolor{keywordtype}{real(idays)} + \textcolor{keywordtype}{real}(isecs)/8.64e4
156   \textcolor{comment}{! This could be:  rdays = time\_type\_to\_real(day)/8.64e4}
157 
158   \textcolor{comment}{! Allocate and zero out the forcing arrays, as necessary.}
159   \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes%p\_surf, isd, ied, jsd, jed)
160   \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes%p\_surf\_full, isd, ied, jsd, jed)
161 
162   \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie
163     fluxes%p\_surf(i,j) = cs%forcing\_mask(i,j)* cs%slp\_amplitude * &
164                          g%mask2dT(i,j) * sin(deg\_rad*(rdays/cs%slp\_period))
165     fluxes%p\_surf\_full(i,j) = cs%forcing\_mask(i,j) * cs%slp\_amplitude * &
166                          g%mask2dT(i,j) * sin(deg\_rad*(rdays/cs%slp\_period))
167 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
168 
\end{DoxyCode}
\mbox{\Hypertarget{namespacedumbbell__surface__forcing_a555241e1be1a78c0f9016012b5cfbbf7}\label{namespacedumbbell__surface__forcing_a555241e1be1a78c0f9016012b5cfbbf7}} 
\index{dumbbell\+\_\+surface\+\_\+forcing@{dumbbell\+\_\+surface\+\_\+forcing}!dumbbell\+\_\+surface\+\_\+forcing\+\_\+init@{dumbbell\+\_\+surface\+\_\+forcing\+\_\+init}}
\index{dumbbell\+\_\+surface\+\_\+forcing\+\_\+init@{dumbbell\+\_\+surface\+\_\+forcing\+\_\+init}!dumbbell\+\_\+surface\+\_\+forcing@{dumbbell\+\_\+surface\+\_\+forcing}}
\subsubsection{\texorpdfstring{dumbbell\+\_\+surface\+\_\+forcing\+\_\+init()}{dumbbell\_surface\_forcing\_init()}}
{\footnotesize\ttfamily subroutine, public dumbbell\+\_\+surface\+\_\+forcing\+::dumbbell\+\_\+surface\+\_\+forcing\+\_\+init (\begin{DoxyParamCaption}\item[{type(time\+\_\+type), intent(in)}]{Time,  }\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,  }\item[{type(diag\+\_\+ctrl), intent(in), target}]{diag,  }\item[{type(\hyperlink{structdumbbell__surface__forcing_1_1dumbbell__surface__forcing__cs}{dumbbell\+\_\+surface\+\_\+forcing\+\_\+cs}), pointer}]{CS }\end{DoxyParamCaption})}



Reads and sets up the forcing for the dumbbell test case. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em time} & The current model time.\\
\hline
\mbox{\tt in}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt in}  & {\em us} & A dimensional unit scaling type\\
\hline
\mbox{\tt in}  & {\em param\+\_\+file} & A structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em diag} & A structure that is used to regulate diagnostic output.\\
\hline
 & {\em cs} & A pointer to the control structure for this module \\
\hline
\end{DoxyParams}


Definition at line 173 of file dumbbell\+\_\+surface\+\_\+forcing.\+F90.


\begin{DoxyCode}
173   \textcolor{keywordtype}{type}(time\_type),              \textcolor{keywordtype}{intent(in)} :: time\textcolor{comment}{ !< The current model time.}
174   \textcolor{keywordtype}{type}(ocean\_grid\_type),        \textcolor{keywordtype}{intent(in)} :: g\textcolor{comment}{    !< The ocean's grid structure}
175   \textcolor{keywordtype}{type}(unit\_scale\_type),        \textcolor{keywordtype}{intent(in)} :: us\textcolor{comment}{   !< A dimensional unit scaling type}
176   \textcolor{keywordtype}{type}(param\_file\_type),        \textcolor{keywordtype}{intent(in)} :: param\_file\textcolor{comment}{ !< A structure to parse for run-time parameters}
177   \textcolor{keywordtype}{type}(diag\_ctrl),      \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(in)} :: diag\textcolor{comment}{ !< A structure that is used to}
178 \textcolor{comment}{                                                   !! regulate diagnostic output.}
179   \textcolor{keywordtype}{type}(dumbbell\_surface\_forcing\_cs), &
180                                 \textcolor{keywordtype}{pointer}    :: cs\textcolor{comment}{   !< A pointer to the control structure for this module}
181   \textcolor{comment}{! Local variables}
182   \textcolor{keywordtype}{real} :: s\_surf, s\_range
183   \textcolor{keywordtype}{real} :: x, y
184   \textcolor{keywordtype}{integer} :: i, j
185   \textcolor{keywordtype}{logical} :: dbrotate    \textcolor{comment}{! If true, rotate the domain.}
186 \textcolor{preprocessor}{#include "version\_variable.h"}
187 \textcolor{preprocessor}{}  \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"dumbbell\_surface\_forcing"} \textcolor{comment}{! This module's name.}
188 
189   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{then}
190     \textcolor{keyword}{call }mom\_error(warning, \textcolor{stringliteral}{"dumbbell\_surface\_forcing\_init called with an associated "}// &
191                              \textcolor{stringliteral}{"control structure."})
192     \textcolor{keywordflow}{return}
193 \textcolor{keywordflow}{  endif}
194   \textcolor{keyword}{allocate}(cs)
195   cs%diag => diag
196 
197   \textcolor{comment}{! Read all relevant parameters and write them to the model log.}
198   \textcolor{keyword}{call }log\_version(param\_file, mdl, version, \textcolor{stringliteral}{""})
199   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"ENABLE\_THERMODYNAMICS"}, cs%use\_temperature, &
200                  \textcolor{stringliteral}{"If true, Temperature and salinity are used as state variables."}, default=.true.)
201 
202   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"G\_EARTH"}, cs%G\_Earth, &
203                  \textcolor{stringliteral}{"The gravitational acceleration of the Earth."}, &
204                  units=\textcolor{stringliteral}{"m s-2"}, default = 9.80, scale=us%m\_to\_L**2*us%Z\_to\_m*us%T\_to\_s**2)
205   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"RHO\_0"}, cs%Rho0, &
206                  \textcolor{stringliteral}{"The mean ocean density used with BOUSSINESQ true to "}//&
207                  \textcolor{stringliteral}{"calculate accelerations and the mass for conservation "}//&
208                  \textcolor{stringliteral}{"properties, or with BOUSSINSEQ false to convert some "}//&
209                  \textcolor{stringliteral}{"parameters from vertical units of m to kg m-2."}, &
210                  units=\textcolor{stringliteral}{"kg m-3"}, default=1035.0, scale=us%kg\_m3\_to\_R)
211   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"DUMBBELL\_SLP\_AMP"}, cs%slp\_amplitude, &
212                  \textcolor{stringliteral}{"Amplitude of SLP forcing in reservoirs."}, &
213                  units=\textcolor{stringliteral}{"Pa"}, default = 10000.0, scale=us%kg\_m3\_to\_R*us%m\_s\_to\_L\_T**2)
214   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"DUMBBELL\_SLP\_PERIOD"}, cs%slp\_period, &
215                  \textcolor{stringliteral}{"Periodicity of SLP forcing in reservoirs."}, &
216                  units=\textcolor{stringliteral}{"days"}, default = 1.0)
217   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"DUMBBELL\_ROTATION"}, dbrotate, &
218                 \textcolor{stringliteral}{'Logical for rotation of dumbbell domain.'},&
219                  units=\textcolor{stringliteral}{'nondim'}, default=.false., do\_not\_log=.true.)
220   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"INITIAL\_SSS"}, s\_surf, &
221                  \textcolor{stringliteral}{"Initial surface salinity"}, units=\textcolor{stringliteral}{"1e-3"}, default=34.0, do\_not\_log=.true.)
222   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"INITIAL\_S\_RANGE"}, s\_range, &
223                  \textcolor{stringliteral}{"Initial salinity range (bottom - surface)"}, units=\textcolor{stringliteral}{"1e-3"}, &
224                  default=2., do\_not\_log=.true.)
225 
226   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"RESTOREBUOY"}, cs%restorebuoy, &
227                  \textcolor{stringliteral}{"If true, the buoyancy fluxes drive the model back "}//&
228                  \textcolor{stringliteral}{"toward some specified surface state with a rate "}//&
229                  \textcolor{stringliteral}{"given by FLUXCONST."}, default= .false.)
230   \textcolor{keywordflow}{if} (cs%restorebuoy) \textcolor{keywordflow}{then}
231     \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"FLUXCONST"}, cs%Flux\_const, &
232                  \textcolor{stringliteral}{"The constant that relates the restoring surface fluxes to the relative "}//&
233                  \textcolor{stringliteral}{"surface anomalies (akin to a piston velocity).  Note the non-MKS units."}, &
234                  default=0.0, units=\textcolor{stringliteral}{"m day-1"}, scale=us%m\_to\_Z*us%T\_to\_s)
235     \textcolor{comment}{! Convert CS%Flux\_const from m day-1 to m s-1.}
236     cs%Flux\_const = cs%Flux\_const / 86400.0
237 
238 
239     \textcolor{keyword}{allocate}(cs%forcing\_mask(g%isd:g%ied, g%jsd:g%jed)); cs%forcing\_mask(:,:)=0.0
240     \textcolor{keyword}{allocate}(cs%S\_restore(g%isd:g%ied, g%jsd:g%jed))
241 
242     \textcolor{keywordflow}{do} j=g%jsc,g%jec
243       \textcolor{keywordflow}{do} i=g%isc,g%iec
244         \textcolor{comment}{! Compute normalized zonal coordinates (x,y=0 at center of domain)}
245 \textcolor{comment}{!       x = ( G%geoLonT(i,j) - G%west\_lon ) / G%len\_lon - 0.5}
246 \textcolor{comment}{!       y = ( G%geoLatT(i,j) - G%south\_lat ) / G%len\_lat - 0.5}
247         \textcolor{keywordflow}{if} (dbrotate) \textcolor{keywordflow}{then}
248           \textcolor{comment}{! This is really y in the rotated case}
249           x = ( g%geoLatT(i,j) - g%south\_lat ) / g%len\_lat - 0.5
250         \textcolor{keywordflow}{else}
251           x = ( g%geoLonT(i,j) - g%west\_lon ) / g%len\_lon - 0.5
252 \textcolor{keywordflow}{        endif}
253         cs%forcing\_mask(i,j)=0
254         cs%S\_restore(i,j) = s\_surf
255         \textcolor{keywordflow}{if} ((x>0.25)) \textcolor{keywordflow}{then}
256           cs%forcing\_mask(i,j) = 1
257           cs%S\_restore(i,j) = s\_surf + s\_range
258         \textcolor{keywordflow}{elseif} ((x<-0.25)) \textcolor{keywordflow}{then}
259           cs%forcing\_mask(i,j) = 1
260           cs%S\_restore(i,j) = s\_surf - s\_range
261 \textcolor{keywordflow}{        endif}
262 \textcolor{keywordflow}{      enddo}
263 \textcolor{keywordflow}{    enddo}
264 \textcolor{keywordflow}{  endif}
265 
\end{DoxyCode}
