LCOV - code coverage report
Current view: top level - wannier - wann_readcenters.f (source / functions) Hit Total Coverage
Test: combined.info Lines: 0 33 0.0 %
Date: 2019-09-08 04:53:50 Functions: 0 1 0.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------
       2             : ! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
       3             : ! This file is part of FLEUR and available as free software under the conditions
       4             : ! of the MIT license as expressed in the LICENSE file in more detail.
       5             : !--------------------------------------------------------------------------------
       6             : 
       7             :       module m_wann_readcenters
       8             :       use m_juDFT
       9             :       contains
      10           0 :       subroutine wann_readcenters(
      11             :      >               nwfs,jspin,
      12           0 :      <               centers,spreads)
      13             : c******************************************************
      14             : c     Read the centers and spreads (optional) from the
      15             : c     file "WF"jspin".1"
      16             : c     Frank Freimuth
      17             : c******************************************************
      18             :       implicit none
      19             :       integer,intent(in)        :: nwfs,jspin
      20             :       real,intent(out)          :: centers(3,nwfs)
      21             :       real,intent(out),optional :: spreads(nwfs)
      22             : 
      23             :       logical                   :: l_readspread
      24             :       character(len=3)          :: spin12(2)
      25             :       data  spin12/'WF1','WF2'/
      26             :       integer                   :: line,ios,linefinal
      27             :       integer                   :: wanind,wanindtmp
      28             :       character(len=30)         :: task
      29             : 
      30           0 :       line=0
      31           0 :       linefinal=0
      32           0 :       l_readspread=.false.
      33           0 :       if(present(spreads)) l_readspread=.true.
      34           0 :       open(100,file=spin12(jspin)//'.wout')
      35             :       do while(.true.) 
      36           0 :         read(100,'(a)',iostat=ios)task
      37           0 :         if(ios.ne.0)exit
      38           0 :         line=line+1
      39           0 :         if(index(task,"Final State").ne.0)linefinal=line
      40             :       enddo
      41           0 :       IF(linefinal==0) CALL juDFT_error("Final State not found",calledby
      42           0 :      +     ="wann_readcenters")
      43           0 :       rewind(100)
      44           0 :       line=0
      45             :       do while(.true.)
      46           0 :         read(100,'(a)',iostat=ios)task
      47           0 :         if(ios.ne.0)exit
      48           0 :         line=line+1
      49           0 :         if(line.eq.linefinal)exit
      50             :       enddo
      51             :       wanind=0
      52             :       do while(.true.)
      53           0 :          read(100,'(a)',iostat=ios)task
      54           0 :          if(ios.ne.0)exit
      55           0 :          if(index(task,"Sum of centres and spreads").ne.0)exit
      56           0 :          wanind=wanind+1
      57           0 :          backspace(100)
      58           0 :          IF(wanind>nwfs) CALL juDFT_error("wanind.gt.nwfs",calledby
      59           0 :      +        ="wann_readcenters")
      60           0 :          if(l_readspread)then
      61           0 :            read(100,fmt=1000)wanindtmp,centers(:,wanind),spreads(wanind)
      62             :          else
      63           0 :            read(100,fmt=2000)wanindtmp,centers(:,wanind)
      64             :          endif
      65           0 :          IF(wanindtmp/=wanind) CALL juDFT_error("wanindtmp",calledby
      66           0 :      +        ="wann_readcenters")
      67             :       enddo
      68           0 :       close(100)
      69             : c      do wanind=1,wanindtmp
      70             : c         print*,centres(:,wanind),spreads(wanind)
      71             : c      enddo   
      72             : 1000  format(22x,i5,3x,f10.6,1x,f10.6,1x,f10.6,2x,f15.8)
      73             : 2000  format(22x,i5,3x,f10.6,1x,f10.6,1x,f10.6)      
      74           0 :       end subroutine wann_readcenters
      75             :       end module m_wann_readcenters

Generated by: LCOV version 1.13