ocean_data_input_fill_static_host Subroutine

public subroutine ocean_data_input_fill_static_host(this, id, n1, n2, dest)

One-shot HOST-side fill of a DATA_TIME_STATIC field. Copies the already-read record-1 slab into dest at the registration-time offsets. Touches NO device memory — callable at setup, before dest is mapped. Plain host do loops (NOT do concurrent — on -stdpar=gpu a bare do concurrent is unconditionally offloaded regardless of whether dest is mapped, which is exactly the silent-stale-write bug this routine exists to avoid). Fails loud for any non-static field.

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
real(kind=wp), intent(inout) :: dest(n1,n2)

Calls

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

Called by

proc~~ocean_data_input_fill_static_host~~CalledByGraph proc~ocean_data_input_fill_static_host ocean_data_input_fill_static_host proc~ocean_data_input_load_static_2d ocean_data_input_load_static_2d proc~ocean_data_input_load_static_2d->proc~ocean_data_input_fill_static_host proc~seed_cavity_draft seed_cavity_draft proc~seed_cavity_draft->proc~ocean_data_input_load_static_2d proc~ocean_state_seed_from_cfg ocean_state_seed_from_cfg proc~ocean_state_seed_from_cfg->proc~seed_cavity_draft proc~engine_setup engine_setup proc~engine_setup->proc~ocean_state_seed_from_cfg 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

Variables

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

Source Code

   subroutine ocean_data_input_fill_static_host(this, id, n1, n2, dest)
      !! One-shot HOST-side fill of a `DATA_TIME_STATIC` field.  Copies
      !! the already-read record-1 slab into `dest` at the
      !! registration-time offsets.  Touches NO device memory —
      !! callable at setup, before `dest` is mapped.  Plain host `do`
      !! loops (NOT `do concurrent` — on `-stdpar=gpu` a bare `do
      !! concurrent` is unconditionally offloaded regardless of whether
      !! `dest` is mapped, which is exactly the silent-stale-write bug
      !! this routine exists to avoid).  Fails loud for any non-static
      !! field.
      class(ocean_data_input_t), intent(in) :: this
      integer, intent(in) :: id, n1, n2
      real(wp), intent(inout) :: dest(n1, n2)
      integer :: i, j

      call check_registered(this, id, is_3d=.false., n1=n1, n2=n2)
      if (this%fields(id)%time_mode /= DATA_TIME_STATIC) then
         call logger%error("ocean_data_input: fill_static_host called on field id "// &
                           to_string(id)//", which is not DATA_TIME_STATIC")
         error stop "ocean_data_input: fill_static_host on a non-static field"
      end if
      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) = &
               this%fields(id)%f0(i, j, 1)
         end do
      end do
   end subroutine ocean_data_input_fill_static_host