Seed the shortwave-penetration band parameters and set the
has_sw gate (sw_pen_frac /= 0). Sibling to
set_surface_flux_const — kept separate so existing callers of
the heat/salt setter are unchanged. Host only; the scalars are
read host-side by the apply kernel (they parameterise the
by-value arguments passed into the device _impl), so no extra
device sync is needed beyond the existing copyin(this).
sw_source (optional; default "net_heat") selects the
irradiance source: "net_heat" ⇒ I0 = sw_pen_frac*Q_heat
(legacy, bit-identical); "q_sw" ⇒ I0 = sw_pen_frac*q_sw
(requires the PR-12 component set — the caller / validate_config
guards allocation). Sets the host-side sw_from_qsw gate.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_surface_flux_t), | intent(inout) | :: | this | |||
| real(kind=wp), | intent(in) | :: | sw_pen_frac | |||
| real(kind=wp), | intent(in) | :: | sw_band_ratio | |||
| real(kind=wp), | intent(in) | :: | sw_zeta1 | |||
| real(kind=wp), | intent(in) | :: | sw_zeta2 | |||
| character(len=*), | intent(in), | optional | :: | sw_source |
subroutine ocean_surfflux_set_sw(this, sw_pen_frac, sw_band_ratio, & sw_zeta1, sw_zeta2, sw_source) !! Seed the shortwave-penetration band parameters and set the !! `has_sw` gate (`sw_pen_frac /= 0`). Sibling to !! `set_surface_flux_const` — kept separate so existing callers of !! the heat/salt setter are unchanged. Host only; the scalars are !! read host-side by the apply kernel (they parameterise the !! by-value arguments passed into the device `_impl`), so no extra !! device sync is needed beyond the existing `copyin(this)`. !! !! `sw_source` (optional; default `"net_heat"`) selects the !! irradiance source: `"net_heat"` ⇒ `I0 = sw_pen_frac*Q_heat` !! (legacy, bit-identical); `"q_sw"` ⇒ `I0 = sw_pen_frac*q_sw` !! (requires the PR-12 component set — the caller / `validate_config` !! guards allocation). Sets the host-side `sw_from_qsw` gate. class(ocean_surface_flux_t), intent(inout) :: this real(wp), intent(in) :: sw_pen_frac, sw_band_ratio, sw_zeta1, sw_zeta2 character(len=*), intent(in), optional :: sw_source this%sw_pen_frac = sw_pen_frac this%sw_band_ratio = sw_band_ratio this%sw_zeta1 = sw_zeta1 this%sw_zeta2 = sw_zeta2 this%has_sw = (sw_pen_frac /= 0.0_wp) this%sw_from_qsw = .false. if (present(sw_source)) this%sw_from_qsw = (trim(sw_source) == "q_sw") end subroutine ocean_surfflux_set_sw