Free_DGModel3D Subroutine

public subroutine Free_DGModel3D(this)

Free the 3D DG model, including GPU BC arrays.

Arguments

TypeIntentOptionalAttributesName
class(DGModel3D), intent(inout) :: this

Calls

proc~~free_dgmodel3d~~CallsGraph proc~free_dgmodel3d Free_DGModel3D interface~hipfree hipFree proc~free_dgmodel3d->interface~hipfree proc~gpucheck gpuCheck proc~free_dgmodel3d->proc~gpucheck proc~free_dgmodel3d_t Free_DGModel3D_t proc~free_dgmodel3d->proc~free_dgmodel3d_t

Contents

Source Code


Source Code

  subroutine Free_DGModel3D(this)
    !! Free the 3D DG model, including GPU BC arrays.
    implicit none
    class(DGModel3D),intent(inout) :: this
    ! Local
    type(BoundaryCondition),pointer :: bc

    ! Free hyperbolic BC device arrays
    bc => this%hyperbolicBCs%head
    do while(associated(bc))
      if(c_associated(bc%elements_gpu)) call gpuCheck(hipFree(bc%elements_gpu))
      if(c_associated(bc%sides_gpu)) call gpuCheck(hipFree(bc%sides_gpu))
      bc%elements_gpu = c_null_ptr
      bc%sides_gpu = c_null_ptr
      bc => bc%next
    enddo

    ! Free parabolic BC device arrays
    bc => this%parabolicBCs%head
    do while(associated(bc))
      if(c_associated(bc%elements_gpu)) call gpuCheck(hipFree(bc%elements_gpu))
      if(c_associated(bc%sides_gpu)) call gpuCheck(hipFree(bc%sides_gpu))
      bc%elements_gpu = c_null_ptr
      bc%sides_gpu = c_null_ptr
      bc => bc%next
    enddo

    call Free_DGModel3D_t(this)

  endsubroutine Free_DGModel3D