mom_meso_sfn_ann module reference
Implements an ANN-based mesoscale streamfunction parameterization for use with isopycnal height diffusion in MOM_thickness_diffuse.
Data Types
Control structure for meso-scale streamfunction ANN parameterization. |
Functions/Subroutines
Compute the ANN-based mesoscale streamfunction on u- and v-points. |
|
Interpolate density gradients from u- and v-points to cell centers. |
|
Interpolate two fields from cell centers to u- and v-points. |
|
Calculates the velocity gradients at the center points in 3D. |
|
Compute density gradients from fixed layer densities and interface heights This is a workaround for running the ANN parameterization in pure layered mode (USE_EOS=False) where calc_isoneutral_slopes won't work. |
|
Initializes the meso-scale streamfunction ANN parameterization. |
|
Finalizes the meso-scale streamfunction ANN parameterization. |
Detailed Description
The network reads a nondimensionalized stencil of density gradients, strain rate components, and relative vorticity, and returns two density flux components at the cell center. The dimensionalization in meso_sfn_ANN_compute (multiplication by rho_grad_mag * vel_grad_mag * areaT * ann_coeff) must match the nondimensionalization used when the network was trained changing one without the other will produce garbage fluxes. The training procedure is the implicit contract.
Density fluxes are converted to a velocity-scale streamfunction Upsilon (Ferrari et al. 2010) by dividing by the local 3-D density gradient magnitude; a configurable clamp acts on Upsilon so the cap is grid-independent. The volume-transport streamfunction passed back to thickness_diffuse is Upsilon * dy_Cu (or dx_Cv), matching MOM6’s Sfn_unlim convention.
Type Documentation
- type mom_meso_sfn_ann/meso_sfn_ann_cs
Control structure for meso-scale streamfunction ANN parameterization.
- Type fields:
% initialized ::
logicalIf true, the module has been initialized.% debug ::
logicalif true, write verbose checksums for debugging purposes.% ann_coeff ::
realCoefficient to multiply the ANN output by.% kappa_smooth ::
realVertical diffusivity used to interpolate more sensible values of T & S into thin layers [H Z T-1 ~> m2 s-1 or kg m-1 s-1].% ann_window ::
integerSize of the window used in the ANN model.% ann_rho_flux ::
type(ann_cs)ANN instance for off-diagonal and diagonal stress.% ann_file_rho_flux ::
character(len=200)Path to netcdf file with ANN.% min_dist_from_boundary ::
realMinimum distance from bottom for valid interface [Z ~> m].% mag_grad_floor ::
realFloor for density gradient magnitude [R Z-1 ~> kg m-4].% flux_clamp ::
realMaximum magnitude of ANN output density flux [R L T-1 ~> kg m-2 s-1].% upsilon_clamp ::
realMaximum magnitude of the velocity-scale streamfunction Upsilon (Ferrari et al. 2010) [L Z T-1 ~> m2 s-1].% diag ::
type(diag_ctrl), pointerstructure used to regulate timing of diagnostics% id_drdx_u ::
integerDiagnostic id for zonal density gradient at u-points.% id_drdy_v ::
integerDiagnostic id for meridional density gradient at v-points.% id_drdz_u ::
integerDiagnostic id for vertical density gradient at u-points.% id_drdz_v ::
integerDiagnostic id for vertical density gradient at v-points.% id_drdx_c ::
integerDiagnostic id for zonal density gradient at center points.% id_drdy_c ::
integerDiagnostic id for meridional density gradient at center points.% id_fx_c ::
integerDiagnostic id for zonal density flux at center points.% id_fy_c ::
integerDiagnostic id for meridional density flux at center points.% id_fx_u ::
integerDiagnostic id for zonal density flux at u-points.% id_fy_v ::
integerDiagnostic id for meridional density flux at v-points.% id_sfn_u ::
integerDiagnostic id for volume streamfunction at u-points.% id_sfn_v ::
integerDiagnostic id for volume streamfunction at v-points.
Function/Subroutine Documentation
- subroutine mom_meso_sfn_ann/meso_sfn_ann_compute(h, e, sfn_u, sfn_v, G, GV, US, tv, CS, dt, u, v)
Compute the ANN-based mesoscale streamfunction on u- and v-points.
Computes density gradients and velocity gradients, feeds them through the ANN to get density fluxes at cell centers, then converts those fluxes into a streamfunction on u- and v-points for use in thickness_diffuse.
- Parameters:
g :: [in] Ocean grid structure
gv :: [in] Vertical grid structure
us :: [in] A dimensional unit scaling type
tv ::
tv[in] Thermodynamics structureh ::
h[in] Layer thickness [Z ~> m or kg m-2]e ::
e[in] Layer thickness [Z ~> m or kg m-2]cs :: [inout] Control structure for thickness_flux_ann
sfn_u ::
sfn_u[out] Mesoscale volume streamfunction on u-points [Z L2 T-1 ~> m3 s-1]sfn_v ::
sfn_v[out] Mesoscale volume streamfunction on v-points [Z L2 T-1 ~> m3 s-1]dt ::
dt[in] Model time step [T ~> s]u ::
u[in] Zonal velocity [L T-1 ~> m s-1].v ::
v[in] Meridional velocity [L T-1 ~> m s-1].
- Call to:
mom_ann::ann_apply_array_siomom_isopycnal_slopes::calc_isoneutral_slopescalc_layered_density_gradientscenter2uvcenter_grad_rhomom_error_handler::mom_errorvel_gradients
- subroutine mom_meso_sfn_ann/center_grad_rho(drdx_u, drdy_v, drdx_c, drdy_c, G, GV, CS)
Interpolate density gradients from u- and v-points to cell centers.
- Parameters:
g :: [in] Ocean grid structure
gv :: [in] Vertical grid structure
cs :: [inout] Control structure for thickness_flux_ann
drdx_u ::
drdx_u[in] Zonal density gradient at u-points [R L-1 ~> kg m-4]drdy_v ::
drdy_v[in] Meridional density gradient at v-points [R L-1 ~> kg m-4]drdx_c ::
drdx_c[inout] Zonal density gradient at center [R L-1 ~> kg m-4]drdy_c ::
drdy_c[inout] Meridional density gradient at center [R L-1 ~> kg m-4]
- Called from:
- subroutine mom_meso_sfn_ann/center2uv(var1_c, var2_c, var1_u, var2_v, G, GV)
Interpolate two fields from cell centers to u- and v-points.
- Parameters:
g :: [in] Ocean grid structure
gv :: [in] Vertical grid structure
var1_c ::
var1_c[in] Variable at center points [arbitrary]var2_c ::
var2_c[in] Variable at center points [arbitrary]var1_u ::
var1_u[inout] Variable at u points [arbitrary]var2_v ::
var2_v[inout] Variable at v points [arbitrary]
- Called from:
- subroutine mom_meso_sfn_ann/vel_gradients(u, v, G, GV, dudx, dudy, dvdx, dvdy, CS)
Calculates the velocity gradients at the center points in 3D.
- Parameters:
g :: [in] Ocean grid structure
gv :: [in] The ocean’s vertical grid structure.
u ::
u[in] The zonal velocity [L T-1 ~> m s-1].v ::
v[in] The meridional velocity [L T-1 ~> m s-1].dudx ::
dudx[out] du/dx [T-1 ~> s-1]dvdy ::
dvdy[out] dv/dy [T-1 ~> s-1]dudy ::
dudy[out] du/dy [T-1 ~> s-1]dvdx ::
dvdx[out] dv/dx [T-1 ~> s-1]cs :: [in] Control structure for thickness_flux_ann
- Called from:
- subroutine mom_meso_sfn_ann/calc_layered_density_gradients(G, GV, US, h, e, drdx_u, drdy_v, drdz_u, drdz_v, halo, min_dist_from_boundary)
Compute density gradients from fixed layer densities and interface heights This is a workaround for running the ANN parameterization in pure layered mode (USE_EOS=False) where calc_isoneutral_slopes won’t work.
- Called from:
- subroutine mom_meso_sfn_ann/meso_sfn_ann_init(Time, G, GV, US, param_file, diag, CS)
Initializes the meso-scale streamfunction ANN parameterization.
- Parameters:
time :: [in] Current model time
g :: [in] Ocean grid structure
gv :: [in] Vertical grid structure
us :: [in] A dimensional unit scaling type
param_file ::
param_file[in] Parameter file handlesdiag ::
diag[inout] Diagnostics control structurecs :: [inout] Control structure for meso sfn ann
- Call to:
mom_ann::ann_initmom_error_handler::mom_errormom_diag_mediator::register_diag_field- Called from:
- subroutine mom_meso_sfn_ann/meso_sfn_ann_end(CS)
Finalizes the meso-scale streamfunction ANN parameterization.
- Parameters:
cs :: [inout] Control structure
- Call to: