Merge lp:~nickpapior/siesta/4.0-io-precision into lp:siesta/4.0

Proposed by Nick Papior
Status: Merged
Merged at revision: 575
Proposed branch: lp:~nickpapior/siesta/4.0-io-precision
Merge into: lp:siesta/4.0
Diff against target: 110 lines (+20/-19)
4 files modified
Src/ioeig.f (+4/-4)
Src/iokp.f (+11/-10)
Src/pdos.F (+4/-4)
version.info (+1/-1)
To merge this branch: bzr merge lp:~nickpapior/siesta/4.0-io-precision
Reviewer Review Type Date Requested Status
Alberto Garcia Approve
Review via email: mp+345154@code.launchpad.net

Commit message

Enabled large precision outputs in EIG, KP and PDOS files

This should accommodate larger k-point sampling and make EIG
files have a qualitatively better precision.

Description of the change

Increased precision

To post a comment you must log in.
Revision history for this message
Alberto Garcia (albertog) wrote :

OK.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Src/ioeig.f'
2--- Src/ioeig.f 2017-10-04 09:48:27 +0000
3+++ Src/ioeig.f 2018-05-07 07:48:58 +0000
4@@ -45,14 +45,14 @@
5 call io_assign( iu )
6 open( iu, file=fname, form='formatted', status='unknown' )
7
8- write(iu,"(f14.4)") ef/eV
9+ write(iu,"(e17.9)") ef/eV
10 if ( ns > 2 ) then
11- write(iu,"(3i6)") no*2, 1, nk
12+ write(iu,"(tr1,i10,i2,tr1,i10)") no*2, 1, nk
13 else
14- write(iu,"(3i6)") no, min(ns,2), nk
15+ write(iu,"(tr1,i10,i2,tr1,i10)") no, min(ns,2), nk
16 end if
17 do ik = 1,nk
18- write(iu,"(i5,10f12.5,/,(5x,10f12.5))")
19+ write(iu,"(i10,10(tr1,e17.9),/,(tr10,10(tr1,e17.9)))")
20 . ik, ((eo(io,is,ik)/eV,io=1,no),is=1,nspin)
21 enddo
22
23
24=== modified file 'Src/iokp.f'
25--- Src/iokp.f 2017-10-04 09:48:27 +0000
26+++ Src/iokp.f 2018-05-07 07:48:58 +0000
27@@ -18,26 +18,27 @@
28 use files, only : slabel, label_length
29 use precision, only : dp
30
31- implicit none
32+ implicit none
33
34- integer :: nk
35- real(dp) :: points(3,*), weight(*)
36- external io_assign, io_close
37+ integer, intent(in) :: nk
38+ real(dp), intent(in) :: points(3,nk), weight(nk)
39+ external :: io_assign, io_close
40
41 c Internal
42 character(len=label_length+3) :: fname
43- integer :: ik, iu, ix
44-c -------------------------------------------------------------------
45+ integer :: ik, iu
46
47 fname = trim(slabel) // '.KP'
48
49 call io_assign( iu )
50 open( iu, file=fname, form='formatted', status='unknown' )
51
52- write(iu,'(i6)') nk
53- write(iu,'(i6,3f12.6,3x,f12.6)')
54- . (ik, (points(ix,ik),ix=1,3), weight(ik), ik=1,nk)
55-
56+ write(iu,'(i10)') nk
57+ do ik = 1, nk
58+ write(iu,'(i10,3(tr1,e13.6),tr3,e12.6)')
59+ & ik, points(:,ik), weight(ik)
60+ end do
61+
62 call io_close( iu )
63
64 return
65
66=== modified file 'Src/pdos.F'
67--- Src/pdos.F 2018-02-01 10:42:36 +0000
68+++ Src/pdos.F 2018-05-07 07:48:58 +0000
69@@ -227,7 +227,7 @@
70 call xml_AddAttribute(xf,"units","eV")
71 call xml_AddCharacters(xf,Ef / eV)
72 call xml_EndElement(xf,"fermi_energy")
73- write(iunit2,'(a,f20.5,a)') '<fermi_energy units="eV">',
74+ write(iunit2,'(a,e17.9,a)') '<fermi_energy units="eV">',
75 & Ef / eV, '</fermi_energy>'
76
77 ! Write sampled energies
78@@ -240,7 +240,7 @@
79 do ihist = 1,nhist
80 ENER = E1 + (ihist-1) * delta
81 tmp(ihist) = ener/eV
82- write(iunit2,'(f20.5)') tmp(ihist)
83+ write(iunit2,'(e17.9)') tmp(ihist)
84 enddo
85 write(iunit2,'(a)') '</energy_values>'
86
87@@ -283,14 +283,14 @@
88 if (nspin.eq.1) then
89 do ihist = 1, nhist
90 tmp(ihist) = dpr(ihist,i,1) * eV
91- write(iunit2,'(f10.5)') tmp(ihist)
92+ write(iunit2,'(e17.9)') tmp(ihist)
93 end do
94 call xml_AddCharacters(xf,tmp(1:nhist))
95 elseif (nspin .eq. 2) then
96 do ihist = 1, nhist
97 tmp(ihist*2-1) = dpr(ihist,i,1) * eV
98 tmp(ihist*2) = dpr(ihist,i,2) * eV
99- write(iunit2,'(2f10.5)') tmp(ihist*2-1:ihist*2)
100+ write(iunit2,'(2(tr1,e17.9))') tmp(ihist*2-1:ihist*2)
101 end do
102 call xml_AddCharacters(xf,tmp(1:2*nhist))
103 endif
104
105=== modified file 'version.info'
106--- version.info 2018-04-26 13:04:08 +0000
107+++ version.info 2018-05-07 07:48:58 +0000
108@@ -1,1 +1,1 @@
109-siesta-4.0--574
110+siesta-4.0--574--io-1

Subscribers

People subscribed via source and target branches