tides_update_eta_eq Subroutine

public subroutine tides_update_eta_eq(this, t)

Refresh eta_eq(x,y) for the current outer-step time t (s). Host recomputes the nconst amplitude scalars, pushes them to the device, then a do concurrent fills eta_eq with no per-cell trig and no reduction. Held static across the inner barotropic substep loop.

Arguments

Type IntentOptional Attributes Name
type(ocean_tides_t), intent(inout) :: this
real(kind=wp), intent(in) :: t

Calls

proc~~tides_update_eta_eq~~CallsGraph proc~tides_update_eta_eq tides_update_eta_eq proc~tides_update_eta_eq_impl tides_update_eta_eq_impl proc~tides_update_eta_eq->proc~tides_update_eta_eq_impl local local proc~tides_update_eta_eq_impl->local

Called by

proc~~tides_update_eta_eq~~CalledByGraph proc~tides_update_eta_eq tides_update_eta_eq proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~tides_update_eta_eq proc~engine_step engine_step proc~engine_step->proc~ocean_dyn_step_split proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_step proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private :: ang
integer, private :: c
real(kind=wp), private :: now
integer, private :: nx
integer, private :: ny
real(kind=wp), private :: pre

Source Code

   subroutine tides_update_eta_eq(this, t)
      !! Refresh `eta_eq(x,y)` for the current outer-step time `t` (s).
      !! Host recomputes the `nconst` amplitude scalars, pushes them to
      !! the device, then a `do concurrent` fills `eta_eq` with no
      !! per-cell trig and no reduction.  Held static across the inner
      !! barotropic substep loop.
      type(ocean_tides_t), intent(inout) :: this
      real(wp), intent(in) :: t
      real(wp) :: now, ang, pre
      integer :: c, nx, ny

      now = t + this%t_epoch
      do c = 1, this%nconst
         ang = this%omega_c(c)*now + this%phase0(c) + this%u_nodal(c)
         pre = this%amp_c(c)*this%love_c(c)*this%f_nodal(c)
         this%amp_cos(c) = pre*cos(ang)
         this%amp_sin(c) = pre*sin(ang)
      end do
      !$acc update device(this%amp_cos, this%amp_sin)

      nx = size(this%eta_eq, 1)
      ny = size(this%eta_eq, 2)
      call tides_update_eta_eq_impl(nx, ny, this%nconst, this%species_c, &
                                    this%amp_cos, this%amp_sin, &
                                    this%cos_struct, this%sin_struct, this%eta_eq)
   end subroutine tides_update_eta_eq