rdb_ocean_bt_wide Module

Shadow state for the wide-halo barotropic march-in. When bt_halo > 0, the BT fast loop runs on WIDE arrays with ghost width ng_wide = nghost + bt_halo. Ghost cells outside the valid band evolve stale data that creeps INWARD at 2 cells/substep; one grouped exchange every bt_halo/2 substeps keeps the physical interior clean. The mid-substep u exchange is absorbed (within the 2-cell/substep stencil budget).

Lifecycle: 1. init — allocate wide arrays + wide grid/metrics/f_corner. 2. enter_data — attach all wide arrays to the GPU present table. 3. Per outer step: copy_in -> (entry_exchange + substep) -> copy_out -> normal-width exit exchange (in the caller). 4. exit_data — release GPU present table entries. 5. destroy — free host memory.


Uses

  • module~~rdb_ocean_bt_wide~~UsesGraph module~rdb_ocean_bt_wide rdb_ocean_bt_wide iso_fortran_env iso_fortran_env module~rdb_ocean_bt_wide->iso_fortran_env module~rdb_barotropic_substep rdb_barotropic_substep module~rdb_ocean_bt_wide->module~rdb_barotropic_substep module~rdb_barotropic_workstate rdb_barotropic_workstate module~rdb_ocean_bt_wide->module~rdb_barotropic_workstate module~rdb_constants rdb_constants module~rdb_ocean_bt_wide->module~rdb_constants module~rdb_grid rdb_grid module~rdb_ocean_bt_wide->module~rdb_grid module~rdb_mem_report rdb_mem_report module~rdb_ocean_bt_wide->module~rdb_mem_report module~rdb_ocean_boundary_types rdb_ocean_boundary_types module~rdb_ocean_bt_wide->module~rdb_ocean_boundary_types module~rdb_ocean_halo rdb_ocean_halo module~rdb_ocean_bt_wide->module~rdb_ocean_halo module~rdb_ocean_metrics rdb_ocean_metrics module~rdb_ocean_bt_wide->module~rdb_ocean_metrics module~rdb_profiler rdb_profiler module~rdb_ocean_bt_wide->module~rdb_profiler pic_logger pic_logger module~rdb_ocean_bt_wide->pic_logger module~rdb_barotropic_substep->module~rdb_barotropic_workstate module~rdb_barotropic_substep->module~rdb_constants module~rdb_barotropic_substep->module~rdb_grid module~rdb_barotropic_substep->module~rdb_ocean_boundary_types module~rdb_barotropic_substep->module~rdb_ocean_halo module~rdb_barotropic_substep->module~rdb_ocean_metrics module~rdb_barotropic_substep->module~rdb_profiler module~rdb_bt_cont_type rdb_bt_cont_type module~rdb_barotropic_substep->module~rdb_bt_cont_type module~rdb_ocean_fold_exchange rdb_ocean_fold_exchange module~rdb_barotropic_substep->module~rdb_ocean_fold_exchange module~rdb_ocean_halo_counters rdb_ocean_halo_counters module~rdb_barotropic_substep->module~rdb_ocean_halo_counters module~rdb_barotropic_workstate->iso_fortran_env module~rdb_barotropic_workstate->module~rdb_constants module~rdb_barotropic_workstate->module~rdb_grid module~rdb_barotropic_workstate->module~rdb_mem_report pic_types pic_types module~rdb_constants->pic_types module~rdb_grid->module~rdb_constants module~rdb_mem_report->iso_fortran_env module~rdb_mem_report->module~rdb_constants module~rdb_mem_report->pic_logger pic_strings pic_strings module~rdb_mem_report->pic_strings module~rdb_ocean_boundary_types->iso_fortran_env module~rdb_ocean_boundary_types->module~rdb_constants module~rdb_ocean_boundary_types->module~rdb_grid module~rdb_ocean_boundary_types->module~rdb_mem_report module~rdb_ocean_boundary_types->pic_logger module~rdb_ocean_status rdb_ocean_status module~rdb_ocean_boundary_types->module~rdb_ocean_status module~rdb_ocean_tide_astro rdb_ocean_tide_astro module~rdb_ocean_boundary_types->module~rdb_ocean_tide_astro pic_ascii pic_ascii module~rdb_ocean_boundary_types->pic_ascii module~rdb_ocean_halo->module~rdb_constants module~rdb_ocean_halo->pic_logger module~rdb_comm_env rdb_comm_env module~rdb_ocean_halo->module~rdb_comm_env module~rdb_decomp rdb_decomp module~rdb_ocean_halo->module~rdb_decomp module~rdb_error_ring rdb_error_ring module~rdb_ocean_halo->module~rdb_error_ring module~rdb_ocean_halo->module~rdb_ocean_halo_counters module~rdb_ocean_periodic rdb_ocean_periodic module~rdb_ocean_halo->module~rdb_ocean_periodic module~rdb_ocean_halo->module~rdb_ocean_status pic_mpi_lib pic_mpi_lib module~rdb_ocean_halo->pic_mpi_lib module~rdb_ocean_halo->pic_strings module~rdb_ocean_metrics->iso_fortran_env module~rdb_ocean_metrics->module~rdb_constants module~rdb_ocean_metrics->module~rdb_grid module~rdb_ocean_metrics->module~rdb_mem_report module~rdb_ocean_metrics->pic_logger module~rdb_ocean_metrics->module~rdb_error_ring module~rdb_io_netcdf rdb_io_netcdf module~rdb_ocean_metrics->module~rdb_io_netcdf module~rdb_ocean_bipolar rdb_ocean_bipolar module~rdb_ocean_metrics->module~rdb_ocean_bipolar module~rdb_ocean_fold rdb_ocean_fold module~rdb_ocean_metrics->module~rdb_ocean_fold module~rdb_ocean_metrics->module~rdb_ocean_status netcdf netcdf module~rdb_ocean_metrics->netcdf module~rdb_ocean_metrics->pic_strings module~rdb_profiler->iso_fortran_env module~rdb_profiler->pic_logger module~rdb_bt_cont_type->module~rdb_barotropic_workstate module~rdb_bt_cont_type->module~rdb_constants module~rdb_comm_env->iso_fortran_env module~rdb_comm_env->module~rdb_constants module~rdb_comm_env->pic_mpi_lib module~rdb_config rdb_config module~rdb_decomp->module~rdb_config module~rdb_error_ring->pic_logger module~rdb_io_netcdf->iso_fortran_env module~rdb_io_netcdf->module~rdb_constants module~rdb_io_netcdf->pic_logger module~rdb_io_netcdf->module~rdb_error_ring module~rdb_io_netcdf->netcdf module~rdb_io_netcdf->pic_strings iso_c_binding iso_c_binding module~rdb_io_netcdf->iso_c_binding module~rdb_ocean_bipolar->module~rdb_constants module~rdb_ocean_fold->module~rdb_constants module~rdb_ocean_fold_exchange->module~rdb_constants module~rdb_ocean_fold_exchange->pic_logger module~rdb_ocean_fold_exchange->module~rdb_comm_env module~rdb_ocean_fold_exchange->module~rdb_decomp module~rdb_ocean_fold_exchange->module~rdb_error_ring module~rdb_ocean_fold_exchange->module~rdb_ocean_fold module~rdb_ocean_fold_exchange->module~rdb_ocean_status module~rdb_ocean_fold_exchange->pic_mpi_lib module~rdb_ocean_fold_exchange->pic_strings module~rdb_ocean_fold_plan rdb_ocean_fold_plan module~rdb_ocean_fold_exchange->module~rdb_ocean_fold_plan module~rdb_ocean_halo_counters->iso_fortran_env module~rdb_ocean_halo_counters->pic_strings module~rdb_ocean_periodic->module~rdb_constants module~rdb_ocean_periodic->module~rdb_grid module~rdb_ocean_periodic->module~rdb_ocean_boundary_types module~rdb_multilayer_state rdb_multilayer_state module~rdb_ocean_periodic->module~rdb_multilayer_state module~rdb_ocean_tide_astro->iso_fortran_env module~rdb_ocean_tide_astro->module~rdb_constants module~rdb_config->module~rdb_constants module~rdb_config->pic_logger module~rdb_config->module~rdb_error_ring module~rdb_config->module~rdb_ocean_status module~rdb_config->pic_ascii module~rdb_config->pic_strings module~rdb_ice_enthalpy rdb_ice_enthalpy module~rdb_config->module~rdb_ice_enthalpy module~rdb_ice_init rdb_ice_init module~rdb_config->module~rdb_ice_init module~rdb_nml_schema rdb_nml_schema module~rdb_config->module~rdb_nml_schema module~rdb_multilayer_state->iso_fortran_env module~rdb_multilayer_state->module~rdb_constants module~rdb_multilayer_state->module~rdb_grid module~rdb_multilayer_state->module~rdb_mem_report module~rdb_multilayer_state->pic_logger module~rdb_multilayer_state->module~rdb_error_ring module~rdb_efp rdb_efp module~rdb_multilayer_state->module~rdb_efp module~rdb_tracer rdb_tracer module~rdb_multilayer_state->module~rdb_tracer module~rdb_efp->iso_fortran_env ieee_arithmetic ieee_arithmetic module~rdb_efp->ieee_arithmetic module~rdb_ice_enthalpy->module~rdb_constants module~rdb_ice_init->module~rdb_constants module~rdb_ice_init->module~rdb_grid module~rdb_ice_init->module~rdb_ocean_metrics module~rdb_ice_init->module~rdb_multilayer_state module~rdb_ice_init->module~rdb_ice_enthalpy module~rdb_ice_column rdb_ice_column module~rdb_ice_init->module~rdb_ice_column module~rdb_ice_state rdb_ice_state module~rdb_ice_init->module~rdb_ice_state module~rdb_nml_schema->module~rdb_constants module~rdb_nml_schema->pic_logger module~rdb_nml_schema->module~rdb_error_ring module~rdb_tracer->iso_fortran_env module~rdb_tracer->module~rdb_constants module~rdb_tracer->module~rdb_grid module~rdb_tracer->module~rdb_mem_report

Used by

  • module~~rdb_ocean_bt_wide~~UsedByGraph module~rdb_ocean_bt_wide rdb_ocean_bt_wide module~rdb_ocean_dyn rdb_ocean_dyn module~rdb_ocean_dyn->module~rdb_ocean_bt_wide module~rdb_driver rdb_driver module~rdb_driver->module~rdb_ocean_dyn module~rdb_ocean_engine rdb_ocean_engine module~rdb_driver->module~rdb_ocean_engine module~rdb_ocean_state rdb_ocean_state module~rdb_driver->module~rdb_ocean_state module~rdb_ocean_api rdb_ocean_api module~rdb_ocean_api->module~rdb_ocean_dyn module~rdb_ocean_api->module~rdb_ocean_engine module~rdb_handle rdb_handle module~rdb_ocean_api->module~rdb_handle module~rdb_ocean_diag_derived rdb_ocean_diag_derived module~rdb_ocean_api->module~rdb_ocean_diag_derived module~rdb_ocean_diag_fills rdb_ocean_diag_fills module~rdb_ocean_api->module~rdb_ocean_diag_fills module~rdb_ocean_engine->module~rdb_ocean_dyn module~rdb_ocean_setup rdb_ocean_setup module~rdb_ocean_engine->module~rdb_ocean_setup module~rdb_ocean_engine->module~rdb_ocean_state module~rdb_ocean_engine->module~rdb_ocean_diag_derived module~rdb_ocean_engine->module~rdb_ocean_diag_fills module~rdb_ocean_setup->module~rdb_ocean_dyn module~rdb_ocean_setup->module~rdb_ocean_state module~rdb_ocean_state->module~rdb_ocean_dyn module~rdb_handle->module~rdb_ocean_engine module~rdb_handle->module~rdb_ocean_state module~rdb_ocean_diag_derived->module~rdb_ocean_state module~rdb_ocean_diag_derived->module~rdb_ocean_diag_fills module~rdb_ocean_diag_fills->module~rdb_ocean_state

Derived Types

type, public ::  bt_wide_t

Wide-halo shadow state for the barotropic fast loop.

Components

Type Visibility Attributes Name Initial
integer, public :: bt_halo = 0

Requested wide-halo width (cells; even, > 0).

real(kind=wp), public, allocatable :: f_corner_w(:,:)

Coriolis at wide-grid C-grid corners (nx_w+1, ny_w+1).

type(hgrid_t), public :: grid_w

Wide hgrid_t: nghost = ng_wide.

logical, public :: is_init = .false.

True after init, before destroy.

type(ocean_metrics_t), public :: metrics_w

Metrics built on grid_w via the same formula generator.

integer, public :: ng_wide = 0

Effective ghost width: nghost + bt_halo.

integer, public :: num_cycles = 0

Substeps between grouped wide exchanges: bt_halo / 2.

real(kind=wp), public, allocatable :: w_H_ref(:,:)
real(kind=wp), public, allocatable :: w_eta(:,:)
real(kind=wp), public, allocatable :: w_eta_end(:,:)
real(kind=wp), public, allocatable :: w_eta_new(:,:)
real(kind=wp), public, allocatable :: w_eta_sum(:,:)
real(kind=wp), public, allocatable :: w_force_u(:,:)
real(kind=wp), public, allocatable :: w_force_v(:,:)
real(kind=wp), public, allocatable :: w_ke(:,:)
real(kind=wp), public, allocatable :: w_rem_u(:,:)
real(kind=wp), public, allocatable :: w_rem_v(:,:)
real(kind=wp), public, allocatable :: w_ubt(:,:)
real(kind=wp), public, allocatable :: w_ubt_end(:,:)
real(kind=wp), public, allocatable :: w_ubt_prev(:,:)
real(kind=wp), public, allocatable :: w_ubt_sum(:,:)
real(kind=wp), public, allocatable :: w_uhbt(:,:)
real(kind=wp), public, allocatable :: w_uhbt_sum(:,:)
real(kind=wp), public, allocatable :: w_vbt(:,:)
real(kind=wp), public, allocatable :: w_vbt_end(:,:)
real(kind=wp), public, allocatable :: w_vbt_prev(:,:)
real(kind=wp), public, allocatable :: w_vbt_sum(:,:)
real(kind=wp), public, allocatable :: w_vhbt(:,:)
real(kind=wp), public, allocatable :: w_vhbt_sum(:,:)
real(kind=wp), public, allocatable :: w_zeta(:,:)

Type-Bound Procedures

procedure, public, non_overridable :: bytes => bt_wide_bytes
procedure, public, non_overridable :: copy_in => bt_wide_copy_in
procedure, public, non_overridable :: copy_out => bt_wide_copy_out
procedure, public, non_overridable :: destroy => bt_wide_destroy
procedure, public, non_overridable :: enter_data => bt_wide_enter_data
procedure, public, non_overridable :: entry_exchange => bt_wide_entry_exchange
procedure, public, non_overridable :: exit_data => bt_wide_exit_data
procedure, public, non_overridable :: init => bt_wide_init

Functions

private pure function bt_wide_bytes(this) result(nbytes)

Counted allocatable footprint of the wide-halo BT shadow state (0 when unallocated, i.e. whenever &ocean_bt_nml bt_halo = 0).

Read more…

Arguments

Type IntentOptional Attributes Name
class(bt_wide_t), intent(in) :: this

Return Value integer(kind=int64)


Subroutines

public subroutine bt_wide_substep(bt_wide, bt_work, n_steps, dt_inner, bc)

Wide-halo (march-in) entry point for the nonlinear barotropic fast loop. Unpacks the wide shadow arrays (w_*, wide grid/metrics, wide f_corner) and forwards them to barotropic_substep_nonlinear with bt_halo = bt_wide%bt_halo, so the ~20-array plumbing lives here once rather than at the call site. bc propagates by absence. Tides (eta_forcing) are a configure-time exclusion on the wide path, so none is forwarded. Interior twin: barotropic_substep_nonlinear_interior.

Arguments

Type IntentOptional Attributes Name
type(bt_wide_t), intent(inout) :: bt_wide
type(barotropic_workstate_t), intent(inout) :: bt_work
integer, intent(in) :: n_steps
real(kind=wp), intent(in) :: dt_inner
type(ocean_bc_state_t), intent(inout), optional :: bc

private subroutine bt_wide_copy_in(this, grid, bt_eta, bt_H_ref, bt_ubt, bt_vbt, bt_ubt_prev, bt_vbt_prev, bt_rem_u, bt_rem_v, force_u, force_v)

Offset-copy normal-width input arrays into the wide shadow arrays. Dispatches to the non-polymorphic _impl body to avoid the class-box GPU descriptor issue (same pattern as enter/exit_data).

Arguments

Type IntentOptional Attributes Name
class(bt_wide_t), intent(inout) :: this
type(hgrid_t), intent(in) :: grid
real(kind=wp), intent(in) :: bt_eta(grid%nx_total,grid%ny_total)
real(kind=wp), intent(in) :: bt_H_ref(grid%nx_total,grid%ny_total)
real(kind=wp), intent(in) :: bt_ubt(grid%nx_total+1,grid%ny_total)
real(kind=wp), intent(in) :: bt_vbt(grid%nx_total,grid%ny_total+1)
real(kind=wp), intent(in) :: bt_ubt_prev(grid%nx_total+1,grid%ny_total)
real(kind=wp), intent(in) :: bt_vbt_prev(grid%nx_total,grid%ny_total+1)
real(kind=wp), intent(in) :: bt_rem_u(grid%nx_total+1,grid%ny_total)
real(kind=wp), intent(in) :: bt_rem_v(grid%nx_total,grid%ny_total+1)
real(kind=wp), intent(in) :: force_u(grid%nx_total+1,grid%ny_total)
real(kind=wp), intent(in) :: force_v(grid%nx_total,grid%ny_total+1)

private subroutine bt_wide_copy_in_impl(this, grid, bt_eta, bt_H_ref, bt_ubt, bt_vbt, bt_ubt_prev, bt_vbt_prev, bt_rem_u, bt_rem_v, force_u, force_v)

Non-polymorphic copy_in body. Offset = bt_halo: w_X(iw, jw) = X(clamp(iw-off), clamp(jw-off)) over the FULL wide extent — the inner band is a direct offset copy; the outer bt_halo ring is a clamped-index (constant-extrapolation) fill. The ring fill matters: without it the ring carries stale end-of-fast-loop values from the previous stage (H_ref = 0, eta from t-1), which at a PHYSICAL (non-seam) edge is never refreshed by any exchange and free-runs an inconsistent zero-depth integration that blows up in O(25) outer steps. At an MPI seam the ring is immediately overwritten with true neighbour data by entry_exchange, so the clamped fill only governs physical edges — the same sane ghost-band construction the v1 normal-width path gets from its own ghosts. Scratch / accumulator arrays (w_eta_new, w_ke, w_eta_sum, …) do not need copy-in — the substep initialises them.

Arguments

Type IntentOptional Attributes Name
type(bt_wide_t), intent(inout) :: this
type(hgrid_t), intent(in) :: grid

Normal-width grid (provides nx_total, ny_total for loop bounds).

real(kind=wp), intent(in) :: bt_eta(grid%nx_total,grid%ny_total)

Barotropic SSH (cell centres, normal-width).

real(kind=wp), intent(in) :: bt_H_ref(grid%nx_total,grid%ny_total)

Reference column depth (cell centres, normal-width).

real(kind=wp), intent(in) :: bt_ubt(grid%nx_total+1,grid%ny_total)

BT u (east faces, normal-width).

real(kind=wp), intent(in) :: bt_vbt(grid%nx_total,grid%ny_total+1)

BT v (north faces, normal-width).

real(kind=wp), intent(in) :: bt_ubt_prev(grid%nx_total+1,grid%ny_total)

BEBT u^{n-1} snapshot (east faces, normal-width).

real(kind=wp), intent(in) :: bt_vbt_prev(grid%nx_total,grid%ny_total+1)

BEBT v^{n-1} snapshot (north faces, normal-width).

real(kind=wp), intent(in) :: bt_rem_u(grid%nx_total+1,grid%ny_total)

Multiplicative drag factor for u (east faces, normal-width).

real(kind=wp), intent(in) :: bt_rem_v(grid%nx_total,grid%ny_total+1)

Multiplicative drag factor for v (north faces, normal-width).

real(kind=wp), intent(in) :: force_u(grid%nx_total+1,grid%ny_total)

BT slow forcing for u (east faces, normal-width).

real(kind=wp), intent(in) :: force_v(grid%nx_total,grid%ny_total+1)

BT slow forcing for v (north faces, normal-width).

private subroutine bt_wide_copy_out(this, grid, bt_eta, bt_ubt, bt_vbt, bt_uhbt, bt_vhbt, bt_eta_end, bt_ubt_end, bt_vbt_end)

Offset-copy wide output arrays back to the normal-width arrays. Dispatches to the non-polymorphic _impl body.

Arguments

Type IntentOptional Attributes Name
class(bt_wide_t), intent(in) :: this
type(hgrid_t), intent(in) :: grid
real(kind=wp), intent(out) :: bt_eta(grid%nx_total,grid%ny_total)
real(kind=wp), intent(out) :: bt_ubt(grid%nx_total+1,grid%ny_total)
real(kind=wp), intent(out) :: bt_vbt(grid%nx_total,grid%ny_total+1)
real(kind=wp), intent(out) :: bt_uhbt(grid%nx_total+1,grid%ny_total)
real(kind=wp), intent(out) :: bt_vhbt(grid%nx_total,grid%ny_total+1)
real(kind=wp), intent(out) :: bt_eta_end(grid%nx_total,grid%ny_total)
real(kind=wp), intent(out) :: bt_ubt_end(grid%nx_total+1,grid%ny_total)
real(kind=wp), intent(out) :: bt_vbt_end(grid%nx_total,grid%ny_total+1)

private subroutine bt_wide_copy_out_impl(this, grid, bt_eta, bt_ubt, bt_vbt, bt_uhbt, bt_vhbt, bt_eta_end, bt_ubt_end, bt_vbt_end)

Non-polymorphic copy_out body. X(i,j) = w_X(i+off, j+off) over the full normal index range. Outputs: time-mean eta/ubt/vbt, uhbt/vhbt, *_end snapshots.

Arguments

Type IntentOptional Attributes Name
type(bt_wide_t), intent(in) :: this
type(hgrid_t), intent(in) :: grid

Normal-width grid.

real(kind=wp), intent(out) :: bt_eta(grid%nx_total,grid%ny_total)

Time-mean barotropic SSH (output).

real(kind=wp), intent(out) :: bt_ubt(grid%nx_total+1,grid%ny_total)

Time-mean BT u (output).

real(kind=wp), intent(out) :: bt_vbt(grid%nx_total,grid%ny_total+1)

Time-mean BT v (output).

real(kind=wp), intent(out) :: bt_uhbt(grid%nx_total+1,grid%ny_total)

Time-mean depth-integrated u transport (output).

real(kind=wp), intent(out) :: bt_vhbt(grid%nx_total,grid%ny_total+1)

Time-mean depth-integrated v transport (output).

real(kind=wp), intent(out) :: bt_eta_end(grid%nx_total,grid%ny_total)

End-of-loop eta snapshot (output).

real(kind=wp), intent(out) :: bt_ubt_end(grid%nx_total+1,grid%ny_total)

End-of-loop u snapshot (output).

real(kind=wp), intent(out) :: bt_vbt_end(grid%nx_total,grid%ny_total+1)

End-of-loop v snapshot (output).

private subroutine bt_wide_destroy(this)

Deallocate all wide state.

Arguments

Type IntentOptional Attributes Name
class(bt_wide_t), intent(inout) :: this

private subroutine bt_wide_enter_data(this)

Attach all wide arrays (and wide metrics leaf arrays) to the GPU present table. The containing ocean_dyn_t is already mapped by the caller; this routine attaches the components.

Arguments

Type IntentOptional Attributes Name
class(bt_wide_t), intent(inout) :: this

private subroutine bt_wide_enter_data_impl(this)

Non-polymorphic enter_data body (avoids class-box GPU descriptor issue).

Arguments

Type IntentOptional Attributes Name
type(bt_wide_t), intent(inout) :: this

private subroutine bt_wide_entry_exchange(this)

One wide grouped exchange (eta+ubt+vbt) + wide singles for the other 7 input arrays (H_ref, ubt_prev, rem_u, force_u, vbt_prev, rem_v, force_v). Fills the entire wide ghost band before the fast loop. Counter effect: +1 bt_group, +1 centre_2d, +3 face_x_2d, +3 face_y_2d. Dispatches to the non-polymorphic _impl body.

Arguments

Type IntentOptional Attributes Name
class(bt_wide_t), intent(inout) :: this

private subroutine bt_wide_entry_exchange_impl(this)

Non-polymorphic entry_exchange body.

Arguments

Type IntentOptional Attributes Name
type(bt_wide_t), intent(inout) :: this

private subroutine bt_wide_exit_data(this)

Detach all wide arrays from the GPU present table.

Arguments

Type IntentOptional Attributes Name
class(bt_wide_t), intent(inout) :: this

private subroutine bt_wide_exit_data_impl(this)

Non-polymorphic exit_data body.

Arguments

Type IntentOptional Attributes Name
type(bt_wide_t), intent(inout) :: this

private subroutine bt_wide_init(this, grid, dx, dy, lon_west, lat_south, rad_earth, grid_config, f_0, beta, y_ref, coriolis_scheme, omega)

Allocate the wide shadow state. Builds grid_w (same nx_phys/ny_phys as grid, nghost = grid%nghost + bt_halo), fills wide metrics via the same formula generator, fills wide f_corner. grid_config must be GRID_CONFIG_CARTESIAN or GRID_CONFIG_SPHERICAL; supergrid/tripolar are excluded at configure time.

Arguments

Type IntentOptional Attributes Name
class(bt_wide_t), intent(inout) :: this
type(hgrid_t), intent(in) :: grid

Normal-width grid descriptor for this subdomain.

real(kind=wp), intent(in) :: dx

Cell spacing (m for Cartesian; deg for spherical).

real(kind=wp), intent(in) :: dy

Cell spacing (m for Cartesian; deg for spherical).

real(kind=wp), intent(in) :: lon_west

South-west corner (used only for spherical; ignored for Cartesian).

real(kind=wp), intent(in) :: lat_south

South-west corner (used only for spherical; ignored for Cartesian).

real(kind=wp), intent(in) :: rad_earth

Earth radius (m; used only for spherical; ignored for Cartesian).

integer, intent(in) :: grid_config

GRID_CONFIG_CARTESIAN or GRID_CONFIG_SPHERICAL.

real(kind=wp), intent(in) :: f_0

Beta-plane Coriolis parameters.

real(kind=wp), intent(in) :: beta

Beta-plane Coriolis parameters.

real(kind=wp), intent(in) :: y_ref

Beta-plane Coriolis parameters.

integer, intent(in) :: coriolis_scheme

CORIOLIS_SCHEME_BETA_PLANE or CORIOLIS_SCHEME_PLANETARY.

real(kind=wp), intent(in), optional :: omega

Planetary rotation rate for the planetary scheme. Absent => 0.