\hypertarget{MOM__ALE_8F90}{}\section{/home/cermak/src/\+M\+O\+M6/src/\+A\+L\+E/\+M\+O\+M\+\_\+\+A\+LE.F90 File Reference}
\label{MOM__ALE_8F90}\index{/home/cermak/src/\+M\+O\+M6/src/\+A\+L\+E/\+M\+O\+M\+\_\+\+A\+L\+E.\+F90@{/home/cermak/src/\+M\+O\+M6/src/\+A\+L\+E/\+M\+O\+M\+\_\+\+A\+L\+E.\+F90}}
{\ttfamily \#include $<$M\+O\+M\+\_\+memory.\+h$>$}\newline
\subsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
type \hyperlink{structmom__ale_1_1ale__cs}{mom\+\_\+ale\+::ale\+\_\+cs}
\begin{DoxyCompactList}\small\item\em A\+LE control structure. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Modules}
\begin{DoxyCompactItemize}
\item 
module \hyperlink{namespacemom__ale}{mom\+\_\+ale}
\begin{DoxyCompactList}\small\item\em This module contains the main regridding routines. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \hyperlink{namespacemom__ale_a7e9593dbe4be5138cb83327df05e1d7b}{mom\+\_\+ale\+::ale\+\_\+init} (param\+\_\+file, GV, US, max\+\_\+depth, CS)
\begin{DoxyCompactList}\small\item\em This routine is typically called (from initialize\+\_\+\+M\+OM in file \hyperlink{MOM_8F90}{M\+O\+M.\+F90}) before the main time integration loop to initialize the regridding stuff. We read the M\+O\+M\+\_\+input file to register the values of different regridding/remapping parameters. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacemom__ale_ac9b603b29f630dc8498e35a0e5c16a53}{mom\+\_\+ale\+::ale\+\_\+register\+\_\+diags} (Time, G, GV, US, diag, CS)
\begin{DoxyCompactList}\small\item\em Initialize diagnostics for the A\+LE module. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacemom__ale_a870a226e28a2cdafad0537d3365d85af}{mom\+\_\+ale\+::adjustgridforintegrity} (CS, G, GV, h)
\begin{DoxyCompactList}\small\item\em Crudely adjust (initial) grid for integrity. This routine is typically called (from initialize\+\_\+\+M\+OM in file \hyperlink{MOM_8F90}{M\+O\+M.\+F90}) before the main time integration loop to initialize the regridding stuff. We read the M\+O\+M\+\_\+input file to register the values of different regridding/remapping parameters. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacemom__ale_a807a4412504e91df4f21e33afe9779f3}{mom\+\_\+ale\+::ale\+\_\+end} (CS)
\begin{DoxyCompactList}\small\item\em End of regridding (memory deallocation). This routine is typically called (from M\+O\+M\+\_\+end in file \hyperlink{MOM_8F90}{M\+O\+M.\+F90}) after the main time integration loop to deallocate the regridding stuff. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacemom__ale_ac56eac14cd9b8909082c1d4fe4e98152}{mom\+\_\+ale\+::ale\+\_\+main} (G, GV, US, h, u, v, tv, Reg, CS, O\+BC, dt, frac\+\_\+shelf\+\_\+h)
\begin{DoxyCompactList}\small\item\em Takes care of (1) building a new grid and (2) remapping all variables between the old grid and the new grid. The creation of the new grid can be based on z coordinates, target interface densities, sigma coordinates or any arbitrary coordinate system. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacemom__ale_a666f48c8fa163fe717e60bd6ed749a75}{mom\+\_\+ale\+::ale\+\_\+main\+\_\+offline} (G, GV, h, tv, Reg, CS, O\+BC, dt)
\begin{DoxyCompactList}\small\item\em Takes care of (1) building a new grid and (2) remapping all variables between the old grid and the new grid. The creation of the new grid can be based on z coordinates, target interface densities, sigma coordinates or any arbitrary coordinate system. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacemom__ale_ae95451e2fbd4805eec01d00bebb268b4}{mom\+\_\+ale\+::ale\+\_\+offline\+\_\+inputs} (CS, G, GV, h, tv, Reg, uhtr, vhtr, Kd, debug, O\+BC)
\begin{DoxyCompactList}\small\item\em Regrid/remap stored fields used for offline tracer integrations. These input fields are assumed to have the same layer thicknesses at the end of the last offline interval (which should be a Zstar grid). This routine builds a grid on the runtime specified vertical coordinate. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacemom__ale_aa7a1311028c2cd514b4b5224c5c7fe17}{mom\+\_\+ale\+::ale\+\_\+offline\+\_\+tracer\+\_\+final} (G, GV, h, tv, h\+\_\+target, Reg, CS, O\+BC)
\begin{DoxyCompactList}\small\item\em Remaps all tracers from h onto h\+\_\+target. This is intended to be called when tracers are done offline. In the case where transports don\textquotesingle{}t quite conserve, we still want to make sure that layer thicknesses offline do not drift too far away from the online model. \end{DoxyCompactList}\item 
subroutine \hyperlink{namespacemom__ale_a9b511a4b61f92b735cef1129dff14bcb}{mom\+\_\+ale\+::check\+\_\+grid} (G, GV, h, threshold)
\begin{DoxyCompactList}\small\item\em Check grid for negative thicknesses. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacemom__ale_ac81ebcd85a340ee69481cffd98848eb1}{mom\+\_\+ale\+::ale\+\_\+build\+\_\+grid} (G, GV, regrid\+CS, remap\+CS, h, tv, debug, frac\+\_\+shelf\+\_\+h)
\begin{DoxyCompactList}\small\item\em Generates new grid. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacemom__ale_a93a3be63e89c22d40356a656790f821f}{mom\+\_\+ale\+::ale\+\_\+regrid\+\_\+accelerated} (CS, G, GV, h, tv, n, u, v, O\+BC, Reg, dt, dz\+Regrid, initial)
\begin{DoxyCompactList}\small\item\em For a state-\/based coordinate, accelerate the process of regridding by repeatedly applying the grid calculation algorithm. \end{DoxyCompactList}\item 
subroutine \hyperlink{namespacemom__ale_a7d3dbcb0719a85ea0a907279fd444539}{mom\+\_\+ale\+::remap\+\_\+all\+\_\+state\+\_\+vars} (C\+S\+\_\+remapping, C\+S\+\_\+\+A\+LE, G, GV, h\+\_\+old, h\+\_\+new, Reg, O\+BC, dx\+Interface, u, v, debug, dt)
\begin{DoxyCompactList}\small\item\em This routine takes care of remapping all variable between the old and the new grids. When velocity components need to be remapped, thicknesses at velocity points are taken to be arithmetic averages of tracer thicknesses. This routine is called during initialization of the model at time=0, to remap initiali conditions to the model grid. It is also called during a time step to update the state. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacemom__ale_a3b5aca0afd3590607919a261b241a185}{mom\+\_\+ale\+::ale\+\_\+remap\+\_\+scalar} (CS, G, GV, nk\+\_\+src, h\+\_\+src, s\+\_\+src, h\+\_\+dst, s\+\_\+dst, all\+\_\+cells, old\+\_\+remap, answers\+\_\+2018)
\begin{DoxyCompactList}\small\item\em Remaps a single scalar between grids described by thicknesses h\+\_\+src and h\+\_\+dst. h\+\_\+dst must be dimensioned as a model array with GVke layers while h\+\_\+src can have an arbitrary number of layers specified by nk\+\_\+src. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacemom__ale_abedb087c760a6ac146735275638db58a}{mom\+\_\+ale\+::ts\+\_\+plm\+\_\+edge\+\_\+values} (CS, S\+\_\+t, S\+\_\+b, T\+\_\+t, T\+\_\+b, G, GV, tv, h, bdry\+\_\+extrap)
\begin{DoxyCompactList}\small\item\em Calculate edge values (top and bottom of layer) for T and S consistent with a P\+LM reconstruction in the vertical direction. Boundary reconstructions are P\+CM unless bdry\+\_\+extrap is true. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacemom__ale_a5b71ef6179d04dda51d124e3a7485909}{mom\+\_\+ale\+::ale\+\_\+plm\+\_\+edge\+\_\+values} (CS, G, GV, h, Q, bdry\+\_\+extrap, Q\+\_\+t, Q\+\_\+b)
\begin{DoxyCompactList}\small\item\em Calculate edge values (top and bottom of layer) 3d scalar array. Boundary reconstructions are P\+CM unless bdry\+\_\+extrap is true. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacemom__ale_a1920c7b1be73d2bf7c5afc29b1b1245b}{mom\+\_\+ale\+::ts\+\_\+ppm\+\_\+edge\+\_\+values} (CS, S\+\_\+t, S\+\_\+b, T\+\_\+t, T\+\_\+b, G, GV, tv, h, bdry\+\_\+extrap)
\begin{DoxyCompactList}\small\item\em Calculate edge values (top and bottom of layer) for T and S consistent with a P\+PM reconstruction in the vertical direction. Boundary reconstructions are P\+CM unless bdry\+\_\+extrap is true. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacemom__ale_a4218c92dc4c2ccb2393f98ec2fa0182a}{mom\+\_\+ale\+::ale\+\_\+initregridding} (GV, US, max\+\_\+depth, param\+\_\+file, mdl, regrid\+CS)
\begin{DoxyCompactList}\small\item\em Initializes regridding for the main A\+LE algorithm. \end{DoxyCompactList}\item 
real function, dimension(cs\%nk+1), public \hyperlink{namespacemom__ale_a761eeb0993d81b0cb168aaebbbb2bc07}{mom\+\_\+ale\+::ale\+\_\+getcoordinate} (CS)
\begin{DoxyCompactList}\small\item\em Query the target coordinate interfaces positions. \end{DoxyCompactList}\item 
character(len=20) function, public \hyperlink{namespacemom__ale_a8c448db5dde525b0571809132bf5e075}{mom\+\_\+ale\+::ale\+\_\+getcoordinateunits} (CS)
\begin{DoxyCompactList}\small\item\em Query the target coordinate units. \end{DoxyCompactList}\item 
logical function, public \hyperlink{namespacemom__ale_a9e4ec7771d6291fc72884796b23922b3}{mom\+\_\+ale\+::ale\+\_\+remap\+\_\+init\+\_\+conds} (CS)
\begin{DoxyCompactList}\small\item\em Returns true if initial conditions should be regridded and remapped. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacemom__ale_aa892ad9bccb3137ea1f662b317be2611}{mom\+\_\+ale\+::ale\+\_\+update\+\_\+regrid\+\_\+weights} (dt, CS)
\begin{DoxyCompactList}\small\item\em Updates the weights for time filtering the new grid generated in regridding. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacemom__ale_a86cb18b00e146a754f09ef6a46cd7878}{mom\+\_\+ale\+::ale\+\_\+updateverticalgridtype} (CS, GV)
\begin{DoxyCompactList}\small\item\em Update the vertical grid type with A\+LE information. This subroutine sets information in the vertical\+Grid\+\_\+type to be consistent with the use of A\+LE mode. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacemom__ale_a8a784e56b0acbcda92f7af471d2c980d}{mom\+\_\+ale\+::ale\+\_\+writecoordinatefile} (CS, GV, directory)
\begin{DoxyCompactList}\small\item\em Write the vertical coordinate information into a file. This subroutine writes out a file containing any available data related to the vertical grid used by the M\+OM ocean model when in A\+LE mode. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacemom__ale_a9fa1d63aa2994e74da912ae87e015c3e}{mom\+\_\+ale\+::ale\+\_\+initthicknesstocoord} (CS, G, GV, h)
\begin{DoxyCompactList}\small\item\em Set h to coordinate values for fixed coordinate systems. \end{DoxyCompactList}\end{DoxyCompactItemize}
