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


\subsection{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. \subsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
type \hyperlink{structmom__pressureforce_1_1pressureforce__cs}{pressureforce\+\_\+cs}
\begin{DoxyCompactList}\small\item\em Pressure force control structure. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \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 \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 \hyperlink{namespacemom__pressureforce_ac5b8f9f89a3a985b7aecf84e3c6ff3d6}{pressureforce\+\_\+end} (CS)
\begin{DoxyCompactList}\small\item\em Deallocate the pressure force control structure. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{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}}
\subsubsection{\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(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(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{type(\hyperlink{structmom__pressureforce_1_1pressureforce__cs}{pressureforce\+\_\+cs}), pointer}]{CS,  }\item[{type(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{\tt in}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt in}  & {\em gv} & The ocean\textquotesingle{}s vertical grid structure\\
\hline
\mbox{\tt in}  & {\em us} & A dimensional unit scaling type\\
\hline
\mbox{\tt in}  & {\em h} & Layer thicknesses \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}\\
\hline
\mbox{\tt in}  & {\em tv} & A structure pointing to various thermodynamic variables\\
\hline
\mbox{\tt out}  & {\em pfu} & Zonal pressure force acceleration \mbox{[}L T-\/2 $\sim$$>$ m s-\/2\mbox{]}\\
\hline
\mbox{\tt 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{\tt out}  & {\em pbce} & The baroclinic pressure anomaly in each layer\\
\hline
\mbox{\tt out}  & {\em eta} & The bottom mass used to calculate P\+Fu and P\+Fv, \\
\hline
\end{DoxyParams}


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


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


\begin{DoxyCode}
123   \textcolor{keywordtype}{type}(pressureforce\_cs), \textcolor{keywordtype}{pointer} :: cs\textcolor{comment}{ !< Pressure force control structure}
124 
125   \textcolor{keywordflow}{if} (cs%Analytic\_FV\_PGF) \textcolor{keywordflow}{then}
126     \textcolor{keyword}{call }pressureforce\_fv\_end(cs%PressureForce\_FV\_CSp)
127   \textcolor{keywordflow}{else}
128     \textcolor{keyword}{call }pressureforce\_mont\_end(cs%PressureForce\_Mont\_CSp)
129 \textcolor{keywordflow}{  endif}
130 
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}}
\subsubsection{\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(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{type(diag\+\_\+ctrl), intent(inout), target}]{diag,  }\item[{type(\hyperlink{structmom__pressureforce_1_1pressureforce__cs}{pressureforce\+\_\+cs}), pointer}]{CS,  }\item[{type(tidal\+\_\+forcing\+\_\+cs), optional, pointer}]{tides\+\_\+\+C\+Sp }\end{DoxyParamCaption})}



Initialize the pressure force control structure. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em time} & Current model time\\
\hline
\mbox{\tt in}  & {\em g} & Ocean grid structure\\
\hline
\mbox{\tt in}  & {\em gv} & Vertical grid structure\\
\hline
\mbox{\tt in}  & {\em us} & A dimensional unit scaling type\\
\hline
\mbox{\tt in}  & {\em param\+\_\+file} & Parameter file handles\\
\hline
\mbox{\tt 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 85 of file M\+O\+M\+\_\+\+Pressure\+Force.\+F90.


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