eulerian_obj_Allocate Subroutine

private impure subroutine eulerian_obj_Allocate(this)

Allocates Cell array in Eulerian object.

Type Bound

eulerian_obj_base

Arguments

Type IntentOptional Attributes Name
class(eulerian_obj_base), intent(inout) :: this

An Eulerian object


Calls

proc~~eulerian_obj_allocate~~CallsGraph proc~eulerian_obj_allocate eulerian_obj_base%eulerian_obj_Allocate cell cell proc~eulerian_obj_allocate->cell

Source Code

    impure subroutine eulerian_obj_Allocate(this)
      !> Allocates Cell array in Eulerian object.
      implicit none
      class(eulerian_obj_base), intent(inout) :: this                          !! An Eulerian object
      ! Work variables
      integer :: ierr

      associate (lo => this%block%lo, hi => this%block%hi, ngc=> this%block%ngc)
        select type (this)
        type is (eulerian_obj_r)
          allocate(this%cell(lo(1)-ngc:hi(1)+ngc,lo(2)-ngc:hi(2)+ngc,lo(3)-ngc:hi(3)+ngc), &
            source = 0.0_wp, stat=ierr)
            if (ierr.ne.0) call this%parallel%Stop('Unable to allocate Eulerian object '//this%name)
        type is (eulerian_obj_i)
          allocate(this%cell(lo(1)-ngc:hi(1)+ngc,lo(2)-ngc:hi(2)+ngc,lo(3)-ngc:hi(3)+ngc),  &
            source = 0, stat=ierr)
            if (ierr.ne.0) call this%parallel%Stop('Unable to allocate Eulerian object '//this%name)
        end select
      end associate

      return
    end subroutine eulerian_obj_Allocate