~nickpapior/siesta/trunk-kovalp

« back to all changes in this revision

Viewing changes to Src/post_scf_work.F

  • Committer: Nick Papior
  • Date: 2016-08-18 05:56:45 UTC
  • Revision ID: nickpapior@gmail.com-20160818055645-judotnqdl75x5y9b
Run all tests, solved merge problems and updated convergence criteria

- Re-run all tests.

  This showed a couple of interesting things.

  1. There was a mistake in the compute_dm code after
  the PEXSI merge when spin-orbit coupling was introduced
  2. I have removed Hprev as it essentially is the same as
  Hold. Either way it shouldn't produce a huge difference
  in the tracking of the dEbs, etc. (after all they are
  not physically used other than for convergence criteria)
  3. The change to SCF.Mix Hamiltonian resulted in a huge
  number of changes in the output. This is because the first
  step prints out the energies at INIT. However, the Hamiltonian
  is different because it is initialized after the compute_dm step.

- Changed the logic in convergence criteria.
  Now the convergence criterias are additive and may be fully controlled.
  However, at least one convergence criteria must be used.

  Now the default convergence criteria is both the Hamiltonian and the density
  matrix.

  This is updated in the manual and the compatibility note.

- Initially I thought the above differences in the energies was
  due to inconsistencies after r538. Hence I have created some
  simple routines in the m_energies.f90 code which updates a selected
  few of the energies.
  I think this should be adopted in the future to ensure that all
  calls to update energies are consistent.
  This will make changes to energy calculations less error-prone.

- Implemented the spin-type in the following routines:
   compute_dm
   final_H_f_stress
   state_init

- Changed the m_compute_max_diff to an interface code with appropriate
  size calculations. There was no reason for explicitly using the
  sparse pattern.

- Fixed a bug in the molecularmechanics code (introduced by Nick r542)

- Added a cyclediffs.sh script which loops on OUT.diffs files and
  it lets one easily cycle the diffs, simply do:

  cd Tests
  make check
  ./cyclediffs.sh

  and answer all the questions. Basically it makes deletes OUT.diffs
  which you have agreed isn't really a change.

- The tests may now be runned via:

   make MPI="mpirun -np 4"
   
  which then uses the default SIESTA location.

  Currently the script checks whether mpirun/mpiexec
  is in SIESTA variable, and if so, does not use MPI variable.
  This makes it easier to decide on the number of cores without
  writing the full path.

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
      ! last SCF step, except if mixing the Hamiltonian, in which case they
125
125
      ! are the same.
126
126
 
127
 
      DEna = Enascf - Enaatm
128
 
      Etot = E0 + DEna + DUscf + DUext + Exc + Ecorrec +
129
 
     &       Emad + Emm + Emeta + Eldau
 
127
      call update_DEna()
 
128
      call update_Etot()
130
129
 
131
130
!     Since this Etot is computed with DM_mixed (the DM predicted by
132
131
!     'mixer' for a hypothetical next SCF iteration) or with DM_out
144
143
      ! and the latest entropy. This is not completely 
145
144
      ! consistent if using a mixed DM to compute Etot, but
146
145
      ! is a reasonable approximation
147
 
      !
148
 
      FreeE  = Etot - Temp * Entropy
149
 
!
 
146
      call update_FreeE( Temp )
 
147
      
 
148
      
150
149
      if (dumpcharge) then
151
150
        call plcharge( no_s, na_s, no_u, maxnh, maxna, h_spin_dim,
152
151
     &       isa, iphorb, indxuo, lasto,