HOST twin of enforce_vanished_content, for SETUP only. The seed
(ocean_state_seed_land_cells) runs before enter_data, where a
do concurrent on the offload build would work on device memory
that is not mapped yet (mem:separate: no implicit copies). Plain
host loops over the SAME included rdb_vl_merge_content, so the
seeded state satisfies I1′ by the one definition. Never call it on
a device-resident state.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multilayer_state_t), | intent(inout) | :: | this | |||
| integer, | intent(in) | :: | nx |
i-extent (total, incl. halos). |
||
| integer, | intent(in) | :: | ny |
j-extent (total, incl. halos). |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | h_col(NZ_STACK_MAX) | ||||
| integer, | private | :: | i | ||||
| integer, | private | :: | j | ||||
| integer, | private | :: | k | ||||
| real(kind=wp), | private | :: | q_col(NZ_STACK_MAX) | ||||
| integer, | private | :: | t |
subroutine multilayer_enforce_vanished_content_host(this, nx, ny) !! HOST twin of `enforce_vanished_content`, for SETUP only. The seed !! (`ocean_state_seed_land_cells`) runs before `enter_data`, where a !! `do concurrent` on the offload build would work on device memory !! that is not mapped yet (`mem:separate`: no implicit copies). Plain !! host loops over the SAME included `rdb_vl_merge_content`, so the !! seeded state satisfies I1′ by the one definition. Never call it on !! a device-resident state. class(multilayer_state_t), intent(inout) :: this integer, intent(in) :: nx !! i-extent (total, incl. halos). integer, intent(in) :: ny !! j-extent (total, incl. halos). integer :: t, i, j, k real(wp) :: h_col(NZ_STACK_MAX), q_col(NZ_STACK_MAX) if (.not. allocated(this%h_layer)) return if (.not. allocated(this%tracers)) return do t = 1, size(this%tracers) if (.not. allocated(this%tracers(t)%hTr)) cycle do j = 1, ny do i = 1, nx do k = 1, this%nz_ml h_col(k) = this%h_layer(i, j, k) q_col(k) = this%tracers(t)%hTr(i, j, k) end do call rdb_vl_merge_content(this%nz_ml, h_col, q_col) do k = 1, this%nz_ml this%tracers(t)%hTr(i, j, k) = q_col(k) end do end do end do end do end subroutine multilayer_enforce_vanished_content_host