configure_ocean_meke Subroutine

private subroutine configure_ocean_meke(cfg, ocean_state, grid)

Fill the MEKE slot’s cell-centre |Coriolis| from the same metrics_fill_coriolis path VarMix / EPBL use (handles beta-plane AND spherical), so beta = |grad f| for the Rhines length is live when alpha_rhines > 0. The MEKE scalar knobs are copied earlier by ocean_state_copy_config; this only fills f_centre. Host loop before enter_data. No-op when MEKE is disabled.

Arguments

Type IntentOptional Attributes Name
type(config_t), intent(in) :: cfg
type(ocean_state_t), intent(inout) :: ocean_state
type(hgrid_t), intent(in) :: grid

Calls

proc~~configure_ocean_meke~~CallsGraph proc~configure_ocean_meke configure_ocean_meke proc~fill_coriolis_centre fill_coriolis_centre proc~configure_ocean_meke->proc~fill_coriolis_centre proc~ocean_meke_set_f_centre ocean_meke_t%ocean_meke_set_f_centre proc~configure_ocean_meke->proc~ocean_meke_set_f_centre proc~metrics_fill_coriolis metrics_fill_coriolis proc~fill_coriolis_centre->proc~metrics_fill_coriolis proc~parse_coriolis_scheme parse_coriolis_scheme proc~fill_coriolis_centre->proc~parse_coriolis_scheme

Called by

proc~~configure_ocean_meke~~CalledByGraph proc~configure_ocean_meke configure_ocean_meke proc~configure_ocean_lateral configure_ocean_lateral proc~configure_ocean_lateral->proc~configure_ocean_meke proc~engine_setup engine_setup proc~engine_setup->proc~configure_ocean_lateral proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_setup proc~driver_validate driver_validate proc~driver_validate->proc~engine_setup proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean proc~rdb_ocean_create_finalize rdb_ocean_create_finalize proc~rdb_ocean_create_finalize->proc~complete_ocean_create proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~complete_ocean_create

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private, allocatable :: f_centre(:,:)

Source Code

   subroutine configure_ocean_meke(cfg, ocean_state, grid)
      !! Fill the MEKE slot's cell-centre |Coriolis| from the same
      !! `metrics_fill_coriolis` path VarMix / EPBL use (handles beta-plane
      !! AND spherical), so `beta = |grad f|` for the Rhines length is live
      !! when `alpha_rhines > 0`.  The MEKE scalar knobs are copied earlier
      !! by `ocean_state_copy_config`; this only fills `f_centre`.  Host loop
      !! before `enter_data`.  No-op when MEKE is disabled.
      type(config_t), intent(in) :: cfg
      type(ocean_state_t), intent(inout) :: ocean_state
      type(hgrid_t), intent(in) :: grid
      real(wp), allocatable :: f_centre(:, :)

      if (.not. ocean_state%meke%enable) return
      allocate (f_centre(grid%nx_total, grid%ny_total))
      call fill_coriolis_centre(cfg, ocean_state%metrics, grid, f_centre)
      call ocean_state%meke%set_f_centre(grid, f_centre)
      deallocate (f_centre)
   end subroutine configure_ocean_meke