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 |
||
real(kind=rp), | intent(inout), | allocatable | :: | v(:) |
Vector to allocate |
subroutine r_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
real(rp), 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_real, istat)
end subroutine r_alloc1