h_layer(k) += dt * (w(k) - w(k+1)) per cell. Bed and
surface interfaces feed through whatever w the caller set
(zero for the bed by default after
compute_w_from_continuity with enforce_bed_bc = true).
No h-floor — plain accumulation; the caller is responsible
for guarding against negative thickness if the prescribed
w + dt is large.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(in) | :: | nz | |||
| real(kind=wp), | intent(in) | :: | dt | |||
| real(kind=wp), | intent(in) | :: | w_interface(nx,ny,nz+1) | |||
| real(kind=wp), | intent(inout) | :: | h_layer(nx,ny,nz) |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | i | ||||
| integer, | private | :: | j | ||||
| integer, | private | :: | k |
pure subroutine apply_w_to_h_layer(nx, ny, nz, dt, w_interface, h_layer) !! `h_layer(k) += dt * (w(k) - w(k+1))` per cell. Bed and !! surface interfaces feed through whatever w the caller set !! (zero for the bed by default after !! `compute_w_from_continuity` with `enforce_bed_bc = true`). !! No h-floor — plain accumulation; the caller is responsible !! for guarding against negative thickness if the prescribed !! w + dt is large. integer, intent(in) :: nx, ny, nz real(wp), intent(in) :: dt real(wp), intent(in) :: w_interface(nx, ny, nz + 1) real(wp), intent(inout) :: h_layer(nx, ny, nz) integer :: i, j, k do concurrent(k=1:nz, j=1:ny, i=1:nx) h_layer(i, j, k) = h_layer(i, j, k) + & dt*(w_interface(i, j, k) - w_interface(i, j, k + 1)) end do end subroutine apply_w_to_h_layer