X4 of the sea-ice MPI plan: the seam ghosts every advective
substep of ice_transport_step reads — the cell-averaged
category masses mca_ice/mca_snow (the PPM donors, 5-point
stencil) and the riding intensive tracers m_ice, enth_ice,
sal_ice, enth_snow (the PCM donors). mca_* ghosts are
zeroed by the IST->CAS conversion and the ride/mass updates leave
the ghost band one substep old, so this runs at the top of EVERY
substep. On one rank with a periodic axis the primitives wrap.
Also carries the tripolar north fold of the same six fields
(plain-copy scalar contract) — without it the fold-seam row’s
advective stencil read a stale/unrelated mirror cell every
substep, which is how ice piled up without bound on that row.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_sea_ice_t), | intent(inout) | :: | ice |
Live sea-ice slot ( |
||
| type(hgrid_t), | intent(in) | :: | grid | |||
| type(ocean_bc_state_t), | intent(in) | :: | bc |
Supplies |
||
| logical, | intent(in), | optional | :: | device_resident |
Forwarded to the halo primitives. |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | nxt | ||||
| integer, | private | :: | nyt |
subroutine ocean_halo_exchange_ice_transport(ice, grid, bc, device_resident) !! X4 of the sea-ice MPI plan: the seam ghosts every advective !! substep of `ice_transport_step` reads — the cell-averaged !! category masses `mca_ice`/`mca_snow` (the PPM donors, 5-point !! stencil) and the riding intensive tracers `m_ice`, `enth_ice`, !! `sal_ice`, `enth_snow` (the PCM donors). `mca_*` ghosts are !! zeroed by the IST->CAS conversion and the ride/mass updates leave !! the ghost band one substep old, so this runs at the top of EVERY !! substep. On one rank with a periodic axis the primitives wrap. !! Also carries the tripolar north fold of the same six fields !! (plain-copy scalar contract) — without it the fold-seam row's !! advective stencil read a stale/unrelated mirror cell every !! substep, which is how ice piled up without bound on that row. type(ocean_sea_ice_t), intent(inout) :: ice !! Live sea-ice slot (`ice%is_init`); a no-op otherwise. type(hgrid_t), intent(in) :: grid type(ocean_bc_state_t), intent(in) :: bc !! Supplies `north_fold` + the grid metrics the fold kernels need. logical, intent(in), optional :: device_resident !! Forwarded to the halo primitives. integer :: nxt, nyt if (.not. ice%is_init) return nxt = ice%nx_total nyt = ice%ny_total call profiler_start("ice_comms_transport") call oh_count_suppress_on() call ice_halo_centre_flat(ice%mca_ice, nxt, nyt, ice%ncat, device_resident) call ice_halo_centre_flat(ice%mca_snow, nxt, nyt, ice%ncat, device_resident) call ice_halo_centre_flat(ice%m_ice, nxt, nyt, ice%ncat, device_resident) call ice_halo_centre_flat(ice%enth_ice, nxt, nyt, ice%ncat*ice%nk_ice, device_resident) call ice_halo_centre_flat(ice%sal_ice, nxt, nyt, ice%ncat*ice%nk_ice, device_resident) call ice_halo_centre_flat(ice%enth_snow, nxt, nyt, ice%ncat, device_resident) call oh_count_suppress_off() call profiler_stop("ice_comms_transport") if (bc%north_fold) then call ocean_fold_wrap_centre_flat(grid, bc, ice%mca_ice, nxt, nyt, & ice%ncat, device_resident) call ocean_fold_wrap_centre_flat(grid, bc, ice%mca_snow, nxt, nyt, & ice%ncat, device_resident) call ocean_fold_wrap_centre_flat(grid, bc, ice%m_ice, nxt, nyt, & ice%ncat, device_resident) call ocean_fold_wrap_centre_flat(grid, bc, ice%enth_ice, nxt, nyt, & ice%ncat*ice%nk_ice, device_resident) call ocean_fold_wrap_centre_flat(grid, bc, ice%sal_ice, nxt, nyt, & ice%ncat*ice%nk_ice, device_resident) call ocean_fold_wrap_centre_flat(grid, bc, ice%enth_snow, nxt, nyt, & ice%ncat, device_resident) end if end subroutine ocean_halo_exchange_ice_transport