~ubuntu-branches/ubuntu/utopic/nwchem/utopic

« back to all changes in this revision

Viewing changes to src/tools/ga-5-2/global/examples/md_cluster/ran3.F

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Daniel Leidert, Andreas Tille, Michael Banck
  • Date: 2013-07-04 12:14:55 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130704121455-5tvsx2qabor3nrui
Tags: 6.3-1
* New upstream release.
* Fixes anisotropic properties (Closes: #696361).
* New features include:
  + Multi-reference coupled cluster (MRCC) approaches
  + Hybrid DFT calculations with short-range HF 
  + New density-functionals including Minnesota (M08, M11) and HSE hybrid
    functionals
  + X-ray absorption spectroscopy (XAS) with TDDFT
  + Analytical gradients for the COSMO solvation model
  + Transition densities from TDDFT 
  + DFT+U and Electron-Transfer (ET) methods for plane wave calculations
  + Exploitation of space group symmetry in plane wave geometry optimizations
  + Local density of states (LDOS) collective variable added to Metadynamics
  + Various new XC functionals added for plane wave calculations, including
    hybrid and range-corrected ones
  + Electric field gradients with relativistic corrections 
  + Nudged Elastic Band optimization method
  + Updated basis sets and ECPs 

[ Daniel Leidert ]
* debian/watch: Fixed.

[ Andreas Tille ]
* debian/upstream: References

[ Michael Banck ]
* debian/upstream (Name): New field.
* debian/patches/02_makefile_flags.patch: Refreshed.
* debian/patches/06_statfs_kfreebsd.patch: Likewise.
* debian/patches/07_ga_target_force_linux.patch: Likewise.
* debian/patches/05_avoid_inline_assembler.patch: Removed, no longer needed.
* debian/patches/09_backported_6.1.1_fixes.patch: Likewise.
* debian/control (Build-Depends): Added gfortran-4.7 and gcc-4.7.
* debian/patches/10_force_gcc-4.7.patch: New patch, explicitly sets
  gfortran-4.7 and gcc-4.7, fixes test suite hang with gcc-4.8 (Closes:
  #701328, #713262).
* debian/testsuite: Added tests for COSMO analytical gradients and MRCC.
* debian/rules (MRCC_METHODS): New variable, required to enable MRCC methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#if HAVE_CONFIG_H
 
2
#   include "config.fh"
 
3
#endif
 
4
c
 
5
c   This is really ran3
 
6
c
 
7
      function ran1(idum)
 
8
c
 
9
c     Random number generator from Numerical Recipes
 
10
c
 
11
c         implicit real*4(m)
 
12
c         parameter (mbig=4000000.,mseed=1618033.,mz=0.,fac=2.5e-7)
 
13
      implicit real*8 (a-h,o-z)
 
14
      parameter (mbig=1000000000,mseed=161803398,mz=0,fac=1.e-9)
 
15
      dimension ma(55)
 
16
      data iff /0/
 
17
      save iff, mj, ma, mk, inext, inextp
 
18
      if(idum.lt.0.or.iff.eq.0)then
 
19
        iff=1
 
20
        mj=mseed-iabs(idum)
 
21
        mj=mod(mj,mbig)
 
22
        ma(55)=mj
 
23
        mk=1
 
24
        do 11 i=1,54
 
25
          ii=mod(21*i,55)
 
26
          ma(ii)=mk
 
27
          mk=mj-mk
 
28
          if(mk.lt.mz)mk=mk+mbig
 
29
          mj=ma(ii)
 
30
11      continue
 
31
        do 13 k=1,4
 
32
          do 12 i=1,55
 
33
            ma(i)=ma(i)-ma(1+mod(i+30,55))
 
34
            if(ma(i).lt.mz)ma(i)=ma(i)+mbig
 
35
12        continue
 
36
13      continue
 
37
        inext=0
 
38
        inextp=31
 
39
        idum=1
 
40
      endif
 
41
      inext=inext+1
 
42
      if(inext.eq.56)inext=1
 
43
      inextp=inextp+1
 
44
      if(inextp.eq.56)inextp=1
 
45
      mj=ma(inext)-ma(inextp)
 
46
      if(mj.lt.mz)mj=mj+mbig
 
47
      ma(inext)=mj
 
48
      ran1=mj*fac
 
49
      return
 
50
      end
 
51
c
 
52
      function gasdev(idum)
 
53
      implicit real*8 (a-h,o-z)
 
54
      data iset/0/
 
55
      save iset, gset
 
56
      if (iset.eq.0) then
 
57
1       v1=2.*ran1(idum)-1.
 
58
        v2=2.*ran1(idum)-1.
 
59
        r=v1**2+v2**2
 
60
        if(r.ge.1.)go to 1
 
61
        fac=sqrt(-2.*log(r)/r)
 
62
        gset=v1*fac
 
63
        gasdev=v2*fac
 
64
        iset=1
 
65
      else
 
66
        gasdev=gset
 
67
        iset=0
 
68
      endif
 
69
      return
 
70
      end