ocean_surfstress_enter_data_impl Subroutine

private subroutine ocean_surfstress_enter_data_impl(this)

Arguments

Type IntentOptional Attributes Name
type(ocean_surface_stress_t), intent(inout) :: this

Calls

proc~~ocean_surfstress_enter_data_impl~~CallsGraph proc~ocean_surfstress_enter_data_impl ocean_surfstress_enter_data_impl proc~scratch_3d_buffer_enter_data_impl scratch_3d_buffer_enter_data_impl proc~ocean_surfstress_enter_data_impl->proc~scratch_3d_buffer_enter_data_impl

Called by

proc~~ocean_surfstress_enter_data_impl~~CalledByGraph proc~ocean_surfstress_enter_data_impl ocean_surfstress_enter_data_impl proc~ocean_surfstress_enter_data ocean_surface_stress_t%ocean_surfstress_enter_data proc~ocean_surfstress_enter_data->proc~ocean_surfstress_enter_data_impl

Source Code

   subroutine ocean_surfstress_enter_data_impl(this)
      type(ocean_surface_stress_t), intent(inout) :: this
      !$acc enter data copyin(this%tau_x, this%tau_y, this%stress_mag, &
      !$acc                   this%stress_shelf)
      ! Force the host wind values onto the device.  On OpenMP the root
      ! map(to:state) can leave tau_x/tau_y already "present" (descriptors
      ! come over with the parent), making the copyin above a no-op copy —
      ! `update device` (-> omp target update to) pushes the values
      ! regardless of presence.  Harmless on OpenACC.  `stress_mag` is
      ! filled host-side at configure by `ocean_surface_stress_set_derived`
      ! BEFORE this call — the `update device` here is what pushes it (the
      ! mem:separate trap: a missed push here gives `stress_mag == 0` on
      ! device, silently killing KPP/EPBL wind mixing, CLAUDE.md:312).
      !$acc update device(this%tau_x, this%tau_y, this%stress_mag, &
      !$acc                this%stress_shelf)
      call scratch_3d_buffer_enter_data_impl(this%du_stress)
      call scratch_3d_buffer_enter_data_impl(this%dv_stress)
   end subroutine ocean_surfstress_enter_data_impl