allocate a 1d array and fill it with 0s (intger version)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int32), | intent(inout), | allocatable | :: | array_(:) | ||
integer(kind=int32), | intent(in) | :: | size_ |
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