halo_async_destroy Subroutine

public subroutine halo_async_destroy(ha)

Free pre-allocated halo buffers

Arguments

Type IntentOptional Attributes Name
type(halo_async_t), intent(inout) :: ha

Source Code

   subroutine halo_async_destroy(ha)
      !! Free pre-allocated halo buffers
      type(halo_async_t), intent(inout) :: ha

      if (.not. ha%initialised) return

      if (allocated(ha_buf_send_west)) then
         !$acc exit data delete( ha_buf_send_west, ha_buf_recv_west)
         deallocate (ha_buf_send_west, ha_buf_recv_west)
      end if
      if (allocated(ha_buf_send_east)) then
         !$acc exit data delete( ha_buf_send_east, ha_buf_recv_east)
         deallocate (ha_buf_send_east, ha_buf_recv_east)
      end if
      if (allocated(ha_buf_send_south)) then
         !$acc exit data delete( ha_buf_send_south, ha_buf_recv_south)
         deallocate (ha_buf_send_south, ha_buf_recv_south)
      end if
      if (allocated(ha_buf_send_north)) then
         !$acc exit data delete( ha_buf_send_north, ha_buf_recv_north)
         deallocate (ha_buf_send_north, ha_buf_recv_north)
      end if

      ha%initialised = .false.

   end subroutine halo_async_destroy