Allocate a 3-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 |
Dimensions of the vector |
||
integer(kind=ip), | intent(in) | :: | len2 |
Dimensions of the vector |
||
integer(kind=ip), | intent(in) | :: | len3 |
Dimensions of the vector |
||
integer(kind=ip), | intent(inout), | allocatable | :: | v(:,:,:) |
Vector to allocate |
subroutine i_alloc3(string, len1, len2, len3, v)
!! Allocate a 3-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, len2, len3
!! Dimensions 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, len2, len3), stat=istat)
call chk_alloc(string, len1*len2*len3*size_of_int, istat)
end subroutine i_alloc3