ocean_halo_destroy Subroutine

public subroutine ocean_halo_destroy()

Release buffers and topology state. Idempotent.

Arguments

None

Called by

proc~~ocean_halo_destroy~~CalledByGraph proc~ocean_halo_destroy ocean_halo_destroy proc~engine_teardown engine_teardown proc~engine_teardown->proc~ocean_halo_destroy proc~ocean_halo_init ocean_halo_init proc~ocean_halo_init->proc~ocean_halo_destroy proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_teardown proc~engine_setup engine_setup proc~driver_run_ocean->proc~engine_setup proc~driver_validate driver_validate proc~driver_validate->proc~engine_teardown proc~driver_validate->proc~engine_setup proc~engine_setup->proc~ocean_halo_init proc~rdb_ocean_destroy rdb_ocean_destroy proc~rdb_ocean_destroy->proc~engine_teardown proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->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

Source Code

   subroutine ocean_halo_destroy()
      !! Release buffers and topology state.  Idempotent.
      if (.not. oh_initialised) return

      !$acc exit data delete(oh_buf_send_east, oh_buf_recv_east, &
      !$acc&                 oh_buf_send_west, oh_buf_recv_west, &
      !$acc&                 oh_buf_send_north, oh_buf_recv_north, &
      !$acc&                 oh_buf_send_south, oh_buf_recv_south)
      deallocate (oh_buf_send_east, oh_buf_recv_east)
      deallocate (oh_buf_send_west, oh_buf_recv_west)
      deallocate (oh_buf_send_north, oh_buf_recv_north)
      deallocate (oh_buf_send_south, oh_buf_recv_south)

      oh_cap_ew = 0
      oh_cap_ns = 0
      oh_nghost = 0
      oh_nx_local = 0
      oh_ny_local = 0
      oh_nx_total = 0
      oh_ny_total = 0
      oh_periodic_x = .false.
      oh_periodic_y = .false.
      oh_initialised = .false.

   end subroutine ocean_halo_destroy