Init_ESAtmo3D Subroutine

public subroutine Init_ESAtmo3D(this, mesh, geometry)

Arguments

TypeIntentOptionalAttributesName
class(ESAtmo3D), intent(out) :: this
type(Mesh3D), intent(in), target:: mesh
type(SEMHex), intent(in), target:: geometry

Calls

proc~~init_esatmo3d~~CallsGraph proc~init_esatmo3d Init_ESAtmo3D proc~init_ecdgmodel3d_t Init_ECDGModel3D_t proc~init_esatmo3d->proc~init_ecdgmodel3d_t interface~hipmalloc hipMalloc proc~init_esatmo3d->interface~hipmalloc interface~hipmemcpy hipMemcpy proc~init_esatmo3d->interface~hipmemcpy proc~gpucheck gpuCheck proc~init_esatmo3d->proc~gpucheck proc~init_dgmodel3d_t Init_DGModel3D_t proc~init_ecdgmodel3d_t->proc~init_dgmodel3d_t

Contents

Source Code


Source Code

  subroutine Init_ESAtmo3D(this,mesh,geometry)
    implicit none
    class(ESAtmo3D),intent(out) :: this
    type(Mesh3D),intent(in),target :: mesh
    type(SEMHex),intent(in),target :: geometry
    ! Local
    type(BoundaryCondition),pointer :: bc

    call Init_ECDGModel3D_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. pbc3d_NoStress_ESAtmo3D_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_ESAtmo3D