\hypertarget{namespacebfb__surface__forcing}{}\doxysection{bfb\+\_\+surface\+\_\+forcing Module Reference}
\label{namespacebfb__surface__forcing}\index{bfb\_surface\_forcing@{bfb\_surface\_forcing}}


\doxysubsection{Detailed Description}
Surface forcing for the boundary-\/forced-\/basin (B\+FB) configuration. \doxysubsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
type \mbox{\hyperlink{structbfb__surface__forcing_1_1bfb__surface__forcing__cs}{bfb\+\_\+surface\+\_\+forcing\+\_\+cs}}
\begin{DoxyCompactList}\small\item\em Control structure for B\+F\+B\+\_\+surface\+\_\+forcing. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \mbox{\hyperlink{namespacebfb__surface__forcing_a8d13a88059987a88f3fcb20518360369}{bfb\+\_\+buoyancy\+\_\+forcing}} (sfc\+\_\+state, fluxes, day, dt, G, US, CS)
\begin{DoxyCompactList}\small\item\em Bouyancy forcing for the boundary-\/forced-\/basin (B\+FB) configuration. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacebfb__surface__forcing_aaf77fa8e36d280fa2f3033f38417d7a0}{bfb\+\_\+surface\+\_\+forcing\+\_\+init}} (Time, G, US, param\+\_\+file, diag, CS)
\begin{DoxyCompactList}\small\item\em Initialization for forcing the boundary-\/forced-\/basin (B\+FB) configuration. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacebfb__surface__forcing_a8d13a88059987a88f3fcb20518360369}\label{namespacebfb__surface__forcing_a8d13a88059987a88f3fcb20518360369}} 
\index{bfb\_surface\_forcing@{bfb\_surface\_forcing}!bfb\_buoyancy\_forcing@{bfb\_buoyancy\_forcing}}
\index{bfb\_buoyancy\_forcing@{bfb\_buoyancy\_forcing}!bfb\_surface\_forcing@{bfb\_surface\_forcing}}
\doxysubsubsection{\texorpdfstring{bfb\_buoyancy\_forcing()}{bfb\_buoyancy\_forcing()}}
{\footnotesize\ttfamily subroutine, public bfb\+\_\+surface\+\_\+forcing\+::bfb\+\_\+buoyancy\+\_\+forcing (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__variables_1_1surface}{surface}}), intent(inout)}]{sfc\+\_\+state,  }\item[{type(\mbox{\hyperlink{structmom__forcing__type_1_1forcing}{forcing}}), intent(inout)}]{fluxes,  }\item[{type(time\+\_\+type), intent(in)}]{day,  }\item[{real, intent(in)}]{dt,  }\item[{type(\mbox{\hyperlink{structmom__grid_1_1ocean__grid__type}{ocean\+\_\+grid\+\_\+type}}), intent(in)}]{G,  }\item[{type(\mbox{\hyperlink{structmom__unit__scaling_1_1unit__scale__type}{unit\+\_\+scale\+\_\+type}}), intent(in)}]{US,  }\item[{type(\mbox{\hyperlink{structbfb__surface__forcing_1_1bfb__surface__forcing__cs}{bfb\+\_\+surface\+\_\+forcing\+\_\+cs}}), pointer}]{CS }\end{DoxyParamCaption})}



Bouyancy forcing for the boundary-\/forced-\/basin (B\+FB) configuration. 


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


Definition at line 50 of file B\+F\+B\+\_\+surface\+\_\+forcing.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{51   \textcolor{keywordtype}{type}(surface),                \textcolor{keywordtype}{intent(inout)} :: sfc\_state\textcolor{comment}{  !< A structure containing fields that}}
\DoxyCodeLine{52 \textcolor{comment}{                                                      !! describe the surface state of the ocean.}}
\DoxyCodeLine{53   \textcolor{keywordtype}{type}(forcing),                \textcolor{keywordtype}{intent(inout)} :: fluxes\textcolor{comment}{ !< A structure containing pointers to any}}
\DoxyCodeLine{54 \textcolor{comment}{                                                      !! possible forcing fields. Unused fields}}
\DoxyCodeLine{55 \textcolor{comment}{                                                      !! have NULL ptrs.}}
\DoxyCodeLine{56   \textcolor{keywordtype}{type}(time\_type),              \textcolor{keywordtype}{intent(in)}    :: day\textcolor{comment}{  !< Time of the fluxes.}}
\DoxyCodeLine{57 \textcolor{keywordtype}{  real},                         \textcolor{keywordtype}{intent(in)}    :: dt\textcolor{comment}{   !< The amount of time over which}}
\DoxyCodeLine{58 \textcolor{comment}{                                                      !! the fluxes apply [s]}}
\DoxyCodeLine{59   \textcolor{keywordtype}{type}(ocean\_grid\_type),        \textcolor{keywordtype}{intent(in)}    :: G\textcolor{comment}{    !< The ocean's grid structure}}
\DoxyCodeLine{60   \textcolor{keywordtype}{type}(unit\_scale\_type),        \textcolor{keywordtype}{intent(in)}    :: US\textcolor{comment}{   !< A dimensional unit scaling type}}
\DoxyCodeLine{61   \textcolor{keywordtype}{type}(BFB\_surface\_forcing\_CS), \textcolor{keywordtype}{pointer}       :: CS\textcolor{comment}{   !< A pointer to the control structure}}
\DoxyCodeLine{62 \textcolor{comment}{                                                      !! returned by a previous call to}}
\DoxyCodeLine{63 \textcolor{comment}{                                                      !! BFB\_surface\_forcing\_init.}}
\DoxyCodeLine{64   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{65 \textcolor{keywordtype}{  real} :: Temp\_restore   \textcolor{comment}{! The temperature that is being restored toward [degC].}}
\DoxyCodeLine{66 \textcolor{keywordtype}{  real} :: Salin\_restore  \textcolor{comment}{! The salinity that is being restored toward [ppt].}}
\DoxyCodeLine{67 \textcolor{keywordtype}{  real} :: density\_restore  \textcolor{comment}{! The potential density that is being restored}}
\DoxyCodeLine{68                          \textcolor{comment}{! toward [R \string~> kg m-\/3].}}
\DoxyCodeLine{69 \textcolor{keywordtype}{  real} :: rhoXcp           \textcolor{comment}{! Reference density times heat capacity times unit scaling}}
\DoxyCodeLine{70                            \textcolor{comment}{! factors [Q R degC-\/1 \string~> J m-\/3 degC-\/1]}}
\DoxyCodeLine{71 \textcolor{keywordtype}{  real} :: buoy\_rest\_const  \textcolor{comment}{! A constant relating density anomalies to the}}
\DoxyCodeLine{72                            \textcolor{comment}{! restoring buoyancy flux [L2 T-\/3 R-\/1 \string~> m5 s-\/3 kg-\/1].}}
\DoxyCodeLine{73   \textcolor{keywordtype}{integer} :: i, j, is, ie, js, je}
\DoxyCodeLine{74   \textcolor{keywordtype}{integer} :: isd, ied, jsd, jed}
\DoxyCodeLine{75 }
\DoxyCodeLine{76   is = g\%isc ; ie = g\%iec ; js = g\%jsc ; je = g\%jec}
\DoxyCodeLine{77   isd = g\%isd ; ied = g\%ied ; jsd = g\%jsd ; jed = g\%jed}
\DoxyCodeLine{78 }
\DoxyCodeLine{79   \textcolor{comment}{! Allocate and zero out the forcing arrays, as necessary.  This portion is}}
\DoxyCodeLine{80   \textcolor{comment}{! usually not changed.}}
\DoxyCodeLine{81   \textcolor{keywordflow}{if} (cs\%use\_temperature) \textcolor{keywordflow}{then}}
\DoxyCodeLine{82     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes\%evap, isd, ied, jsd, jed)}
\DoxyCodeLine{83     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes\%lprec, isd, ied, jsd, jed)}
\DoxyCodeLine{84     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes\%fprec, isd, ied, jsd, jed)}
\DoxyCodeLine{85     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes\%lrunoff, isd, ied, jsd, jed)}
\DoxyCodeLine{86     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes\%frunoff, isd, ied, jsd, jed)}
\DoxyCodeLine{87     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes\%vprec, isd, ied, jsd, jed)}
\DoxyCodeLine{88 }
\DoxyCodeLine{89     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes\%sw, isd, ied, jsd, jed)}
\DoxyCodeLine{90     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes\%lw, isd, ied, jsd, jed)}
\DoxyCodeLine{91     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes\%latent, isd, ied, jsd, jed)}
\DoxyCodeLine{92     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes\%sens, isd, ied, jsd, jed)}
\DoxyCodeLine{93   \textcolor{keywordflow}{else} \textcolor{comment}{! This is the buoyancy only mode.}}
\DoxyCodeLine{94     \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes\%buoy, isd, ied, jsd, jed)}
\DoxyCodeLine{95 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{96 }
\DoxyCodeLine{97   \textcolor{keywordflow}{if} ( cs\%use\_temperature ) \textcolor{keywordflow}{then}}
\DoxyCodeLine{98     \textcolor{comment}{! Set whichever fluxes are to be used here.  Any fluxes that}}
\DoxyCodeLine{99     \textcolor{comment}{! are always zero do not need to be changed here.}}
\DoxyCodeLine{100     \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{101       \textcolor{comment}{! Fluxes of fresh water through the surface are in units of [R Z T-\/1 \string~> kg m-\/2 s-\/1]}}
\DoxyCodeLine{102       \textcolor{comment}{! and are positive downward -\/ i.e. evaporation should be negative.}}
\DoxyCodeLine{103       fluxes\%evap(i,j) = -\/0.0 * g\%mask2dT(i,j)}
\DoxyCodeLine{104       fluxes\%lprec(i,j) = 0.0 * g\%mask2dT(i,j)}
\DoxyCodeLine{105 }
\DoxyCodeLine{106       \textcolor{comment}{! vprec will be set later, if it is needed for salinity restoring.}}
\DoxyCodeLine{107       fluxes\%vprec(i,j) = 0.0}
\DoxyCodeLine{108 }
\DoxyCodeLine{109       \textcolor{comment}{! Heat fluxes are in units of [Q R Z T-\/1 \string~> W m-\/2] and are positive into the ocean.}}
\DoxyCodeLine{110       fluxes\%lw(i,j) = 0.0 * g\%mask2dT(i,j)}
\DoxyCodeLine{111       fluxes\%latent(i,j) = 0.0 * g\%mask2dT(i,j)}
\DoxyCodeLine{112       fluxes\%sens(i,j) = 0.0 * g\%mask2dT(i,j)}
\DoxyCodeLine{113       fluxes\%sw(i,j) = 0.0 * g\%mask2dT(i,j)}
\DoxyCodeLine{114 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{115   \textcolor{keywordflow}{else} \textcolor{comment}{! This is the buoyancy only mode.}}
\DoxyCodeLine{116     \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{117       \textcolor{comment}{!   fluxes\%buoy is the buoyancy flux into the ocean [L2 T-\/3 \string~> m2 s-\/3].  A positive}}
\DoxyCodeLine{118       \textcolor{comment}{! buoyancy flux is of the same sign as heating the ocean.}}
\DoxyCodeLine{119       fluxes\%buoy(i,j) = 0.0 * g\%mask2dT(i,j)}
\DoxyCodeLine{120 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{121 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{122 }
\DoxyCodeLine{123   \textcolor{keywordflow}{if} (cs\%restorebuoy) \textcolor{keywordflow}{then}}
\DoxyCodeLine{124     \textcolor{keywordflow}{if} (cs\%use\_temperature) \textcolor{keywordflow}{then}}
\DoxyCodeLine{125       \textcolor{keyword}{call }safe\_alloc\_ptr(fluxes\%heat\_added, isd, ied, jsd, jed)}
\DoxyCodeLine{126       \textcolor{comment}{!   When modifying the code, comment out this error message.  It is here}}
\DoxyCodeLine{127       \textcolor{comment}{! so that the original (unmodified) version is not accidentally used.}}
\DoxyCodeLine{128       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"{}User\_buoyancy\_surface\_forcing: "{}} // \&}
\DoxyCodeLine{129         \textcolor{stringliteral}{"{}Temperature and salinity restoring used without modification."{}} )}
\DoxyCodeLine{130 }
\DoxyCodeLine{131       rhoxcp = cs\%Rho0 * fluxes\%C\_p}
\DoxyCodeLine{132       \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{133         \textcolor{comment}{!   Set Temp\_restore and Salin\_restore to the temperature (in degC) and}}
\DoxyCodeLine{134         \textcolor{comment}{! salinity (in ppt) that are being restored toward.}}
\DoxyCodeLine{135         temp\_restore = 0.0}
\DoxyCodeLine{136         salin\_restore = 0.0}
\DoxyCodeLine{137 }
\DoxyCodeLine{138         fluxes\%heat\_added(i,j) = (g\%mask2dT(i,j) * (rhoxcp * cs\%Flux\_const)) * \&}
\DoxyCodeLine{139             (temp\_restore -\/ sfc\_state\%SST(i,j))}
\DoxyCodeLine{140         fluxes\%vprec(i,j) = -\/ (g\%mask2dT(i,j) * (cs\%Rho0*cs\%Flux\_const)) * \&}
\DoxyCodeLine{141             ((salin\_restore -\/ sfc\_state\%SSS(i,j)) / (0.5 * (salin\_restore + sfc\_state\%SSS(i,j))))}
\DoxyCodeLine{142 \textcolor{keywordflow}{      enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{143     \textcolor{keywordflow}{else}}
\DoxyCodeLine{144       \textcolor{comment}{!   When modifying the code, comment out this error message.  It is here}}
\DoxyCodeLine{145       \textcolor{comment}{! so that the original (unmodified) version is not accidentally used.}}
\DoxyCodeLine{146       \textcolor{comment}{! call MOM\_error(FATAL, "{}User\_buoyancy\_surface\_forcing: "{} // \&}}
\DoxyCodeLine{147       \textcolor{comment}{!   "{}Buoyancy restoring used without modification."{} )}}
\DoxyCodeLine{148 }
\DoxyCodeLine{149       \textcolor{comment}{! The -\/1 is because density has the opposite sign to buoyancy.}}
\DoxyCodeLine{150       buoy\_rest\_const = -\/1.0 * (cs\%G\_Earth * cs\%Flux\_const) / cs\%Rho0}
\DoxyCodeLine{151       temp\_restore = 0.0}
\DoxyCodeLine{152       \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{153        \textcolor{comment}{!   Set density\_restore to an expression for the surface potential}}
\DoxyCodeLine{154        \textcolor{comment}{! density [R \string~> kg m-\/3] that is being restored toward.}}
\DoxyCodeLine{155         \textcolor{keywordflow}{if} (g\%geoLatT(i,j) < cs\%lfrslat) \textcolor{keywordflow}{then}}
\DoxyCodeLine{156             temp\_restore = cs\%SST\_s}
\DoxyCodeLine{157         \textcolor{keywordflow}{elseif} (g\%geoLatT(i,j) > cs\%lfrnlat) \textcolor{keywordflow}{then}}
\DoxyCodeLine{158             temp\_restore = cs\%SST\_n}
\DoxyCodeLine{159         \textcolor{keywordflow}{else}}
\DoxyCodeLine{160             temp\_restore = (cs\%SST\_s -\/ cs\%SST\_n)/(cs\%lfrslat -\/ cs\%lfrnlat) * \&}
\DoxyCodeLine{161                     (g\%geoLatT(i,j) -\/ cs\%lfrslat) + cs\%SST\_s}
\DoxyCodeLine{162 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{163 }
\DoxyCodeLine{164         density\_restore = temp\_restore*cs\%drho\_dt + cs\%Rho0}
\DoxyCodeLine{165 }
\DoxyCodeLine{166         fluxes\%buoy(i,j) = g\%mask2dT(i,j) * buoy\_rest\_const * \&}
\DoxyCodeLine{167                           (density\_restore -\/ sfc\_state\%sfc\_density(i,j))}
\DoxyCodeLine{168 \textcolor{keywordflow}{      enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{169 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{170 \textcolor{keywordflow}{  endif}                                             \textcolor{comment}{! end RESTOREBUOY}}
\DoxyCodeLine{171 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacebfb__surface__forcing_aaf77fa8e36d280fa2f3033f38417d7a0}\label{namespacebfb__surface__forcing_aaf77fa8e36d280fa2f3033f38417d7a0}} 
\index{bfb\_surface\_forcing@{bfb\_surface\_forcing}!bfb\_surface\_forcing\_init@{bfb\_surface\_forcing\_init}}
\index{bfb\_surface\_forcing\_init@{bfb\_surface\_forcing\_init}!bfb\_surface\_forcing@{bfb\_surface\_forcing}}
\doxysubsubsection{\texorpdfstring{bfb\_surface\_forcing\_init()}{bfb\_surface\_forcing\_init()}}
{\footnotesize\ttfamily subroutine, public bfb\+\_\+surface\+\_\+forcing\+::bfb\+\_\+surface\+\_\+forcing\+\_\+init (\begin{DoxyParamCaption}\item[{type(time\+\_\+type), intent(in)}]{Time,  }\item[{type(\mbox{\hyperlink{structmom__grid_1_1ocean__grid__type}{ocean\+\_\+grid\+\_\+type}}), intent(in)}]{G,  }\item[{type(\mbox{\hyperlink{structmom__unit__scaling_1_1unit__scale__type}{unit\+\_\+scale\+\_\+type}}), intent(in)}]{US,  }\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{param\+\_\+file,  }\item[{type(\mbox{\hyperlink{structmom__diag__mediator_1_1diag__ctrl}{diag\+\_\+ctrl}}), intent(in), target}]{diag,  }\item[{type(\mbox{\hyperlink{structbfb__surface__forcing_1_1bfb__surface__forcing__cs}{bfb\+\_\+surface\+\_\+forcing\+\_\+cs}}), pointer}]{CS }\end{DoxyParamCaption})}



Initialization for forcing the boundary-\/forced-\/basin (B\+FB) configuration. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em time} & The current model time. \\
\hline
\mbox{\texttt{ in}}  & {\em g} & The ocean\textquotesingle{}s grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & A structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ 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 175 of file B\+F\+B\+\_\+surface\+\_\+forcing.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{176   \textcolor{keywordtype}{type}(time\_type),              \textcolor{keywordtype}{intent(in)} :: Time\textcolor{comment}{ !< The current model time.}}
\DoxyCodeLine{177   \textcolor{keywordtype}{type}(ocean\_grid\_type),        \textcolor{keywordtype}{intent(in)} :: G\textcolor{comment}{    !< The ocean's grid structure}}
\DoxyCodeLine{178   \textcolor{keywordtype}{type}(unit\_scale\_type),        \textcolor{keywordtype}{intent(in)} :: US\textcolor{comment}{   !< A dimensional unit scaling type}}
\DoxyCodeLine{179   \textcolor{keywordtype}{type}(param\_file\_type),        \textcolor{keywordtype}{intent(in)} :: param\_file\textcolor{comment}{ !< A structure to parse for run-\/time parameters}}
\DoxyCodeLine{180   \textcolor{keywordtype}{type}(diag\_ctrl), \textcolor{keywordtype}{target},      \textcolor{keywordtype}{intent(in)} :: diag\textcolor{comment}{ !< A structure that is used to}}
\DoxyCodeLine{181 \textcolor{comment}{                                                   !! regulate diagnostic output.}}
\DoxyCodeLine{182   \textcolor{keywordtype}{type}(BFB\_surface\_forcing\_CS), \textcolor{keywordtype}{pointer}    :: CS\textcolor{comment}{   !< A pointer to the control structure for this module}}
\DoxyCodeLine{183 \textcolor{comment}{! This include declares and sets the variable "{}version"{}.}}
\DoxyCodeLine{184 \textcolor{preprocessor}{\#include "{}version\_variable.h"{}}}
\DoxyCodeLine{185 \textcolor{preprocessor}{}  \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"{}BFB\_surface\_forcing"{}} \textcolor{comment}{! This module's name.}}
\DoxyCodeLine{186 }
\DoxyCodeLine{187   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{188     \textcolor{keyword}{call }mom\_error(warning, \textcolor{stringliteral}{"{}BFB\_surface\_forcing\_init called with an associated "{}}// \&}
\DoxyCodeLine{189                              \textcolor{stringliteral}{"{}control structure."{}})}
\DoxyCodeLine{190     \textcolor{keywordflow}{return}}
\DoxyCodeLine{191 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{192   \textcolor{keyword}{allocate}(cs)}
\DoxyCodeLine{193   cs\%diag => diag}
\DoxyCodeLine{194 }
\DoxyCodeLine{195   \textcolor{comment}{! Read all relevant parameters and write them to the model log.}}
\DoxyCodeLine{196   \textcolor{keyword}{call }log\_version(param\_file, mdl, version, \textcolor{stringliteral}{"{}"{}})}
\DoxyCodeLine{197   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"{}ENABLE\_THERMODYNAMICS"{}}, cs\%use\_temperature, \&}
\DoxyCodeLine{198                  \textcolor{stringliteral}{"{}If true, Temperature and salinity are used as state variables."{}}, default=.true.)}
\DoxyCodeLine{199 }
\DoxyCodeLine{200   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"{}G\_EARTH"{}}, cs\%G\_Earth, \&}
\DoxyCodeLine{201                  \textcolor{stringliteral}{"{}The gravitational acceleration of the Earth."{}}, \&}
\DoxyCodeLine{202                  units=\textcolor{stringliteral}{"{}m s-\/2"{}}, default = 9.80, scale=us\%m\_to\_L**2*us\%Z\_to\_m*us\%T\_to\_s**2)}
\DoxyCodeLine{203   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"{}RHO\_0"{}}, cs\%Rho0, \&}
\DoxyCodeLine{204                  \textcolor{stringliteral}{"{}The mean ocean density used with BOUSSINESQ true to "{}}//\&}
\DoxyCodeLine{205                  \textcolor{stringliteral}{"{}calculate accelerations and the mass for conservation "{}}//\&}
\DoxyCodeLine{206                  \textcolor{stringliteral}{"{}properties, or with BOUSSINSEQ false to convert some "{}}//\&}
\DoxyCodeLine{207                  \textcolor{stringliteral}{"{}parameters from vertical units of m to kg m-\/2."{}}, \&}
\DoxyCodeLine{208                  units=\textcolor{stringliteral}{"{}kg m-\/3"{}}, default=1035.0, scale=us\%kg\_m3\_to\_R)}
\DoxyCodeLine{209   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"{}LFR\_SLAT"{}}, cs\%lfrslat, \&}
\DoxyCodeLine{210                  \textcolor{stringliteral}{"{}Southern latitude where the linear forcing ramp begins."{}}, \&}
\DoxyCodeLine{211                  units=\textcolor{stringliteral}{"{}degrees"{}}, default=20.0)}
\DoxyCodeLine{212   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"{}LFR\_NLAT"{}}, cs\%lfrnlat, \&}
\DoxyCodeLine{213                  \textcolor{stringliteral}{"{}Northern latitude where the linear forcing ramp ends."{}}, \&}
\DoxyCodeLine{214                  units=\textcolor{stringliteral}{"{}degrees"{}}, default=40.0)}
\DoxyCodeLine{215   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"{}SST\_S"{}}, cs\%SST\_s, \&}
\DoxyCodeLine{216                  \textcolor{stringliteral}{"{}SST at the southern edge of the linear forcing ramp."{}}, \&}
\DoxyCodeLine{217                  units=\textcolor{stringliteral}{"{}C"{}}, default=20.0)}
\DoxyCodeLine{218   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"{}SST\_N"{}}, cs\%SST\_n, \&}
\DoxyCodeLine{219                  \textcolor{stringliteral}{"{}SST at the northern edge of the linear forcing ramp."{}}, \&}
\DoxyCodeLine{220                  units=\textcolor{stringliteral}{"{}C"{}}, default=10.0)}
\DoxyCodeLine{221   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"{}DRHO\_DT"{}}, cs\%drho\_dt, \&}
\DoxyCodeLine{222                  \textcolor{stringliteral}{"{}The rate of change of density with temperature."{}}, \&}
\DoxyCodeLine{223                  units=\textcolor{stringliteral}{"{}kg m-\/3 K-\/1"{}}, default=-\/0.2, scale=us\%kg\_m3\_to\_R)}
\DoxyCodeLine{224   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"{}GUST\_CONST"{}}, cs\%gust\_const, \&}
\DoxyCodeLine{225                  \textcolor{stringliteral}{"{}The background gustiness in the winds."{}}, units=\textcolor{stringliteral}{"{}Pa"{}}, default=0.0)}
\DoxyCodeLine{226 }
\DoxyCodeLine{227   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"{}RESTOREBUOY"{}}, cs\%restorebuoy, \&}
\DoxyCodeLine{228                  \textcolor{stringliteral}{"{}If true, the buoyancy fluxes drive the model back "{}}//\&}
\DoxyCodeLine{229                  \textcolor{stringliteral}{"{}toward some specified surface state with a rate "{}}//\&}
\DoxyCodeLine{230                  \textcolor{stringliteral}{"{}given by FLUXCONST."{}}, default= .false.)}
\DoxyCodeLine{231   \textcolor{keywordflow}{if} (cs\%restorebuoy) \textcolor{keywordflow}{then}}
\DoxyCodeLine{232     \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"{}FLUXCONST"{}}, cs\%Flux\_const, \&}
\DoxyCodeLine{233                  \textcolor{stringliteral}{"{}The constant that relates the restoring surface fluxes to the relative "{}}//\&}
\DoxyCodeLine{234                  \textcolor{stringliteral}{"{}surface anomalies (akin to a piston velocity).  Note the non-\/MKS units."{}}, \&}
\DoxyCodeLine{235                  default=0.0, units=\textcolor{stringliteral}{"{}m day-\/1"{}}, scale=us\%m\_to\_Z*us\%T\_to\_s)}
\DoxyCodeLine{236     \textcolor{comment}{! Convert CS\%Flux\_const from m day-\/1 to m s-\/1.}}
\DoxyCodeLine{237     cs\%Flux\_const = cs\%Flux\_const / 86400.0}
\DoxyCodeLine{238 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{239 }

\end{DoxyCode}
