c*** returns a vector of random values N(variance=1,mean=0) subroutine random2(work1,n) implicit none integer, intent(in) :: n real, intent(out) :: work1(n) real, allocatable :: work2(:) real, pi allocate (work2(n)) pi=3.14159 call random_number(work1) call random_number(work2) work1=sqrt(-2.*log(work1))*cos(2.*pi*work2) deallocate(work2) end subroutine random2