program main implicit none integer :: n double precision, allocatable :: xh(:), xl(:) integer :: incx double precision :: dh, dl n = 2000 incx = 1 allocate(xh(1+(n-1)*abs(incx))) allocate(xl(1+(n-1)*abs(incx))) call random_number(xh) xl = 0d0 call ddnrm2(n, xh, xl, incx, dh, dl) print *, "dh =", dh print *, "dl =", dl end program