Flat-impl Phase-A u-face kernel. Parallel over (i,j) interior
u-faces (i=2..nx); the 2*nz+2 sweep runs serially inside each
thread over a column pair (iw=i-1 west, i east). Wall faces and
land faces leave the inert (zero/identity) coefficients. The
sweep runs on each face’s open window uKb..uKt (1..nz off the
z-level closed-face path; module header); a face with no open
layer (uKt < uKb) is inert.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(in) | :: | nz | |||
| integer, | intent(in) | :: | ns | |||
| type(eos_t), | intent(in) | :: | eos | |||
| real(kind=wp), | intent(in) | :: | h_layer(nx,ny,nz) | |||
| real(kind=wp), | intent(in) | :: | t_htr(nx,ny,nz) | |||
| real(kind=wp), | intent(in) | :: | s_htr(nx,ny,nz) | |||
| real(kind=wp), | intent(in) | :: | wet_u(nx+1,ny) | |||
| integer, | intent(in) | :: | uKb(nx+1,ny) |
Per-face open window (native layers). |
||
| integer, | intent(in) | :: | uKt(nx+1,ny) |
Per-face open window (native layers). |
||
| real(kind=wp), | intent(out) | :: | uPoL(nx+1,ny,ns) | |||
| real(kind=wp), | intent(out) | :: | uPoR(nx+1,ny,ns) | |||
| integer, | intent(out) | :: | uKoL(nx+1,ny,ns) | |||
| integer, | intent(out) | :: | uKoR(nx+1,ny,ns) | |||
| real(kind=wp), | intent(out) | :: | uhEff(nx+1,ny,ns-1) |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | KoLc(2*NZ_STACK_MAX+2) | ||||
| integer, | private | :: | KoRc(2*NZ_STACK_MAX+2) | ||||
| real(kind=wp), | private | :: | PoLc(2*NZ_STACK_MAX+2) | ||||
| real(kind=wp), | private | :: | PoRc(2*NZ_STACK_MAX+2) | ||||
| real(kind=wp), | private | :: | hEc(2*NZ_STACK_MAX+1) | ||||
| real(kind=wp), | private | :: | hL(NZ_STACK_MAX) | ||||
| real(kind=wp), | private | :: | hR(NZ_STACK_MAX) | ||||
| integer, | private | :: | i | ||||
| integer, | private | :: | j | ||||
| integer, | private | :: | k | ||||
| integer, | private | :: | kb | ||||
| integer, | private | :: | kt | ||||
| integer, | private | :: | s | ||||
| real(kind=wp), | private | :: | scL(NZ_STACK_MAX) | ||||
| real(kind=wp), | private | :: | scR(NZ_STACK_MAX) | ||||
| real(kind=wp), | private | :: | tcL(NZ_STACK_MAX) | ||||
| real(kind=wp), | private | :: | tcR(NZ_STACK_MAX) |
subroutine redi_calc_coeffs_x(nx, ny, nz, ns, eos, h_layer, & t_htr, s_htr, wet_u, uKb, uKt, & uPoL, uPoR, uKoL, uKoR, uhEff) !! Flat-impl Phase-A u-face kernel. Parallel over (i,j) interior !! u-faces (i=2..nx); the 2*nz+2 sweep runs serially inside each !! thread over a column pair (iw=i-1 west, i east). Wall faces and !! land faces leave the inert (zero/identity) coefficients. The !! sweep runs on each face's open window `uKb..uKt` (`1..nz` off the !! z-level closed-face path; module header); a face with no open !! layer (`uKt < uKb`) is inert. integer, intent(in) :: nx, ny, nz, ns type(eos_t), intent(in) :: eos real(wp), intent(in) :: h_layer(nx, ny, nz) real(wp), intent(in) :: t_htr(nx, ny, nz) real(wp), intent(in) :: s_htr(nx, ny, nz) real(wp), intent(in) :: wet_u(nx + 1, ny) integer, intent(in) :: uKb(nx + 1, ny), uKt(nx + 1, ny) !! Per-face open window (native layers). real(wp), intent(out) :: uPoL(nx + 1, ny, ns) real(wp), intent(out) :: uPoR(nx + 1, ny, ns) integer, intent(out) :: uKoL(nx + 1, ny, ns) integer, intent(out) :: uKoR(nx + 1, ny, ns) real(wp), intent(out) :: uhEff(nx + 1, ny, ns - 1) integer :: i, j, k, s, kb, kt real(wp) :: hL(NZ_STACK_MAX), tcL(NZ_STACK_MAX), scL(NZ_STACK_MAX) real(wp) :: hR(NZ_STACK_MAX), tcR(NZ_STACK_MAX), scR(NZ_STACK_MAX) real(wp) :: PoLc(2*NZ_STACK_MAX + 2), PoRc(2*NZ_STACK_MAX + 2) integer :: KoLc(2*NZ_STACK_MAX + 2), KoRc(2*NZ_STACK_MAX + 2) real(wp) :: hEc(2*NZ_STACK_MAX + 1) do concurrent(j=1:ny, i=2:nx) & local(k, s, kb, kt, hL, tcL, scL, hR, tcR, scR, PoLc, PoRc, KoLc, KoRc, hEc) do s = 1, ns uPoL(i, j, s) = 0.0_wp uPoR(i, j, s) = 0.0_wp uKoL(i, j, s) = 1 uKoR(i, j, s) = 1 end do do s = 1, ns - 1 uhEff(i, j, s) = 0.0_wp end do kb = uKb(i, j) kt = uKt(i, j) if (wet_u(i, j) > 0.0_wp .and. kt >= kb) then do k = 1, nz hL(k) = h_layer(i - 1, j, k) tcL(k) = t_htr(i - 1, j, k) scL(k) = s_htr(i - 1, j, k) hR(k) = h_layer(i, j, k) tcR(k) = t_htr(i, j, k) scR(k) = s_htr(i, j, k) end do call redi_face_coeffs(nz, ns, kb, kt, hL, tcL, scL, hR, tcR, scR, eos, & PoLc, PoRc, KoLc, KoRc, hEc) do s = 1, ns uPoL(i, j, s) = PoLc(s) uPoR(i, j, s) = PoRc(s) uKoL(i, j, s) = KoLc(s) uKoR(i, j, s) = KoRc(s) end do do s = 1, ns - 1 uhEff(i, j, s) = hEc(s) end do end if end do end subroutine redi_calc_coeffs_x