\hypertarget{namespacemom__pressureforce}{}\doxysection{mom\+\_\+pressureforce Module Reference}
\label{namespacemom__pressureforce}\index{mom\_pressureforce@{mom\_pressureforce}}


\doxysubsection{Detailed Description}
A thin wrapper for Boussinesq/non-\/\+Boussinesq forms of the pressure force calculation. 

This thin module provides a branch to two forms of the horizontal accelerations due to pressure gradients. The two options currently available are a Montgomery potential form (used in traditional isopycnal layer models), and the analytic finite volume form. \doxysubsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
type \mbox{\hyperlink{structmom__pressureforce_1_1pressureforce__cs}{pressureforce\+\_\+cs}}
\begin{DoxyCompactList}\small\item\em Pressure force control structure. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \mbox{\hyperlink{namespacemom__pressureforce_ab8f34ea530e5a436a4d1967a562394bd}{pressureforce}} (h, tv, P\+Fu, P\+Fv, G, GV, US, CS, A\+L\+E\+\_\+\+C\+Sp, p\+\_\+atm, pbce, eta)
\begin{DoxyCompactList}\small\item\em A thin layer between the model and the Boussinesq and non-\/\+Boussinesq pressure force routines. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__pressureforce_a9d4e96b8dd697eb597a7e8376803d1f8}{pressureforce\+\_\+init}} (Time, G, GV, US, param\+\_\+file, diag, CS, tides\+\_\+\+C\+Sp)
\begin{DoxyCompactList}\small\item\em Initialize the pressure force control structure. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__pressureforce_ac5b8f9f89a3a985b7aecf84e3c6ff3d6}{pressureforce\+\_\+end}} (CS)
\begin{DoxyCompactList}\small\item\em Deallocate the pressure force control structure. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacemom__pressureforce_ab8f34ea530e5a436a4d1967a562394bd}\label{namespacemom__pressureforce_ab8f34ea530e5a436a4d1967a562394bd}} 
\index{mom\_pressureforce@{mom\_pressureforce}!pressureforce@{pressureforce}}
\index{pressureforce@{pressureforce}!mom\_pressureforce@{mom\_pressureforce}}
\doxysubsubsection{\texorpdfstring{pressureforce()}{pressureforce()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+pressureforce\+::pressureforce (\begin{DoxyParamCaption}\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed, g \%ke), intent(in)}]{h,  }\item[{type(\mbox{\hyperlink{structmom__variables_1_1thermo__var__ptrs}{thermo\+\_\+var\+\_\+ptrs}}), intent(in)}]{tv,  }\item[{real, dimension( g \%isdb\+: g \%iedb, g \%jsd\+: g \%jed, g \%ke), intent(out)}]{P\+Fu,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsdb\+: g \%jedb, g \%ke), intent(out)}]{P\+Fv,  }\item[{type(\mbox{\hyperlink{structmom__grid_1_1ocean__grid__type}{ocean\+\_\+grid\+\_\+type}}), intent(in)}]{G,  }\item[{type(\mbox{\hyperlink{structmom__verticalgrid_1_1verticalgrid__type}{verticalgrid\+\_\+type}}), intent(in)}]{GV,  }\item[{type(\mbox{\hyperlink{structmom__unit__scaling_1_1unit__scale__type}{unit\+\_\+scale\+\_\+type}}), intent(in)}]{US,  }\item[{type(\mbox{\hyperlink{structmom__pressureforce_1_1pressureforce__cs}{pressureforce\+\_\+cs}}), pointer}]{CS,  }\item[{type(\mbox{\hyperlink{structmom__ale_1_1ale__cs}{ale\+\_\+cs}}), pointer}]{A\+L\+E\+\_\+\+C\+Sp,  }\item[{real, dimension(\+:,\+:), optional, pointer}]{p\+\_\+atm,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed, g \%ke), intent(out), optional}]{pbce,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed), intent(out), optional}]{eta }\end{DoxyParamCaption})}



A thin layer between the model and the Boussinesq and non-\/\+Boussinesq pressure force routines. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em g} & The ocean\textquotesingle{}s grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & The ocean\textquotesingle{}s vertical grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\mbox{\texttt{ in}}  & {\em h} & Layer thicknesses \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em tv} & A structure pointing to various thermodynamic variables \\
\hline
\mbox{\texttt{ out}}  & {\em pfu} & Zonal pressure force acceleration \mbox{[}L T-\/2 $\sim$$>$ m s-\/2\mbox{]} \\
\hline
\mbox{\texttt{ out}}  & {\em pfv} & Meridional pressure force acceleration \mbox{[}L T-\/2 $\sim$$>$ m s-\/2\mbox{]} \\
\hline
 & {\em cs} & Pressure force control structure \\
\hline
 & {\em ale\+\_\+csp} & A\+LE control structure \\
\hline
 & {\em p\+\_\+atm} & The pressure at the ice-\/ocean or \\
\hline
\mbox{\texttt{ out}}  & {\em pbce} & The baroclinic pressure anomaly in each layer \\
\hline
\mbox{\texttt{ out}}  & {\em eta} & The bottom mass used to calculate P\+Fu and P\+Fv, \\
\hline
\end{DoxyParams}


Definition at line 40 of file M\+O\+M\+\_\+\+Pressure\+Force.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{41   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(in)}  :: G\textcolor{comment}{    !< The ocean's grid structure}}
\DoxyCodeLine{42   \textcolor{keywordtype}{type}(verticalGrid\_type), \textcolor{keywordtype}{intent(in)}  :: GV\textcolor{comment}{   !< The ocean's vertical grid structure}}
\DoxyCodeLine{43   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)}  :: US\textcolor{comment}{   !< A dimensional unit scaling type}}
\DoxyCodeLine{44 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{45                            \textcolor{keywordtype}{intent(in)}  :: h\textcolor{comment}{    !< Layer thicknesses [H \string~> m or kg m-\/2]}}
\DoxyCodeLine{46   \textcolor{keywordtype}{type}(thermo\_var\_ptrs),   \textcolor{keywordtype}{intent(in)}  :: tv\textcolor{comment}{   !< A structure pointing to various thermodynamic variables}}
\DoxyCodeLine{47 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZIB\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{48                            \textcolor{keywordtype}{intent(out)} :: PFu\textcolor{comment}{  !< Zonal pressure force acceleration [L T-\/2 \string~> m s-\/2]}}
\DoxyCodeLine{49 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJB\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{50                            \textcolor{keywordtype}{intent(out)} :: PFv\textcolor{comment}{  !< Meridional pressure force acceleration [L T-\/2 \string~> m s-\/2]}}
\DoxyCodeLine{51   \textcolor{keywordtype}{type}(PressureForce\_CS),  \textcolor{keywordtype}{pointer}     :: CS\textcolor{comment}{   !< Pressure force control structure}}
\DoxyCodeLine{52   \textcolor{keywordtype}{type}(ALE\_CS),            \textcolor{keywordtype}{pointer}     :: ALE\_CSp\textcolor{comment}{ !< ALE control structure}}
\DoxyCodeLine{53 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)}, \&}
\DoxyCodeLine{54                  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{pointer}     :: p\_atm\textcolor{comment}{ !< The pressure at the ice-\/ocean or}}
\DoxyCodeLine{55 \textcolor{comment}{                                               !! atmosphere-\/ocean interface [R L2 T-\/2 \string~> Pa].}}
\DoxyCodeLine{56 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{57                  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)} :: pbce\textcolor{comment}{ !< The baroclinic pressure anomaly in each layer}}
\DoxyCodeLine{58 \textcolor{comment}{                                               !! due to eta anomalies [L2 T-\/2 H-\/1 \string~> m s-\/2 or m4 s-\/2 kg-\/1].}}
\DoxyCodeLine{59 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G))}, \&}
\DoxyCodeLine{60                  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)} :: eta\textcolor{comment}{  !< The bottom mass used to calculate PFu and PFv,}}
\DoxyCodeLine{61 \textcolor{comment}{                                               !! [H \string~> m or kg m-\/2], with any tidal contributions.}}
\DoxyCodeLine{62 }
\DoxyCodeLine{63   \textcolor{keywordflow}{if} (cs\%Analytic\_FV\_PGF) \textcolor{keywordflow}{then}}
\DoxyCodeLine{64     \textcolor{keywordflow}{if} (gv\%Boussinesq) \textcolor{keywordflow}{then}}
\DoxyCodeLine{65       \textcolor{keyword}{call }pressureforce\_fv\_bouss(h, tv, pfu, pfv, g, gv, us, cs\%PressureForce\_FV\_CSp, \&}
\DoxyCodeLine{66                                    ale\_csp, p\_atm, pbce, eta)}
\DoxyCodeLine{67     \textcolor{keywordflow}{else}}
\DoxyCodeLine{68       \textcolor{keyword}{call }pressureforce\_fv\_nonbouss(h, tv, pfu, pfv, g, gv, us, cs\%PressureForce\_FV\_CSp, \&}
\DoxyCodeLine{69                                       ale\_csp, p\_atm, pbce, eta)}
\DoxyCodeLine{70 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{71   \textcolor{keywordflow}{else}}
\DoxyCodeLine{72     \textcolor{keywordflow}{if} (gv\%Boussinesq) \textcolor{keywordflow}{then}}
\DoxyCodeLine{73       \textcolor{keyword}{call }pressureforce\_mont\_bouss(h, tv, pfu, pfv, g, gv, us, cs\%PressureForce\_Mont\_CSp, \&}
\DoxyCodeLine{74                                     p\_atm, pbce, eta)}
\DoxyCodeLine{75     \textcolor{keywordflow}{else}}
\DoxyCodeLine{76       \textcolor{keyword}{call }pressureforce\_mont\_nonbouss(h, tv, pfu, pfv, g, gv, us, cs\%PressureForce\_Mont\_CSp, \&}
\DoxyCodeLine{77                                        p\_atm, pbce, eta)}
\DoxyCodeLine{78 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{79 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{80 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__pressureforce_ac5b8f9f89a3a985b7aecf84e3c6ff3d6}\label{namespacemom__pressureforce_ac5b8f9f89a3a985b7aecf84e3c6ff3d6}} 
\index{mom\_pressureforce@{mom\_pressureforce}!pressureforce\_end@{pressureforce\_end}}
\index{pressureforce\_end@{pressureforce\_end}!mom\_pressureforce@{mom\_pressureforce}}
\doxysubsubsection{\texorpdfstring{pressureforce\_end()}{pressureforce\_end()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+pressureforce\+::pressureforce\+\_\+end (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__pressureforce_1_1pressureforce__cs}{pressureforce\+\_\+cs}}), pointer}]{CS }\end{DoxyParamCaption})}



Deallocate the pressure force control structure. 


\begin{DoxyParams}{Parameters}
{\em cs} & Pressure force control structure \\
\hline
\end{DoxyParams}


Definition at line 122 of file M\+O\+M\+\_\+\+Pressure\+Force.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{123   \textcolor{keywordtype}{type}(PressureForce\_CS), \textcolor{keywordtype}{pointer} :: CS\textcolor{comment}{ !< Pressure force control structure}}
\DoxyCodeLine{124 }
\DoxyCodeLine{125   \textcolor{keywordflow}{if} (cs\%Analytic\_FV\_PGF) \textcolor{keywordflow}{then}}
\DoxyCodeLine{126     \textcolor{keyword}{call }pressureforce\_fv\_end(cs\%PressureForce\_FV\_CSp)}
\DoxyCodeLine{127   \textcolor{keywordflow}{else}}
\DoxyCodeLine{128     \textcolor{keyword}{call }pressureforce\_mont\_end(cs\%PressureForce\_Mont\_CSp)}
\DoxyCodeLine{129 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{130 }
\DoxyCodeLine{131   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs)) \textcolor{keyword}{deallocate}(cs)}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__pressureforce_a9d4e96b8dd697eb597a7e8376803d1f8}\label{namespacemom__pressureforce_a9d4e96b8dd697eb597a7e8376803d1f8}} 
\index{mom\_pressureforce@{mom\_pressureforce}!pressureforce\_init@{pressureforce\_init}}
\index{pressureforce\_init@{pressureforce\_init}!mom\_pressureforce@{mom\_pressureforce}}
\doxysubsubsection{\texorpdfstring{pressureforce\_init()}{pressureforce\_init()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+pressureforce\+::pressureforce\+\_\+init (\begin{DoxyParamCaption}\item[{type(time\+\_\+type), intent(in), target}]{Time,  }\item[{type(\mbox{\hyperlink{structmom__grid_1_1ocean__grid__type}{ocean\+\_\+grid\+\_\+type}}), intent(in)}]{G,  }\item[{type(\mbox{\hyperlink{structmom__verticalgrid_1_1verticalgrid__type}{verticalgrid\+\_\+type}}), intent(in)}]{GV,  }\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(inout), target}]{diag,  }\item[{type(\mbox{\hyperlink{structmom__pressureforce_1_1pressureforce__cs}{pressureforce\+\_\+cs}}), pointer}]{CS,  }\item[{type(\mbox{\hyperlink{structmom__tidal__forcing_1_1tidal__forcing__cs}{tidal\+\_\+forcing\+\_\+cs}}), optional, pointer}]{tides\+\_\+\+C\+Sp }\end{DoxyParamCaption})}



Initialize the pressure force control structure. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em time} & Current model time \\
\hline
\mbox{\texttt{ in}}  & {\em g} & Ocean grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & Vertical grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & Parameter file handles \\
\hline
\mbox{\texttt{ in,out}}  & {\em diag} & Diagnostics control structure \\
\hline
 & {\em cs} & Pressure force control structure \\
\hline
 & {\em tides\+\_\+csp} & Tide control structure \\
\hline
\end{DoxyParams}


Definition at line 84 of file M\+O\+M\+\_\+\+Pressure\+Force.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{85   \textcolor{keywordtype}{type}(time\_type), \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(in)}    :: Time\textcolor{comment}{ !< Current model time}}
\DoxyCodeLine{86   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(in)}    :: G\textcolor{comment}{    !< Ocean grid structure}}
\DoxyCodeLine{87   \textcolor{keywordtype}{type}(verticalGrid\_type), \textcolor{keywordtype}{intent(in)}    :: GV\textcolor{comment}{   !< Vertical grid structure}}
\DoxyCodeLine{88   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)}    :: US\textcolor{comment}{   !< A dimensional unit scaling type}}
\DoxyCodeLine{89   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(in)}    :: param\_file\textcolor{comment}{ !< Parameter file handles}}
\DoxyCodeLine{90   \textcolor{keywordtype}{type}(diag\_ctrl), \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(inout)} :: diag\textcolor{comment}{ !< Diagnostics control structure}}
\DoxyCodeLine{91   \textcolor{keywordtype}{type}(PressureForce\_CS),  \textcolor{keywordtype}{pointer}       :: CS\textcolor{comment}{   !< Pressure force control structure}}
\DoxyCodeLine{92   \textcolor{keywordtype}{type}(tidal\_forcing\_CS), \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{pointer} :: tides\_CSp\textcolor{comment}{ !< Tide control structure}}
\DoxyCodeLine{93 \textcolor{preprocessor}{\#include "{}version\_variable.h"{}}}
\DoxyCodeLine{94 \textcolor{preprocessor}{}  \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"{}MOM\_PressureForce"{}} \textcolor{comment}{! This module's name.}}
\DoxyCodeLine{95 }
\DoxyCodeLine{96   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{97     \textcolor{keyword}{call }mom\_error(warning, \textcolor{stringliteral}{"{}PressureForce\_init called with an associated "{}}// \&}
\DoxyCodeLine{98                             \textcolor{stringliteral}{"{}control structure."{}})}
\DoxyCodeLine{99     \textcolor{keywordflow}{return}}
\DoxyCodeLine{100   \textcolor{keywordflow}{else} ; \textcolor{keyword}{allocate}(cs) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{101 }
\DoxyCodeLine{102   \textcolor{comment}{! Read all relevant parameters and write them to the model log.}}
\DoxyCodeLine{103   \textcolor{keyword}{call }log\_version(param\_file, mdl, version, \textcolor{stringliteral}{"{}"{}})}
\DoxyCodeLine{104   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"{}ANALYTIC\_FV\_PGF"{}}, cs\%Analytic\_FV\_PGF, \&}
\DoxyCodeLine{105                  \textcolor{stringliteral}{"{}If true the pressure gradient forces are calculated "{}}//\&}
\DoxyCodeLine{106                  \textcolor{stringliteral}{"{}with a finite volume form that analytically integrates "{}}//\&}
\DoxyCodeLine{107                  \textcolor{stringliteral}{"{}the equations of state in pressure to avoid any "{}}//\&}
\DoxyCodeLine{108                  \textcolor{stringliteral}{"{}possibility of numerical thermobaric instability, as "{}}//\&}
\DoxyCodeLine{109                  \textcolor{stringliteral}{"{}described in Adcroft et al., O. Mod. (2008)."{}}, default=.true.)}
\DoxyCodeLine{110 }
\DoxyCodeLine{111   \textcolor{keywordflow}{if} (cs\%Analytic\_FV\_PGF) \textcolor{keywordflow}{then}}
\DoxyCodeLine{112     \textcolor{keyword}{call }pressureforce\_fv\_init(time, g, gv, us, param\_file, diag, \&}
\DoxyCodeLine{113              cs\%PressureForce\_FV\_CSp, tides\_csp)}
\DoxyCodeLine{114   \textcolor{keywordflow}{else}}
\DoxyCodeLine{115     \textcolor{keyword}{call }pressureforce\_mont\_init(time, g, gv, us, param\_file, diag, \&}
\DoxyCodeLine{116              cs\%PressureForce\_Mont\_CSp, tides\_csp)}
\DoxyCodeLine{117 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{118 }

\end{DoxyCode}
