~ubuntu-branches/ubuntu/saucy/nwchem/saucy

« back to all changes in this revision

Viewing changes to src/nwpw/nwpwlib/ion/ion.F

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Michael Banck, Daniel Leidert
  • Date: 2012-02-09 20:02:41 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120209200241-jgk03qfsphal4ug2
Tags: 6.1-1
* New upstream release.

[ Michael Banck ]
* debian/patches/02_makefile_flags.patch: Updated.
* debian/patches/02_makefile_flags.patch: Use internal blas and lapack code.
* debian/patches/02_makefile_flags.patch: Define GCC4 for LINUX and LINUX64
  (Closes: #632611 and LP: #791308).
* debian/control (Build-Depends): Added openssh-client.
* debian/rules (USE_SCALAPACK, SCALAPACK): Removed variables (Closes:
  #654658).
* debian/rules (LIBDIR, USE_MPIF4, ARMCI_NETWORK): New variables.
* debian/TODO: New file.
* debian/control (Build-Depends): Removed libblas-dev, liblapack-dev and
  libscalapack-mpi-dev.
* debian/patches/04_show_testsuite_diff_output.patch: New patch, shows the
  diff output for failed tests.
* debian/patches/series: Adjusted.
* debian/testsuite: Optionally run all tests if "all" is passed as option.
* debian/rules: Run debian/testsuite with "all" if DEB_BUILD_OPTIONS
  contains "checkall".

[ Daniel Leidert ]
* debian/control: Used wrap-and-sort. Added Vcs-Svn and Vcs-Browser fields.
  (Priority): Moved to extra according to policy section 2.5.
  (Standards-Version): Bumped to 3.9.2.
  (Description): Fixed a typo.
* debian/watch: Added.
* debian/patches/03_hurd-i386_define_path_max.patch: Added.
  - Define MAX_PATH if not defines to fix FTBFS on hurd.
* debian/patches/series: Adjusted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
*
2
 
* $Id: ion.F,v 1.55 2009-03-26 00:18:59 bylaska Exp $
 
2
* $Id: ion.F 21524 2011-11-12 17:42:51Z bylaska $
3
3
*
4
4
 
5
5
*     ***************************
2657
2657
      return
2658
2658
      end
2659
2659
 
 
2660
 
 
2661
*     ***************************
 
2662
*     *                         *
 
2663
*     *      ion_nearest_index  *
 
2664
*     *                         *
 
2665
*     ***************************
 
2666
*
 
2667
*  returns the index of the ion nearest to rtest
 
2668
 
 
2669
      integer function ion_nearest_index(xx,yy,zz)
 
2670
      implicit none
 
2671
      real*8 xx,yy,zz
 
2672
 
 
2673
#include "mafdecls.fh"
 
2674
#include "ion.fh"
 
2675
 
 
2676
*     **** local variables ****
 
2677
      integer ii,iimin,i1,i2,i3
 
2678
      real*8 d,dmin,x,y,z,dx,dy,dz
 
2679
      real*8 a(3,3)
 
2680
 
 
2681
*     **** external functions ****
 
2682
      real*8   lattice_unita
 
2683
      external lattice_unita
 
2684
 
 
2685
      do i2=1,3
 
2686
         do i1=1,3
 
2687
            a(i1,i2) = lattice_unita(i1,i2)
 
2688
         end do
 
2689
      end do
 
2690
 
 
2691
      iimin = -1
 
2692
      dmin = 9999999990099.0d0
 
2693
      do ii=1,nion
 
2694
         dx = dbl_mb(r1(1)+3*(ii-1))   - xx
 
2695
         dy = dbl_mb(r1(1)+3*(ii-1)+1) - yy
 
2696
         dz = dbl_mb(r1(1)+3*(ii-1)+2) - zz
 
2697
         do i3=-1,1
 
2698
            do i2=-1,1
 
2699
               do i1=-1,1
 
2700
                  x = dx + i1*a(1,1) + i2*a(1,2) + i3*a(1,3)
 
2701
                  y = dy + i1*a(2,1) + i2*a(2,2) + i3*a(2,3)
 
2702
                  z = dz + i1*a(3,1) + i2*a(3,2) + i3*a(3,3)
 
2703
                  d = dsqrt(x*x + y*y + z*z)
 
2704
                  if (d.lt.dmin) then
 
2705
                     dmin = d
 
2706
                     iimin = ii
 
2707
                  end if
 
2708
               end do
 
2709
            end do
 
2710
         end do
 
2711
      end do
 
2712
 
 
2713
      ion_nearest_index = iimin
 
2714
      return
 
2715
      end
 
2716