Flat-impl y-face remap, mirror of remap_x_face_velocity. See
that routine for the conserve_ke / bnd_extrap / nonunif
semantics.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(in) | :: | nz | |||
| real(kind=wp), | intent(in) | :: | h_old(nx,ny,nz) | |||
| real(kind=wp), | intent(in) | :: | h_new(nx,ny,nz) | |||
| real(kind=wp), | intent(inout) | :: | v_face_y(nx,ny+1,nz) | |||
| integer, | intent(in) | :: | method | |||
| logical, | intent(in) | :: | conserve_ke | |||
| logical, | intent(in) | :: | zlevel_faces |
With the arithmetic mean a one-sided filler gives
|
||
| logical, | intent(in) | :: | bnd_extrap | |||
| logical, | intent(in) | :: | nonunif |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | J | ||||
| real(kind=wp), | private | :: | h_new_face(NZ_STACK_MAX) | ||||
| real(kind=wp), | private | :: | h_old_face(NZ_STACK_MAX) | ||||
| integer, | private | :: | i | ||||
| integer, | private | :: | k | ||||
| real(kind=wp), | private | :: | v_new_col(NZ_STACK_MAX) | ||||
| real(kind=wp), | private | :: | v_old_col(NZ_STACK_MAX) |
pure subroutine remap_y_face_velocity(nx, ny, nz, h_old, h_new, v_face_y, method, & conserve_ke, zlevel_faces, bnd_extrap, nonunif) !! Flat-impl y-face remap, mirror of `remap_x_face_velocity`. See !! that routine for the `conserve_ke` / `bnd_extrap` / `nonunif` !! semantics. integer, intent(in) :: nx, ny, nz, method real(wp), intent(in) :: h_old(nx, ny, nz) real(wp), intent(in) :: h_new(nx, ny, nz) real(wp), intent(inout) :: v_face_y(nx, ny + 1, nz) logical, intent(in) :: conserve_ke logical, intent(in) :: zlevel_faces !! `&vcoord_nml zfixed_closed_faces` — z-level partial steps. !! Builds the face column as the OVERLAP of the two cell !! columns, `min(h_L, h_R)`, instead of their arithmetic mean, !! and then drops any layer at or below `H_VANISHED` from BOTH !! the source and the target column. A layer that is an inert !! filler on one side then has an exactly-zero target thickness, !! which is the one case every `remap_column` variant already !! short-circuits (`dz_new <= 0 ⇒ q_new = 0`), so no momentum is !! poured INTO a closed layer and none is carried OUT of one. !! !! With the arithmetic mean a one-sided filler gives !! `0.5·h_live > 0` — an ordinary half-thickness live layer as !! far as the column kernel is concerned — and the remap happily !! deposits momentum in a cell that geometrically holds no !! water. `min` is also the standard partial-cell face !! thickness, so this is not a special case bolted on: it is the !! face thickness a z-level model has all along. !! !! `.false.` (default) ⇒ every expression is textually the !! arithmetic-mean form ⇒ bit-identical. logical, intent(in) :: bnd_extrap logical, intent(in) :: nonunif integer :: i, J, k real(wp) :: h_old_face(NZ_STACK_MAX), h_new_face(NZ_STACK_MAX) real(wp) :: v_old_col(NZ_STACK_MAX), v_new_col(NZ_STACK_MAX) do concurrent(J=1:ny + 1, i=1:nx) & local(k, h_old_face, h_new_face, v_old_col, v_new_col) do k = 1, nz if (J == 1) then h_old_face(k) = h_old(i, 1, k) h_new_face(k) = h_new(i, 1, k) else if (J == ny + 1) then h_old_face(k) = h_old(i, ny, k) h_new_face(k) = h_new(i, ny, k) else h_old_face(k) = 0.5_wp*(h_old(i, J - 1, k) + h_old(i, J, k)) h_new_face(k) = 0.5_wp*(h_new(i, J - 1, k) + h_new(i, J, k)) end if if (zlevel_faces) then if (J == 1) then h_old_face(k) = h_old(i, 1, k) h_new_face(k) = h_new(i, 1, k) else if (J == ny + 1) then h_old_face(k) = h_old(i, ny, k) h_new_face(k) = h_new(i, ny, k) else h_old_face(k) = min(h_old(i, J - 1, k), h_old(i, J, k)) h_new_face(k) = min(h_new(i, J - 1, k), h_new(i, J, k)) end if if (h_old_face(k) <= H_VANISHED .or. h_new_face(k) <= H_VANISHED) then h_old_face(k) = 0.0_wp h_new_face(k) = 0.0_wp end if end if v_old_col(k) = v_face_y(i, J, k) end do call remap_column(method, nz, & h_old_face(1:nz), h_new_face(1:nz), & v_old_col(1:nz), v_new_col(1:nz), bnd_extrap, nonunif) if (conserve_ke) then call rescale_anomaly_ke(nz, h_old_face, h_new_face, v_old_col, v_new_col) end if do k = 1, nz v_face_y(i, J, k) = v_new_col(k) end do end do end subroutine remap_y_face_velocity