wavespeed_compute Subroutine

public 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).

Arguments

Type IntentOptional 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

Calls

proc~~wavespeed_compute~~CallsGraph proc~wavespeed_compute wavespeed_compute proc~wavespeed_compute_impl wavespeed_compute_impl proc~wavespeed_compute->proc~wavespeed_compute_impl local local proc~wavespeed_compute_impl->local proc~wavespeed_cg1_column wavespeed_cg1_column proc~wavespeed_compute_impl->proc~wavespeed_cg1_column proc~wavespeed_rd wavespeed_rd proc~wavespeed_compute_impl->proc~wavespeed_rd proc~det_sign det_sign proc~wavespeed_cg1_column->proc~det_sign proc~sturm_count sturm_count proc~wavespeed_cg1_column->proc~sturm_count

Called by

proc~~wavespeed_compute~~CalledByGraph proc~wavespeed_compute wavespeed_compute proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~wavespeed_compute proc~engine_step engine_step proc~engine_step->proc~ocean_dyn_step_split proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_step proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean

Variables

Type Visibility Attributes Name Initial
integer, private :: nx
integer, private :: ny
integer, private :: nz

Source Code

   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