Wide-halo shadow state for the barotropic fast loop.
| 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 |
|
| type(ocean_metrics_t), | public | :: | metrics_w |
Metrics built on |
|||
| integer, | public | :: | ng_wide | = | 0 |
Effective ghost width: |
|
| integer, | public | :: | num_cycles | = | 0 |
Substeps between grouped wide exchanges: |
|
| 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(:,:) |
Counted allocatable footprint of the wide-halo BT shadow state
(0 when unallocated, i.e. whenever &ocean_bt_nml bt_halo = 0).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bt_wide_t), | intent(in) | :: | this |
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).
| Type | Intent | Optional | 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) |
Offset-copy wide output arrays back to the normal-width arrays.
Dispatches to the non-polymorphic _impl body.
| Type | Intent | Optional | 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) |
Deallocate all wide state.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bt_wide_t), | intent(inout) | :: | 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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bt_wide_t), | intent(inout) | :: | 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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bt_wide_t), | intent(inout) | :: | this |
Detach all wide arrays from the GPU present table.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bt_wide_t), | intent(inout) | :: | this |
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.
| Type | Intent | Optional | 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. |
type :: bt_wide_t !! Wide-halo shadow state for the barotropic fast loop. logical :: is_init = .false. !! True after `init`, before `destroy`. integer :: bt_halo = 0 !! Requested wide-halo width (cells; even, > 0). integer :: ng_wide = 0 !! Effective ghost width: `nghost + bt_halo`. integer :: num_cycles = 0 !! Substeps between grouped wide exchanges: `bt_halo / 2`. ! Wide grid and metrics. Same `nx_phys/ny_phys` as the normal grid; ! only `nghost` differs (`ng_wide`). type(hgrid_t) :: grid_w !! Wide hgrid_t: nghost = ng_wide. type(ocean_metrics_t) :: metrics_w !! Metrics built on `grid_w` via the same formula generator. ! Wide Coriolis corners — filled by `metrics_fill_coriolis`. real(wp), allocatable :: f_corner_w(:, :) !! Coriolis at wide-grid C-grid corners (nx_w+1, ny_w+1). ! Wide shadow copies of the 22 fast-loop 2D arrays. ! Naming convention: w_<field> mirrors <field> on the wide grid. ! Centres (nx_w, ny_w): real(wp), allocatable :: w_eta(:, :) real(wp), allocatable :: w_H_ref(:, :) real(wp), allocatable :: w_eta_new(:, :) real(wp), allocatable :: w_ke(:, :) real(wp), allocatable :: w_eta_sum(:, :) real(wp), allocatable :: w_eta_end(:, :) ! East-face u (nx_w+1, ny_w): real(wp), allocatable :: w_ubt(:, :) real(wp), allocatable :: w_ubt_prev(:, :) real(wp), allocatable :: w_rem_u(:, :) real(wp), allocatable :: w_ubt_sum(:, :) real(wp), allocatable :: w_uhbt_sum(:, :) real(wp), allocatable :: w_uhbt(:, :) real(wp), allocatable :: w_ubt_end(:, :) ! North-face v (nx_w, ny_w+1): real(wp), allocatable :: w_vbt(:, :) real(wp), allocatable :: w_vbt_prev(:, :) real(wp), allocatable :: w_rem_v(:, :) real(wp), allocatable :: w_vbt_sum(:, :) real(wp), allocatable :: w_vhbt_sum(:, :) real(wp), allocatable :: w_vhbt(:, :) real(wp), allocatable :: w_vbt_end(:, :) ! Corner zeta (nx_w+1, ny_w+1): real(wp), allocatable :: w_zeta(:, :) ! Wide force arrays (copied in from the normal-width slow tendencies): real(wp), allocatable :: w_force_u(:, :) real(wp), allocatable :: w_force_v(:, :) contains procedure, non_overridable :: init => bt_wide_init procedure, non_overridable :: enter_data => bt_wide_enter_data procedure, non_overridable :: exit_data => bt_wide_exit_data procedure, non_overridable :: copy_in => bt_wide_copy_in procedure, non_overridable :: entry_exchange => bt_wide_entry_exchange procedure, non_overridable :: copy_out => bt_wide_copy_out procedure, non_overridable :: destroy => bt_wide_destroy procedure, non_overridable :: bytes => bt_wide_bytes end type bt_wide_t