/[MITgcm]/MITgcm_contrib/afe/osse_MkII/filter/random2.F
ViewVC logotype

Contents of /MITgcm_contrib/afe/osse_MkII/filter/random2.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 2.0 - (show annotations) (download)
Wed Apr 13 17:17:23 2005 UTC (19 years, 2 months ago) by afe
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
pre-H-rewrite

1 c*** returns a vector of random values N(variance=1,mean=0)
2 subroutine random2(work1,n)
3
4 implicit none
5
6 integer, intent(in) :: n
7 real, intent(out) :: work1(n)
8 real, allocatable :: work2(:)
9 real, pi
10
11 allocate (work2(n))
12
13 pi=3.14159
14 call random_number(work1)
15 call random_number(work2)
16 work1=sqrt(-2.*log(work1))*cos(2.*pi*work2)
17
18 deallocate(work2)
19 end subroutine random2

  ViewVC Help
Powered by ViewVC 1.1.22