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.
| Type | Intent | Optional | 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) |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | i | ||||
| integer, | private | :: | j |
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