Overwrite net surface salt flux h%state%surface_flux%Q_salt on
the physical interior, narrow-push. See
rdb_ocean_get_q_heat_ptr for the P2.4 unification note.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | intent(in), | value | :: | c_handle | ||
| real(kind=c_double), | intent(in) | :: | q_data(nx_p,ny_p) | |||
| integer(kind=c_int), | intent(in), | value | :: | nx_p | ||
| integer(kind=c_int), | intent(in), | value | :: | ny_p |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(ocean_handle_t), | private, | pointer | :: | h | |||
| integer, | private | :: | ierr_local | ||||
| integer, | private | :: | ng |
function rdb_ocean_set_salt_flux(c_handle, q_data, nx_p, ny_p) result(status) & bind(c, name="rdb_ocean_set_salt_flux") !! Overwrite net surface salt flux `h%state%surface_flux%Q_salt` on !! the physical interior, narrow-push. See !! `rdb_ocean_get_q_heat_ptr` for the P2.4 unification note. type(c_ptr), intent(in), value :: c_handle integer(c_int), intent(in), value :: nx_p, ny_p real(c_double), intent(in) :: q_data(nx_p, ny_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 (nx_p /= h%grid%nx_phys .or. ny_p /= h%grid%ny_phys) then call fail("rdb_ocean_set_salt_flux: 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 (qs => h%state%surface_flux%Q_salt) qs(ng + 1:ng + nx_p, ng + 1:ng + ny_p) = real(q_data, wp) !$acc update device(qs) end associate status = int(OCEAN_STATUS_OK, c_int) end function rdb_ocean_set_salt_flux