sponge_add_band_y Subroutine

private pure subroutine sponge_add_band_y(idamp_h, idamp_u, idamp_v, wall_face, band, strength, side, i0, i1, ramp)

Mirror of sponge_add_band_x for a south/north (y-normal) sponge edge: idamp_h/idamp_u share the row offset; idamp_v (the y-normal face) sits one further row in for the south edge (side = +1) and shares the offset for the north edge (side = -1).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: idamp_h(:,:)
real(kind=wp), intent(inout) :: idamp_u(:,:)
real(kind=wp), intent(inout) :: idamp_v(:,:)
integer, intent(in) :: wall_face
integer, intent(in) :: band
real(kind=wp), intent(in) :: strength
integer, intent(in) :: side
integer, intent(in) :: i0
integer, intent(in) :: i1
integer, intent(in) :: ramp

See sponge_add_band_x.


Calls

proc~~sponge_add_band_y~~CallsGraph proc~sponge_add_band_y sponge_add_band_y proc~sponge_band_alpha sponge_band_alpha proc~sponge_add_band_y->proc~sponge_band_alpha

Called by

proc~~sponge_add_band_y~~CalledByGraph proc~sponge_add_band_y sponge_add_band_y proc~configure_ocean_sponge configure_ocean_sponge proc~configure_ocean_sponge->proc~sponge_add_band_y proc~engine_setup engine_setup proc~engine_setup->proc~configure_ocean_sponge proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_setup proc~driver_validate driver_validate proc~driver_validate->proc~engine_setup proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean proc~rdb_ocean_create_finalize rdb_ocean_create_finalize proc~rdb_ocean_create_finalize->proc~complete_ocean_create proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~complete_ocean_create

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private :: alpha
integer, private :: d
integer, private :: i
integer, private :: j_h
integer, private :: j_v
real(kind=wp), private :: rate

Source Code

   pure subroutine sponge_add_band_y(idamp_h, idamp_u, idamp_v, wall_face, band, &
                                     strength, side, i0, i1, ramp)
      !! Mirror of `sponge_add_band_x` for a south/north (y-normal) sponge
      !! edge: `idamp_h`/`idamp_u` share the row offset; `idamp_v` (the
      !! y-normal face) sits one further row in for the south edge (`side =
      !! +1`) and shares the offset for the north edge (`side = -1`).
      real(wp), intent(inout) :: idamp_h(:, :), idamp_u(:, :), idamp_v(:, :)
      integer, intent(in) :: wall_face, band, side, i0, i1
      integer, intent(in) :: ramp
         !! See `sponge_add_band_x`.
      real(wp), intent(in) :: strength

      integer :: d, i, j_h, j_v
      real(wp) :: rate, alpha

      do d = 0, band - 1
         alpha = sponge_band_alpha(d, band, ramp)
         rate = strength*alpha
         if (side > 0) then
            j_h = wall_face + d
            j_v = wall_face + d + 1
         else
            j_h = wall_face - d - 1
            j_v = wall_face - d - 1
         end if
         if (j_h >= 1 .and. j_h <= size(idamp_h, 2)) then
            do i = i0, i1
               idamp_h(i, j_h) = idamp_h(i, j_h) + rate
            end do
            do i = i0, i1 + 1
               idamp_u(i, j_h) = idamp_u(i, j_h) + rate
            end do
         end if
         if (j_v >= 1 .and. j_v <= size(idamp_v, 2)) then
            do i = i0, i1
               idamp_v(i, j_v) = idamp_v(i, j_v) + rate
            end do
         end if
      end do
   end subroutine sponge_add_band_y