~nickpapior/siesta/trunk-buds-format0.92

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
-----------------------------------------------------------------------
2013-03-04  Alberto Garcia <albertog@icmab.es>   trunk-432-scf-40
Re-implement SCF.MixAfterConvergence 

The option to control the mixing after scf convergence had
been quietly ignored after the major changes to the scf loop
logic. Now it has been reinstated:

SCF.MixAfterConvergence  T

should recover the old behavior.

modified:
  Src/siesta_forces.F
  Src/siesta_options.F90

-----------------------------------------------------------------------
2013-02-21  Alberto Garcia <albertog@icmab.es>   trunk-432-scf-39
Sync to trunk-432

2013-01-24 Export some MPI symbols explicitly. Remove ob...
2013-01-21 [merge] Fix possible problems in temporary fi...
2013-01-21 Rationalize fdf logging and debugging
2013-01-18 [merge] JobList utility to organize and run mul...


-----------------------------------------------------------------------
2013-02-21  Alberto Garcia <albertog@icmab.es>   trunk-428-scf-39
Sync to trunk-428

2012-12-13 [merge] Bugfix in spin calculations for TBTra...
2012-12-10 [merge] More fixes and tests for new transies...
2012-11-20 [merge] Bug fixes for new transiesta/tbtrans_...
2012-11-14 Use scratch fdf log files for non-master nodes
2012-10-31 [merge] Bug fixes for array bounds 

-----------------------------------------------------------------------
2013-02-21  Alberto Garcia <albertog@icmab.es>   trunk-423-scf-39
Sync to trunk-423

2012-10-30 [merge] Transiesta and TBTrans enhancements by Nick P. Andersen

Notes: 

- The increase in the width of the dDmax field has been postponed.
- The full logic of the TranSiesta continuation (changes in now non-existing
scf_convergence_test) needs to be checked. Note that the timer calls in that
routine are now in compute_dm.
- The support for min_nscf has been implemented in a different, clearer way.
  nscf is set to the maximum of (nscf,min_nscf) in siesta_options.

-----------------------------------------------------------------------
2013-01-14  Alberto Garcia <albertog@icmab.es>   trunk-422-scf-39
SVD interface change. Experimental SVD scheme for DM extrapolation.

The SVD interface has been made more complete to accomodate new
functionality.

Summary of options for DM extrapolation:

If UseDIISforDMExtrapolation is 'true', the program will use a DIIS
framework instead of Jose Soler's original method for the
extrapolation of DMs accross geometries.

Further, if UseSVD is 'true', SVD techniques instead of direct matrix
inversion are used.

If UseSVDExperimental is 'true', the 'forward
differences' method of Kresse and Furthmuller is used. (Note that this
option does not yet work very well).

Summary of options for DM mixing with SVD:

If UseSVDinPulay is 'true', SVD techniques instead of direct matrix
inversion are used in Pulay mixing.

modified:
  Src/m_new_dm.F90
  Src/m_pulay.F90
  Src/m_svd.F90
  Src/state_analysis.F

-----------------------------------------------------------------------
2012-11-14  Alberto Garcia <albertog@icmab.es>   trunk-422-scf-38
Extend SVD procedure to DM Pulay mixing

The implicit inversion in the DIIS procedure is carried out using
SVD techniques if the user sets

UseSVDInPulay T

The tolerance to discard small singular values is hardwired to 1.e-6
('rcond' in the sense of the LAPACK routine dgelss).

Rank degradation history information might be used to determine
the appropriateness of "kicks" (to be implemented).

(+ The 'solve_with_svd' routine is in the new m_svd.F90 module file)

added:
  Src/m_svd.F90
modified:
  Src/Makefile
  Src/m_new_dm.F90
  Src/m_pulay.F90

-----------------------------------------------------------------------
2012-11-13  Alberto Garcia <albertog@icmab.es>   trunk-422-scf-37
Use SVD to obtain the DM extrapolation coefficients

Sometimes (particularly for consecutive line-minimization steps in CG
relaxation) the coordinate vectors in the extrapolation history for
the DM might be linearly dependent. A new method based on
singular-value decomposition has been implemented. This scheme is
"guaranteed" to give the best possible answer in the presence of a
reduced-rank matrix.

The new scheme is the default when DM.AllowExtrapolation is set to .true.

The tolerance to discard small singular values is hardwired to 1.e-6
('rcond' in the sense of the LAPACK routine dgelss).

When trying to figure out the best DM.HistoryDepth value, it is a good
idea to monitor the effective rank of the DIIS matrix. 

modified:
  Src/Fstack.T90
  Src/m_new_dm.F90

-----------------------------------------------------------------------
2012-11-07  Alberto Garcia <albertog@icmab.es>   trunk-422-scf-36
Add option to avoid correcting E_KS at every scf step

If the explicit display of the convergence of E_KS during the scf loop
is not necessary, the new fdf option

DoNotCorrectEKS T

can be used to deactivate the variationality correction. The *final*
E_KS value will still be variational, as it is computed with a pure
density matrix (not mixed after convergence). The forces will also be
computed with the pure DM.

modified:
  Src/Makefile
  Src/compute_EKS_Harris.F90
  Docs/siesta.tex
  Docs/siesta.ind

-----------------------------------------------------------------------
2012-10-26  Alberto Garcia <albertog@icmab.es>   trunk-422-scf-35
Sync to trunk-422

Fix handling of debugging preprocessor symbol...
[merge] Add rp and rv options to XML pseudopo...
[merge] Enable MD continuation runs even if t...
[merge] Add option to turn off time-reversal ...
[merge] Use actual number of electrons in opt...
[merge] Allow doping feature for all systems
[merge] Fix spin loop in initialization in Ei...
[merge] New options for wavefunction output. ...
[merge] Hirshfeld and Voronoi charges. Bader ...
Use a 'unique' string in fdf log files
Nullify pointers in diagkp
Fix bug in fdf_bbackspace. No .ion.nc files f...

removed:
  Src/fdf/tags
added:
  Src/m_partial_charges.F
  Tests/Reference-xml/si_fatbands.xml
  Tests/Reference/si_fatbands.out
  Tests/h2o-pop/
  Tests/h2o-pop/h2o-pop.fdf
  Tests/h2o-pop/h2o-pop.pseudos
  Tests/h2o-pop/makefile
  Tests/md-anneal-cont/
  Tests/md-anneal-cont/README
  Tests/md-anneal-cont/makefile
  Tests/md-anneal-cont/script.sh
  Tests/md-cont/
  Tests/md-cont-no-restart-file/
  Tests/md-cont-no-restart-file/README
  Tests/md-cont-no-restart-file/makefile
  Tests/md-cont-no-restart-file/script.sh
  Tests/md-cont/README
  Tests/md-cont/makefile
  Tests/md-cont/script.sh
  Tests/md-single-run/
  Tests/md-single-run/README
  Tests/md-single-run/makefile
  Tests/md-single-run/script.sh
  Tests/si_fatbands/
  Tests/si_fatbands/makefile
  Tests/si_fatbands/si_fatbands.fdf
  Tests/si_fatbands/si_fatbands.pseudos
  Util/Bands/
  Util/Bands/Makefile
  Util/Bands/README
  Util/Bands/eigfat2plot.f90
  Util/Bands/f2kcli.F90
  Util/Bands/fat.gplot
  Util/Bands/m_getopts.f90
  Util/Bands/new.gnubands.f90
  Util/COOP/Tests/si_fatbands/
  Util/COOP/Tests/si_fatbands/README
  Util/COOP/Tests/si_fatbands/fatbands.mpr
  Util/COOP/fat.f90
  Util/Denchar/Examples/2dplot.py
  Util/Denchar/Examples/FullExample.fdf
  Util/Denchar/Examples/Si.psf
  Util/Denchar/Examples/surf.py
  Util/Denchar/Src/readwavesx.f
renamed:
  Util/gnubands.f => Util/Bands/gnubands.f
modified:
  Docs/CHANGES
  Docs/siesta.ind
  Docs/siesta.tex
  Pseudo/atom/pseudoXML.f
  Src/Makefile
  Src/bands.F
  Src/basis_io.F
  Src/basis_specs.f
  Src/dhscf.F
  Src/diagk.F
  Src/diagkp.F
  Src/dynamics.f
  Src/fdf/fdf.F90
  Src/find_kgrid.F
  Src/grdsam.F
  Src/kpoint_grid.F90
  Src/kpoint_pdos.F90
  Src/m_new_dm.F90
  Src/meshsubs.F
  Src/optical.F
  Src/reinit.F
  Src/setup_hamiltonian.F
  Src/siesta_analysis.F
  Src/siesta_options.F90
  Src/struct_init.F
  Src/writewave.F
  Tests/Makefile
  Tests/md_anneal/md_anneal.fdf
  Util/COOP/Makefile
  Util/COOP/README
  Util/COOP/Tests/README
  Util/COOP/dm_creator.F90
  Util/COOP/main_vars.f90
  Util/COOP/mprop.f90
  Util/COOP/subs.f90
  Util/Denchar/Docs/CHANGES
  Util/Denchar/Docs/denchar.tex
  Util/Denchar/Src/Makefile
  Util/Denchar/Src/denchar.f
  Util/Eig2DOS/Eig2DOS.f90
  Util/Grid/grid2cube.f
  Util/README
  Util/pseudo-xml/xml2psf_helper.f


-----------------------------------------------------------------------
2012-06-18  Alberto Garcia <albertog@icmab.es>   trunk-410-scf-34
Sync to trunk-410

modified:
  Docs/CHANGES
  Src/Makefile
  Src/automatic_cell.f
  version.info

-----------------------------------------------------------------------
2012-04-26  Alberto Garcia <albertog@icmab.es>   trunk-409-scf-34
Fix bug in extrapolation. Cosmetics

Pass the number of atoms in the unit cell, instead of 
sizing the xa array (which might be enlarged for the supercell).
The 'extrapolate' routine is now in the m_new_dm module.

Wrap for MPI or remove various printing statements.

removed:
  Src/extrapolate.f90
  Src/m_history.f90
modified:
  Src/Fstack.T90
  Src/Makefile
  Src/fdf/fdf.F90
  Src/m_check_supercell.f
  Src/m_new_dm.F90
  Src/siesta_init.F

-----------------------------------------------------------------------
2012-04-25  Alberto Garcia <albertog@icmab.es>   trunk-409-scf-33
Fixes for Marenostrum compilation

Initialized derived types in modules have to have the "save" attribute
to satisfy xlf. It applies to new objects in sparse_matrices.

(+ other oversights detected by xlf)

modified:
  Src/siesta_init.F
  Src/sparse_matrices.F
  Src/state_analysis.F

-----------------------------------------------------------------------
2012-04-25  Alberto Garcia <albertog@icmab.es>   trunk-409-scf-32
Sync with trunk-409. Cosmetic changes in manual and branch name

Changed the branch name to "trunk-scf". Updated the manual with
the new branch name and corrected a few inconsistencies.

added:
  Util/Eig2DOS/
  Util/Eig2DOS/Eig2DOS.f90
  Util/Eig2DOS/Makefile
  Util/Eig2DOS/m_getopts.f90
renamed:
  Docs/Sparse.CHANGES => Docs/SCF.CHANGES
  Util/eig2dos.f => Util/Eig2DOS/original.eig2dos.f
modified:
  Docs/CHANGES
  Docs/siesta.ind
  Docs/siesta.tex
  Src/iodm_netcdf.F90
  Src/iodmhs_netcdf.F90
  Util/README

-----------------------------------------------------------------------
2012-04-25  Alberto Garcia <albertog@icmab.es>   trunk-407-sparse-31
Use alloc module and proper 'die' routine in class modules

The class_ modules implementing data structures now use the standard
Siesta alloc module for their memory handling, and call an MPI-aware
'die' routine (which, to minimize dependencies, resides in the new
file die.F90, outside any modules).

added:
  Src/die.F90
modified:
  Src/Fstack.T90
  Src/Makefile
  Src/Pair.T90
  Src/basic_type.inc
  Src/class_Array2D.F90
  Src/class_Geometry.F90
  Src/class_OrbitalDistribution.F90
  Src/class_SpMatrix.F90
  Src/class_Sparsity.F90

-----------------------------------------------------------------------
2012-04-25  Alberto Garcia <albertog@icmab.es>   trunk-407-sparse-30
Documentation of recent changes. Cosmetics

The manual has been updated to reflect some of the most important
changes, mostly related to the handling of the self-consistent loop.

Some cosmetic changes to reduce redundant output.

+ Renaming of new_dm file.

removed:
  Src/m_sparse.F
  Src/new_dm.F
renamed:
  Src/my_new_dm.F90 => Src/m_new_dm.F90
modified:
  Docs/siesta.ind
  Docs/siesta.tex
  Src/Makefile
  Src/iomd.f
  Src/siesta_init.F
  Src/state_init.F
  Src/m_new_dm.F90

-----------------------------------------------------------------------
2012-04-24  Alberto Garcia <albertog@icmab.es>   trunk-407-sparse-29
Support TranSiesta logic in new_dm routine. Configurable debugging

Extend readSpmatrix to read both DM and EDM, and Ef, as needed
by TranSiesta when dealing with TSDE file (a bit kludgish).

Implemented a simple framework for controlling the object debugging
information:

DebugObjects T

will cause the IOnode to print a message when allocating and
deallocating objects.

(Extended basic_object.inc to provide this functionality)

added:
  Src/object_debug.F90
modified:
  Src/Fstack.T90
  Src/Makefile
  Src/Pair.T90
  Src/basic_type.inc
  Src/check_scf_convergence.F
  Src/class_Array2D.F90
  Src/class_Geometry.F90
  Src/class_OrbitalDistribution.F90
  Src/class_SpMatrix.F90
  Src/class_Sparsity.F90
  Src/my_new_dm.F90
  Src/readSpMatrix.F90
  Src/save_density_matrix.F
  Src/siesta_init.F
  Src/sparse_matrices.F
  Src/state_init.F

-----------------------------------------------------------------------
2012-04-13  Alberto Garcia <albertog@icmab.es>   trunk-407-sparse-28
Tagging of allocated objects by UUID

A very simple prototype mechanism for keeping track of extant allocated
data structures has been implemented. Further refinements might include
an in-memory registry and optional printout.

modified:
  Src/Fstack.T90
  Src/Pair.T90
  Src/basic_type.inc
  Src/class_Array2D.F90
  Src/class_Geometry.F90
  Src/class_OrbitalDistribution.F90
  Src/class_SpMatrix.F90
  Src/class_Sparsity.F90

-----------------------------------------------------------------------
2012-04-12  Alberto Garcia <albertog@icmab.es>   trunk-407-sparse-27
Completed new framework for extrapolation

The extrapolation of the DM using the history of (geometry,DM) pairs
has been extended to an arbitrary number of history records, using
code by J.M. Soler and the new infrastructure for flexible data
structures.

The size of the history stack is determined by the fdf symbol

DM.HistoryDepth <4 by default>

Fine-tuned the design of a few modules. Still work in progress. 

Added the m_uuid module from FoX, as an experimental feature.

added:
  Src/extrapolate.f90
  Src/m_uuid.f90
modified:
  Src/Fstack.T90
  Src/Makefile
  Src/basic_type.inc
  Src/class_Array2D.F90
  Src/class_Fstack_Pair_Geometry_SpMatrix.F90
  Src/class_Geometry.F90
  Src/class_OrbitalDistribution.F90
  Src/class_Pair_Geometry_SpMatrix.F90
  Src/class_SpMatrix.F90
  Src/class_Sparsity.F90
  Src/my_new_dm.F90
  Src/readSpMatrix.F90
  Src/restructSpMatrix.F90
  Src/siesta_init.F
  Src/state_analysis.F

-----------------------------------------------------------------------
2012-04-11  Alberto Garcia <albertog@icmab.es>   trunk-407-sparse-26
New framework for extrapolation

Using a finite stack, the (geometry,DM) pairs for every geometry step are
saved and potentially used for extrapolation. So far only the latest two
steps are used.

Re-designed the type modules with the use of 'basic_type.inc' for the
standard reference-counting functionality.

Added template files Pair.T90 and Fstack.T90.

added:
  Src/Fstack.T90
  Src/Pair.T90
  Src/basic_type.inc
  Src/class_Geometry.F90
  Src/class_Pair_Geometry_SpMatrix.F90
modified:
  Src/Makefile
  Src/class_Array2D.F90
  Src/class_OrbitalDistribution.F90
  Src/class_SpMatrix.F90
  Src/class_Sparsity.F90
  Src/my_new_dm.F90
  Src/siesta_init.F
  Src/siesta_options.F90
  Src/sparse_matrices.F
  Src/state_analysis.F
  Src/state_init.F

-----------------------------------------------------------------------
2012-04-11  Alberto Garcia <albertog@icmab.es>   trunk-407-sparse-25
Add nrows_g to sparsity type. Simplify distribution handling

The sparsity now holds no_l and no_u as local and global number of
rows, respectively, and nrows_g is now a function on sparsity and
sparse-matrix instances.

Removed no_u from the "block-cyclic" part of the orbital distribution type.

Routine readSpMatrix is now simpler as the reference distribution is
used as is.

modified:
  Src/class_OrbitalDistribution.F90
  Src/class_SpMatrix.F90
  Src/class_Sparsity.F90
  Src/my_new_dm.F90
  Src/readSpMatrix.F90
  Src/restructSpMatrix.F90
  Src/state_init.F

-----------------------------------------------------------------------
2012-04-03  Alberto Garcia <albertog@icmab.es>   trunk-407-sparse-24
Added support for DM extrapolation

The code is now very clear. 

Note that DM and DM_prev_geom are reset if the supercell
changes (this was a bug in the previous implementation).

added:
  Src/extrapolateSpMatrix.F90
modified:
  Src/Makefile
  Src/my_new_dm.F90
  Src/state_init.F

-----------------------------------------------------------------------
2012-04-03  Alberto Garcia <albertog@icmab.es>   trunk-407-sparse-23
Bug fixes. Saving of DM_prev_geom

Fixed a number of bugs. Re-wrote the logic for the flow
of DM and added some printSpMatrix calls. Found a place
to save DM_prev_geom and the conditions for extrapolation.
Some rough edges remain.

Moved block_dist to module 'sparse_matrices'.

Updated SiestaXC makefile for class_OrbitalDistribution dependency.

modified:
  Src/Makefile
  Src/SiestaXC/makefile
  Src/initparallel.F
  Src/my_new_dm.F90
  Src/parallel.F
  Src/readSpMatrix.F90
  Src/sparse_matrices.F
  Src/state_init.F

-----------------------------------------------------------------------
2012-03-30  Alberto Garcia <albertog@icmab.es>   trunk-407-sparse-22
First attempt at DM flow clarification

Wrote my_new_dm, and hooked up readSpMatrix and restructSpMatrix.
Some rough edges.

added:
  Src/my_new_dm.F90
  Src/restructSpMatrix.F90
modified:
  Src/Makefile
  Src/class_SpMatrix.F90
  Src/readSpMatrix.F90
  Src/sparse_matrices.F
  Src/state_init.F

-----------------------------------------------------------------------
2012-03-30  Alberto Garcia <albertog@icmab.es>   trunk-407-sparse-21
First implementation of OrbitalDistribution object

Code in class_OrbitalDistribution. The object holds data to handle
block-cyclic distributions (basically the blocksize), plus pointers
for a more general distribution (such as one based on domain- or
spatial-decomposition).

This is supplemented by communicator information.

The code in readSpMatrix.F90 (not hooked up yet) uses the new ideas. In principle,
it is able to read flexibly any matrix, and distribute it in block-cyclic form.

Still pending: ditribution transformations..., proper serial testing...

added:
  Src/class_OrbitalDistribution.F90
  Src/readSpMatrix.F90
modified:
  Src/Makefile
  Src/class_SpMatrix.F90
  Src/initparallel.F
  Src/parallel.F
  Src/parallelsubs.F
  Src/state_init.F

-----------------------------------------------------------------------
2012-03-27  Alberto Garcia <albertog@icmab.es>   trunk-407-sparse-20
First implementation of new refCount paradigm

Used class_Sparsity, class_Array2D, and class_SpMatrix for a cleaner 
implementation of the reference-counting ideas. Based on code by
David Car and Michael List.

removed:
  Src/m_sparse_types.F90
added:
  Src/class_Array2D.F90
  Src/class_SpMatrix.F90
  Src/class_Sparsity.F90
modified:
  Src/Makefile
  Src/compute_EKS_Harris.F90
  Src/setup_H0.F
  Src/setup_hamiltonian.F
  Src/sparse_matrices.F
  Src/state_init.F

-----------------------------------------------------------------------
2012-03-09  Alberto Garcia <albertog@icmab.es>   trunk-407-sparse-19
Sync to trunk-407

-----------------------------------------------------------------------
2012-03-07  Alberto Garcia <albertog@icmab.es>   trunk-401-sparse-19
New options for testing the convergence. Force convergence diagnostic

* Two new options for convergence:

-- Free Energy (E_KS - T_el * S_electronic)

SCF.RequireFreeEnergyConvergence T
SCF.FreeEnergyTolerance  <Value> <Unit>  (default 1.0e-5 eV)

-- Hamiltonian matrix elements

SCF.RequireHamiltonianConvergence T
SCF.H.Tolerance  <Value> <Unit>  (default 0.1 mRy)


The SCF cycle will end when the appropriate criterion is satisfied. These two
are *absolute* criteria: they do not depend on the additional convergence of
the density matrix (as does the "energy convergence" option already implemented).

* When the option to monitor the forces during the SCF cycle is in effect, the
program will print the maximum absolute value of the change in forces from one
step to the next. Other statistics could be implemented.

* More documentation on the flow of information in 'siesta_forces'.

modified:
  Src/Makefile
  Src/check_scf_convergence.F
  Src/siesta_forces.F
  Src/siesta_options.F90
  Src/write_subs.F

-----------------------------------------------------------------------
2012-03-06  Alberto Garcia <albertog@icmab.es>   trunk-401-sparse-18
Allow monitoring of forces during SCF cycle

Using the fdf symbol

MonitorForcesInSCF T

the program will compute the forces and stresses at every scf step. 
Use in combination with WriteForces.

modified:
  Src/Makefile
  Src/siesta_forces.F
  Src/siesta_options.F90

-----------------------------------------------------------------------
2012-03-05  Alberto Garcia <albertog@icmab.es>   trunk-401-sparse-17
Avoid extra debugging output in new sparse-matrix code

Reduce for now the level of debugging output in the experimental
sparse-matrix code.

modified:
  Src/m_sparse_types.F90

-----------------------------------------------------------------------
2012-03-04  Alberto Garcia <albertog@icmab.es>   trunk-401-sparse-16
Tag storage of DM as 'mixed' or 'dmout' (in progress)

The code for storing the DM on file has been encapsulated in a new
routine 'save_density_matrix'. This routine is called: a) in the 
scf cycle, after mixing, and b) after the scf cycle, to store DM_out
for further offline processing. Note that this is a change from
previous versions, in which DM_next was always stored.

DM_out corresponds to the last electronic-structure computed, and
is wave-function-representable.

added:
  Src/save_density_matrix.F
modified:
  Src/Makefile
  Src/mixer.F
  Src/siesta_forces.F

-----------------------------------------------------------------------
2012-03-02  Alberto Garcia <albertog@icmab.es>   trunk-401-sparse-15
Include dHmax in write_energies

An extra column in the output.

Fixed the logic in siesta_write_energies.
Fixed wrong units in CML output for dDmax 

modified:
  Src/check_scf_convergence.F
  Src/siesta_analysis.F
  Src/siesta_forces.F
  Src/write_subs.F

-----------------------------------------------------------------------
2012-03-02  Alberto Garcia <albertog@icmab.es>   trunk-401-sparse-14
Clarify TranSiesta logic in SCF loop

A new routine checks whether TranSiesta is compiled in, and
whether, upon self-consistency, the program is going to switch
to GF mode and remain in the loop. This is not completely optimal,
but is an improvement over the previous obscure practice.

The timing calls for the end of the Transiesta step have been
moved to the transiesta section of compute_dm.

modified:
  Src/Makefile
  Src/check_scf_convergence.F
  Src/compute_dm.F
  Src/siesta_forces.F

-----------------------------------------------------------------------
2012-03-02  Alberto Garcia <albertog@icmab.es>   trunk-401-sparse-13
Fix logic related to Harris runs. Timer and CML calls. Fix MPI makefile. 

Harris "one-shot" runs "do not converge", yet they exit the loop early since nscf=2 (...).
The logic in siesta_forces has been changed to allow for this. Now nscf=1 for
Harris runs.

The placement of the timer and CML calls has been set correctly.

The MPI interface library libmpi_f90.a did not include timer_mpi.o.

Use of MPI-only routine in compute_EKS_Harris.F90

modified:
  Src/MPI/Makefile
  Src/compute_EKS_Harris.F90
  Src/siesta_forces.F
  Src/siesta_options.F90

-----------------------------------------------------------------------
2012-03-01  Alberto Garcia <albertog@icmab.es>   trunk-401-sparse-12
Change of logic in siesta_forces to make E_KS variational

A re-ordering of the operations, and a careful consideration of the different
contributions to the energy, have allowed the computation of E_KS(out), which
is variational, both when mixing H and when mixing the DM.

There are still some rough edges, notably in TranSiesta operation and the output
of the DM.

removed:
  Src/scfconvergence_test.F
added:
  Src/check_scf_convergence.F
  Src/compute_EKS_Harris.F90
  Src/compute_max_diff.F
modified:
  Src/Makefile
  Src/compute_dm.F
  Src/mixer.F
  Src/siesta_forces.F
  Src/state_init.F

-----------------------------------------------------------------------
2012-02-28  Alberto Garcia <albertog@icmab.es>   trunk-401-sparse-11
Monitor both H and DM SCF errors

Both dDmax and dHmax are now computed in 'scfconvergence_test', to
monitor H and DM convergence. Only dDmax is used as convergence
criterion, to maintain compatibility, if mixing H, with previous
levels of SCF convergence.

Dold is now set in 'compute_dm', and Hold is now (always, even if
mixing the DM) in setup_hamiltonian.

The DM normalization error is now printed only if relevant (> 1%).

modified:
  Src/compute_dm.F
  Src/normalize_dm.F
  Src/post_scf_work.F
  Src/scfconvergence_test.F
  Src/setup_hamiltonian.F
  Src/siesta_init.F
  Src/sparse_matrices.F
  Src/state_init.F

-----------------------------------------------------------------------
2012-02-28  Alberto Garcia <albertog@icmab.es>   trunk-401-sparse-10
Use electronic entropy from current SCF step

The electronic entropy is computed (in 'compute_dm') once the
electronic structure is known. The -TS term in the electronic free
energy was previously computed using the information from the previous
SCF step (by having it added to Etot in setup_hamiltonian, using an
intermediate variable). Now it is added in scfconvergence_test, and it
corresponds to the current SCF step. There is not much theoretical
justification for the previous choice, and the new one looks more
appropriate in general, and notably if E_KS(out) is computed (as with
H mixing).

The CEA group suggested the change quite a long time ago, and has been
used it in their own versions of the program.

modified:
  Src/compute_dm.F
  Src/final_H_f_stress.F
  Src/local_DOS.F
  Src/m_energies.F90
  Src/scfconvergence_test.F
  Src/setup_hamiltonian.F
  Src/siesta_init.F
  Src/siesta_options.F90

-----------------------------------------------------------------------
2012-02-27  Alberto Garcia <albertog@icmab.es>   trunk-401-sparse-9
Clarify various issues of DM, H, and energy flow

Mixing after SCF convergence is now a user-settable option, controlled
by the fdf logical MixAfterConvergence, which is .true. by default.

Some comments have been added (and some other corrected) to clarify
some issues, in particular the fact that E_KS(DM_out) is computed when
mixing the Hamiltonian.

The variable 'mix' has been renamed to the more appropriate
'mix_first_scf_step'.

modified:
  Src/Makefile
  Src/m_convergence.f90
  Src/m_energies.F90
  Src/mixer.F
  Src/post_scf_work.F
  Src/scfconvergence_test.F
  Src/siesta_forces.F
  Src/siesta_init.F
  Src/siesta_options.F90

-----------------------------------------------------------------------
2012-02-24  Alberto Garcia <albertog@icmab.es>   trunk-401-sparse-8
Check for convergence (and maybe exit SCF loop) before mixing 

The computation of the maximum difference between X_in and X_out (with
X either the DM or the Hamiltonian) is now done in
scfconvergence_test. If convergence has been achieved, mixer is
bypassed, and the SCF loop is exited. This has the side effect of
keeping the output DM as input to the post-processing (in particular
the computation of forces and stresses, and final energies in
post_scf_work).

Experimentally, it is found that the final E_KS (computed with DM_out)
is very close to the Harris energy of the last SCF step. This seems to
be due to the fact that the Hamiltonian is almost converged.

The Harris energy converges very fast. There remains to be explored
whether the forces computed with DM_out (instead of with DM_predicted) are
reasonable even for non-perfect convergence in the DM.
Some tests with Hamiltonian mixing look promising also.

The DM is now written to disk only by mixer, which is fine for re-starts of
an interrrupted SCF cycle. Another, final copy, should be written in post_scf_work
after each SCF step.

(To be continued...)

modified:
  Src/Makefile
  Src/mixer.F
  Src/post_scf_work.F
  Src/scfconvergence_test.F
  Src/siesta_forces.F

-----------------------------------------------------------------------
2012-02-24  Alberto Garcia <albertog@icmab.es>   trunk-401-sparse-7
Avoid updating Eharrs after SCF loop

The Harris energy update DEharr is only computed by compute_dm, and
corresponds to Tr(H*(DM_out-DM_in)).

In 'post_scf_work' there was an statement

      ! Eharrs = Etot + DEharr

Since this Etot is computed with DM_next (the DM predicted by 'mixer'
for a hypothetical next SCF iteration) this value for Eharrs is
suspect. To make things worse, this value is never actually printed,
since printing routines use Eharrs1, which is the last value of Eharrs
computed in the SCF cycle (set in 'scfconvergence_test').  Apparently,
Eharrs1 is saved in case a further grid-cell sampling is carried out,
presumably to avoid recomputing it with an "impure" H. In fact,
Eharrs1 might be what we need everywhere, particularly in the
computation of the FreeEHarris value used if performing
Harris-oriented runs, as in basis-optimization (the only magnitude
depending explicitly on Eharrs, and thus exhibiting a mismatch with
what would be obtained from Eharrs1).  From this point of view, what
is needed is to remove the above statement (and replace Eharris1 with
Eharrs elsewhere).

Note also in general that the "Harris forces" are computed by the call
to 'final_H_f_stress' in 'post_scf_work', which is using the wrong DM!
This would explain the non-conservation of the energy in some
Harris-based MD runs.

All this gives further support to the idea that the DM coming out of
the SCF cycle for post-processing should be the last DM_out...

-----------------------------------------------------------------------
2012-02-23  Alberto Garcia <albertog@icmab.es>   trunk-401-sparse-6
Write DM normalization info. Simplify logic in scf loop

The DM normalization info is written unconditionally, for
information purposes to diagnose possible folding problems.

The variable "first" (meaning iscf==1) has been removed from
siesta_forces, scfconvergence_test, and write_energies.

modified:
  Src/Makefile
  Src/normalize_dm.F
  Src/scfconvergence_test.F
  Src/siesta_analysis.F
  Src/siesta_forces.F
  Src/write_subs.F

-----------------------------------------------------------------------
2012-02-22  Alberto Garcia <albertog@icmab.es>   trunk-401-sparse-5
Sync with trunk-401

-----------------------------------------------------------------------
2012-02-20  Alberto Garcia <albertog@icmab.es>   trunk-396-sparse-5
Sync with trunk-396

-----------------------------------------------------------------------
2012-02-17  Alberto Garcia <albertog@icmab.es>   trunk-391-sparse-5
Take Escf initialization away from new_dm

It is now moved to state_init, just after the call to new_dm.

modified:
  Src/Makefile
  Src/new_dm.F
  Src/state_init.F

-----------------------------------------------------------------------
2012-02-17  Alberto Garcia <albertog@icmab.es>   trunk-391-sparse-4
Avoid re-use of arrays as scratch

Routines in the polarization (KSV) and optical modules
were re-using some arrays in sparse_matrices as scratch.
Now they do their own allocation, for clarity.

Also, in post_scf_work, set in more clear terms the questions
regarding the copying of Dold and Dscf.

modified:
  Src/born_charge.F
  Src/final_H_f_stress.F
  Src/ksv.f
  Src/optical.F
  Src/overfsm.f
  Src/post_scf_work.F
  Src/siesta_analysis.F

-----------------------------------------------------------------------
2012-02-17  Alberto Garcia <albertog@icmab.es>   trunk-391-sparse-3
Generalize the option to mix the Hamiltonian

The option to mix the Hamiltonian instead of the density matrix was 
already present in TranSiesta. It has now been generalized.
The preferred option keyword in the fdf file is

MixHamiltonian T

although the previous TS.MixH keyword is also honored if present.

modified:
  Src/Makefile
  Src/compute_dm.F
  Src/m_ts_global_vars.f90
  Src/m_ts_options.F90
  Src/mixer.F
  Src/setup_hamiltonian.F
  Src/siesta_forces.F
  Src/siesta_options.F90
  Src/sparse_matrices.F

-----------------------------------------------------------------------
2012-02-17  Alberto Garcia <albertog@icmab.es>   trunk-391-sparse-2
Refinement of the implementation of sparse-matrix types

More debugging statements to trace the association of sparsities to matrices.
Single variable "sparsity" now lives in the 'sparse_matrices' module, and is
set only in 'state_init'.

Tested H_vkb flow with multiple geometries.

modified:
  Src/Makefile
  Src/hsparse.F
  Src/m_sparse_types.F90
  Src/sparse_matrices.F
  Src/state_init.F

-----------------------------------------------------------------------
2012-02-16  Alberto Garcia <albertog@icmab.es>   trunk-391-sparse-1
First prototype implementation of sparse-matrix types

A first test with H_vkb.
Some rough edges remain.

added:
  Src/m_sparse_types.F90
modified:
  Src/Makefile
  Src/hsparse.F
  Src/setup_H0.F
  Src/setup_hamiltonian.F
  Src/sparse_matrices.F
  Src/state_init.F