ocean_pressure_force_set_bathymetry Subroutine

private subroutine ocean_pressure_force_set_bathymetry(this, b)

Copy b(:, :) into this%b on the host. Must be called BEFORE enter_data (the device copy is taken from the host values). Issues no update device; to refresh post enter_data the caller must issue !$acc update device(this%b) itself.

Type Bound

ocean_pressure_force_t

Arguments

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

Called by

proc~~ocean_pressure_force_set_bathymetry~~CalledByGraph proc~ocean_pressure_force_set_bathymetry ocean_pressure_force_t%ocean_pressure_force_set_bathymetry proc~engine_setup engine_setup proc~engine_setup->proc~ocean_pressure_force_set_bathymetry proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_setup proc~driver_validate driver_validate proc~driver_validate->proc~engine_setup proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean proc~rdb_ocean_create_finalize rdb_ocean_create_finalize proc~rdb_ocean_create_finalize->proc~complete_ocean_create proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~complete_ocean_create

Variables

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

Source Code

   subroutine ocean_pressure_force_set_bathymetry(this, b)
      !! Copy `b(:, :)` into `this%b` on the host. Must be called BEFORE
      !! `enter_data` (the device copy is taken from the host values).
      !! Issues no `update device`; to refresh post `enter_data` the
      !! caller must issue `!$acc update device(this%b)` itself.
      class(ocean_pressure_force_t), intent(inout) :: this
      real(wp), intent(in) :: b(:, :)
      integer :: nx, ny, i, j
      nx = size(this%b, 1)
      ny = size(this%b, 2)
      if (size(b, 1) /= nx .or. size(b, 2) /= ny) then
         error stop "ocean_pressure_force_set_bathymetry: shape mismatch"
      end if
      do j = 1, ny
         do i = 1, nx
            this%b(i, j) = b(i, j)
         end do
      end do
   end subroutine ocean_pressure_force_set_bathymetry