Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Scalar1D), | intent(out) | :: | this | |||
type(Lagrange), | intent(in), | target | :: | interp | ||
integer, | intent(in) | :: | nVar | |||
integer, | intent(in) | :: | nElem |
subroutine Init_Scalar1D(this,interp,nVar,nElem)
implicit none
class(Scalar1D),intent(out) :: this
type(Lagrange),intent(in),target :: interp
integer,intent(in) :: nVar
integer,intent(in) :: nElem
if(.not. GPUAvailable()) then
print*,__FILE__,':',__LINE__,' : Error : Attempt to use GPU extension, but GPU is not available.'
stop 1
endif
this%interp => interp
this%nVar = nVar
this%nElem = nElem
this%N = interp%N
this%M = interp%M
allocate(this%interior(1:interp%N+1,1:nelem,1:nvar), &
this%boundary(1:2,1:nelem,1:nvar), &
this%extBoundary(1:2,1:nelem,1:nvar), &
this%avgBoundary(1:2,1:nelem,1:nvar))
allocate(this%meta(1:nVar))
allocate(this%eqn(1:nVar))
call gpuCheck(hipMalloc(c_loc(this%interior_gpu),sizeof(this%interior)))
call gpuCheck(hipMalloc(c_loc(this%boundary_gpu),sizeof(this%boundary)))
call gpuCheck(hipMalloc(c_loc(this%extBoundary_gpu),sizeof(this%extBoundary)))
call gpuCheck(hipMalloc(c_loc(this%avgBoundary_gpu),sizeof(this%avgBoundary)))
call hipblasCheck(hipblasCreate(this%blas_handle))
endsubroutine Init_Scalar1D