drain_wrap_centre Subroutine

private subroutine drain_wrap_centre(fld, nx, ny, nz, nx_phys, ny_phys, nghost, per_x, per_y, fold_n, no_wait)

Periodic wrap (+ north fold) of a cell-centred drain field. no_wait (optional): when .true. AND not folding, the periodic wrap is issued async on queue 1 without syncing, so a caller can batch several independent wraps (e.g. the pal/par/pa6 parabola triple) and !$acc wait(1) once. Ignored when fold_n (the fold reads the wrapped field, so the periodic wrap must complete first).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: fld(nx,ny,nz)
integer, intent(in) :: nx
integer, intent(in) :: ny
integer, intent(in) :: nz
integer, intent(in) :: nx_phys
integer, intent(in) :: ny_phys
integer, intent(in) :: nghost
logical, intent(in) :: per_x
logical, intent(in) :: per_y
logical, intent(in) :: fold_n
logical, intent(in), optional :: no_wait

Calls

proc~~drain_wrap_centre~~CallsGraph proc~drain_wrap_centre drain_wrap_centre interface~fold_north_centre fold_north_centre proc~drain_wrap_centre->interface~fold_north_centre proc~ocean_periodic_wrap_centre_3d ocean_periodic_wrap_centre_3d proc~drain_wrap_centre->proc~ocean_periodic_wrap_centre_3d proc~fold_north_centre_2d fold_north_centre_2d interface~fold_north_centre->proc~fold_north_centre_2d proc~fold_north_centre_3d fold_north_centre_3d interface~fold_north_centre->proc~fold_north_centre_3d

Called by

proc~~drain_wrap_centre~~CalledByGraph proc~drain_wrap_centre drain_wrap_centre proc~continuity_tracer_drain continuity_tracer_drain proc~continuity_tracer_drain->proc~drain_wrap_centre proc~ocean_dyn_flush_tracer_window ocean_dyn_flush_tracer_window proc~ocean_dyn_flush_tracer_window->proc~continuity_tracer_drain proc~ocean_dyn_step ocean_dyn_step proc~ocean_dyn_step->proc~continuity_tracer_drain proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~continuity_tracer_drain proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~ocean_dyn_flush_tracer_window proc~engine_step engine_step proc~driver_run_ocean->proc~engine_step proc~engine_step->proc~ocean_dyn_step proc~engine_step->proc~ocean_dyn_step_split proc~rdb_ocean_set_tracer rdb_ocean_set_tracer proc~rdb_ocean_set_tracer->proc~ocean_dyn_flush_tracer_window proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step

Variables

Type Visibility Attributes Name Initial
logical, private :: nw

Source Code

   subroutine drain_wrap_centre(fld, nx, ny, nz, nx_phys, ny_phys, nghost, &
                                per_x, per_y, fold_n, no_wait)
      !! Periodic wrap (+ north fold) of a cell-centred drain field.
      !! `no_wait` (optional): when .true. AND not folding, the periodic wrap
      !! is issued async on queue 1 without syncing, so a caller can batch
      !! several independent wraps (e.g. the pal/par/pa6 parabola triple) and
      !! `!$acc wait(1)` once.  Ignored when fold_n (the fold reads the wrapped
      !! field, so the periodic wrap must complete first).
      integer, intent(in) :: nx, ny, nz, nx_phys, ny_phys, nghost
      real(wp), intent(inout) :: fld(nx, ny, nz)
      logical, intent(in) :: per_x, per_y, fold_n
      logical, intent(in), optional :: no_wait
      logical :: nw
      nw = .false.
      if (present(no_wait)) nw = no_wait .and. .not. fold_n
      if (per_x .or. per_y) then
         call ocean_periodic_wrap_centre_3d(fld, nx, ny, nz, &
                                            nx_phys, ny_phys, nghost, per_x, per_y, no_wait=nw)
      end if
      if (fold_n) call fold_north_centre(fld, nx, ny, nz, nx_phys, ny_phys, nghost)
   end subroutine drain_wrap_centre