Seam ghosts of the three per-cell ice->ocean flux diagnostics the
couplers hand to the ocean — salt_flux_diag, heat_flux_diag,
sw_thru_diag — one two-pass centre exchange each.
Why. The column driver, frazil uptake and snowfall share write
them on PHYSICAL cells only, but the brine / heat / shortwave
couplers copy them over the FULL array into Q_salt / Q_heat /
q_sw (or their components), and the ocean’s surface-flux
application reads a seam ghost before its next exchange. A stale
ghost there is the neighbour’s flux replaced by this tile’s old
one (measured: the first decomposed run diverged from the serial
one in the outer step after the first thermo block). Call after
the last contributor and before the couplers. Single-rank
non-periodic: a no-op; requires ocean_halo_init. Also carries
the tripolar north fold of the same three fields (plain-copy
scalar contract) — the fold-seam fix’s third exchange site.
| 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. |
subroutine ocean_halo_exchange_ice_fluxes(ice, grid, bc, device_resident) !! Seam ghosts of the three per-cell ice->ocean flux diagnostics the !! couplers hand to the ocean — `salt_flux_diag`, `heat_flux_diag`, !! `sw_thru_diag` — one two-pass centre exchange each. !! !! **Why.** The column driver, frazil uptake and snowfall share write !! them on PHYSICAL cells only, but the brine / heat / shortwave !! couplers copy them over the FULL array into `Q_salt` / `Q_heat` / !! `q_sw` (or their components), and the ocean's surface-flux !! application reads a seam ghost before its next exchange. A stale !! ghost there is the neighbour's flux replaced by this tile's old !! one (measured: the first decomposed run diverged from the serial !! one in the outer step after the first thermo block). Call after !! the last contributor and before the couplers. Single-rank !! non-periodic: a no-op; requires `ocean_halo_init`. Also carries !! the tripolar north fold of the same three fields (plain-copy !! scalar contract) — the fold-seam fix's third exchange site. 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. if (.not. ice%is_init) return call profiler_start("ice_comms_fluxes") call oh_count_suppress_on() call ocean_halo_centre(ice%salt_flux_diag, device_resident) call ocean_halo_centre(ice%heat_flux_diag, device_resident) call ocean_halo_centre(ice%sw_thru_diag, device_resident) call oh_count_suppress_off() call profiler_stop("ice_comms_fluxes") if (bc%north_fold) then call ocean_fold_wrap_centre_flat(grid, bc, ice%salt_flux_diag, & size(ice%salt_flux_diag, 1), & size(ice%salt_flux_diag, 2), 1, device_resident) call ocean_fold_wrap_centre_flat(grid, bc, ice%heat_flux_diag, & size(ice%heat_flux_diag, 1), & size(ice%heat_flux_diag, 2), 1, device_resident) call ocean_fold_wrap_centre_flat(grid, bc, ice%sw_thru_diag, & size(ice%sw_thru_diag, 1), & size(ice%sw_thru_diag, 2), 1, device_resident) end if end subroutine ocean_halo_exchange_ice_fluxes