rdb_ocean_periodic Module

GPU-resident periodic ghost-wrap helpers. Seam invariant after every wrap call: (a) every ghost cell equals its interior partner, and (b) u(i_w, ·) == u(i_e, ·) bit-for-bit (i_w = nghost+1, i_e = nghost+nx_phys+1).

Explicit-shape dummies (never assumed-shape), j-outer / i-inner do concurrent for NVHPC GPU coalescing. The fast barotropic substep does NOT call these — it wraps inline in its !$acc kernels async(1) region.


Uses

  • module~~rdb_ocean_periodic~~UsesGraph module~rdb_ocean_periodic rdb_ocean_periodic module~rdb_constants rdb_constants module~rdb_ocean_periodic->module~rdb_constants module~rdb_grid rdb_grid module~rdb_ocean_periodic->module~rdb_grid module~rdb_multilayer_state rdb_multilayer_state module~rdb_ocean_periodic->module~rdb_multilayer_state module~rdb_ocean_boundary_types rdb_ocean_boundary_types module~rdb_ocean_periodic->module~rdb_ocean_boundary_types pic_types pic_types module~rdb_constants->pic_types module~rdb_grid->module~rdb_constants module~rdb_multilayer_state->module~rdb_constants module~rdb_multilayer_state->module~rdb_grid iso_fortran_env iso_fortran_env module~rdb_multilayer_state->iso_fortran_env module~rdb_efp rdb_efp module~rdb_multilayer_state->module~rdb_efp module~rdb_error_ring rdb_error_ring module~rdb_multilayer_state->module~rdb_error_ring module~rdb_mem_report rdb_mem_report module~rdb_multilayer_state->module~rdb_mem_report module~rdb_tracer rdb_tracer module~rdb_multilayer_state->module~rdb_tracer pic_logger pic_logger module~rdb_multilayer_state->pic_logger module~rdb_ocean_boundary_types->module~rdb_constants module~rdb_ocean_boundary_types->module~rdb_grid module~rdb_ocean_boundary_types->iso_fortran_env module~rdb_ocean_boundary_types->module~rdb_mem_report 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_boundary_types->pic_logger module~rdb_efp->iso_fortran_env ieee_arithmetic ieee_arithmetic module~rdb_efp->ieee_arithmetic module~rdb_error_ring->pic_logger module~rdb_mem_report->module~rdb_constants module~rdb_mem_report->iso_fortran_env module~rdb_mem_report->pic_logger pic_strings pic_strings module~rdb_mem_report->pic_strings module~rdb_ocean_tide_astro->module~rdb_constants module~rdb_ocean_tide_astro->iso_fortran_env module~rdb_tracer->module~rdb_constants module~rdb_tracer->module~rdb_grid module~rdb_tracer->iso_fortran_env module~rdb_tracer->module~rdb_mem_report

Used by

  • module~~rdb_ocean_periodic~~UsedByGraph module~rdb_ocean_periodic rdb_ocean_periodic module~rdb_continuity rdb_continuity module~rdb_continuity->module~rdb_ocean_periodic module~rdb_ocean_halo rdb_ocean_halo module~rdb_continuity->module~rdb_ocean_halo module~rdb_ice_evp rdb_ice_evp module~rdb_ice_evp->module~rdb_ocean_periodic module~rdb_ice_evp->module~rdb_ocean_halo module~rdb_ocean_api rdb_ocean_api module~rdb_ocean_api->module~rdb_ocean_periodic module~rdb_ocean_dyn rdb_ocean_dyn module~rdb_ocean_api->module~rdb_ocean_dyn module~rdb_ocean_engine rdb_ocean_engine 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_dyn->module~rdb_ocean_periodic module~rdb_ocean_dyn->module~rdb_continuity module~rdb_ocean_dyn->module~rdb_ocean_halo module~rdb_ocean_halo_state rdb_ocean_halo_state module~rdb_ocean_dyn->module~rdb_ocean_halo_state module~rdb_barotropic_substep rdb_barotropic_substep module~rdb_ocean_dyn->module~rdb_barotropic_substep module~rdb_ocean_bt_wide rdb_ocean_bt_wide module~rdb_ocean_dyn->module~rdb_ocean_bt_wide module~rdb_ocean_engine->module~rdb_ocean_periodic module~rdb_ocean_engine->module~rdb_ice_evp module~rdb_ocean_engine->module~rdb_ocean_dyn module~rdb_ocean_engine->module~rdb_ocean_halo module~rdb_ocean_engine->module~rdb_ocean_halo_state module~rdb_ocean_state rdb_ocean_state module~rdb_ocean_engine->module~rdb_ocean_state module~rdb_ice_ocean_coupler rdb_ice_ocean_coupler module~rdb_ocean_engine->module~rdb_ice_ocean_coupler module~rdb_ice_transport rdb_ice_transport module~rdb_ocean_engine->module~rdb_ice_transport module~rdb_ocean_data_forcing rdb_ocean_data_forcing module~rdb_ocean_engine->module~rdb_ocean_data_forcing module~rdb_ocean_engine->module~rdb_ocean_diag_derived module~rdb_ocean_engine->module~rdb_ocean_diag_fills module~rdb_ocean_setup rdb_ocean_setup module~rdb_ocean_engine->module~rdb_ocean_setup module~rdb_ocean_halo->module~rdb_ocean_periodic module~rdb_ocean_halo_state->module~rdb_ocean_periodic module~rdb_ocean_halo_state->module~rdb_ocean_halo module~rdb_ocean_state->module~rdb_ocean_periodic module~rdb_ocean_state->module~rdb_continuity module~rdb_ocean_state->module~rdb_ocean_dyn module~rdb_ocean_state->module~rdb_ocean_data_forcing module~rdb_barotropic_substep->module~rdb_ocean_halo module~rdb_driver rdb_driver module~rdb_driver->module~rdb_ocean_dyn module~rdb_driver->module~rdb_ocean_engine module~rdb_driver->module~rdb_ocean_state module~rdb_handle->module~rdb_ocean_engine module~rdb_handle->module~rdb_ocean_state module~rdb_ice_ocean_coupler->module~rdb_ocean_halo_state module~rdb_ice_transport->module~rdb_continuity module~rdb_ice_transport->module~rdb_ocean_halo module~rdb_ice_transport->module~rdb_ocean_halo_state module~rdb_ocean_bt_wide->module~rdb_ocean_halo module~rdb_ocean_bt_wide->module~rdb_barotropic_substep module~rdb_ocean_data_forcing->module~rdb_ocean_halo_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 module~rdb_ocean_setup->module~rdb_ocean_dyn module~rdb_ocean_setup->module~rdb_ocean_halo module~rdb_ocean_setup->module~rdb_ocean_halo_state module~rdb_ocean_setup->module~rdb_ocean_state

Subroutines

public pure subroutine ocean_periodic_wrap_centre_2d(fld, nx_total, ny_total, nx_phys, ny_phys, nghost, wrap_x, wrap_y)

Fill ghost cells of a cell-centred 2D field (e.g. η, bt_H_ref) with the periodically-matching interior values. Explicit-shape dummies avoid per-launch descriptor-walk memcpys.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: fld(nx_total,ny_total)

Cell-centred field, shape (nx_total, ny_total).

integer, intent(in) :: nx_total
integer, intent(in) :: ny_total
integer, intent(in) :: nx_phys
integer, intent(in) :: ny_phys
integer, intent(in) :: nghost
logical, intent(in) :: wrap_x

Wrap ghost columns (west ↔ east).

logical, intent(in) :: wrap_y

Wrap ghost rows (south ↔ north).

public subroutine ocean_periodic_wrap_centre_3d(fld, nx_total, ny_total, nz, nx_phys, ny_phys, nghost, wrap_x, wrap_y, no_wait)

Fill ghost cells of a cell-centred 3D field (e.g. h_layer, hTr, T, S). no_wait (optional, default .false.): when .true., loops issue on OpenACC queue 1 and the routine returns WITHOUT syncing, so a batched caller can pipeline many tiny ghost-slab wraps and !$acc wait(1) once. Default ⇒ self-contained blocking wrap. Not pure (directives).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: fld(nx_total,ny_total,nz)

Cell-centred field, shape (nx_total, ny_total, nz).

integer, intent(in) :: nx_total
integer, intent(in) :: ny_total
integer, intent(in) :: nz
integer, intent(in) :: nx_phys
integer, intent(in) :: ny_phys
integer, intent(in) :: nghost
logical, intent(in) :: wrap_x
logical, intent(in) :: wrap_y
logical, intent(in), optional :: no_wait

public pure subroutine ocean_periodic_wrap_face_x_2d(fld, nx_face, ny_total, nx_phys, ny_phys, nghost, wrap_x, wrap_y)

Fill ghost faces of a 2D x-face field (e.g. bt_ubt, shape nx_total+1). Also copies the west physical-wall face value onto the east physical-wall face (belt-and-braces seam invariant, §1.1 property b). nx_face = nx_total + 1.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: fld(nx_face,ny_total)

x-face field, shape (nx_total+1, ny_total).

integer, intent(in) :: nx_face
integer, intent(in) :: ny_total
integer, intent(in) :: nx_phys
integer, intent(in) :: ny_phys
integer, intent(in) :: nghost
logical, intent(in) :: wrap_x
logical, intent(in) :: wrap_y

public subroutine ocean_periodic_wrap_face_x_3d(fld, nx_face, ny_total, nz, nx_phys, ny_phys, nghost, wrap_x, wrap_y, no_wait)

Fill ghost faces of a 3D x-face field (e.g. u_face_x_layer). nx_face = nx_total + 1. no_wait (optional): see ocean_periodic_wrap_centre_3d — batched async(1), sync once at the caller. Not pure (async/wait directives).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: fld(nx_face,ny_total,nz)

x-face field, shape (nx_total+1, ny_total, nz).

integer, intent(in) :: nx_face
integer, intent(in) :: ny_total
integer, intent(in) :: nz
integer, intent(in) :: nx_phys
integer, intent(in) :: ny_phys
integer, intent(in) :: nghost
logical, intent(in) :: wrap_x
logical, intent(in) :: wrap_y
logical, intent(in), optional :: no_wait

public pure subroutine ocean_periodic_wrap_face_y_2d(fld, nx_total, ny_face, nx_phys, ny_phys, nghost, wrap_x, wrap_y)

Fill ghost faces of a 2D y-face field (e.g. bt_vbt, shape ny_total+1). Also copies south physical-wall face onto north physical-wall face. ny_face = ny_total + 1.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: fld(nx_total,ny_face)

y-face field, shape (nx_total, ny_total+1).

integer, intent(in) :: nx_total
integer, intent(in) :: ny_face
integer, intent(in) :: nx_phys
integer, intent(in) :: ny_phys
integer, intent(in) :: nghost
logical, intent(in) :: wrap_x
logical, intent(in) :: wrap_y

public subroutine ocean_periodic_wrap_face_y_3d(fld, nx_total, ny_face, nz, nx_phys, ny_phys, nghost, wrap_x, wrap_y, no_wait)

Fill ghost faces of a 3D y-face field (e.g. v_face_y_layer). ny_face = ny_total + 1. no_wait (optional): see ocean_periodic_wrap_centre_3d. Not pure (async/wait directives).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: fld(nx_total,ny_face,nz)

y-face field, shape (nx_total, ny_total+1, nz).

integer, intent(in) :: nx_total
integer, intent(in) :: ny_face
integer, intent(in) :: nz
integer, intent(in) :: nx_phys
integer, intent(in) :: ny_phys
integer, intent(in) :: nghost
logical, intent(in) :: wrap_x
logical, intent(in) :: wrap_y
logical, intent(in), optional :: no_wait

public subroutine ocean_periodic_wrap_state(grid, bc, ms, skip_x, skip_y)

Convenience wrapper: wrap h_layer, u/v layer faces, and every registered tracer. Called at stage entry (before derive_bt_from_layers) and after continuity (before hdiff).

Read more…

Arguments

Type IntentOptional Attributes Name
type(hgrid_t), intent(in) :: grid
type(ocean_bc_state_t), intent(in) :: bc
type(multilayer_state_t), intent(inout) :: ms
logical, intent(in), optional :: skip_x

When .true., suppress the local x-axis wrap (D4 multi-rank).

logical, intent(in), optional :: skip_y

When .true., suppress the local y-axis wrap (D4 multi-rank).