Max |u_ice|/|v_ice| over PHYSICAL faces only (the array-edge
ghost faces carry no meaning here). !$acc parallel loop
reduction (inert comment on non-OpenACC compilers) — GPU-safe
max reduction for the zero-velocity exact no-op gate.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | u_ice(nx+1,ny) | |||
| real(kind=wp), | intent(in) | :: | v_ice(nx,ny+1) | |||
| integer, | intent(in) | :: | nghost | |||
| integer, | intent(in) | :: | nx_phys | |||
| integer, | intent(in) | :: | ny_phys | |||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny | |||
| real(kind=wp), | intent(out) | :: | vmax |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| 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_max_speed_impl(u_ice, v_ice, nghost, nx_phys, ny_phys, nx, ny, vmax) !! Max |u_ice|/|v_ice| over PHYSICAL faces only (the array-edge !! ghost faces carry no meaning here). `!$acc parallel loop !! reduction` (inert comment on non-OpenACC compilers) — GPU-safe !! max reduction for the zero-velocity exact no-op gate. integer, intent(in) :: nghost, nx_phys, ny_phys, nx, ny real(wp), intent(in) :: u_ice(nx + 1, ny) real(wp), intent(in) :: v_ice(nx, ny + 1) real(wp), intent(out) :: vmax integer :: i, j, i_lo, i_hi, j_lo, j_hi i_lo = nghost + 1 i_hi = nghost + nx_phys j_lo = nghost + 1 j_hi = nghost + ny_phys vmax = 0.0_wp do concurrent(j=j_lo:j_hi, i=i_lo:i_hi + 1) reduce(max:vmax) vmax = max(vmax, abs(u_ice(i, j))) end do do concurrent(j=j_lo:j_hi + 1, i=i_lo:i_hi) reduce(max:vmax) vmax = max(vmax, abs(v_ice(i, j))) end do end subroutine ice_max_speed_impl