Fill fb_part_sum(i,j) = Σ_c part_size(i,j,c) restricted to
categories passing the column’s OWN entry gate
(m_ice(i,j,c) > ICE_RHO_ICE*H_VANISHED) — MUST run BEFORE
ice_thermo_columns mutates m_ice (module docstring). Device
kernel over PHYSICAL cells, inner if/serial do cat — never a
masked do concurrent header.
Decl-order: all integer dims declared before the explicit-shape arrays that use them.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | wet_mask(nx,ny) | |||
| real(kind=wp), | intent(in) | :: | part_size(nx,ny,0:ncat) | |||
| real(kind=wp), | intent(in) | :: | m_ice(nx,ny,ncat) | |||
| real(kind=wp), | intent(inout) | :: | fb_part_sum(nx,ny) | |||
| integer, | intent(in) | :: | nghost | |||
| integer, | intent(in) | :: | ncat | |||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | cat | ||||
| integer, | private | :: | i | ||||
| integer, | private | :: | i_hi | ||||
| integer, | private | :: | i_lo | ||||
| integer, | private | :: | j | ||||
| integer, | private | :: | j_hi | ||||
| integer, | private | :: | j_lo |
pure subroutine ice_fb_part_sum_fill_impl(wet_mask, part_size, m_ice, fb_part_sum, & nghost, ncat, nx, ny) !! Fill `fb_part_sum(i,j) = Σ_c part_size(i,j,c)` restricted to !! categories passing the column's OWN entry gate !! (`m_ice(i,j,c) > ICE_RHO_ICE*H_VANISHED`) — MUST run BEFORE !! `ice_thermo_columns` mutates `m_ice` (module docstring). Device !! kernel over PHYSICAL cells, inner `if`/serial `do cat` — never a !! masked `do concurrent` header. !! !! Decl-order: all integer dims declared before the explicit-shape !! arrays that use them. integer, intent(in) :: nghost, ncat, nx, ny real(wp), intent(in) :: wet_mask(nx, ny) real(wp), intent(in) :: part_size(nx, ny, 0:ncat) real(wp), intent(in) :: m_ice(nx, ny, ncat) real(wp), intent(inout) :: fb_part_sum(nx, ny) integer :: i, j, cat, i_lo, i_hi, j_lo, j_hi i_lo = nghost + 1 i_hi = nx - nghost j_lo = nghost + 1 j_hi = ny - nghost do concurrent(j=j_lo:j_hi, i=i_lo:i_hi) local(cat) fb_part_sum(i, j) = 0.0_wp if (wet_mask(i, j) > 0.5_wp) then do cat = 1, ncat if (m_ice(i, j, cat) > ICE_RHO_ICE*H_VANISHED) then fb_part_sum(i, j) = fb_part_sum(i, j) + part_size(i, j, cat) end if end do end if end do end subroutine ice_fb_part_sum_fill_impl