Allocate a 1-dimensional array of integers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the allocation operation, just for output purpose. |
||
integer(kind=ip), | intent(in) | :: | len1 |
Dimension of the vector |
||
integer(kind=ip), | intent(inout), | allocatable | :: | v(:) |
Vector to allocate |
subroutine i_alloc1(string, len1, v)
!! Allocate a 1-dimensional array of integers
implicit none
character (len=*), intent(in) :: string
!! Human-readable description string of the allocation
!! operation, just for output purpose.
integer(ip), intent(in) :: len1
!! Dimension of the vector
integer(ip), allocatable, intent(inout) :: v(:)
!! Vector to allocate
integer(ip) :: istat
if(.not. is_init) call memory_init(.false., 0.0_rp)
allocate(v(len1), stat=istat)
call chk_alloc(string, len1*size_of_int, istat)
end subroutine i_alloc1