~nickpapior/siesta/tddft-work

« back to all changes in this revision

Viewing changes to Src/read_options.F90

  • Committer: Rafi Ullah
  • Date: 2017-08-30 14:09:10 UTC
  • mfrom: (611.1.19 trunk)
  • Revision ID: rraffiu@gmail.com-20170830140910-bhu0osuh4d59wn8e
Merged with trunk-630

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
  use siesta_options
21
21
  use precision, only : dp, grid_p
22
 
  use parallel,  only : IOnode, Nodes, ParallelOverK
 
22
  use parallel,  only : IOnode, Nodes
23
23
  use fdf
24
24
  use files,     only : slabel
25
25
  use files,     only : filesOut_t   ! derived type for output file names
26
26
  use sys
27
27
  use units,     only : eV, Ang, Kelvin
28
 
  use diagmemory,   only: memoryfactor
29
28
  use siesta_cml
30
29
  use m_target_stress, only: set_target_stress
31
 
  use m_spin, only: print_spin
 
30
  use m_spin, only: print_spin_options
32
31
 
33
32
  use m_charge_add, only : read_charge_add
34
33
  use m_hartree_add, only : read_hartree_add
37
36
  use m_mixing_scf, only: mixers_scf_print, mixers_scf_print_block
38
37
 
39
38
  use m_cite, only: add_citation
 
39
#ifdef SIESTA__CHESS
 
40
  use m_chess, only: set_CheSS_parameter
 
41
#endif
40
42
  
41
43
  implicit none
42
44
  !----------------------------------------------------------- Input Variables
43
45
  ! integer na               : Number of atoms
44
46
  ! integer ns               : Number of species
45
47
  ! integer nspin            : Number of spin-components
46
 
  !                            1=non-polarized, 2=polarized, 4=non-collinear
 
48
  !                            1=non-polarized, 2=polarized, 4=non-collinear,
 
49
  !                            8=spin-orbit
47
50
 
48
51
  integer, intent(in)  :: na, ns, nspin
49
52
 
50
53
  ! This routine sets variables in the 'siesta_options' module
51
54
 
 
55
#ifdef SIESTA__CHESS
 
56
  real(dp) :: chess_value
 
57
#endif
52
58
  ! The following are comment lines that should be merged into 'siesta_options'.
53
59
 
54
60
  ! real*8 charnet           : Net charge (in units of |e|)
69
75
  !                                                 3   = OMM
70
76
  !                                                 4   = PEXSI
71
77
  !                                                 5   = (Matrix write)
 
78
  !                                                 6   = CheSS
72
79
  ! real*8 temp              : Temperature for Fermi smearing (Ry)
73
80
  ! logical fixspin          : Fix the spin of the system?
74
81
  ! real*8  ts               : Total spin of the system
161
168
  character(len=30) :: ctmp
162
169
  character(len=6) :: method
163
170
 
164
 
  logical :: DaC, qnch, qnch2
 
171
  logical :: qnch, qnch2
165
172
  logical :: tBool
166
173
 
167
174
  !--------------------------------------------------------------------- BEGIN
191
198
  endif
192
199
 
193
200
  ! Start by printing out spin-configuration
194
 
  call print_spin()
 
201
  call print_spin_options()
195
202
 
196
203
  ! H setup only
197
204
  h_setup_only = fdf_get('HSetupOnly', .false.)
508
515
  dDtol = fdf_get('SCF.DM.Tolerance',dDtol)
509
516
  if ( IONode ) then
510
517
     write(6,1) 'redata: Require DM convergence for SCF', converge_DM
511
 
     write(6,9) 'redata: DM tolerance for SCF',dDtol
 
518
     write(6,11) 'redata: DM tolerance for SCF',dDtol
512
519
  end if
513
520
  if (cml_p) then
514
521
     call cmlAddParameter( xf=mainXML, name='SCF.DM.Converge', &
654
661
     
655
662
  else if (leqi(method,'diagon')) then
656
663
     isolve = SOLVE_DIAGON
657
 
     ! DivideAndConquer is now the default
658
 
     DaC = fdf_get('Diag.DivideAndConquer',.true.)
659
664
     if (ionode)  then
660
665
        write(*,3) 'redata: Method of Calculation', 'Diagonalization'
661
 
        write(*,1) 'redata: Divide and Conquer', DaC
662
666
     endif
663
667
     
664
668
  else if (leqi(method,'ordern')) then
665
669
     isolve = SOLVE_ORDERN
666
 
     DaC    = .false.
667
670
     if (ionode) then
668
671
        write(*,3) 'redata: Method of Calculation','Order-N'
669
672
     endif
675
678
     
676
679
  else if (leqi(method,'omm')) then
677
680
     isolve = SOLVE_MINIM
678
 
     DaC    = .false.
679
681
     call_diagon_default=fdf_integer('OMM.Diagon',0)
680
682
     call_diagon_first_step=fdf_integer('OMM.DiagonFirstStep',call_diagon_default)
681
683
     minim_calc_eigenvalues=fdf_boolean('OMM.Eigenvalues',.false.)
692
694
#else
693
695
     call die("PEXSI solver is not compiled in. Use -DSIESTA__PEXSI")
694
696
#endif
 
697
 
 
698
#ifdef SIESTA__CHESS
 
699
  else if (leqi(method,'chess')) then
 
700
     isolve = SOLVE_CHESS
 
701
     if (ionode) then
 
702
        write(*,'(a,4x,a)')                                &
 
703
             'redata: Method of Calculation            = ',  &
 
704
             '    CheSS'
 
705
     endif
 
706
#endif /* CHESS */
695
707
     
696
708
#ifdef TRANSIESTA
697
709
  else if (leqi(method,'transi') .or. leqi(method,'transiesta') &
705
717
#endif /* TRANSIESTA */
706
718
  else
707
719
     call die( 'redata: The method of solution must be either '//&
 
720
#ifdef SIESTA__CHESS
 
721
          'CheSS, '//&
 
722
#endif
708
723
#ifdef TRANSIESTA
709
724
          'Transiesta, '//&
710
725
#endif
718
733
  call write_debug( '    Solution Method: ' // method )
719
734
#endif
720
735
 
721
 
  if (cml_p) then
722
 
     call cmlAddParameter( xf=mainXML, name='Diag.DivideAndConquer', &
723
 
          value=DaC, dictRef='siesta:DaC' )
724
 
  endif
725
 
 
726
 
  ! Memory scaling factor for rdiag/cdiag - cannot be less than 1.0
727
 
  MemoryFactor = fdf_get('Diag.Memory', 1.0_dp )
728
 
  MemoryFactor = max(MemoryFactor,1.0_dp)
729
 
  if (cml_p) then
730
 
     call cmlAddParameter( xf=mainXML, name='Diag.Memory', &
731
 
          value=MemoryFactor,             &
732
 
          dictRef='siesta:MemoryFactor',  &
733
 
          units="cmlUnits:dimensionless" )
734
 
  endif
 
736
#ifdef SIESTA__CHESS
 
737
  ! Buffer for the density kernel within the CheSS calculation
 
738
  chess_value = fdf_get('CheSS.Buffer.Kernel', 4.0_dp, 'Bohr')
 
739
  call set_CheSS_parameter('chess_buffer_kernel', chess_value)
 
740
  if (ionode)  write(6,7), &
 
741
      'redata: CheSS.Buffer.Kernel',chess_value
 
742
 
 
743
  ! Buffer for the matrix vector multiplication within the CheSS calculation
 
744
  chess_value = fdf_get('CheSS.Buffer.Mult', 6.0_dp, 'Bohr')
 
745
  call set_CheSS_parameter('chess_buffer_mult', chess_value)
 
746
  if (ionode)  write(6,7), &
 
747
      'redata: CheSS.Buffer.Mult',chess_value
 
748
 
 
749
  ! Parameters for the penalty function used to determine the eigenvalue bounds
 
750
  chess_value = fdf_get('CheSS.Betax', -1000.0_dp)
 
751
  call set_CheSS_parameter('chess_betax', chess_value)
 
752
  if (ionode)  write(6,7), &
 
753
      'redata: CheSS.Betax',chess_value
 
754
 
 
755
  ! Initial guess for the error function decay length
 
756
  chess_value = fdf_get('CheSS.Fscale', 1.e-1_dp, 'Ry')
 
757
  call set_CheSS_parameter('chess_fscale', chess_value)
 
758
  if (ionode)  write(6,7), &
 
759
      'redata: CheSS.Fscale',chess_value
 
760
 
 
761
  ! Lower bound for the error function decay length
 
762
  chess_value = fdf_get('CheSS.FscaleLowerbound', 1.e-2_dp, 'Ry')
 
763
  call set_CheSS_parameter('chess_fscale_lowerbound', chess_value)
 
764
  if (ionode)  write(6,7), &
 
765
      'redata: CheSS.FscaleLowerbound',chess_value
 
766
 
 
767
  ! Upper bound for the error function decay length
 
768
  chess_value = fdf_get('CheSS.FscaleUpperbound', 1.e-1_dp, 'Ry')
 
769
  call set_CheSS_parameter('chess_fscale_upperbound', chess_value)
 
770
  if (ionode)  write(6,7), &
 
771
      'redata: CheSS.FscaleUpperbound',chess_value
 
772
 
 
773
  ! Initial guess for the lowest eigenvalue bound of the Hamiltonian
 
774
  chess_value = fdf_get('CheSS.evlowH', -2.0_dp, 'Ry')
 
775
  call set_CheSS_parameter('chess_evlow_h', chess_value)
 
776
  if (ionode)  write(6,7), &
 
777
      'redata: CheSS.evlowH',chess_value
 
778
 
 
779
  ! Initial guess for the highest eigenvalue bound of the Hamiltonian
 
780
  chess_value = fdf_get('CheSS.evhighH', 2.0_dp, 'Ry')
 
781
  call set_CheSS_parameter('chess_evhigh_h', chess_value)
 
782
  if (ionode)  write(6,7), &
 
783
      'redata: CheSS.evhighH',chess_value
 
784
 
 
785
  ! Initial guess for the lowest eigenvalue bound of the overlap matrix
 
786
  chess_value = fdf_get('CheSS.evlowS', 0.5_dp)
 
787
  call set_CheSS_parameter('chess_evlow_s', chess_value)
 
788
  if (ionode)  write(6,7), &
 
789
      'redata: CheSS.evlowS',chess_value
 
790
 
 
791
  ! Initial guess for the highest eigenvalue bound of the overlap matrix
 
792
  chess_value = fdf_get('CheSS.evhighS', 1.5_dp)
 
793
  call set_CheSS_parameter('chess_evhigh_s', chess_value)
 
794
  if (ionode)  write(6,7), &
 
795
      'redata: CheSS.evhighS',chess_value
 
796
 
 
797
#endif
735
798
 
736
799
  ! Electronic temperature for Fermi Smearing ...
737
800
  temp = fdf_get('ElectronicTemperature',1.9e-3_dp,'Ry')
1042
1105
  ! Tolerance in the maximum residual stress (var cell) [1 GPa]
1043
1106
  strtol = fdf_get('MD.MaxStressTol', 6.79773e-5_dp, 'Ry/Bohr**3')
1044
1107
  strtol = abs(strtol)
 
1108
  
 
1109
  GeometryMustConverge = fdf_get('GeometryMustConverge', .false.)
1045
1110
 
1046
1111
  if (ionode) then
1047
1112
     select case (idyn)
1643
1708
     bornz = .false.
1644
1709
  endif
1645
1710
  change_kgrid_in_md           = fdf_get('ChangeKgridInMD', .false.)
1646
 
  ParallelOverK                = fdf_get('Diag.ParallelOverK', .false.)
1647
 
  ! If non-collinear spin, it *MUST* be false.
1648
 
  if ( nspin > 2 ) ParallelOverK = .false.
1649
1711
  RelaxCellOnly                = fdf_get('MD.RelaxCellOnly', .false.)
1650
1712
  RemoveIntraMolecularPressure = fdf_get( &
1651
1713
       'MD.RemoveIntraMolecularPressure', .false.)
1706
1768
8  format(a,t53,'= ',f14.12)
1707
1769
9  format(a,t53,'= ',f10.4)
1708
1770
10 format(t55,a)
 
1771
11 format(a,t53,'= ',f12.6)
1709
1772
 
1710
1773
CONTAINS
1711
1774
  subroutine deprecated( str )