~jose-soler/siesta/unfolding

« back to all changes in this revision

Viewing changes to Util/Unfolding/Src/unfold.F90

  • Committer: sara
  • Date: 2018-12-11 14:12:18 UTC
  • Revision ID: sara@xenon.fmc.uam.es-20181211141218-cxhe13etyn0kk8fv
Fixed bug reading Fermi level.

modified:
  Util/Unfolding/README
  Util/Unfolding/Src/unfold.F90

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
! Reads the .fdf, .ion, .out, .psf and .HSX files of a SIESTA calculation and 
12
12
! generates unfolded and refolded bands. See Util/Unfolding/README for details.
13
13
! Ref: "Band unfolding made simple", S.G.Mayo and J.M.Soler, Dic.2018
 
14
!       arXiv:1812.03925          ( https://arxiv.org/abs/1812.03925 )
14
15
! S.G.Mayo and J.M.Soler, Oct.2018
15
16
 
16
17
  use alloc,        only: alloc_report, de_alloc, re_alloc
58
59
  integer, parameter :: allocReportLevelDefault = 2 ! default allocation report level
59
60
 
60
61
  ! Internal variables
61
 
  integer          :: i, i1, i2, i3, ia, iao, ib, ie, ierr, ig, ij, &
 
62
  integer          :: i, i1, i2, i3, ia, iao, ib, ic, ie, ierr, ig, ij, &
62
63
                      io, ios, iostat, iou, ipath, iq, iq1, iq2, iqNode, iqx(3), &
63
64
                      ir, irq, iscf, isp, ispin, itag, iu, j, je, jk, jlm, jo, jos, jou, &
64
65
                      kdsc(3,3), kscell(3,3), l, lastq(0:maxpaths), level, ll, lmax, &
77
78
  character(len=20):: labelfis, symfio
78
79
  character(len=200):: line
79
80
  character(len=10):: label(maxnq), string
80
 
  character(len=14):: dumm1, dumm2
 
81
  character(len=80):: dumm
81
82
  type(block_fdf)  :: bfdf
82
83
  type(hsx_t)      :: hsx
83
84
 
552
553
    if (myNode==0) then
553
554
      call system('grep ''Fermi = '' *out -h > fermi')
554
555
      open(8181,file='fermi',action='read')
555
 
      read(8181,'(a, a, f)'),dumm1,dumm2,efermi
 
556
      read(8181,'(a)'),dumm
 
557
      ic = index(dumm,'=')
 
558
      read(dumm(ic+1:),*),efermi
556
559
      print*,'unfold: Fermi = ',efermi
557
560
      call system('rm fermi')
558
561
    endif
571
574
          fname = trim(fname)//'.path'//adjustl(numstr)
572
575
        endif
573
576
        open(iu,file=fname,status='unknown',form='formatted',action='write')
574
 
        write(iu,'(2(i6),2(f10.3),f14.8)') &
 
577
        write(iu,'(2(i6),2(f10.3),f13.6)') &
575
578
                 lastq(ipath)-lastq(ipath-1),ne+1,emin,emax,efermi
576
579
        do iq = iq1,iq2
577
580
          if (label(iq) .eq. ' ') then
579
582
          else
580
583
            string = ""//trim(label(iq))//""
581
584
          endif
582
 
          write(iu,'(3(f12.8),i5,a12)') q(:,iq), iline(iq), string 
 
585
          write(iu,'(3(f13.8),i5,a12)') q(:,iq), iline(iq), string 
583
586
          do j = 0,ne
584
587
            write(iu,'(e15.6)') udos(iq,j,ispin)
585
588
          enddo
598
601
            fname = trim(fname)//'.path'//adjustl(numstr)
599
602
          endif
600
603
          open(iu,file=fname,status='unknown',form='formatted',action='write')
601
 
          write(iu,'(2(i6),2(f10.3),f14.8)') &
 
604
          write(iu,'(2(i6),2(f10.3),f13.6)') &
602
605
                   lastq(ipath)-lastq(ipath-1),ne+1,emin,emax,efermi
603
606
          do iq = iq1,iq2
604
607
            if (label(iq) .eq. ' ') then
606
609
            else
607
610
              string = ""//trim(label(iq))//""
608
611
            endif
609
 
            write(iu,'(3(f14.8),i5,a12)') q(:,iq), iline(iq), string
 
612
            write(iu,'(3(f13.8),i5,a12)') q(:,iq), iline(iq), string
610
613
            do j = 0,ne
611
614
              write(iu,'(e15.6)') rdos(iq,j,ispin)
612
615
            enddo