ocean_slopes_set_bathymetry Subroutine

private subroutine ocean_slopes_set_bathymetry(this, b)

Copy the bed depth b (m, positive down, (nx_total, ny_total) incl. ghosts) into this%bathy on the host. Call it with the WRAPPED + halo-exchanged barotropic%b (the seam faces read the ghosts) and BEFORE enter_data (the device copy is taken from the host values); to refresh after enter_data the caller issues !$acc update device(this%bathy) itself. No-op on an uninitialised slot.

Type Bound

ocean_slopes_t

Arguments

Type IntentOptional Attributes Name
class(ocean_slopes_t), intent(inout) :: this
real(kind=wp), intent(in) :: b(:,:)

Called by

proc~~ocean_slopes_set_bathymetry~~CalledByGraph proc~ocean_slopes_set_bathymetry ocean_slopes_t%ocean_slopes_set_bathymetry proc~rdb_ocean_set_bathymetry rdb_ocean_set_bathymetry proc~rdb_ocean_set_bathymetry->proc~ocean_slopes_set_bathymetry

Variables

Type Visibility Attributes Name Initial
integer, private :: i
integer, private :: j

Source Code

   subroutine ocean_slopes_set_bathymetry(this, b)
      !! Copy the bed depth `b` (m, positive down, `(nx_total, ny_total)`
      !! incl. ghosts) into `this%bathy` on the host.  Call it with the
      !! WRAPPED + halo-exchanged `barotropic%b` (the seam faces read the
      !! ghosts) and BEFORE `enter_data` (the device copy is taken from
      !! the host values); to refresh after `enter_data` the caller issues
      !! `!$acc update device(this%bathy)` itself.  No-op on an
      !! uninitialised slot.
      class(ocean_slopes_t), intent(inout) :: this
      real(wp), intent(in) :: b(:, :)
      integer :: i, j
      if (.not. this%is_init) return
      if (size(b, 1) /= this%nx_total .or. size(b, 2) /= this%ny_total) then
         error stop "ocean_slopes_set_bathymetry: shape mismatch"
      end if
      do j = 1, this%ny_total
         do i = 1, this%nx_total
            this%bathy(i, j) = b(i, j)
         end do
      end do
      this%bathy_set = .true.
   end subroutine ocean_slopes_set_bathymetry