allocate_2d_int32 Module Subroutine

pure module subroutine allocate_2d_int32(array_, size1_, size2_)

allocate a 2d 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) :: size1_
integer(kind=int32), intent(in) :: size2_

Contents

Source Code


Source Code

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