m_rd_dat_wan.f90

Go to the documentation of this file.
00001 module m_rd_dat_wan
00002 use m_rd_dat_wfn
00003 implicit none
00004 private 
00005 public::rd_dat_ns_nb 
00006 public::rd_dat_umat 
00007 public::rd_dat_wan 
00008 public::rd_dat_hmatr 
00009 !ns-nb(149)  
00010 integer,public::Mb,Mt  
00011 integer,public,allocatable::Ns(:)!Ns(NTK) 
00012 integer,public,allocatable::Nb(:)!Nb(NTK) 
00013 integer,public,allocatable::Nt(:)!Nt(NTK) 
00014 !umat(150)  
00015 integer,public::NWF 
00016 complex(8),public,allocatable::UNT(:,:,:)!UNT(Mb,NWF,NTK) 
00017 !c0_wn(113)  
00018 complex(8),public,allocatable::C0_WN(:,:,:)!C0_WN(NTG,NWF,NTK) 
00019 !h_mat_r(122) 
00020 complex(8),public,allocatable::H_MAT_R(:,:,:,:,:)!H_MAT_R(NWF,NWF,-Na1:Na1,-Na2:Na2,-Na3:Na3) 
00021 contains
00022 subroutine rd_dat_ns_nb 
00023 implicit none 
00024 integer::ik 
00025 !--
00026 OPEN(149,FILE='./dir-wan/dat.ns-nb') 
00027 rewind(149) 
00028 allocate(Ns(NTK));Ns=0
00029 allocate(Nb(NTK));Nb=0
00030 allocate(Nt(NTK));Nt=0
00031 do ik=1,NTK 
00032  read(149,*) Ns(ik),Nb(ik) 
00033 enddo  
00034 Mb=maxval(Nb) 
00035 !write(6,*)'Mb=',Mb 
00036 Nt(:)=0
00037 do ik=1,NTK 
00038  Nt(ik)=Ns(ik)+Nb(ik) 
00039 enddo 
00040 Mt=maxval(Nt) 
00041 !write(6,*) 'Mt=',Mt 
00042 !---
00043 end subroutine
00044 !--
00045 subroutine rd_dat_umat  
00046 implicit none 
00047 integer::ik,jb,jw
00048 OPEN(150,FILE='./dir-wan/dat.umat') 
00049 rewind(150) 
00050 read(150,*) NWF 
00051 allocate(UNT(Mb,NWF,NTK));UNT(:,:,:)=0.0d0 
00052 do ik=1,NTK
00053  do jb=1,Nb(ik)
00054   read(150,*)(UNT(jb,jw,ik),jw=1,NWF) 
00055  enddo 
00056 enddo 
00057 !write(6,*)'NWF=',NWF 
00058 end subroutine
00059 !--
00060 subroutine rd_dat_wan 
00061 implicit none
00062 integer::ik,iw,ig,nwftmp 
00063 OPEN(113,FILE='./dir-wan/dat.wan',FORM='unformatted') 
00064 REWIND(113)       
00065 read(113) nwftmp 
00066 if(nwftmp/=NWF)then
00067  write(6,*)'ERROR; STOP; nwftmp should be NWF'   
00068  write(6,*)'nwftmp=',nwftmp,'NWF=',NWF;STOP
00069 endif 
00070 allocate(C0_WN(NTG,NWF,NTK));C0_WN(:,:,:)=0.0D0 
00071 do ik=1,NTK
00072  read(113)((C0_WN(ig,iw,ik),ig=1,NG0(ik)),iw=1,NWF)           
00073  !
00074  !20180519 
00075  !do iw=1,NWF
00076  ! read(113)(C0_WN(ig,iw,ik),ig=1,NG0(ik))
00077  !enddo!iw
00078  !
00079 enddo!ik 
00080 CLOSE(113)  
00081 !write(6,*)'FINISH REDING C0_WN'
00082 !--
00083 !do ik=1,Nk_irr 
00084 ! do iw=1,NWF
00085 !  do jw=1,NWF 
00086 !   SUM_CMPX=0.0d0 
00087 !   do ig=1,NG0(ik) 
00088 !    SUM_CMPX=SUM_CMPX+CONJG(C0_WN(ig,iw,ik))*C0_WN(ig,jw,ik) 
00089 !   enddo 
00090 !   write(6,'(3i5,x,2f15.10)') ik,iw,jw,SUM_CMPX 
00091 !  enddo 
00092 ! enddo 
00093 !enddo 
00094 end subroutine
00095 !--
00096 subroutine rd_dat_hmatr 
00097 implicit none
00098 character(99)::header1,header2,header3 
00099 integer::ia1,ia2,ia3,idum1,idum2,idum3,ib,jb 
00100 real(8),parameter::au=27.21151d0
00101 OPEN(122,FILE='./dir-wan/dat.h_mat_r') 
00102 allocate(H_MAT_R(NWF,NWF,-Na1:Na1,-Na2:Na2,-Na3:Na3));H_MAT_R(:,:,:,:,:)=0.0d0  
00103 REWIND(122)
00104 read(122,'(a)') header1 
00105 read(122,'(a)') header2 
00106 read(122,'(a)') header3 
00107 do ia1=-Na1,Na1!-1
00108  do ia2=-Na2,Na2!-1
00109   do ia3=-Na3,Na3!-1
00110    read(122,*) idum1,idum2,idum3 
00111    do ib=1,NWF 
00112     do jb=1,NWF 
00113      read(122,'(i5,i5,2f20.10)') idum1,idum2,H_MAT_R(ib,jb,ia1,ia2,ia3) 
00114     enddo!jb 
00115    enddo!ib 
00116    read(122,*) 
00117   enddo 
00118  enddo 
00119 enddo 
00120 CLOSE(122) 
00121 H_MAT_R=H_MAT_R/au 
00122 end subroutine
00123 !--
00124 end module 

Generated on 17 Nov 2020 for respack by  doxygen 1.6.1