~siesta-pseudos-bases/siesta/trunk-psml

« back to all changes in this revision

Viewing changes to Src/m_ts_gf.F90

  • Committer: Alberto Garcia
  • Date: 2019-09-02 14:09:43 UTC
  • mfrom: (427.6.323 trunk)
  • Revision ID: albertog@icmab.es-20190902140943-mzmbe1jacgefpgxw
Sync to trunk-776 (notably nc/soc wavefunction support)


Show diffs side-by-side

added added

removed removed

Lines of Context:
377
377
    end if
378
378
 
379
379
    ! Initial size of minimal size with expansion
380
 
    read_Size_HS = El%no_used ** 2 * product(El%Bloch) ! no_GS * no_GS * nq
 
380
    read_Size_HS = El%no_used ** 2 * El%Bloch%size() ! no_GS * no_GS * nq
381
381
    select case ( El%pre_expand )
382
382
    case ( 0 )
383
383
       ! Nothing is pre-expanded
384
384
       read_Size = read_Size_HS
385
385
    case ( 1 )
386
386
       ! Only the Green function is pre-expanded
387
 
       read_Size = read_Size_HS * product(El%Bloch)
 
387
       read_Size = read_Size_HS * El%Bloch%size()
388
388
    case ( 2 )
389
389
       ! Everything is pre-expanded
390
 
       read_Size = read_Size_HS * product(El%Bloch)
 
390
       read_Size = read_Size_HS * El%Bloch%size()
391
391
       read_Size_HS = read_Size
392
392
    end select
393
393
 
583
583
    do i = 1 , N_Elec
584
584
 
585
585
       ! Transfer the k-point to the expanded supercell
586
 
       kpt(1) = bkpt(Elecs(i)%pvt(1)) / Elecs(i)%Bloch(1)
587
 
       kpt(2) = bkpt(Elecs(i)%pvt(2)) / Elecs(i)%Bloch(2)
588
 
       kpt(3) = bkpt(Elecs(i)%pvt(3)) / Elecs(i)%Bloch(3)
 
586
       kpt(1) = bkpt(Elecs(i)%pvt(1)) / Elecs(i)%Bloch%B(1)
 
587
       kpt(2) = bkpt(Elecs(i)%pvt(2)) / Elecs(i)%Bloch%B(2)
 
588
       kpt(3) = bkpt(Elecs(i)%pvt(3)) / Elecs(i)%Bloch%B(3)
589
589
 
590
590
       ! Ensure zero in the semi-infinite direction
591
591
       select case ( Elecs(i)%t_dir )
648
648
 
649
649
          ! Set k-point for calculating expansion
650
650
          Elecs(i)%bkpt_cur = kpt
 
651
          
651
652
          call read_next_GS_Elec(uGF(i), NEReqs, &
652
653
               ikpt, Elecs(i), c, &
653
654
               nzwork, zwork, forward = forward)
773
774
       end if
774
775
 
775
776
       ! Check # of Bloch k-points
776
 
       if ( any(El%Bloch /= Bloch) ) then
 
777
       if ( any(El%Bloch%B /= Bloch) ) then
777
778
          write(*,*)"ERROR: Green function file: "//trim(curGFfile)
778
779
          write(*,*) 'read_Green: ERROR: unexpected no. Bloch expansion k-points'
779
780
          errorGF = .true.
814
815
          errorGF = .true.
815
816
       end if
816
817
 
817
 
       if ( product(El%Bloch) > 1 ) then
 
818
       if ( El%Bloch%size() > 1 ) then
818
819
          if ( pre_expand /= El%pre_expand ) then
819
820
             write(*,*)"ERROR: Green function file: "//trim(curGFfile)
820
821
             write(*,*) 'read_Green: ERROR: Bloch pre-expansion not consistent'
1067
1068
    end if
1068
1069
    deallocate(lasto)
1069
1070
 
1070
 
    if ( any(El%Bloch(:)/=Bloch(:)) ) then
 
1071
    if ( any(El%Bloch%B(:)/=Bloch(:)) ) then
1071
1072
      write(*,*)"ERROR: Green function file: "//trim(curGFfile)
1072
1073
      write(*,*)"Number of Bloch expansions is wrong!"
1073
 
      write(*,'(2(a,i3))') "Found Bloch-A1: ",Bloch(1),", expected: ",El%Bloch(1)
1074
 
      write(*,'(2(a,i3))') "Found Bloch-A2: ",Bloch(2),", expected: ",El%Bloch(2)
1075
 
      write(*,'(2(a,i3))') "Found Bloch-A3: ",Bloch(3),", expected: ",El%Bloch(3)
 
1074
      write(*,'(2(a,i3))') "Found Bloch-A1: ",Bloch(1),", expected: ",El%Bloch%B(1)
 
1075
      write(*,'(2(a,i3))') "Found Bloch-A2: ",Bloch(2),", expected: ",El%Bloch%B(2)
 
1076
      write(*,'(2(a,i3))') "Found Bloch-A3: ",Bloch(3),", expected: ",El%Bloch%B(3)
1076
1077
      localErrorGf = .true.
1077
1078
    end if
1078
1079
    if ( El%repeat .neqv. repeat ) then
1080
1081
      write(*,*) 'Ordering of Bloch repetitions is not the same (repeat or tile)'
1081
1082
      localErrorGf = .true.
1082
1083
    end if
1083
 
    if ( product(El%Bloch) > 1 ) then
 
1084
    if ( El%Bloch%size() > 1 ) then
1084
1085
      if ( pre_expand /= El%pre_expand ) then
1085
1086
        write(*,*)"ERROR: Green function file: "//trim(curGFfile)
1086
1087
        write(*,*)"Expecting a pre-expanded self-energy!"