stress_mag(i,j) = |tau| at cell centres — literal copy of the
three lines this dedups from rdb_ocean_vmix.F90 (KPP,
:575-577/:641-643, pre-PR-12) and rdb_ocean_epbl.F90
(:974-976, pre-PR-12): SAME face-average op order, so the
substitution at each call site is bit-identical (PR-12 §7.5).
Explicit-shape dummies, integer dims first (decl-order).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | tau_x(nx+1,ny) | |||
| real(kind=wp), | intent(in) | :: | tau_y(nx,ny+1) | |||
| real(kind=wp), | intent(inout) | :: | stress_mag(nx,ny) | |||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | i | ||||
| integer, | private | :: | j | ||||
| real(kind=wp), | private | :: | tau_x_cell | ||||
| real(kind=wp), | private | :: | tau_y_cell |
pure subroutine ocean_surfstress_derived_impl(tau_x, tau_y, stress_mag, nx, ny) !! `stress_mag(i,j) = |tau|` at cell centres — literal copy of the !! three lines this dedups from `rdb_ocean_vmix.F90` (KPP, !! `:575-577`/`:641-643`, pre-PR-12) and `rdb_ocean_epbl.F90` !! (`:974-976`, pre-PR-12): SAME face-average op order, so the !! substitution at each call site is bit-identical (PR-12 §7.5). !! Explicit-shape dummies, integer dims first (decl-order). integer, intent(in) :: nx, ny real(wp), intent(in) :: tau_x(nx + 1, ny), tau_y(nx, ny + 1) real(wp), intent(inout) :: stress_mag(nx, ny) integer :: i, j real(wp) :: tau_x_cell, tau_y_cell do concurrent(j=1:ny, i=1:nx) local(tau_x_cell, tau_y_cell) tau_x_cell = 0.5_wp*(tau_x(i, j) + tau_x(i + 1, j)) tau_y_cell = 0.5_wp*(tau_y(i, j) + tau_y(i, j + 1)) stress_mag(i, j) = sqrt(tau_x_cell*tau_x_cell + tau_y_cell*tau_y_cell) end do end subroutine ocean_surfstress_derived_impl