allocate_1d_int32 Module Subroutine

pure module subroutine allocate_1d_int32(array_, size_)

allocate a 1d array and fill it with 0s (intger version)

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(inout), allocatable :: array_(:)
integer(kind=int32), intent(in) :: size_

Contents

Source Code


Source Code

      pure module subroutine allocate_1d_int32(array_, size_)
         !! allocate a 1d array and fill it with 0s (intger version)
         integer(int32), allocatable, intent(inout) :: array_(:)
         integer(int32), intent(in)                 :: size_
         !---------------------------------------------------------------------!
         if (allocated(array_)) deallocate(array_)
         allocate(array_(size_))
         array_ = 0
         !---------------------------------------------------------------------!
      end subroutine allocate_1d_int32