Allocate a 1-dimensional array of reals
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 |
||
logical(kind=lp), | intent(inout), | allocatable | :: | v(:) |
Vector to allocate |
subroutine l_alloc1(string, len1, v)
!! Allocate a 1-dimensional array of reals
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
logical(lp), 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_logical, istat)
end subroutine l_alloc1