ocean_data_input_fill_static_host_3d Subroutine

public subroutine ocean_data_input_fill_static_host_3d(this, id, n1, n2, n3, dest)

3-D twin of fill_static_host.

Arguments

Type IntentOptional Attributes Name
class(ocean_data_input_t), intent(in) :: this
integer, intent(in) :: id
integer, intent(in) :: n1
integer, intent(in) :: n2
integer, intent(in) :: n3
real(kind=wp), intent(inout) :: dest(n1,n2,n3)

Calls

proc~~ocean_data_input_fill_static_host_3d~~CallsGraph proc~ocean_data_input_fill_static_host_3d ocean_data_input_fill_static_host_3d error error proc~ocean_data_input_fill_static_host_3d->error proc~check_registered check_registered proc~ocean_data_input_fill_static_host_3d->proc~check_registered to_string to_string proc~ocean_data_input_fill_static_host_3d->to_string proc~check_registered->error proc~check_registered->to_string

Variables

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

Source Code

   subroutine ocean_data_input_fill_static_host_3d(this, id, n1, n2, n3, dest)
      !! 3-D twin of `fill_static_host`.
      class(ocean_data_input_t), intent(in) :: this
      integer, intent(in) :: id, n1, n2, n3
      real(wp), intent(inout) :: dest(n1, n2, n3)
      integer :: i, j, k

      call check_registered(this, id, is_3d=.true., n1=n1, n2=n2, n3=n3)
      if (this%fields(id)%time_mode /= DATA_TIME_STATIC) then
         call logger%error("ocean_data_input: fill_static_host_3d called on field id "// &
                           to_string(id)//", which is not DATA_TIME_STATIC")
         error stop "ocean_data_input: fill_static_host_3d on a non-static field"
      end if
      do k = 1, this%fields(id)%nz
         do j = 1, this%fields(id)%ny
            do i = 1, this%fields(id)%nx
               dest(this%fields(id)%dest_i0 + i - 1, this%fields(id)%dest_j0 + j - 1, k) = &
                  this%fields(id)%f0(i, j, k)
            end do
         end do
      end do
   end subroutine ocean_data_input_fill_static_host_3d