Public entry point — fill slope_x/slope_y + n2_u/n2_v at
all interfaces. No-op if absent / uninitialised / disabled, so
the driver can call it unconditionally. Pipeline: vert-fill T/S
→ build interface heights e_int → u-face pass → v-face pass.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(hgrid_t), | intent(in) | :: | grid | |||
| type(ocean_metrics_t), | intent(in) | :: | metrics | |||
| type(eos_t), | intent(in) | :: | eos | |||
| type(ocean_slopes_t), | intent(inout), | optional | :: | slopes | ||
| type(multilayer_state_t), | intent(in) | :: | ms | |||
| real(kind=wp), | intent(in) | :: | dt |
subroutine ocean_slopes_compute(grid, metrics, eos, slopes, ms, dt) !! Public entry point — fill `slope_x`/`slope_y` + `n2_u`/`n2_v` at !! all interfaces. No-op if absent / uninitialised / disabled, so !! the driver can call it unconditionally. Pipeline: vert-fill T/S !! → build interface heights `e_int` → u-face pass → v-face pass. type(hgrid_t), intent(in) :: grid type(ocean_metrics_t), intent(in) :: metrics type(eos_t), intent(in) :: eos type(ocean_slopes_t), intent(inout), optional :: slopes type(multilayer_state_t), intent(in) :: ms real(wp), intent(in) :: dt if (.not. present(slopes)) return if (.not. slopes%is_init) return if (.not. slopes%enable) return if (ms%idx_temperature <= 0 .or. ms%idx_salinity <= 0) return if (.not. allocated(ms%h_layer)) return if (.not. slopes%bathy_set) then error stop "ocean_slopes_compute: bed datum never set; call "// & "slopes%set_bathymetry(barotropic%b) before enter_data" end if ! Outer shim: dereference the tracer-registry hTr arrays (array of ! derived types ⇒ device indirection) on the host, pass the flat ! top-level allocatables into the flat-impl kernel. call ocean_slopes_compute_impl(grid, metrics, eos, slopes, ms, & ms%h_layer, & ms%tracers(ms%idx_temperature)%hTr, & ms%tracers(ms%idx_salinity)%hTr, dt) end subroutine ocean_slopes_compute