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

« back to all changes in this revision

Viewing changes to src/nwdft/scf_dft/dft_main0d.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:
2
2
c     == Main DFT driver ==
3
3
      logical function dft_main0d(rtdb)
4
4
c     
5
 
c     $Id: dft_main0d.F,v 1.92 2009-01-17 00:44:02 niri Exp $
 
5
c     $Id: dft_main0d.F 21138 2011-10-03 17:17:39Z niri $
6
6
c     
7
7
      implicit none
8
8
c
17
17
#include "mafdecls.fh"
18
18
#include "stdio.fh"
19
19
#include "cdft.fh"
 
20
#include "dft_conv.fh"
20
21
#include "global.fh"
21
22
#include "util.fh"
22
23
#include "tcgmsg.fh"
52
53
      integer isvals, lsvals,  idum,n_dep
53
54
      double precision toll_s
54
55
c
55
 
      logical dft_scf,atmblk, lcdft
56
 
      external dft_scf
57
 
      logical dft_scf_so 
58
 
      external dft_scf_so 
 
56
      logical lsuccess, ltried_scf, ltried_cgmin, lcgmin
 
57
      logical dft_scf,atmblk, lcdft, dft_cscf_equals_scftype
 
58
      external dft_scf, dft_cscf_equals_scftype
 
59
      logical dft_scf_so
 
60
      external dft_scf_so
 
61
      logical  dft_uks_nr_solve, dft_roks_nr_solve
 
62
      external dft_uks_nr_solve, dft_roks_nr_solve
 
63
      logical  dft_cg_solve
 
64
      external dft_cg_solve
59
65
c
60
66
c     == RT_TDDFT ==
61
67
      logical lrt_tddft       ! real-time TDDFT dynamics flag
62
 
c     logical rt_tddft_dft    ! standard DFT
63
 
c     external rt_tddft_dft
64
 
c     logical rt_tddft_sodft  ! spin-orbit DFT
65
 
c     external rt_tddft_sodft
66
68
      integer g_dipx  ! ga for dipole x
67
69
      integer g_dipy  ! ga for dipole y
68
70
      integer g_dipz  ! ga for dipole z
74
76
c
75
77
      character*80 theory
76
78
      logical status
77
 
      logical ldirect
 
79
      logical ldirect, xc_active
78
80
      character*32 pname
 
81
 
82
      double precision eone, etwo, enrep, energy
 
83
      double precision dft_time
 
84
c
 
85
      nexc = 1
79
86
c
80
87
c     == Preliminaries ==
81
88
      dft_main0d = .false.
88
95
      if(ga_nodeid().eq.0.and.
89
96
     .     util_print('geometry', print_high)) then
90
97
        if(.not.geom_print(geom)) call errquit(
91
 
     .       ' dftmain0d: geom print failed',0, GEOM_ERR)
 
98
     .       pname//'geom print failed',0, GEOM_ERR)
92
99
      endif
93
100
      IOLGC = .TRUE.
94
101
      if (noio.eq.1) IOLGC = .FALSE.
95
102
c
 
103
      lcgmin = .false.
 
104
      lsuccess = .false.
 
105
      ltried_scf = .false.
 
106
      ltried_cgmin = .false.
 
107
c
96
108
c     == SCALAPACK related ==
97
109
c
98
110
#ifdef SCALAPACK
106
118
#endif
107
119
#endif
108
120
c
 
121
c     == Trash junk that may have remained in restart calcs ==
 
122
      if(rtdb_get(rtdb,'bgj:xc_active', MT_LOG, 1,xc_active)) then
 
123
        if (xc_active) then
 
124
c         Junk left from previous run, clobber it!!!
 
125
c         Leaving it causes trouble in fock_2e because it then also
 
126
c         calls fock_xc. The routine dft_fockbld does not expect to be
 
127
c         using fock_xc anywhere but computes the XC-contributions by
 
128
c         a different route. This conflict will cause the calculation
 
129
c         to fail.
 
130
          if(.not. rtdb_put(rtdb,'bgj:xc_active', MT_LOG, 1, .false.))
 
131
     &      call errquit(pname//"could not store xc_active",
 
132
     &                   0,RTDB_ERR)
 
133
        endif
 
134
      endif
 
135
c
 
136
c     == Check which solver to use ==
 
137
      if (.not.rtdb_get(rtdb, 'dft:cgmin', mt_log, 1, lcgmin))
 
138
     &   lcgmin=.false.
 
139
c
109
140
c     == Check real-time TDDFT flag ==
110
141
      lrt_tddft = .false.
111
 
c      if (.not. rtdb_get(rtdb, 'dft:lrt_tddft', mt_log, 1, lrt_tddft))
112
 
c     &   lrt_tddft = .false.
 
142
      if (.not. rtdb_get(rtdb, 'dft:lrt_tddft', mt_log, 1, lrt_tddft))
 
143
     &   lrt_tddft = .false.
113
144
c
114
145
c     == Evaluate the nuclear repulsion energy ==
115
146
      LResult = geom_nuc_rep_energy(geom, Enuc)
136
167
c     == Get the grid cutoff or set default ==
137
168
      if(.not.rtdb_get(rtdb,'zora:cutoff',mt_dbl,1,zoracutoff))
138
169
     &  zoracutoff = 1.0d-08
 
170
      if(.not.rtdb_get(rtdb,'zora:cutoff_EFG',          ! FA
 
171
     &                 mt_dbl,1,zoracutoff_EFG))        ! FA
 
172
     &  zoracutoff_EFG = 1.0d-08                        ! FA
 
173
      if(.not.rtdb_get(rtdb,'zora:cutoff_NMR',          ! FA
 
174
     &                 mt_dbl,1,zoracutoff_NMR))        ! FA
 
175
     &  zoracutoff_NMR = 1.0d-08                        ! FA
 
176
      if(.not.rtdb_get(rtdb,'zora:do_NonRel',           ! FA
 
177
     &                 mt_log,1,do_NonRel))             ! FA
 
178
     &  do_NonRel = .false.                             ! FA
 
179
      if(.not.rtdb_get(rtdb,'zora:not_zora_scale',      ! FA
 
180
     &                 mt_log,1,not_zora_scale))        ! FA
 
181
     &  not_zora_scale = .false.                        ! FA
139
182
c
140
183
c     == Get the light speed and other constants, if specified ==
141
184
      call rel_init_con(rtdb)
442
485
       call ga_zero(g_Vxc(2))
443
486
c
444
487
      endif 
445
 
 
 
488
c
 
489
      call dft_cscf_movecs(g_evecs)
 
490
c
446
491
      nVxc = ipol
447
492
      if (.not. ga_duplicate(g_s, g_fock, 'fock matrix'))
448
493
     &     call errquit(pname//'Error creating ga',0,GA_ERR)
530
575
c     == Call the main drivers ==
531
576
      if (theory .eq. 'dft') then
532
577
       if (.not.lrt_tddft) then
533
 
        ! Standard DFT
534
 
        dft_main0d = dft_scf(rtdb, Etold, Enuc, iVcoul_opt, 
535
 
     &        iVxc_opt, iter, g_dens, g_dens_at, g_evecs, g_vxc, g_fock,
536
 
     &        g_svecs, dbl_mb(isvals), g_xcinv, g_s,
537
 
     &        lcdft, nconstr)
 
578
          if ((.not.lcgmin)) then
 
579
            dft_main0d = dft_scf(rtdb, Etold, Enuc, iVcoul_opt,
 
580
     &                         iVxc_opt, iter, g_dens, g_dens_at,
 
581
     &                         g_evecs, g_vxc, g_fock, g_svecs,
 
582
     &                         dbl_mb(isvals), g_xcinv, g_s, lcdft,
 
583
     &                         nconstr)
 
584
          else if (lcgmin) then
 
585
            dft_main0d = dft_cg_solve(rtdb)
 
586
          endif
538
587
       else
539
 
        ! Standard DFT + real-time dynamics
540
 
        !dft_main0d = rt_tddft_dft(rtdb, Etold, Enuc, iVcoul_opt, 
541
 
     &  !      iVxc_opt, iter, g_dens, g_dens_at, g_evecs, g_vxc, g_fock,
542
 
     &  !      g_svecs, dbl_mb(isvals), g_xcinv, g_s, 
543
 
     &  !      g_dipx, g_dipy, g_dipz, g_ddotE, g_vel,
544
 
     &  !      lcdft, nconstr)
545
 
        dft_main0d = .false.
 
588
          dft_main0d = .false.
546
589
       end if   ! lrt_tddft
547
590
      else if (theory .eq. 'sodft') then
548
591
c
549
592
c      announce that spin-orbit calculations are being performed
550
593
       if (me.eq.0) then
551
 
          write(luout,*)
552
 
          write(luout,*) "==============================="
553
 
          write(luout,*) " Performing SODFT calculations "
554
 
          write(luout,*) "==============================="
555
 
          write(luout,*)
556
 
       end if
 
594
         call util_print_centered(LuOut,
 
595
     $    'Performing spin-orbit DFT (SO-DFT) calculations', 23, .true.)
 
596
         write(LuOut,*)
 
597
       endif
557
598
c
558
599
       if (.not.lrt_tddft) then
559
600
        ! Spin-Orbit DFT
560
 
        dft_main0d = dft_scf_so(rtdb, Etold, Enuc, iVcoul_opt, 
561
 
     &       iVxc_opt, iter, g_dens, g_dens_at, g_evecs, g_vxc, g_fock, 
 
601
        dft_main0d = dft_scf_so(rtdb, Etold, Enuc, iVcoul_opt,
 
602
     &       iVxc_opt, iter, g_dens, g_dens_at, g_evecs, g_vxc, g_fock,
562
603
     &       g_svecs, dbl_mb(isvals), g_xcinv, g_s)
563
604
       else
564
 
        ! Spin-Orbit DFT + real-time dynamics
565
 
        !dft_main0d = rt_tddft_sodft(rtdb, Etold, Enuc, iVcoul_opt, 
566
 
     &  !   iVxc_opt, iter, g_dens, g_dens_at, g_evecs, g_vxc, g_fock, 
567
 
     &  !   g_svecs, dbl_mb(isvals), g_xcinv, g_s, 
568
 
     &  !   g_dipx, g_dipy, g_dipz, g_ddotE, g_vel)
569
605
        dft_main0d = .false.
570
606
       end if  ! lrt_tddft
571
 
      endif 
 
607
      endif ! theory
 
608
c
572
609
      if (odftps) call pstat_off(ps_scfdft)
573
610
c     
574
611
c     == Clean up memory usage ==