namespace coord_slight

Overview

Regrid columns for the SLight coordinate. More…

namespace coord_slight {

// global functions

subroutine, public init_coord_slight(
    CS CS,
    nk nk,
    ref_pressure ref_pressure,
    target_density target_density,
    interp_CS interp_CS,
    m_to_H m_to_H
    );

subroutine, public end_coord_slight(CS CS);

subroutine, public set_slight_params(
    CS CS,
    max_interface_depths max_interface_depths,
    max_layer_thickness max_layer_thickness,
    min_thickness min_thickness,
    compressibility_fraction compressibility_fraction,
    dz_ml_min dz_ml_min,
    nz_fixed_surface nz_fixed_surface,
    Rho_ML_avg_depth Rho_ML_avg_depth,
    nlay_ML_offset nlay_ML_offset,
    fix_haloclines fix_haloclines,
    halocline_filter_length halocline_filter_length,
    halocline_strat_tol halocline_strat_tol,
    interp_CS interp_CS
    );

subroutine, public build_slight_column(
    CS CS,
    eqn_of_state eqn_of_state,
    H_to_Pa H_to_Pa,
    H_subroundoff H_subroundoff,
    nz nz,
    depth depth,
    h_col h_col,
    T_col T_col,
    S_col S_col,
    p_col p_col,
    z_col z_col,
    z_col_new z_col_new,
    h_neglect h_neglect,
    h_neglect_edge h_neglect_edge
    );

} // namespace coord_slight

Detailed Documentation

Regrid columns for the SLight coordinate.

Global Functions

subroutine, public init_coord_slight(
    CS CS,
    nk nk,
    ref_pressure ref_pressure,
    target_density target_density,
    interp_CS interp_CS,
    m_to_H m_to_H
    )

Initialise a slight_CS with pointers to parameters.

Parameters:

cs

Unassociated pointer to hold the control structure

nk

Number of layers in the grid

ref_pressure

Coordinate reference pressure [Pa]

target_density

Nominal density of interfaces [kg m-3]

interp_cs

Controls for interpolation

m_to_h

A conversion factor from m to the units of thicknesses

subroutine, public end_coord_slight(CS CS)

This subroutine deallocates memory in the control structure for the coord_slight module.

Parameters:

cs

Coordinate control structure

subroutine, public set_slight_params(
    CS CS,
    max_interface_depths max_interface_depths,
    max_layer_thickness max_layer_thickness,
    min_thickness min_thickness,
    compressibility_fraction compressibility_fraction,
    dz_ml_min dz_ml_min,
    nz_fixed_surface nz_fixed_surface,
    Rho_ML_avg_depth Rho_ML_avg_depth,
    nlay_ML_offset nlay_ML_offset,
    fix_haloclines fix_haloclines,
    halocline_filter_length halocline_filter_length,
    halocline_strat_tol halocline_strat_tol,
    interp_CS interp_CS
    )

This subroutine can be used to set the parameters for the coord_slight module.

Parameters:

cs

Coordinate control structure

max_interface_depths

Maximum depths of interfaces [H ~> m or kg m-2]

max_layer_thickness

Maximum thicknesses of layers [H ~> m or kg m-2]

min_thickness

Minimum thickness allowed when building the new grid through regridding [H ~> m or kg m-2]

compressibility_fraction

Fraction (between 0 and 1) of compressibility to add to potential density profiles when interpolating for target grid positions. [nondim]

dz_ml_min

The fixed resolution in the topmost SLight_nkml_min layers [H ~> m or kg m-2]

nz_fixed_surface

The number of fixed-thickness layers at the top of the model

rho_ml_avg_depth

Depth over which to average to determine the mixed layer potential density [H ~> m or kg m-2]

nlay_ml_offset

Number of layers to offset the mixed layer density to find resolved stratification [nondim]

fix_haloclines

If true, detect regions with much weaker than based on in-situ density, and use a stretched coordinate there.

halocline_filter_length

A length scale over which to filter T & S when looking for spuriously unstable water mass profiles [H ~> m or kg m-2].

halocline_strat_tol

A value of the stratification ratio that defines a problematic halocline region [nondim].

interp_cs

Controls for interpolation

subroutine, public build_slight_column(
    CS CS,
    eqn_of_state eqn_of_state,
    H_to_Pa H_to_Pa,
    H_subroundoff H_subroundoff,
    nz nz,
    depth depth,
    h_col h_col,
    T_col T_col,
    S_col S_col,
    p_col p_col,
    z_col z_col,
    z_col_new z_col_new,
    h_neglect h_neglect,
    h_neglect_edge h_neglect_edge
    )

Build a SLight coordinate column.

Parameters:

cs

Coordinate control structure

eqn_of_state

Equation of state structure

h_to_pa

GVH_to_Pa

h_subroundoff

GVH_subroundoff

nz

Number of levels

depth

Depth of ocean bottom (positive [H ~> m or kg m-2])

t_col

T for column

s_col

S for column

h_col

Layer thicknesses [H ~> m or kg m-2]

p_col

Layer quantities

z_col

Interface positions relative to the surface [H ~> m or kg m-2]

z_col_new

Absolute positions of interfaces [H ~> m or kg m-2]

h_neglect

A negligibly small width for the purpose of cell reconstructions [H ~> m or kg m-2].

h_neglect_edge

A negligibly small width for the purpose of edge value calculations [H ~> m or kg m-2].