| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ESAtmo2D), | intent(out) | :: | this | |||
| type(Mesh2D), | intent(in), | target | :: | mesh | ||
| type(SEMQuad), | intent(in), | target | :: | geometry |
subroutine Init_ESAtmo2D(this,mesh,geometry)
implicit none
class(ESAtmo2D),intent(out) :: this
type(Mesh2D),intent(in),target :: mesh
type(SEMQuad),intent(in),target :: geometry
! Local
type(BoundaryCondition),pointer :: bc
call Init_ECDGModel2D_t(this,mesh,geometry)
! Upload hyperbolic BC element/side arrays to device
bc => this%hyperbolicBCs%head
do while(associated(bc))
if(bc%nBoundaries > 0) then
call gpuCheck(hipMalloc(bc%elements_gpu,sizeof(bc%elements)))
call gpuCheck(hipMemcpy(bc%elements_gpu,c_loc(bc%elements), &
sizeof(bc%elements),hipMemcpyHostToDevice))
call gpuCheck(hipMalloc(bc%sides_gpu,sizeof(bc%sides)))
call gpuCheck(hipMemcpy(bc%sides_gpu,c_loc(bc%sides), &
sizeof(bc%sides),hipMemcpyHostToDevice))
endif
bc => bc%next
enddo
! Upload parabolic BC element/side arrays to device. Required for the
! GPU parabolic BC kernels (e.g. pbc2d_NoStress_ESAtmo2D_GPU_wrapper).
bc => this%parabolicBCs%head
do while(associated(bc))
if(bc%nBoundaries > 0) then
call gpuCheck(hipMalloc(bc%elements_gpu,sizeof(bc%elements)))
call gpuCheck(hipMemcpy(bc%elements_gpu,c_loc(bc%elements), &
sizeof(bc%elements),hipMemcpyHostToDevice))
call gpuCheck(hipMalloc(bc%sides_gpu,sizeof(bc%sides)))
call gpuCheck(hipMemcpy(bc%sides_gpu,c_loc(bc%sides), &
sizeof(bc%sides),hipMemcpyHostToDevice))
endif
bc => bc%next
enddo
endsubroutine Init_ESAtmo2D