| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | public, | parameter | :: | CAVITY_CD_ISOMIP | = | 2.5e-3_wp |
ISOMIP+ top drag coefficient |
| integer, | public, | parameter | :: | CAVITY_FW_INVALID | = | 0 |
Unrecognised |
| integer, | public, | parameter | :: | CAVITY_FW_MASS | = | 2 |
Real Boussinesq volume source on the top layer,
|
| integer, | public, | parameter | :: | CAVITY_FW_VIRTUAL | = | 1 |
Fixed column mass; the dilution is emulated by the exact
fixed-mass equivalent salt flux |
| real(kind=wp), | public, | parameter | :: | CAVITY_GAMMA_RATIO_ISOMIP | = | 35.0_wp |
|
| real(kind=wp), | public, | parameter | :: | CAVITY_GAMMA_S_ISOMIP | = | CAVITY_GAMMA_T_ISOMIP/CAVITY_GAMMA_RATIO_ISOMIP |
ISOMIP+ salt-transfer coefficient, |
| real(kind=wp), | public, | parameter | :: | CAVITY_GAMMA_T_ISOMIP | = | 2.2e-2_wp |
ISOMIP+ heat-transfer coefficient |
| integer, | public, | parameter | :: | CAVITY_ICE_ADV_DIFF | = | 2 |
SHIPS. Holland & Jenkins (1999) constant-vertical-advection
+ diffusion in the linearised eq. (31) p. 1794 form, where the
amplification factor is replaced by its asymptote
i.e. the melt flux must additionally warm the incorporated ice
from |
| integer, | public, | parameter | :: | CAVITY_ICE_DIFFUSIVE | = | 3 |
RESERVED. Holland & Jenkins (1999) section 2d(2) eq. (21)
p. 1793, |
| integer, | public, | parameter | :: | CAVITY_ICE_INSULATING | = | 1 |
SHIPS. Perfect insulator, |
| integer, | public, | parameter | :: | CAVITY_ICE_INVALID | = | 0 |
Unrecognised ice-conduction string. |
| integer, | public, | parameter | :: | CAVITY_LAW_BURCHARD22 | = | 8 |
RESERVED. Burchard et al. (2022) resolution-robust log-layer law — the only law in the set that treats the far-field sampling depth as a physical input, and the natural control for a vertical-coordinate study. |
| integer, | public, | parameter | :: | CAVITY_LAW_CONST_GAMMA | = | 1 |
SHIPS. |
| integer, | public, | parameter | :: | CAVITY_LAW_HJ99 | = | 2 |
SHIPS. Holland & Jenkins (1999) eqs. (14)-(18) p. 1792 —
turbulent + molecular sublayer with the McPhee (1981) stability
parameter |
| integer, | public, | parameter | :: | CAVITY_LAW_INVALID | = | 0 |
Unrecognised law string. |
| integer, | public, | parameter | :: | CAVITY_LAW_JENKINS21 | = | 9 |
RESERVED, and probably permanently: Jenkins (2021) is a 1-D
boundary-CURRENT model, not a per-column transfer law. Its only
separable piece is the two-equation constant-Stanton law already
available as |
| integer, | public, | parameter | :: | CAVITY_LAW_JENKINS91 | = | 3 |
RESERVED. Kader & Yaglom smooth-wall form, Holland & Jenkins
(1999) eqs. (11)-(12) p. 1792. Explicit in the melt rate, but it
carries a free boundary-layer thickness |
| integer, | public, | parameter | :: | CAVITY_LAW_MK18 | = | 7 |
RESERVED. McConnochie & Kerr convective floor, reachable only
through Yung et al. (2025) eqs. (10)-(13) p. 5836. It is the
ONLY law that reads the interface state |
| integer, | public, | parameter | :: | CAVITY_LAW_ROSEVEAR22 | = | 5 |
RESERVED. Rosevear, Gayen & Galton-Fenzi (2022) eqs. (27)-(28)
p. 2601. Needs two documented choices the paper does not make
(natural vs base-10 logarithm; behaviour below |
| integer, | public, | parameter | :: | CAVITY_LAW_VT19 | = | 6 |
RESERVED. Vreugdenhil & Taylor (2019) Monin-Obukhov recipe.
Carries a free reference height |
| integer, | public, | parameter | :: | CAVITY_LAW_YUNG25 | = | 4 |
SHIPS. Yung et al. (2025) “StratFeedback”, eqs. (7)-(8)
p. 5832 — two power laws in the viscous Obukhov scale |
| real(kind=wp), | public, | parameter | :: | CAVITY_L_PLUS_NEUTRAL | = | huge(1.0_wp) |
Sentinel for “neutral / unsuppressed”, i.e. the |
| integer, | public, | parameter | :: | CAVITY_MELT_BAD_INPUT | = | 3 |
Finite but outside the solver’s domain: a negative drag or
friction-velocity floor, a negative exchange velocity, a negative
ice salinity, |
| integer, | public, | parameter | :: | CAVITY_MELT_LAW_DOMAIN | = | 9 |
An exchange law was evaluated outside its own domain: a
non-positive logarithm argument, a non-positive |
| integer, | public, | parameter | :: | CAVITY_MELT_LAW_INVALID | = | 7 |
The law / ice-mode code is not one of the enum values at all
(e.g. |
| integer, | public, | parameter | :: | CAVITY_MELT_NONFINITE_INPUT | = | 1 |
An INPUT was NaN or +/-Inf. Every guard fires BEFORE any min/max/clamp, so a non-finite input can never come back out as a plausible clamp bound (the nvfortran relaxed-FP hazard). |
| integer, | public, | parameter | :: | CAVITY_MELT_NONFINITE_STATE | = | 2 |
An INTERMEDIATE went non-finite (overflow in the discriminant, a non-finite root or melt rate) from finite inputs. |
| integer, | public, | parameter | :: | CAVITY_MELT_NOT_CONVERGED | = | 5 |
The outer stratification bisection did not bracket or did not
converge within |
| integer, | public, | parameter | :: | CAVITY_MELT_NOT_IMPLEMENTED | = | 6 |
A RESERVED exchange law or ice-conduction mode — the enum value
exists so the dispatch seam is stable, the physics does not ship
yet. See the per-enum |
| integer, | public, | parameter | :: | CAVITY_MELT_NO_CORIOLIS | = | 8 |
The Holland & Jenkins (1999) law was asked for at |
| integer, | public, | parameter | :: | CAVITY_MELT_NO_PHYSICAL_ROOT | = | 4 |
The quadratic has no admissible root: a negative discriminant
(impossible for a well-posed set, so it is treated as corruption
and never clamped to zero), a fully degenerate |
| integer, | public, | parameter | :: | CAVITY_MELT_OK | = | 0 |
Solved. The outputs are physics. |
| real(kind=wp), | public, | parameter | :: | CAVITY_USTAR_MIN_YUNG25 | = | 1.0e-4_wp |
Friction-velocity floor (m/s) — Yung et al. (2025) eq. (14) p. 5836 with the value from their Table 2 p. 5838. It exists because “a friction velocity of zero (perhaps created by initialising the model at rest) will result in identically zero melt … which would be inconsistent with the presence of heat available for melting” (p. 5836). |
| real(kind=wp), | public, | parameter | :: | CAVITY_U_TIDE_ISOMIP | = | 1.0e-2_wp |
ISOMIP+ RMS tidal velocity |
| integer, | public, | parameter | :: | CAVITY_VC_INVALID | = | 0 |
Unrecognised |
| integer, | public, | parameter | :: | CAVITY_VC_NONE | = | 1 |
No compensation; a closed domain gains the melt volume. |
| integer, | public, | parameter | :: | CAVITY_VC_UNIFORM_OPEN | = | 2 |
Remove the domain-integrated melt volume again, uniformly per unit area over the wet cells the ice does NOT cover. |
| real(kind=wp), | private, | parameter | :: | CAVITY_LP_X_HI | = | 46.051701859880914_wp |
Upper bracket, |
| real(kind=wp), | private, | parameter | :: | CAVITY_LP_X_LO | = | -18.420680743952367_wp |
Lower bracket, |
| real(kind=wp), | private, | parameter | :: | CAVITY_LP_X_TOL | = | 1.0e-13_wp |
Bracket width in |
| integer, | private, | parameter | :: | CAVITY_MAX_ITER | = | 200 |
Hard cap on the outer bisection. A 64.5-wide bracket halved 200
times is far beyond exhausting double precision, so the loop
normally exits on |
| real(kind=wp), | private, | parameter | :: | HJ99_H_NU_COEFF | = | 5.0_wp |
Viscous sublayer thickness |
| real(kind=wp), | private, | parameter | :: | HJ99_MOLE_OFFSET | = | 6.0_wp |
The |
| real(kind=wp), | private, | parameter | :: | HJ99_MOLE_SLOPE | = | 12.5_wp |
|
| real(kind=wp), | private, | parameter | :: | Y25_A_S | = | -4.30_wp |
|
| real(kind=wp), | private, | parameter | :: | Y25_A_T | = | -3.21_wp |
|
| real(kind=wp), | private, | parameter | :: | Y25_GAMMA_S_CC | = | 3.9e-4_wp |
Constant-coefficient cap on |
| real(kind=wp), | private, | parameter | :: | Y25_GAMMA_T_CC | = | 0.012_wp |
Constant-coefficient cap on |
| real(kind=wp), | private, | parameter | :: | Y25_N_S | = | 0.223_wp |
|
| real(kind=wp), | private, | parameter | :: | Y25_N_T | = | 0.322_wp |
|
Thermodynamic + turbulence constants. All SI.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | public | :: | L_f | = | 3.34e5_wp |
Latent heat of fusion (J/kg) — Holland & Jenkins (1999) Table 1 p. 1790; Asay-Davis et al. (2016) Table 4 p. 2483; Yung et al. (2025) Table 1 p. 5832. (Burchard et al. (2022) Table 1 p. 8 uses 3.335e5.) |
|
| real(kind=wp), | public | :: | Pr | = | 13.8_wp |
Molecular Prandtl number — Holland & Jenkins (1999) Table 1 p. 1790, confirmed by McPhee, Maykut & Morison (1987) p. 7029. |
|
| real(kind=wp), | public | :: | R_c | = | 0.20_wp |
Critical flux Richardson number — Holland & Jenkins (1999) Table 1 p. 1790. |
|
| real(kind=wp), | public | :: | Sc | = | 2432.0_wp |
Molecular Schmidt number — same two sources. |
|
| real(kind=wp), | public | :: | alpha_T | = | 3.733e-5_wp |
FRACTIONAL thermal expansion coefficient (1/degC) of the
ISOMIP+ linear EOS — Asay-Davis et al. (2016) Table 4 p. 2483.
Feeds the interfacial buoyancy flux only. NOTE
|
|
| real(kind=wp), | public | :: | beta_S | = | 7.843e-4_wp |
FRACTIONAL haline contraction coefficient (1/(g/kg)) of the ISOMIP+ linear EOS — Asay-Davis et al. (2016) Table 4 p. 2483. |
|
| real(kind=wp), | public | :: | c_i | = | 2009.0_wp |
Specific heat capacity of ice (J/kg/K) — Holland & Jenkins
(1999) Table 1 p. 1790. Read only by |
|
| real(kind=wp), | public | :: | c_w | = | 3974.0_wp |
Specific heat capacity of seawater (J/kg/K) — unanimous across Holland & Jenkins (1999), Jenkins et al. (2010), Asay-Davis et al. (2016) and Yung et al. (2025). |
|
| real(kind=wp), | public | :: | g | = | 9.81_wp |
Gravitational acceleration (m/s^2), as used by the buoyancy flux — Asay-Davis et al. (2016) Table 4 p. 2483. |
|
| real(kind=wp), | public | :: | kappa_vk | = | 0.40_wp |
Von Karman constant — Holland & Jenkins (1999) Table 1
p. 1790. Also the |
|
| real(kind=wp), | public | :: | nu | = | 1.95e-6_wp |
Kinematic viscosity of seawater (m^2/s) — Holland & Jenkins (1999) Table 1 p. 1790. |
|
| real(kind=wp), | public | :: | rho_fw | = | 1000.0_wp |
Freshwater density (kg/m^3), REPORTING ONLY — the density
ISOMIP+ reports its |
|
| real(kind=wp), | public | :: | rho_i | = | 918.0_wp |
Ice density (kg/m^3), REPORTING ONLY — Asay-Davis et al. (2016) p. 2479 and Yung et al. (2025). |
|
| real(kind=wp), | public | :: | rho_w | = | 1028.0_wp |
Seawater density multiplying the turbulent fluxes (kg/m^3) — Asay-Davis et al. (2016) p. 2479. The papers span 1025 (H&J99) to 1030 (Jenkins et al. 2010), a 0.5% spread that lands directly on the melt rate. |
|
| real(kind=wp), | public | :: | xi_N | = | 0.052_wp |
McPhee stability constant |
Exchange-law selector + its parameters. ONE bundle for every
law, so the dispatch is a single select case and a later
do concurrent kernel can call it without reshaping. Members a
given law does not read are ignored.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | public | :: | f_cor | = | -1.4e-4_wp |
Coriolis parameter (1/s) — read by |
|
| real(kind=wp), | public | :: | gamma_s_coeff | = | CAVITY_GAMMA_S_ISOMIP |
Dimensionless |
|
| real(kind=wp), | public | :: | gamma_t_coeff | = | CAVITY_GAMMA_T_ISOMIP |
Dimensionless |
|
| integer, | public | :: | law | = | CAVITY_LAW_CONST_GAMMA |
|
Ice-side conduction selector + its parameter.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | public | :: | T_ice | = | -25.0_wp |
Ice interior / surface temperature (degC), read by
|
|
| integer, | public | :: | mode | = | CAVITY_ICE_INSULATING |
|
Everything cavity_solve_melt returns: the interface state, the
fluxes a coupling seam needs, and the solver diagnostics.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | public | :: | L_obukhov |
Dimensional Obukhov length (m), > 0 stabilising. |
|||
| real(kind=wp), | public | :: | S_b |
Interface salinity (g/kg). |
|||
| real(kind=wp), | public | :: | S_star |
Haline driving |
|||
| real(kind=wp), | public | :: | T_b |
Interface temperature (degC), on the liquidus by construction. |
|||
| real(kind=wp), | public | :: | T_star |
Thermal driving |
|||
| real(kind=wp), | public | :: | b_flux |
Interfacial buoyancy flux (m^2/s^3), < 0 stabilising. |
|||
| logical, | public | :: | converged |
Outer iteration converged (always |
|||
| real(kind=wp), | public | :: | gamma_s |
Salt exchange velocity actually used (m/s). |
|||
| real(kind=wp), | public | :: | gamma_t |
Heat exchange velocity actually used (m/s). |
|||
| real(kind=wp), | public | :: | l_plus |
Viscous Obukhov scale (dimensionless), > 0 stabilising;
|
|||
| real(kind=wp), | public | :: | m_mass |
Canonical melt mass flux (kg/m^2/s of ice), > 0 melting. |
|||
| integer, | public | :: | n_iter |
Outer bisection iterations taken (0 for an explicit law or a destabilising short-circuit). |
|||
| real(kind=wp), | public | :: | q_ice |
Conductive + ice-warming flux interface → ice (W/m^2). |
|||
| real(kind=wp), | public | :: | q_latent |
Latent heat consumed by the phase change (W/m^2). |
|||
| real(kind=wp), | public | :: | q_ocean |
Turbulent heat flux ocean → interface (W/m^2). |
|||
| real(kind=wp), | public | :: | u_star |
Friction velocity the solve was given (m/s). |
Interfacial buoyancy flux B_b (m^2/s^3), NEGATIVE = stabilising
— Yung et al. (2025) eq. (6) p. 5831,
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle — |
||
| real(kind=wp), | intent(in) | :: | T_w |
Far-field temperature (degC). |
||
| real(kind=wp), | intent(in) | :: | S_w |
Far-field salinity (g/kg). |
||
| real(kind=wp), | intent(in) | :: | T_b |
Interface temperature (degC). |
||
| real(kind=wp), | intent(in) | :: | S_b |
Interface salinity (g/kg). |
||
| real(kind=wp), | intent(in) | :: | gamma_t |
Heat exchange velocity (m/s). |
||
| real(kind=wp), | intent(in) | :: | gamma_s |
Salt exchange velocity (m/s). |
Viscous Obukhov scale L+ = L/delta_nu with delta_nu = nu/u*,
i.e. L+ = -u*^4/(nu*kappa*B_b) — Yung et al. (2025) eq. (5)
p. 5831; the same definition in Vreugdenhil & Taylor (2019)
eq. (27) and Rosevear et al. (2022) eqs. (6)+(8) p. 2592.
POSITIVE for melting. Returns CAVITY_L_PLUS_NEUTRAL for a
vanishing buoyancy flux.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle — |
||
| real(kind=wp), | intent(in) | :: | u_star |
Friction velocity (m/s), > 0. |
||
| real(kind=wp), | intent(in) | :: | b_flux |
Interfacial buoyancy flux (m^2/s^3). |
Is this trial L+ the neutral / unsuppressed limit?
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | l_plus |
Viscous Obukhov scale, or |
Solid-ice thickness rate (m/s) from the canonical mass flux,
m_ice = m_mass/rho_i. REPORTING ONLY — this is Jenkins,
Nicholls & Corr (2010)’s a_b convention.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle — |
||
| real(kind=wp), | intent(in) | :: | m_mass |
Melt mass flux (kg/m^2/s). |
Freshwater-equivalent thickness rate (m/s) from the canonical
mass flux, m_weq = m_mass/rho_fw. REPORTING ONLY — this is
ISOMIP+’s m_w (Asay-Davis et al. (2016) eq. (24) p. 2485), the
number their figures are in.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle — |
||
| real(kind=wp), | intent(in) | :: | m_mass |
Melt mass flux (kg/m^2/s). |
Dimensional Obukhov length L = -u*^3/(kappa*B_b) (m), POSITIVE
for a stabilising (melting) buoyancy flux. McPhee, Maykut &
Morison (1987) p. 7029; the same scale appears as Yung et al.
(2025) eq. (5) p. 5831. (Holland & Jenkins (1999) uses L_O in
their eq. (18) but never defines it.)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle — |
||
| real(kind=wp), | intent(in) | :: | u_star |
Friction velocity (m/s), > 0. |
||
| real(kind=wp), | intent(in) | :: | b_flux |
Interfacial buoyancy flux (m^2/s^3). |
Translate an exchange-law string into a CAVITY_LAW_* code.
RESERVED laws parse successfully — the refusal belongs to
cavity_exchange_velocities, which returns
CAVITY_MELT_NOT_IMPLEMENTED — so that a typo
(CAVITY_LAW_INVALID) and an honest request for unwritten
physics stay distinguishable.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
Translate a &ocean_cavity_melt_nml freshwater string into a
CAVITY_FW_* code. The accepted set MIRRORS the nml_enum
registration in register_ocean_cavity_melt — the two lists
move together.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
Translate an ice-conduction string into a CAVITY_ICE_* code.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
Translate a &ocean_cavity_melt_nml volume_compensation string
into a CAVITY_VC_* code. Mirrors the nml_enum list.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
Does this law’s (gamma_t, gamma_s) depend on the interfacial
buoyancy flux — and therefore on the melt rate it produces? Yung
et al. (2025) p. 5833 states the consequence: “Since the transfer
coefficients depend on L+, which in turn depends on melt rate via
surface buoyancy forcing, iteration is required for convergence
of the three-equation parameterisation solution.”
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | law |
|
Outer-iteration residual G(x) = ln(L+_new(x)) - x, with the
destabilising branch folded in: a non-positive, non-finite or
sentinel L+_new means the buoyancy flux at this iterate is
destabilising (or zero), which every law treats as
L+ = +infinity, so G = +infinity. Mapping it that way keeps
the bisection bracket valid instead of taking log() of a
negative number.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | lp_new |
|
||
| real(kind=wp), | intent(in) | :: | x |
The trial |
Ice temperature actually used: exactly zero when the mode ignores
it, so an unset or stale T_ice cannot leak into an insulating
run through L_eff.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_cavity_ice_t), | intent(in) | :: | ice |
Ice-conduction bundle. |
Exchange-velocity dispatch with the Coriolis parameter taken from
the bundle (par%f_cor). Thin wrapper over
cavity_exchange_velocities_f, which holds the dispatch.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_cavity_exchange_t), | intent(in) | :: | par |
Law selector + parameters. |
||
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle. |
||
| real(kind=wp), | intent(in) | :: | u_star |
Friction velocity (m/s), strictly positive. |
||
| real(kind=wp), | intent(in) | :: | l_plus |
Trial viscous Obukhov scale, or |
||
| real(kind=wp), | intent(in) | :: | T_w |
Far-field temperature (degC) — reserved-law argument. |
||
| real(kind=wp), | intent(in) | :: | S_w |
Far-field salinity (g/kg) — reserved-law argument. |
||
| real(kind=wp), | intent(in) | :: | T_b |
Trial interface temperature (degC) — reserved-law argument. |
||
| real(kind=wp), | intent(in) | :: | S_b |
Trial interface salinity (g/kg) — reserved-law argument. |
||
| real(kind=wp), | intent(out) | :: | gamma_t |
Heat exchange velocity (m/s). Zero on any non-OK status. |
||
| real(kind=wp), | intent(out) | :: | gamma_s |
Salt exchange velocity (m/s). Zero on any non-OK status. |
||
| integer, | intent(out) | :: | ierr |
|
The three heat fluxes of (E2), W/m^2:
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | T_w |
Far-field temperature (degC). |
||
| real(kind=wp), | intent(in) | :: | T_b |
Interface temperature (degC). |
||
| real(kind=wp), | intent(in) | :: | m_mass |
Melt mass flux (kg/m^2/s). |
||
| real(kind=wp), | intent(in) | :: | gamma_t |
Heat exchange velocity (m/s). |
||
| type(ocean_cavity_ice_t), | intent(in) | :: | ice |
Ice-conduction bundle. |
||
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle. |
||
| real(kind=wp), | intent(out) | :: | q_ocean |
Turbulent heat flux ocean → interface (W/m^2). |
||
| real(kind=wp), | intent(out) | :: | q_ice |
Conductive + ice-warming flux interface → ice (W/m^2). |
||
| real(kind=wp), | intent(out) | :: | q_latent |
Latent heat consumed by the phase change (W/m^2). |
Data-parallel driver: solve n independent columns.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n |
Number of columns. |
||
| real(kind=wp), | intent(in) | :: | T_w(n) |
Far-field temperature per column (degC). |
||
| real(kind=wp), | intent(in) | :: | S_w(n) |
Far-field salinity per column (g/kg). |
||
| real(kind=wp), | intent(in) | :: | p_b(n) |
Interface pressure per column (Pa). |
||
| real(kind=wp), | intent(in) | :: | u_star(n) |
Friction velocity per column (m/s). |
||
| real(kind=wp), | intent(in) | :: | S_i(n) |
Ice salinity per column (g/kg). |
||
| type(ocean_cavity_exchange_t), | intent(in) | :: | par |
Exchange-law bundle, shared by every column. |
||
| type(ocean_cavity_ice_t), | intent(in) | :: | ice |
Ice-conduction bundle, shared by every column. |
||
| type(eos_t), | intent(in) | :: | eos |
Shared EOS handle — the liquidus. Flat POD, by value. |
||
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle, shared by every column. |
||
| real(kind=wp), | intent(out) | :: | T_b(n) |
Interface temperature per column (degC). |
||
| real(kind=wp), | intent(out) | :: | S_b(n) |
Interface salinity per column (g/kg). |
||
| real(kind=wp), | intent(out) | :: | m_mass(n) |
Melt mass flux per column (kg/m^2/s), > 0 melting. |
||
| real(kind=wp), | intent(out) | :: | q_ocean(n) |
Ocean -> interface heat flux per column (W/m^2). |
||
| integer, | intent(out) | :: | ierr_col(n) |
|
Masked 2-D driver: form the friction velocity and solve the
interface on every ICE-COVERED column of an (nx, ny) plane,
leaving the rest untouched at exactly zero.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nx |
First dimension (ghosts included — the caller decides). |
||
| integer, | intent(in) | :: | ny |
Second dimension. |
||
| real(kind=wp), | intent(in) | :: | cover(nx,ny) |
Ice-cover mask; a column is solved iff |
||
| real(kind=wp), | intent(in) | :: | T_w(nx,ny) |
Far-field temperature (degC). |
||
| real(kind=wp), | intent(in) | :: | S_w(nx,ny) |
Far-field salinity (g/kg). |
||
| real(kind=wp), | intent(in) | :: | p_b(nx,ny) |
Interface pressure (Pa) — |
||
| real(kind=wp), | intent(in) | :: | u_far(nx,ny) |
Far-field x velocity at the CELL CENTRE (m/s). |
||
| real(kind=wp), | intent(in) | :: | v_far(nx,ny) |
Far-field y velocity at the CELL CENTRE (m/s). |
||
| real(kind=wp), | intent(in) | :: | S_i |
Ice salinity (g/kg), >= 0; one scalar for the whole plane. |
||
| real(kind=wp), | intent(in) | :: | f_cor(nx,ny) |
Coriolis parameter (1/s) per column; read by |
||
| real(kind=wp), | intent(in) | :: | cd |
Top drag coefficient for the MELT friction velocity. |
||
| real(kind=wp), | intent(in) | :: | u_tide |
RMS tidal velocity (m/s); melt |
||
| real(kind=wp), | intent(in) | :: | ustar_min |
Friction-velocity floor (m/s). |
||
| type(ocean_cavity_exchange_t), | intent(in) | :: | par |
Exchange-law bundle; its |
||
| type(ocean_cavity_ice_t), | intent(in) | :: | ice |
Ice-conduction bundle, shared by every column. |
||
| type(eos_t), | intent(in) | :: | eos |
Shared EOS handle — the liquidus. Flat POD, by value. |
||
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle, shared by every column. |
||
| real(kind=wp), | intent(out) | :: | u_star(nx,ny) |
Friction velocity (m/s); 0 where uncovered or refused. |
||
| real(kind=wp), | intent(out) | :: | T_b(nx,ny) |
Interface temperature (degC); 0 where uncovered. |
||
| real(kind=wp), | intent(out) | :: | S_b(nx,ny) |
Interface salinity (g/kg); 0 where uncovered. |
||
| real(kind=wp), | intent(out) | :: | m_mass(nx,ny) |
Melt mass flux (kg/m^2/s), > 0 melting; 0 where uncovered. |
||
| real(kind=wp), | intent(out) | :: | q_ocean(nx,ny) |
Ocean -> interface heat flux (W/m^2); 0 where uncovered. |
||
| real(kind=wp), | intent(out) | :: | gamma_t(nx,ny) |
Thermal exchange velocity (m/s) of each column’s converged solve; EXACTLY zero where the column is not solved. |
||
| real(kind=wp), | intent(out) | :: | gamma_s(nx,ny) |
Haline exchange velocity (m/s), same convention. |
||
| integer, | intent(out) | :: | ierr_col(nx,ny) |
|
Scalar entry point returning only what a coupling seam consumes:
the interface state, the canonical melt mass flux and the ocean
-> interface heat flux. A thin wrapper over cavity_solve_melt
that keeps the solution BUNDLE inside the callee, so a
do concurrent over columns needs no derived-type local(...)
clause at all — each iteration writes its own array elements.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | T_w |
Far-field temperature (degC). |
||
| real(kind=wp), | intent(in) | :: | S_w |
Far-field salinity (g/kg). |
||
| real(kind=wp), | intent(in) | :: | p_b |
Interface pressure (Pa). |
||
| real(kind=wp), | intent(in) | :: | u_star |
Friction velocity (m/s). |
||
| real(kind=wp), | intent(in) | :: | S_i |
Ice salinity (g/kg). |
||
| type(ocean_cavity_exchange_t), | intent(in) | :: | par |
Exchange-law bundle. |
||
| type(ocean_cavity_ice_t), | intent(in) | :: | ice |
Ice-conduction bundle. |
||
| type(eos_t), | intent(in) | :: | eos |
Shared EOS handle — the liquidus. |
||
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle. |
||
| real(kind=wp), | intent(out) | :: | T_b |
Interface temperature (degC). |
||
| real(kind=wp), | intent(out) | :: | S_b |
Interface salinity (g/kg). |
||
| real(kind=wp), | intent(out) | :: | m_mass |
Melt mass flux (kg/m^2/s), > 0 melting; EXACTLY zero on any non-OK status. |
||
| real(kind=wp), | intent(out) | :: | q_ocean |
Turbulent heat flux ocean -> interface (W/m^2). |
||
| integer, | intent(out) | :: | ierr |
|
cavity_melt_point plus the two EXCHANGE VELOCITIES the solve
converged on.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | T_w |
Far-field temperature (degC). |
||
| real(kind=wp), | intent(in) | :: | S_w |
Far-field salinity (g/kg). |
||
| real(kind=wp), | intent(in) | :: | p_b |
Interface pressure (Pa). |
||
| real(kind=wp), | intent(in) | :: | u_star |
Friction velocity (m/s). |
||
| real(kind=wp), | intent(in) | :: | S_i |
Ice salinity (g/kg). |
||
| type(ocean_cavity_exchange_t), | intent(in) | :: | par |
Exchange-law bundle. |
||
| type(ocean_cavity_ice_t), | intent(in) | :: | ice |
Ice-conduction bundle. |
||
| type(eos_t), | intent(in) | :: | eos |
Shared EOS handle — the liquidus. |
||
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle. |
||
| real(kind=wp), | intent(out) | :: | T_b |
Interface temperature (degC). |
||
| real(kind=wp), | intent(out) | :: | S_b |
Interface salinity (g/kg). |
||
| real(kind=wp), | intent(out) | :: | m_mass |
Melt mass flux (kg/m^2/s), > 0 melting. |
||
| real(kind=wp), | intent(out) | :: | q_ocean |
Turbulent heat flux ocean -> interface (W/m^2). |
||
| real(kind=wp), | intent(out) | :: | gamma_t |
Thermal exchange velocity (m/s) of the converged solve. |
||
| real(kind=wp), | intent(out) | :: | gamma_s |
Haline exchange velocity (m/s) of the converged solve. |
||
| integer, | intent(out) | :: | ierr |
|
The two sides of (E3), in (g/kg)*kg/m^2/s:
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle — |
||
| real(kind=wp), | intent(in) | :: | S_w |
Far-field salinity (g/kg). |
||
| real(kind=wp), | intent(in) | :: | S_b |
Interface salinity (g/kg). |
||
| real(kind=wp), | intent(in) | :: | m_mass |
Melt mass flux (kg/m^2/s). |
||
| real(kind=wp), | intent(in) | :: | gamma_s |
Salt exchange velocity (m/s). |
||
| real(kind=wp), | intent(in) | :: | S_i |
Ice salinity (g/kg). |
||
| real(kind=wp), | intent(out) | :: | f_turb |
Turbulent salt flux toward the interface. |
||
| real(kind=wp), | intent(out) | :: | f_phase |
Phase-change salt flux. |
cavity_solve_melt_f with the Coriolis parameter taken from the
bundle (par%f_cor) — the scalar entry point every host caller
and the kernel suite use.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | T_w |
Far-field temperature (degC). |
||
| real(kind=wp), | intent(in) | :: | S_w |
Far-field salinity (g/kg). Must exceed |
||
| real(kind=wp), | intent(in) | :: | p_b |
Interface pressure (Pa). |
||
| real(kind=wp), | intent(in) | :: | u_star |
Friction velocity (m/s), strictly positive — from
|
||
| real(kind=wp), | intent(in) | :: | S_i |
Ice salinity (g/kg), >= 0. |
||
| type(ocean_cavity_exchange_t), | intent(in) | :: | par |
Exchange-law bundle. |
||
| type(ocean_cavity_ice_t), | intent(in) | :: | ice |
Ice-conduction bundle. |
||
| type(eos_t), | intent(in) | :: | eos |
Shared EOS handle — the liquidus. |
||
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle. |
||
| type(ocean_cavity_solution_t), | intent(out) | :: | sol |
Interface state, fluxes and solver diagnostics. On any non-OK
status this carries the safe state ( |
||
| integer, | intent(out) | :: | ierr |
|
Closed-form solve of (E1)-(E3) on the linear liquidus carried by
eos. Returns the interface state and the canonical melt mass
flux (kg/m^2/s, > 0 melting). See the derivation block above for
the root selection, the cancellation-safe quadratic and the
pre-solve melt/freeze branch.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | T_w |
Far-field temperature (degC). |
||
| real(kind=wp), | intent(in) | :: | S_w |
Far-field salinity (g/kg). Must exceed |
||
| real(kind=wp), | intent(in) | :: | p_b |
Interface pressure (Pa) — |
||
| real(kind=wp), | intent(in) | :: | gamma_t |
Heat exchange velocity (m/s), >= 0. |
||
| real(kind=wp), | intent(in) | :: | gamma_s |
Salt exchange velocity (m/s), > 0. |
||
| real(kind=wp), | intent(in) | :: | S_i |
Ice salinity (g/kg), >= 0. Holland & Jenkins (1999) p. 1789
treats marine ice as fresh (“we can treat S_I as zero
always”); the argument is kept because the root-bracketing
proof is stated for general |
||
| type(ocean_cavity_ice_t), | intent(in) | :: | ice |
Ice-conduction bundle. |
||
| type(eos_t), | intent(in) | :: | eos |
Shared EOS handle — the liquidus. By value, flat POD. |
||
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle. |
||
| real(kind=wp), | intent(out) | :: | T_b |
Interface temperature (degC). |
||
| real(kind=wp), | intent(out) | :: | S_b |
Interface salinity (g/kg). |
||
| real(kind=wp), | intent(out) | :: | m_mass |
Melt mass flux (kg/m^2/s), > 0 melting. |
||
| integer, | intent(out) | :: | ierr |
|
Two-equation variant: the interface salinity is the FAR-FIELD
salinity, S_b = S_w exactly, i.e. the gamma_s -> infinity
limit of the three-equation form (NOT the gamma_s -> 0 limit,
which sends T_b -> T_w and the melt rate to zero). Holland &
Jenkins (1999) section 2b(2) p. 1791; Jenkins, Nicholls & Corr
(2010) eq. (6) p. 2302, where the single transfer coefficient is
Gamma_TS ~ 0.006 and the freezing point is evaluated at the
far-field salinity.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | T_w |
Far-field temperature (degC). |
||
| real(kind=wp), | intent(in) | :: | S_w |
Far-field salinity (g/kg). |
||
| real(kind=wp), | intent(in) | :: | p_b |
Interface pressure (Pa). |
||
| real(kind=wp), | intent(in) | :: | gamma_t |
Heat exchange velocity (m/s), >= 0. |
||
| type(ocean_cavity_ice_t), | intent(in) | :: | ice |
Ice-conduction bundle. |
||
| type(eos_t), | intent(in) | :: | eos |
Shared EOS handle — the liquidus. |
||
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle. |
||
| real(kind=wp), | intent(out) | :: | T_b |
Interface temperature (degC) = |
||
| real(kind=wp), | intent(out) | :: | S_b |
Interface salinity (g/kg) = |
||
| real(kind=wp), | intent(out) | :: | m_mass |
Melt mass flux (kg/m^2/s), > 0 melting. |
||
| integer, | intent(out) | :: | ierr |
|
Interface friction velocity (m/s),
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | u |
Far-field velocity component (m/s). |
||
| real(kind=wp), | intent(in) | :: | v |
Far-field velocity component (m/s). |
||
| real(kind=wp), | intent(in) | :: | cd |
Top drag coefficient (dimensionless), >= 0. |
||
| real(kind=wp), | intent(in) | :: | u_tide |
RMS tidal velocity (m/s), >= 0 by squaring. |
||
| real(kind=wp), | intent(in) | :: | ustar_min |
Friction-velocity floor (m/s), >= 0. |
||
| real(kind=wp), | intent(out) | :: | u_star |
Friction velocity (m/s). Exactly zero on any non-OK status. |
||
| integer, | intent(out) | :: | ierr |
|
Exchange-velocity dispatch — ONE argument list for every law, so
a later do concurrent kernel dispatches with a single
select case and no reshaping. l_plus is the viscous Obukhov
scale of the CURRENT iterate: the single scalar that carries the
stratification feedback for every implicit law. Pass
CAVITY_L_PLUS_NEUTRAL for the neutral / unsuppressed
evaluation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_cavity_exchange_t), | intent(in) | :: | par |
Law selector + parameters (its |
||
| real(kind=wp), | intent(in) | :: | f_cor |
Coriolis parameter (1/s) for this column; |
||
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle. |
||
| real(kind=wp), | intent(in) | :: | u_star |
Friction velocity (m/s), strictly positive. |
||
| real(kind=wp), | intent(in) | :: | l_plus |
Trial viscous Obukhov scale, or |
||
| real(kind=wp), | intent(in) | :: | T_w |
Far-field temperature (degC) — reserved-law argument. |
||
| real(kind=wp), | intent(in) | :: | S_w |
Far-field salinity (g/kg) — reserved-law argument. |
||
| real(kind=wp), | intent(in) | :: | T_b |
Trial interface temperature (degC) — reserved-law argument. |
||
| real(kind=wp), | intent(in) | :: | S_b |
Trial interface salinity (g/kg) — reserved-law argument. |
||
| real(kind=wp), | intent(out) | :: | gamma_t |
Heat exchange velocity (m/s). Zero on any non-OK status. |
||
| real(kind=wp), | intent(out) | :: | gamma_s |
Salt exchange velocity (m/s). Zero on any non-OK status. |
||
| integer, | intent(out) | :: | ierr |
|
Holland & Jenkins (1999) eqs. (14)-(18) p. 1792:
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | u_star |
Friction velocity (m/s), > 0. |
||
| real(kind=wp), | intent(in) | :: | l_plus |
Trial viscous Obukhov scale, or |
||
| real(kind=wp), | intent(in) | :: | f_cor |
Coriolis parameter (1/s), used as |
||
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle. |
||
| real(kind=wp), | intent(out) | :: | gamma_t |
Heat exchange velocity (m/s). |
||
| real(kind=wp), | intent(out) | :: | gamma_s |
Salt exchange velocity (m/s). |
||
| integer, | intent(out) | :: | ierr |
|
Yung et al. (2025) “StratFeedback”, eqs. (7)-(8) p. 5832:
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | u_star |
Friction velocity (m/s), > 0. |
||
| real(kind=wp), | intent(in) | :: | l_plus |
Trial viscous Obukhov scale, or |
||
| real(kind=wp), | intent(out) | :: | gamma_t |
Heat exchange velocity (m/s). |
||
| real(kind=wp), | intent(out) | :: | gamma_s |
Salt exchange velocity (m/s). |
||
| integer, | intent(out) | :: | ierr |
|
(c_i_eff, kh) for the requested ice-conduction mode — the two
numbers through which every mode enters the quadratic.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_cavity_ice_t), | intent(in) | :: | ice |
Ice-conduction bundle. |
||
| logical, | intent(in) | :: | melting |
Melt/freeze branch, decided from the thermal driving. |
||
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle. |
||
| real(kind=wp), | intent(out) | :: | c_i_eff |
Effective ice heat capacity (J/kg/K) in |
||
| real(kind=wp), | intent(out) | :: | kh |
Conductance |
||
| integer, | intent(out) | :: | ierr |
|
cavity_melt_point_gamma with the Coriolis parameter passed as a
per-column SCALAR — what cavity_melt_columns_2d calls, so no
device code has to build a modified ocean_cavity_exchange_t
(see cavity_exchange_velocities_f).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | T_w |
Far-field temperature (degC). |
||
| real(kind=wp), | intent(in) | :: | S_w |
Far-field salinity (g/kg). |
||
| real(kind=wp), | intent(in) | :: | p_b |
Interface pressure (Pa). |
||
| real(kind=wp), | intent(in) | :: | u_star |
Friction velocity (m/s). |
||
| real(kind=wp), | intent(in) | :: | S_i |
Ice salinity (g/kg). |
||
| type(ocean_cavity_exchange_t), | intent(in) | :: | par |
Exchange-law bundle (its |
||
| real(kind=wp), | intent(in) | :: | f_cor |
Coriolis parameter (1/s) for this column; |
||
| type(ocean_cavity_ice_t), | intent(in) | :: | ice |
Ice-conduction bundle. |
||
| type(eos_t), | intent(in) | :: | eos |
Shared EOS handle — the liquidus. |
||
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle. |
||
| real(kind=wp), | intent(out) | :: | T_b |
Interface temperature (degC). |
||
| real(kind=wp), | intent(out) | :: | S_b |
Interface salinity (g/kg). |
||
| real(kind=wp), | intent(out) | :: | m_mass |
Melt mass flux (kg/m^2/s), > 0 melting. |
||
| real(kind=wp), | intent(out) | :: | q_ocean |
Turbulent heat flux ocean -> interface (W/m^2). |
||
| real(kind=wp), | intent(out) | :: | gamma_t |
Thermal exchange velocity (m/s) of the converged solve. |
||
| real(kind=wp), | intent(out) | :: | gamma_s |
Haline exchange velocity (m/s) of the converged solve. |
||
| integer, | intent(out) | :: | ierr |
|
The documented SAFE STATE returned on every non-OK status: zero
melt, interface salinity equal to the far field, interface
temperature on the liquidus there. m_mass is EXACTLY zero, so
a failed column contributes nothing to a heat/salt budget rather
than contributing a plausible wrong number.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(eos_t), | intent(in) | :: | eos |
Shared EOS handle — carries the liquidus coefficient set. |
||
| real(kind=wp), | intent(in) | :: | S_w |
Far-field salinity (g/kg). |
||
| real(kind=wp), | intent(in) | :: | p_b |
Interface pressure (Pa). |
||
| real(kind=wp), | intent(out) | :: | T_b |
Interface temperature (degC) = |
||
| real(kind=wp), | intent(out) | :: | S_b |
Interface salinity (g/kg) = |
||
| real(kind=wp), | intent(out) | :: | m_mass |
Melt mass flux (kg/m^2/s) = exactly 0. |
Define every component of the solution bundle. Called FIRST by
cavity_solve_melt, before any early return, because the type
carries no default initialisers (see its docstring: they would
bar it from a do concurrent local(...) clause on gfortran).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_cavity_solution_t), | intent(out) | :: | sol |
Solution bundle, zeroed. |
Solve the three-equation system with any implemented exchange law, and return the full interface state plus the fluxes a coupling seam will consume.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | T_w |
Far-field temperature (degC). |
||
| real(kind=wp), | intent(in) | :: | S_w |
Far-field salinity (g/kg). Must exceed |
||
| real(kind=wp), | intent(in) | :: | p_b |
Interface pressure (Pa). |
||
| real(kind=wp), | intent(in) | :: | u_star |
Friction velocity (m/s), strictly positive — from
|
||
| real(kind=wp), | intent(in) | :: | S_i |
Ice salinity (g/kg), >= 0. |
||
| type(ocean_cavity_exchange_t), | intent(in) | :: | par |
Exchange-law bundle (its |
||
| real(kind=wp), | intent(in) | :: | f_cor |
Coriolis parameter (1/s) for this column; |
||
| type(ocean_cavity_ice_t), | intent(in) | :: | ice |
Ice-conduction bundle. |
||
| type(eos_t), | intent(in) | :: | eos |
Shared EOS handle — the liquidus. |
||
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle. |
||
| type(ocean_cavity_solution_t), | intent(out) | :: | sol |
Interface state, fluxes and solver diagnostics. On any non-OK
status this carries the safe state ( |
||
| integer, | intent(out) | :: | ierr |
|
Evaluate the whole interface at a trial x = ln(L+): exchange
velocities at that stratification, the closed-form three-equation
solve, the buoyancy flux the answer implies and the L+ it
re-diagnoses. The fixed point of x -> ln(L+_new) is the
solution of the implicit system.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | x |
Trial |
||
| type(ocean_cavity_exchange_t), | intent(in) | :: | par |
Exchange-law bundle (its |
||
| real(kind=wp), | intent(in) | :: | f_cor |
Coriolis parameter (1/s) for this column. |
||
| type(ocean_cavity_ice_t), | intent(in) | :: | ice |
Ice-conduction bundle. |
||
| type(eos_t), | intent(in) | :: | eos |
Shared EOS handle — the liquidus. |
||
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle. |
||
| real(kind=wp), | intent(in) | :: | u_star |
Friction velocity (m/s). |
||
| real(kind=wp), | intent(in) | :: | T_w |
Far-field temperature (degC). |
||
| real(kind=wp), | intent(in) | :: | S_w |
Far-field salinity (g/kg). |
||
| real(kind=wp), | intent(in) | :: | p_b |
Interface pressure (Pa). |
||
| real(kind=wp), | intent(in) | :: | S_i |
Ice salinity (g/kg). |
||
| real(kind=wp), | intent(out) | :: | T_b |
Interface temperature (degC). |
||
| real(kind=wp), | intent(out) | :: | S_b |
Interface salinity (g/kg). |
||
| real(kind=wp), | intent(out) | :: | m_mass |
Melt mass flux (kg/m^2/s). |
||
| real(kind=wp), | intent(out) | :: | gamma_t |
Heat exchange velocity (m/s) at this iterate. |
||
| real(kind=wp), | intent(out) | :: | gamma_s |
Salt exchange velocity (m/s) at this iterate. |
||
| real(kind=wp), | intent(out) | :: | b_flux |
Interfacial buoyancy flux (m^2/s^3) the answer implies. |
||
| real(kind=wp), | intent(out) | :: | lp_new |
|
||
| integer, | intent(out) | :: | ierr |
|