CalculiX  2.13
A Free Software Three-Dimensional Structural Finite Element Program
randomval.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine randomval (randval, nev)
 

Function/Subroutine Documentation

◆ randomval()

subroutine randomval ( real*8, dimension(*)  randval,
integer  nev 
)
20 !
21 ! Creation of normal ditributed unit variance gaussian
22 ! random variables using the Box-Muller-Transformation
23 !
24  implicit none
25 !
26  integer nev,i
27 !
28  real*8 randval(*),fac,v1,v2,rsq
29 !
30  call random_seed()
31 !
32  do i=1,nev
33  do
34  call random_number(v1)
35  call random_number(v2)
36  rsq=v1**2+v2**2
37  if((rsq.ge.1.d0).or.(rsq.le.0.d0)) cycle
38  fac=sqrt(-2.*dlog(rsq)/rsq)
39  randval(i)=v1*fac
40  exit
41  enddo
42  enddo
43 !
44  return
static double * v1
Definition: mafillsmmain_se.c:40
Hosted by OpenAircraft.com, (Michigan UAV, LLC)