91
91
! chemical potential of the electrode
92
92
type(ts_mu), pointer :: mu => null()
93
93
! infinity direction
94
integer :: inf_dir = INF_NEGATIVE
94
integer :: inf_dir = INF_POSITIVE
95
95
! transport direction (determines H01)
96
96
! And is considered with respect to the electrode direction...
97
97
! t_dir is with respect to the electrode unit-cell
399
399
if ( len_trim(ln) /= 1 ) then
400
400
call die(trim(tmp))
403
402
ln = trim(ln) // fdf_bnames(pline,3)
405
! preset for checks of arguments
410
409
! now for testing
411
410
if ( ln(1:1) == '+' ) then
412
412
this%inf_dir = INF_POSITIVE
413
414
else if ( ln(1:1) == '-' ) then
414
416
this%inf_dir = INF_NEGATIVE
415
! The 3 below cases are *special* in the sense that they require the user
416
! to supply the GF files (TranSiesta/TBtrans cannot calculate the self-energies of
417
! real-space Green functions).
418
else if ( leqi(ln,'ab') .or. leqi(ln, 'ba') ) then
420
! The 3 below cases are *special* in the sense that they require the user
421
! to supply the GF files (TranSiesta/TBtrans cannot calculate the self-energies of
422
! real-space Green functions).
423
if ( leqi(ln,'ab') .or. leqi(ln, 'ba') ) then
419
424
this%t_dir = 6 ! Voigt notation
420
425
else if ( leqi(ln,'ac') .or. leqi(ln, 'ca') ) then
422
427
else if ( leqi(ln,'bc') .or. leqi(ln, 'cb') ) then
429
else if ( leqi(ln,'c') .or. leqi(ln,'a3') ) then
431
else if ( leqi(ln,'b') .or. leqi(ln,'a2') ) then
433
else if ( leqi(ln,'a') .or. leqi(ln,'a1') ) then
436
! Simply a wrong argument (lattice vector)
425
437
call die(trim(tmp))
428
if ( this%t_dir > 3 ) then
429
! This flag has no influence
430
this%inf_dir = INF_NEGATIVE
432
! figure out direction...
434
if ( leqi(ln,'a') .or. leqi(ln,'a1') ) then
436
else if ( leqi(ln,'b') .or. leqi(ln,'a2') ) then
438
else if ( leqi(ln,'c') .or. leqi(ln,'a3') ) then
440
! In case only a single lattice vector has been specified, in that
441
! case the sign of the semi-infinite direction *must* be used!
442
if ( this%t_dir <= 3 .and. i == 0 ) then
879
880
! Calculate planes of the electrodes
880
881
select case ( this%t_dir )
883
call cross(this%cell(:,1), this%cell(:,2), p)
885
call cross(this%cell(:,1), this%cell(:,3), p)
886
if ( contrib > VNORM(p) ) then
887
! the area on A-B is biggest, hence the normal plane is along C
893
call cross(this%cell(:,2), this%cell(:,1), p)
895
call cross(this%cell(:,2), this%cell(:,3), p)
896
if ( contrib > VNORM(p) ) then
902
call cross(this%cell(:,3), this%cell(:,1), p)
904
call cross(this%cell(:,3), this%cell(:,2), p)
905
if ( contrib > VNORM(p) ) then
891
911
p = this%cell(:,this%t_dir)
1552
1572
! Calculate pqosition in the grid
1553
1573
call dgesv(3,1,LHS,3,idx,RHS,3,i)
1554
1574
if ( i /= 0 ) then
1555
call die('ts_voltage: Could not solve linear system.')
1575
call die('ts_electype: Could not solve linear system.')
1558
1578
! Convert to integer position