Fill this%cg1, this%rd, this%rd_over_dx over the domain.
rho_layer is a top-level allocatable that reaches the device
directly, so no outer-shim tracer dereference is needed (unlike
EPBL/kappa-shear). Call at the n_wavespeed cadence.
Host guards + dereference here; the explicit-shape do
concurrent kernel lives in wavespeed_compute_impl
(outer-shim + flat-impl pattern — mirrors varmix_compute).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(hgrid_t), | intent(in) | :: | grid | |||
| type(ocean_metrics_t), | intent(in) | :: | metrics | |||
| type(ocean_wave_speed_t), | intent(inout) | :: | this | |||
| type(multilayer_state_t), | intent(in) | :: | ms |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | nx | ||||
| integer, | private | :: | ny | ||||
| integer, | private | :: | nz |
pure subroutine wavespeed_compute(grid, metrics, this, ms) !! Fill `this%cg1`, `this%rd`, `this%rd_over_dx` over the domain. !! `rho_layer` is a top-level allocatable that reaches the device !! directly, so no outer-shim tracer dereference is needed (unlike !! EPBL/kappa-shear). Call at the `n_wavespeed` cadence. !! Host guards + dereference here; the explicit-shape `do !! concurrent` kernel lives in `wavespeed_compute_impl` !! (outer-shim + flat-impl pattern — mirrors `varmix_compute`). type(hgrid_t), intent(in) :: grid type(ocean_metrics_t), intent(in) :: metrics type(ocean_wave_speed_t), intent(inout) :: this type(multilayer_state_t), intent(in) :: ms integer :: nx, ny, nz if (.not. this%is_init) return if (.not. this%enable) return if (.not. allocated(ms%rho_layer)) return if (.not. allocated(this%cg1)) return nx = grid%nx_total ny = grid%ny_total nz = ms%nz_ml call wavespeed_compute_impl(nx, ny, nz, this%rho0, & ms%h_layer, ms%rho_layer, ms%wet_mask, & this%f_centre, this%beta_centre, metrics%dxT, & this%cg1, this%rd, this%rd_over_dx) end subroutine wavespeed_compute