cavity_melt_point plus the two EXCHANGE VELOCITIES the solve
converged on.
A separate entry point rather than two more intent(out)
arguments on cavity_melt_point: that procedure’s signature is
the scalar oracle the 17-digit kernel suite is written against,
and widening it would re-signature every one of those calls to
carry two values they do not check. The bundle
(ocean_cavity_solution_t) already carries gamma_t/gamma_s,
so this wrapper costs nothing but the two extra stores — it is
the SAME cavity_solve_melt call, not a second solve.
gamma_t/gamma_s exist so the diagnostic catalog can report
exch_vel_t/exch_vel_s without re-deriving the exchange law
outside the module that owns it: under hj99 or yung25 they
are implicit functions of the converged interface state, and a
diagnostic that re-computed them from u* alone would quietly
report the neutral values instead of the stratification-
suppressed ones.
| 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 |
|
pure subroutine cavity_melt_point_gamma(T_w, S_w, p_b, u_star, S_i, par, ice, eos, & const, T_b, S_b, m_mass, q_ocean, & gamma_t, gamma_s, ierr) !! `cavity_melt_point` plus the two EXCHANGE VELOCITIES the solve !! converged on. !! !! A separate entry point rather than two more `intent(out)` !! arguments on `cavity_melt_point`: that procedure's signature is !! the scalar oracle the 17-digit kernel suite is written against, !! and widening it would re-signature every one of those calls to !! carry two values they do not check. The bundle !! (`ocean_cavity_solution_t`) already carries `gamma_t`/`gamma_s`, !! so this wrapper costs nothing but the two extra stores — it is !! the SAME `cavity_solve_melt` call, not a second solve. !! !! `gamma_t`/`gamma_s` exist so the diagnostic catalog can report !! `exch_vel_t`/`exch_vel_s` without re-deriving the exchange law !! outside the module that owns it: under `hj99` or `yung25` they !! are implicit functions of the converged interface state, and a !! diagnostic that re-computed them from `u*` alone would quietly !! report the neutral values instead of the stratification- !! suppressed ones. !$acc routine seq real(wp), intent(in) :: T_w !! Far-field temperature (degC). real(wp), intent(in) :: S_w !! Far-field salinity (g/kg). real(wp), intent(in) :: p_b !! Interface pressure (Pa). real(wp), intent(in) :: u_star !! Friction velocity (m/s). real(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(wp), intent(out) :: T_b !! Interface temperature (degC). real(wp), intent(out) :: S_b !! Interface salinity (g/kg). real(wp), intent(out) :: m_mass !! Melt mass flux (kg/m^2/s), > 0 melting. real(wp), intent(out) :: q_ocean !! Turbulent heat flux ocean -> interface (W/m^2). real(wp), intent(out) :: gamma_t !! Thermal exchange velocity (m/s) of the converged solve. real(wp), intent(out) :: gamma_s !! Haline exchange velocity (m/s) of the converged solve. integer, intent(out) :: ierr !! `CAVITY_MELT_*` status. call cavity_melt_point_gamma_f(T_w, S_w, p_b, u_star, S_i, par, par%f_cor, ice, eos, & const, T_b, S_b, m_mass, q_ocean, gamma_t, gamma_s, & ierr) end subroutine cavity_melt_point_gamma