~ubuntu-branches/ubuntu/trusty/nwchem/trusty-proposed

« back to all changes in this revision

Viewing changes to src/nwdft/xc/xc_eval_fnl.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:
7
7
c
8
8
      Subroutine xc_eval_fnl(rho, delrho, Amat, Amat2, Cmat, Cmat2,
9
9
     &                       nq, Ex, Ec, qwght, grad, ldew, func,
10
 
     &                       do_2nd, tau, ttau, kske, Mmat, Mmat2,
 
10
     &                       do_2nd, ttau, kske, Mmat, Mmat2,
11
11
     &                       StericEnergy)
12
12
c
13
 
c     $Id: xc_eval_fnl.F 21745 2012-01-11 08:12:51Z niri $
 
13
c     $Id: xc_eval_fnl.F 23554 2013-02-09 16:41:27Z mswart $
14
14
c
15
15
      implicit none
16
16
c
19
19
#include "stdio.fh"
20
20
#include "steric.fh"
21
21
c
22
 
      integer nq
 
22
      integer nq, is12x
23
23
      double precision rho(*), delrho(*)
24
24
c
25
 
      double precision tau(*), Mmat(*), ttau(*)
 
25
      double precision Mmat(*), ttau(*)
26
26
c
27
27
      double precision Amat(*), Cmat(*), Amat2(*), Cmat2(*), Mmat2(*)
28
28
      double precision Ex, Ec
408
408
         endif 
409
409
      endif
410
410
c
 
411
c s12g
 
412
c
 
413
      if (abs(xfac(60)).gt.eps) then
 
414
         is12x = 1
 
415
         if (.not. do_2nd) then
 
416
            call xc_s12x(tol_rho, xfac(60), lxfac(60), nlxfac(60),
 
417
     &           rho, delrho, Amat, Cmat, nq, ipol,
 
418
     &           Ex, qwght, ldew, func, is12x)
 
419
         else
 
420
            call xc_s12x_d2(tol_rho, xfac(60), lxfac(60), nlxfac(60),
 
421
     &         rho, delrho, Amat, Amat2, Cmat, Cmat2, nq, ipol,
 
422
     &           Ex, qwght, ldew, func, is12x)
 
423
         endif
 
424
      endif
 
425
c
 
426
c s12h
 
427
c
 
428
      if (abs(xfac(61)).gt.eps) then
 
429
         is12x = 2
 
430
         if (.not. do_2nd) then
 
431
            call xc_s12x(tol_rho, xfac(61), lxfac(61), nlxfac(61),
 
432
     &           rho, delrho, Amat, Cmat, nq, ipol,
 
433
     &           Ex, qwght, ldew, func, is12x)
 
434
         else
 
435
            call xc_s12x_d2(tol_rho, xfac(61), lxfac(61), nlxfac(61),
 
436
     &         rho, delrho, Amat, Amat2, Cmat, Cmat2, nq, ipol,
 
437
     &           Ex, qwght, ldew, func, is12x)
 
438
         endif
 
439
      endif
 
440
c
 
441
c cam-s12g
 
442
c
 
443
      if (abs(xfac(62)).gt.eps) then
 
444
         is12x = 1
 
445
         if (.not. do_2nd) then
 
446
            call xc_cams12x(tol_rho, xfac(62), lxfac(62), nlxfac(62),
 
447
     &           rho, delrho, Amat, Cmat, nq, ipol,
 
448
     &           Ex, qwght, ldew, func, is12x)
 
449
         else
 
450
            call xc_cams12x_d2(tol_rho, xfac(62), lxfac(62), nlxfac(62),
 
451
     &         rho, delrho, Amat, Amat2, Cmat, Cmat2, nq, ipol,
 
452
     &           Ex, qwght, ldew, func, is12x)
 
453
         endif
 
454
      endif
 
455
c
 
456
c cam-s12h
 
457
c
 
458
      if (abs(xfac(63)).gt.eps) then
 
459
         is12x = 2
 
460
         if (.not. do_2nd) then
 
461
            call xc_cams12x(tol_rho, xfac(63), lxfac(63), nlxfac(63),
 
462
     &           rho, delrho, Amat, Cmat, nq, ipol,
 
463
     &           Ex, qwght, ldew, func, is12x)
 
464
         else
 
465
            call xc_cams12x_d2(tol_rho, xfac(63), lxfac(63), nlxfac(63),
 
466
     &         rho, delrho, Amat, Amat2, Cmat, Cmat2, nq, ipol,
 
467
     &           Ex, qwght, ldew, func, is12x)
 
468
         endif
 
469
      endif
 
470
c
411
471
      if (abs(xfac(8)).gt.eps)then
412
472
         if (.not. do_2nd) then
413
473
            call xc_gill96(tol_rho, xfac(8), lxfac(8), nlxfac(8), 
486
546
         if (.not. do_2nd) then
487
547
            call xc_xpkzb99(tol_rho, xfac(18), lxfac(18), nlxfac(18), 
488
548
     &           rho, delrho, Amat, Cmat, nq, ipol, 
489
 
     &           Ex, qwght,ldew,func,tau, Mmat)
 
549
     &           Ex, qwght,ldew,func,ttau, Mmat)
490
550
         else
491
551
            call xc_xpkzb99_d2()
492
552
         endif
513
573
         if (.not. do_2nd) then
514
574
            call xc_cpkzb99(tol_rho, cfac(25), lcfac(25), nlcfac(25),  
515
575
     &           rho, delrho,  nq, ipol, 
516
 
     &           Ec, qwght, ldew, func, tau,Amat,Cmat,Mmat)
 
576
     &           Ec, qwght, ldew, func, ttau,Amat,Cmat,Mmat)
517
577
         else
518
578
            call xc_cpkzb99_d2()
519
579
         endif
525
585
         if (.not. do_2nd) then
526
586
            call xc_xtpss03(tol_rho, xfac(21),  
527
587
     &           rho, delrho, Amat, Cmat, nq, ipol, 
528
 
     &           Ex, qwght,ldew,func,tau,Mmat)
 
588
     &           Ex, qwght,ldew,func,ttau,Mmat)
529
589
         else
530
590
            call xc_xtpss03_d2()
531
591
         endif
542
602
         if (.not. do_2nd) then
543
603
            call xc_ctpss03(tol_rho, cfac(27), lcfac(27), nlcfac(27),  
544
604
     &           rho, delrho,  nq, ipol, 
545
 
     &           Ec, qwght, ldew, func, tau,Amat,Cmat,Mmat)
 
605
     &           Ec, qwght, ldew, func, ttau,Amat,Cmat,Mmat)
546
606
 
547
607
         else
548
608
            call xc_ctpss03_d2()
562
622
         if (.not. do_2nd) then
563
623
            call xc_bc95(tol_rho, cfac(31), lcfac(31), nlcfac(31),
564
624
     &           rho, delrho,  nq, ipol,
565
 
     &           Ec, qwght, ldew,func, tau,Amat,Cmat,Mmat,0)
 
625
     &           Ec, qwght, ldew,func, ttau,Amat,Cmat,Mmat,0)
566
626
      
567
627
         else
568
628
            call xc_bc95_d2()
603
663
         if (.not. do_2nd) then
604
664
            call xc_xm05(tol_rho, xfac(28), lxfac(28), nlxfac(28),
605
665
     &           rho, delrho, Amat, Cmat, nq, ipol,
606
 
     &           Ex, qwght,ldew,func,tau,Mmat,1)
 
666
     &           Ex, qwght,ldew,func,ttau,Mmat,1)
607
667
         else
608
668
            call xc_xm05_d2()
609
669
         endif
615
675
         if (.not. do_2nd) then
616
676
            call xc_xm05(tol_rho, xfac(29), lxfac(29), nlxfac(29),
617
677
     &           rho, delrho, Amat, Cmat, nq, ipol,
618
 
     &           Ex, qwght,ldew, func,tau,Mmat,2)
 
678
     &           Ex, qwght,ldew, func,ttau,Mmat,2)
619
679
         else
620
680
            call xc_xm05_d2()
621
681
         endif
622
682
      endif
623
683
c
 
684
c dlDF    meta GGA Exchange
 
685
c      
 
686
      if (abs(xfac(32)).gt.eps)then
 
687
         if (.not. do_2nd) then
 
688
            call xc_xdldf(tol_rho, xfac(32), lxfac(32), nlxfac(32),
 
689
     &           rho, delrho, Amat, Cmat, nq, ipol,
 
690
     &           Ex, qwght,ldew, func,ttau,Mmat)
 
691
         else
 
692
            call xc_xdldf_d2()
 
693
         endif
 
694
      endif
 
695
c
624
696
c VSXC   meta GGA Exchange
625
697
c
626
698
      if (abs(xfac(33)).gt.eps)then
627
699
         if (.not. do_2nd) then
628
700
            call xc_xvs98(tol_rho, xfac(33), lxfac(33), nlxfac(33),
629
701
     &           rho, delrho, Amat, Cmat, nq, ipol,
630
 
     &           Ex, qwght,ldew, func,tau,Mmat,1)
 
702
     &           Ex, qwght,ldew, func,ttau,Mmat,1)
631
703
         else
632
704
            call xc_xvs98_d2()
633
705
         endif
639
711
         if (.not. do_2nd) then
640
712
            call xc_xm06(tol_rho, xfac(34), lxfac(34), nlxfac(34),
641
713
     &           rho, delrho, Amat, Cmat, nq, ipol,
642
 
     &           Ex, qwght,ldew, func,tau,Mmat,1)
 
714
     &           Ex, qwght,ldew, func,ttau,Mmat,1)
643
715
         else
644
716
            call xc_xm06_d2()
645
717
         endif
651
723
         if (.not. do_2nd) then
652
724
            call xc_xm06(tol_rho, xfac(35), lxfac(35), nlxfac(35),
653
725
     &           rho, delrho, Amat, Cmat, nq, ipol,
654
 
     &           Ex, qwght,ldew, func,tau,Mmat,2)
 
726
     &           Ex, qwght,ldew, func,ttau,Mmat,2)
655
727
         else
656
728
            call xc_xm06_d2()
657
729
         endif
663
735
         if (.not. do_2nd) then
664
736
            call xc_xm06(tol_rho, xfac(36), lxfac(36), nlxfac(36),
665
737
     &           rho, delrho, Amat, Cmat, nq, ipol,
666
 
     &           Ex, qwght,ldew, func,tau,Mmat,3)
 
738
     &           Ex, qwght,ldew, func,ttau,Mmat,3)
667
739
         else
668
740
            call xc_xm06_d2()
669
741
         endif
675
747
         if (.not. do_2nd) then
676
748
            call xc_xm06(tol_rho, xfac(37), lxfac(37), nlxfac(37),
677
749
     &           rho, delrho, Amat, Cmat, nq, ipol,
678
 
     &           Ex, qwght,ldew, func,tau,Mmat,4)
 
750
     &           Ex, qwght,ldew, func,ttau,Mmat,4)
679
751
         else
680
752
            call xc_xm06_d2()
681
753
         endif
682
754
      endif
683
755
c
 
756
c M08-HX   meta GGA Exchange
 
757
c
 
758
      if (abs(xfac(48)).gt.eps)then
 
759
         if (.not. do_2nd) then
 
760
            call xc_xm11(tol_rho, xfac(48), lxfac(48), nlxfac(48),
 
761
     &           rho, delrho, Amat, Cmat, nq, ipol,
 
762
     &           Ex, qwght,ldew, func,ttau,Mmat,1)
 
763
         else
 
764
            call xc_xm11_d2()
 
765
         endif
 
766
      endif
 
767
c
 
768
c M08-SO   meta GGA Exchange
 
769
c
 
770
      if (abs(xfac(49)).gt.eps)then
 
771
         if (.not. do_2nd) then
 
772
            call xc_xm11(tol_rho, xfac(49), lxfac(49), nlxfac(49),
 
773
     &           rho, delrho, Amat, Cmat, nq, ipol,
 
774
     &           Ex, qwght,ldew, func,ttau,Mmat,2)
 
775
         else
 
776
            call xc_xm11_d2()
 
777
         endif
 
778
      endif
 
779
c
 
780
c M11   meta GGA Exchange
 
781
c
 
782
      if (abs(xfac(50)).gt.eps)then
 
783
         if (.not. do_2nd) then
 
784
            call xc_xm11(tol_rho, xfac(50), lxfac(50), nlxfac(50),
 
785
     &           rho, delrho, Amat, Cmat, nq, ipol,
 
786
     &           Ex, qwght,ldew, func,ttau,Mmat,3)
 
787
         else
 
788
            call xc_xm11_d2()
 
789
         endif
 
790
      endif
 
791
c
 
792
c M11-L   meta GGA Exchange
 
793
c
 
794
      if (abs(xfac(51)).gt.eps)then
 
795
         if (.not. do_2nd) then
 
796
            call xc_xm11(tol_rho, xfac(51), lxfac(51), nlxfac(51),
 
797
     &           rho, delrho, Amat, Cmat, nq, ipol,
 
798
     &           Ex, qwght,ldew, func,ttau,Mmat,4)
 
799
         else
 
800
            call xc_xm11_d2()
 
801
         endif
 
802
      endif
 
803
c
 
804
c SOGGA GGA Exchange
 
805
c
 
806
      if (abs(xfac(52)).gt.eps)then
 
807
         if (.not. do_2nd) then
 
808
            call xc_xsogga(tol_rho, xfac(48), lxfac(48), nlxfac(48),
 
809
     &           rho, delrho, Amat, Cmat, nq, ipol,
 
810
     &           Ex, qwght,ldew, func,1)
 
811
         else
 
812
            call xc_xsogga_d2()
 
813
         endif
 
814
      endif
 
815
c
 
816
c SOGGA11 GGA Exchange
 
817
c
 
818
      if (abs(xfac(53)).gt.eps)then
 
819
         if (.not. do_2nd) then
 
820
            call xc_xsogga(tol_rho, xfac(49), lxfac(49), nlxfac(49),
 
821
     &           rho, delrho, Amat, Cmat, nq, ipol,
 
822
     &           Ex, qwght,ldew, func,2)
 
823
         else
 
824
            call xc_xsogga_d2()
 
825
         endif
 
826
      endif
 
827
c
 
828
c SOGGA11-X GGA Exchange
 
829
c
 
830
      if (abs(xfac(54)).gt.eps)then
 
831
         if (.not. do_2nd) then
 
832
            call xc_xsogga(tol_rho, xfac(50), lxfac(50), nlxfac(50),
 
833
     &           rho, delrho, Amat, Cmat, nq, ipol,
 
834
     &           Ex, qwght,ldew, func,3)
 
835
         else
 
836
            call xc_xsogga_d2()
 
837
         endif
 
838
      endif
 
839
c
 
840
c     cm08-hx is special in that the GGA part is
 
841
c     defined to be dependent on
 
842
c     the E(LDA) ...
 
843
c     the decision has been made to use the PW91-LDA as the
 
844
c     LDA-correlation.  at present, this LDA  cannot be
 
845
c     set by the user
 
846
c
 
847
      if (abs(cfac(48)).gt.eps)then
 
848
         if (.not. do_2nd) then
 
849
            call xc_cm11(tol_rho, cfac(48), lcfac(48), nlcfac(48),
 
850
     &           rho, delrho,  nq, ipol,
 
851
     &           Ec, qwght, ldew,func,ttau,Amat,Cmat,Mmat,1)
 
852
 
 
853
         else
 
854
            call xc_cm11_d2()
 
855
         endif
 
856
      endif
 
857
c
 
858
c     cm08-so is special in that the GGA part is
 
859
c     defined to be dependent on
 
860
c     the E(LDA) ...
 
861
c     the decision has been made to use the PW91-LDA as the
 
862
c     LDA-correlation.  at present, this LDA  cannot be
 
863
c     set by the user
 
864
c
 
865
      if (abs(cfac(49)).gt.eps)then
 
866
         if (.not. do_2nd) then
 
867
            call xc_cm11(tol_rho, cfac(49), lcfac(49), nlcfac(49),
 
868
     &           rho, delrho,  nq, ipol,
 
869
     &           Ec, qwght, ldew,func,ttau,Amat,Cmat,Mmat,2)
 
870
 
 
871
         else
 
872
            call xc_cm11_d2()
 
873
         endif
 
874
      endif
 
875
c
 
876
c     cm11 is special in that the GGA part is
 
877
c     defined to be dependent on
 
878
c     the E(LDA) ...
 
879
c     the decision has been made to use the PW91-LDA as the
 
880
c     LDA-correlation.  at present, this LDA  cannot be
 
881
c     set by the user
 
882
c
 
883
      if (abs(cfac(50)).gt.eps)then
 
884
         if (.not. do_2nd) then
 
885
            call xc_cm11(tol_rho, cfac(50), lcfac(50), nlcfac(50),
 
886
     &           rho, delrho,  nq, ipol,
 
887
     &           Ec, qwght, ldew,func,ttau,Amat,Cmat,Mmat,3)
 
888
 
 
889
         else
 
890
            call xc_cm11_d2()
 
891
         endif
 
892
      endif
 
893
c
 
894
c     cm11-l is special in that the GGA part is
 
895
c     defined to be dependent on
 
896
c     the E(LDA) ...
 
897
c     the decision has been made to use the PW91-LDA as the
 
898
c     LDA-correlation.  at present, this LDA  cannot be
 
899
c     set by the user
 
900
c
 
901
      if (abs(cfac(51)).gt.eps)then
 
902
         if (.not. do_2nd) then
 
903
            call xc_cm11(tol_rho, cfac(51), lcfac(51), nlcfac(51),
 
904
     &           rho, delrho,  nq, ipol,
 
905
     &           Ec, qwght, ldew,func,ttau,Amat,Cmat,Mmat,4)
 
906
 
 
907
         else
 
908
            call xc_cm11_d2()
 
909
         endif
 
910
      endif
 
911
c
 
912
c     csogga is special in that the GGA part is
 
913
c     defined to be dependent on
 
914
c     the E(LDA) ...
 
915
c     the decision has been made to use the PW91-LDA as the
 
916
c     LDA-correlation.  at present, this LDA  cannot be
 
917
c     set by the user
 
918
c
 
919
      if (abs(cfac(52)).gt.eps)then
 
920
         if (.not. do_2nd) then
 
921
            call xc_cpbe96(tol_rho, cfac, lcfac, nlcfac, rho,
 
922
     &           delrho, Amat, Cmat, nq, ipol,
 
923
     &           Ec, qwght, ldew, func)
 
924
         else
 
925
            call xc_csogga_d2()
 
926
         endif
 
927
      endif
 
928
c
 
929
c     csogga11 is special in that the GGA part is
 
930
c     defined to be dependent on
 
931
c     the E(LDA) ...
 
932
c     the decision has been made to use the PW91-LDA as the
 
933
c     LDA-correlation.  at present, this LDA  cannot be
 
934
c     set by the user
 
935
c
 
936
      if (abs(cfac(53)).gt.eps)then
 
937
         if (.not. do_2nd) then
 
938
            call xc_csogga(tol_rho, cfac(49), lcfac(49), nlcfac(49),
 
939
     &           rho, delrho,  nq, ipol,
 
940
     &           Ec, qwght, ldew,func,Amat,Cmat,1)
 
941
 
 
942
         else
 
943
            call xc_csogga_d2()
 
944
         endif
 
945
      endif
 
946
c
 
947
c     csogga11-x is special in that the GGA part is
 
948
c     defined to be dependent on
 
949
c     the E(LDA) ...
 
950
c     the decision has been made to use the PW91-LDA as the
 
951
c     LDA-correlation.  at present, this LDA  cannot be
 
952
c     set by the user
 
953
c
 
954
      if (abs(cfac(54)).gt.eps)then
 
955
         if (.not. do_2nd) then
 
956
            call xc_csogga(tol_rho, cfac(50), lcfac(50), nlcfac(50),
 
957
     &           rho, delrho,  nq, ipol,
 
958
     &           Ec, qwght, ldew,func,Amat,Cmat,2)
 
959
 
 
960
         else
 
961
            call xc_csogga_d2()
 
962
         endif
 
963
      endif
 
964
c
684
965
c LC-BNL 2007 Exchange 
685
966
c
686
967
      if (abs(xfac(38)).gt.eps)then
687
968
       if (.not. do_2nd) then
688
 
        call xc_rodaes_erf(tol_rho, xfac(38), lxfac(38), nlxfac(38), 
 
969
        call xc_bnl(tol_rho, xfac(38), lxfac(38), nlxfac(38), 
689
970
     &    rho, Amat, nq, ipol, Ex, qwght, ldew, func)
690
971
       else
691
 
        call xc_rodaes_erf_d2(tol_rho, xfac(38), lxfac(38), nlxfac(38), 
 
972
        call xc_bnl_d2(tol_rho, xfac(38), lxfac(38), nlxfac(38), 
692
973
     &    rho, Amat, Amat2, nq, ipol, Ex, qwght, ldew, func)
693
974
       endif
694
975
      endif
760
1041
         if (.not. do_2nd) then
761
1042
            call xc_bc95(tol_rho, cfac(32), lcfac(32), nlcfac(32),
762
1043
     &           rho, delrho,  nq, ipol,
763
 
     &           Ec, qwght, ldew,func, tau,Amat,Cmat,Mmat,1)
 
1044
     &           Ec, qwght, ldew,func, ttau,Amat,Cmat,Mmat,1)
764
1045
 
765
1046
         else
766
1047
            call xc_bc95_d2()
779
1060
            
780
1061
            call xc_bc95(tol_rho, cfac(33), lcfac(33), nlcfac(33),
781
1062
     &           rho, delrho,  nq, ipol,
782
 
     &           Ec, qwght, ldew,func,tau,Amat,Cmat,Mmat,2)
 
1063
     &           Ec, qwght, ldew,func,ttau,Amat,Cmat,Mmat,2)
783
1064
 
784
1065
         else
785
1066
            call xc_bc95_d2()
797
1078
         if (.not. do_2nd) then
798
1079
            call xc_cm05(tol_rho, cfac(34), lcfac(34), nlcfac(34),
799
1080
     &           rho, delrho,  nq, ipol,
800
 
     &           Ec, qwght, ldew, func,tau,Amat,Cmat,Mmat,1)
 
1081
     &           Ec, qwght, ldew, func,ttau,Amat,Cmat,Mmat,1)
801
1082
 
802
1083
         else
803
1084
            call xc_cm05_d2()
815
1096
         if (.not. do_2nd) then
816
1097
            call xc_cm05(tol_rho, cfac(35), lcfac(35), nlcfac(35),
817
1098
     &           rho, delrho,  nq, ipol,
818
 
     &           Ec, qwght, ldew,func,tau,Amat,Cmat,Mmat,2)
 
1099
     &           Ec, qwght, ldew,func,ttau,Amat,Cmat,Mmat,2)
819
1100
 
820
1101
         else
821
1102
            call xc_cm05_d2()
822
1103
         endif
823
1104
      endif
824
1105
c
 
1106
c     dlDF Correlation
 
1107
c
 
1108
c     cdldf is special in that the GGA part is
 
1109
c     defined to be dependent on
 
1110
c     the E(LDA) ...
 
1111
c     the decision has been made to use the PW91-LDA as the
 
1112
c     LDA-correlation.  at present, this LDA  cannot be
 
1113
c     set by the user
 
1114
c
 
1115
      if (abs(cfac(42)).gt.eps)then
 
1116
         if (.not. do_2nd) then
 
1117
            call xc_cdldf(tol_rho, cfac(42), lcfac(42), nlcfac(42),
 
1118
     &           rho, delrho,  nq, ipol,
 
1119
     &           Ec, qwght, ldew,func,ttau,Amat,Cmat,Mmat)
 
1120
 
 
1121
         else
 
1122
            call xc_cdldf_d2()
 
1123
         endif
 
1124
      endif
 
1125
c
825
1126
c     cvs98 is special in that the GGA part is
826
1127
c     defined to be dependent on
827
1128
c     the E(LDA) ...
833
1134
         if (.not. do_2nd) then
834
1135
            call xc_cvs98(tol_rho, cfac(29), lcfac(29), nlcfac(29),
835
1136
     &           rho, delrho,  nq, ipol,
836
 
     &           Ec, qwght, ldew,func,tau,Amat,Cmat,Mmat,1)
 
1137
     &           Ec, qwght, ldew,func,ttau,Amat,Cmat,Mmat,1)
837
1138
 
838
1139
         else
839
1140
            call xc_cvs98_d2()
851
1152
         if (.not. do_2nd) then
852
1153
            call xc_cm06(tol_rho, cfac(30), lcfac(30), nlcfac(30),
853
1154
     &           rho, delrho,  nq, ipol,
854
 
     &           Ec, qwght, ldew,func,tau,Amat,Cmat,Mmat,1)
 
1155
     &           Ec, qwght, ldew,func,ttau,Amat,Cmat,Mmat,1)
855
1156
 
856
1157
         else
857
1158
            call xc_cm06_d2()
869
1170
         if (.not. do_2nd) then
870
1171
            call xc_cm06(tol_rho, cfac(38), lcfac(38), nlcfac(38),
871
1172
     &           rho, delrho,  nq, ipol,
872
 
     &           Ec, qwght, ldew,func,tau,Amat,Cmat,Mmat,2)
 
1173
     &           Ec, qwght, ldew,func,ttau,Amat,Cmat,Mmat,2)
873
1174
 
874
1175
         else
875
1176
            call xc_cm06_d2()
887
1188
         if (.not. do_2nd) then
888
1189
            call xc_cm06(tol_rho, cfac(39), lcfac(39), nlcfac(39),
889
1190
     &           rho, delrho,  nq, ipol,
890
 
     &           Ec, qwght, ldew,func,tau,Amat,Cmat,Mmat,3)
 
1191
     &           Ec, qwght, ldew,func,ttau,Amat,Cmat,Mmat,3)
891
1192
 
892
1193
         else
893
1194
            call xc_cm06_d2()
905
1206
         if (.not. do_2nd) then
906
1207
            call xc_cm06(tol_rho, cfac(40), lcfac(40), nlcfac(40),
907
1208
     &           rho, delrho,  nq, ipol,
908
 
     &           Ec, qwght, ldew,func,tau,Amat,Cmat,Mmat,4)
 
1209
     &           Ec, qwght, ldew,func,ttau,Amat,Cmat,Mmat,4)
909
1210
 
910
1211
         else
911
1212
            call xc_cm06_d2()