MOM6
MOM_neutral_diffusion.F90 File Reference
#include <MOM_memory.h>
#include "version_variable.h"
Include dependency graph for MOM_neutral_diffusion.F90:

Go to the source code of this file.

Data Types

type  mom_neutral_diffusion::neutral_diffusion_cs
 The control structure for the MOM_neutral_diffusion module. More...
 

Modules

module  mom_neutral_diffusion
 A column-wise toolbox for implementing neutral diffusion.
 

Functions/Subroutines

logical function, public mom_neutral_diffusion::neutral_diffusion_init (Time, G, param_file, diag, EOS, diabatic_CSp, CS)
 Read parameters and allocate control structure for neutral_diffusion module. More...
 
subroutine, public mom_neutral_diffusion::neutral_diffusion_calc_coeffs (G, GV, US, h, T, S, CS)
 Calculate remapping factors for u/v columns used to map adjoining columns to a shared coordinate space. More...
 
subroutine, public mom_neutral_diffusion::neutral_diffusion (G, GV, h, Coef_x, Coef_y, dt, Reg, US, CS)
 Update tracer concentration due to neutral diffusion; layer thickness unchanged by this update. More...
 
subroutine mom_neutral_diffusion::interface_scalar (nk, h, S, Si, i_method, h_neglect)
 Returns interface scalar, Si, for a column of layer values, S. More...
 
real function mom_neutral_diffusion::ppm_edge (hkm1, hk, hkp1, hkp2, Ak, Akp1, Pk, Pkp1, h_neglect)
 Returns the PPM quasi-fourth order edge value at k+1/2 following equation 1.6 in Colella & Woodward, 1984: JCP 54, 174-201. More...
 
real function mom_neutral_diffusion::ppm_ave (xL, xR, aL, aR, aMean)
 Returns the average of a PPM reconstruction between two fractional positions. More...
 
real function mom_neutral_diffusion::signum (a, x)
 A true signum function that returns either -abs(a), when x<0; or abs(a) when x>0; or 0 when x=0. More...
 
subroutine mom_neutral_diffusion::plm_diff (nk, h, S, c_method, b_method, diff)
 Returns PLM slopes for a column where the slopes are the difference in value across each cell. The limiting follows equation 1.8 in Colella & Woodward, 1984: JCP 54, 174-201. More...
 
real function mom_neutral_diffusion::fv_diff (hkm1, hk, hkp1, Skm1, Sk, Skp1)
 Returns the cell-centered second-order finite volume (unlimited PLM) slope using three consecutive cell widths and average values. Slope is returned as a difference across the central cell (i.e. units of scalar S). Discretization follows equation 1.7 in Colella & Woodward, 1984: JCP 54, 174-201. More...
 
real function mom_neutral_diffusion::fvlsq_slope (hkm1, hk, hkp1, Skm1, Sk, Skp1)
 Returns the cell-centered second-order weighted least squares slope using three consecutive cell widths and average values. Slope is returned as a gradient (i.e. units of scalar S over width units). More...
 
subroutine mom_neutral_diffusion::find_neutral_surface_positions_continuous (nk, Pl, Tl, Sl, dRdTl, dRdSl, Pr, Tr, Sr, dRdTr, dRdSr, PoL, PoR, KoL, KoR, hEff, bl_kl, bl_kr, bl_zl, bl_zr)
 Returns positions within left/right columns of combined interfaces using continuous reconstructions of T/S. More...
 
real function mom_neutral_diffusion::interpolate_for_nondim_position (dRhoNeg, Pneg, dRhoPos, Ppos)
 Returns the non-dimensional position between Pneg and Ppos where the interpolated density difference equals zero. The result is always bounded to be between 0 and 1. More...
 
subroutine mom_neutral_diffusion::find_neutral_surface_positions_discontinuous (CS, nk, Pres_l, hcol_l, Tl, Sl, ppoly_T_l, ppoly_S_l, stable_l, Pres_r, hcol_r, Tr, Sr, ppoly_T_r, ppoly_S_r, stable_r, PoL, PoR, KoL, KoR, hEff, zeta_bot_L, zeta_bot_R, k_bot_L, k_bot_R, hard_fail_heff)
 Higher order version of find_neutral_surface_positions. Returns positions within left/right columns of combined interfaces using intracell reconstructions of T/S. Note that the polynomial reconstrcutions of T and S are optional to aid with unit testing, but will always be passed otherwise. More...
 
subroutine mom_neutral_diffusion::mark_unstable_cells (CS, nk, T, S, P, stable_cell)
 Sweep down through the column and mark as stable if the bottom interface of a cell is denser than the top. More...
 
real function mom_neutral_diffusion::search_other_column (CS, ksurf, pos_last, T_from, S_from, P_from, T_top, S_top, P_top, T_bot, S_bot, P_bot, T_poly, S_poly)
 Searches the "other" (searched) column for the position of the neutral surface. More...
 
subroutine mom_neutral_diffusion::increment_interface (nk, kl, ki, reached_bottom, searching_this_column, searching_other_column)
 Increments the interface which was just connected and also set flags if the bottom is reached. More...
 
real function mom_neutral_diffusion::find_neutral_pos_linear (CS, z0, T_ref, S_ref, P_ref, dRdT_ref, dRdS_ref, P_top, dRdT_top, dRdS_top, P_bot, dRdT_bot, dRdS_bot, ppoly_T, ppoly_S)
 Search a layer to find where delta_rho = 0 based on a linear interpolation of alpha and beta of the top and bottom being searched and polynomial reconstructions of T and S. Compressibility is not needed because either, we are assuming incompressibility in the equation of state for this module or alpha and beta are calculated having been displaced to the average pressures of the two pressures We need Newton's method because the T and S reconstructions make delta_rho a polynomial function of z if using PPM or higher. If Newton's method would search fall out of the interval [0,1], a bisection step would be taken instead. Also this linearization of alpha, beta means that second derivatives of the EOS are not needed. Note that delta in variable names below refers to horizontal differences and 'd' refers to vertical differences. More...
 
real function mom_neutral_diffusion::find_neutral_pos_full (CS, z0, T_ref, S_ref, P_ref, P_top, P_bot, ppoly_T, ppoly_S)
 Use the full equation of state to calculate the difference in locally referenced potential density. The derivatives in this case are not trivial to calculate, so instead we use a regula falsi method. More...
 
subroutine mom_neutral_diffusion::calc_delta_rho_and_derivs (CS, T1, S1, p1_in, T2, S2, p2_in, drho, drdt1_out, drds1_out, drdt2_out, drds2_out)
 Calculate the difference in density between two points in a variety of ways. More...
 
real function mom_neutral_diffusion::delta_rho_from_derivs (T1, S1, P1, dRdT1, dRdS1, T2, S2, P2, dRdT2, dRdS2)
 Calculate delta rho from derivatives and gradients of properties \( \Delta \rho$ = \frac{1}{2}\left[ (\alpha_1 + \alpha_2)*(T_1-T_2) + (\beta_1 + \beta_2)*(S_1-S_2) + (\gamma^{-1}_1 + \gamma%{-1}_2)*(P_1-P_2) \right] \). More...
 
real function mom_neutral_diffusion::absolute_position (n, ns, Pint, Karr, NParr, k_surface)
 Converts non-dimensional position within a layer to absolute position (for debugging) More...
 
real function, dimension(ns) mom_neutral_diffusion::absolute_positions (n, ns, Pint, Karr, NParr)
 Converts non-dimensional positions within layers to absolute positions (for debugging) More...
 
subroutine mom_neutral_diffusion::neutral_surface_flux (nk, nsurf, deg, hl, hr, Tl, Tr, PiL, PiR, KoL, KoR, hEff, Flx, continuous, h_neglect, remap_CS, h_neglect_edge)
 Returns a single column of neutral diffusion fluxes of a tracer. More...
 
subroutine mom_neutral_diffusion::neutral_surface_t_eval (nk, ns, k_sub, Ks, Ps, T_mean, T_int, deg, iMethod, T_poly, T_top, T_bot, T_sub, T_top_int, T_bot_int, T_layer)
 Evaluate various parts of the reconstructions to calculate gradient-based flux limter. More...
 
subroutine mom_neutral_diffusion::ppm_left_right_edge_values (nk, Tl, Ti, aL, aR)
 Discontinuous PPM reconstructions of the left/right edge values within a cell. More...
 
logical function, public mom_neutral_diffusion::neutral_diffusion_unit_tests (verbose)
 Returns true if unit tests of neutral_diffusion functions fail. Otherwise returns false. More...
 
logical function mom_neutral_diffusion::ndiff_unit_tests_continuous (verbose)
 Returns true if unit tests of neutral_diffusion functions fail. Otherwise returns false. More...
 
logical function mom_neutral_diffusion::ndiff_unit_tests_discontinuous (verbose)
 
logical function mom_neutral_diffusion::test_fv_diff (verbose, hkm1, hk, hkp1, Skm1, Sk, Skp1, Ptrue, title)
 Returns true if a test of fv_diff() fails, and conditionally writes results to stream. More...
 
logical function mom_neutral_diffusion::test_fvlsq_slope (verbose, hkm1, hk, hkp1, Skm1, Sk, Skp1, Ptrue, title)
 Returns true if a test of fvlsq_slope() fails, and conditionally writes results to stream. More...
 
logical function mom_neutral_diffusion::test_ifndp (verbose, rhoNeg, Pneg, rhoPos, Ppos, Ptrue, title)
 Returns true if a test of interpolate_for_nondim_position() fails, and conditionally writes results to stream. More...
 
logical function mom_neutral_diffusion::test_data1d (verbose, nk, Po, Ptrue, title)
 Returns true if comparison of Po and Ptrue fails, and conditionally writes results to stream. More...
 
logical function mom_neutral_diffusion::test_data1di (verbose, nk, Po, Ptrue, title)
 Returns true if comparison of Po and Ptrue fails, and conditionally writes results to stream. More...
 
logical function mom_neutral_diffusion::test_nsp (verbose, ns, KoL, KoR, pL, pR, hEff, KoL0, KoR0, pL0, pR0, hEff0, title)
 Returns true if output of find_neutral_surface_positions() does not match correct values, and conditionally writes results to stream. More...
 
logical function mom_neutral_diffusion::compare_nsp_row (KoL, KoR, pL, pR, KoL0, KoR0, pL0, pR0)
 Compares a single row, k, of output from find_neutral_surface_positions() More...
 
logical function mom_neutral_diffusion::test_rnp (expected_pos, test_pos, title)
 Compares output position from refine_nondim_position with an expected value. More...
 
subroutine, public mom_neutral_diffusion::neutral_diffusion_end (CS)
 Deallocates neutral_diffusion control structure. More...
 

Variables

character(len=40) mom_neutral_diffusion::mdl = "MOM_neutral_diffusion"
 module name More...