update new files
[unres.git] / source / maxlik / src_MD_T_maxlik-NEWCORR-PMF / random.f
1       double precision function ran_number(x1,x2)
2 C Calculate a random real number from the range (x1,x2).
3       implicit none
4       integer ix
5       double precision x1,x2,fctor
6       data fctor /2147483647.0D0/
7       call vrnd(ix,1)
8       ran_number=x1+(x2-x1)*ix/fctor
9       return
10       end
11
12       integer function iran_num(n1,n2)
13 C Calculate a random integer number from the range (n1,n2).
14       implicit none
15       integer n1,n2,ix
16       real fctor /2147483647.0/
17       call vrnd(ix,1)
18       ix=n1+(n2-n1+1)*(ix/fctor)
19       if (ix.gt.n2) ix=n2
20       iran_num=ix
21       return
22       end
23
24