Overwrite v_face_y_layer on the physical interior faces
(ny_p+1 south faces bracketing ny_p physical rows) and
narrow-push it. See rdb_ocean_set_u for the
hv_face_y_layer caveat (not re-derived).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | intent(in), | value | :: | c_handle | ||
| real(kind=c_double), | intent(in) | :: | v_data(nx_p,ny_p+1,nz_p) | |||
| integer(kind=c_int), | intent(in), | value | :: | nx_p | ||
| integer(kind=c_int), | intent(in), | value | :: | ny_p | ||
| integer(kind=c_int), | intent(in), | value | :: | nz_p |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(ocean_handle_t), | private, | pointer | :: | h | |||
| integer, | private | :: | ierr_local | ||||
| integer, | private | :: | ng |
function rdb_ocean_set_v(c_handle, v_data, nx_p, ny_p, nz_p) result(status) & bind(c, name="rdb_ocean_set_v") !! Overwrite `v_face_y_layer` on the physical interior faces !! (`ny_p+1` south faces bracketing `ny_p` physical rows) and !! narrow-push it. See `rdb_ocean_set_u` for the !! `hv_face_y_layer` caveat (not re-derived). type(c_ptr), intent(in), value :: c_handle integer(c_int), intent(in), value :: nx_p, ny_p, nz_p real(c_double), intent(in) :: v_data(nx_p, ny_p + 1, nz_p) integer(c_int) :: status type(ocean_handle_t), pointer :: h integer :: ng, ierr_local status = resolve_ocean(c_handle, h) if (status /= OCEAN_STATUS_OK) return if (.not. shape_matches_interior(h, nx_p, ny_p, nz_p)) then call fail("rdb_ocean_set_v: shape mismatch against the physical interior", & ierr_local, OCEAN_STATUS_ERR_BAD_SHAPE) status = int(ierr_local, c_int) return end if ng = h%grid%nghost associate (vf => h%state%multilayer%v_face_y_layer) vf(ng + 1:ng + nx_p, ng + 1:ng + ny_p + 1, :) = real(v_data, wp) !$acc update device(vf) end associate status = int(OCEAN_STATUS_OK, c_int) end function rdb_ocean_set_v