Skip to content

Commit

Permalink
replaced Complex*16 with "double complex". Also added "implicit none"…
Browse files Browse the repository at this point in the history
…, and declared some variables

git-svn-id: svn://localhost/spinoptics/trunk@4 ac43315b-3e54-499a-a480-b11484f4b207
  • Loading branch information
mlenz committed Dec 1, 2008
1 parent 8f052e2 commit a47b67f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 31 deletions.
26 changes: 13 additions & 13 deletions inv_general_complex_mat.f
Expand Up @@ -120,17 +120,17 @@ subroutine zaxpy(n,za,zx,incx,zy,incy)
*********************************************************************** ***********************************************************************
subroutine zgefa(a,lda,n,ipvt,info) subroutine zgefa(a,lda,n,ipvt,info)
integer lda,n,ipvt(1),info integer lda,n,ipvt(1),info
complex*16 a(lda,1) Double Complex a(lda,1)
c c
c zgefa factors a complex*16 matrix by gaussian elimination. c zgefa factors a Double Complex matrix by gaussian elimination.
c c
c zgefa is usually called by zgeco, but it can be called c zgefa is usually called by zgeco, but it can be called
c directly with a saving in time if rcond is not needed. c directly with a saving in time if rcond is not needed.
c (time for zgeco) = (1 + 9/n)*(time for zgefa) . c (time for zgeco) = (1 + 9/n)*(time for zgefa) .
c c
c on entry c on entry
c c
c a complex*16(lda, n) c a Double Complex(lda, n)
c the matrix to be factored. c the matrix to be factored.
c c
c lda integer c lda integer
Expand Down Expand Up @@ -168,13 +168,13 @@ subroutine zgefa(a,lda,n,ipvt,info)
c c
c internal variables c internal variables
c c
complex*16 t Double Complex t
integer izamax,j,k,kp1,l,nm1 integer izamax,j,k,kp1,l,nm1
c c
complex*16 zdum Double Complex zdum
double precision cabs1 double precision cabs1
double precision dreal,dimag double precision dreal,dimag
complex*16 zdumr,zdumi Double Complex zdumr,zdumi
dreal(zdumr) = zdumr dreal(zdumr) = zdumr
dimag(zdumi) = (0.0d0,-1.0d0)*zdumi dimag(zdumi) = (0.0d0,-1.0d0)*zdumi
cabs1(zdum) = dabs(dreal(zdum)) + dabs(dimag(zdum)) cabs1(zdum) = dabs(dreal(zdum)) + dabs(dimag(zdum))
Expand Down Expand Up @@ -281,14 +281,14 @@ double precision function dcabs1(z)
*********************************************************************** ***********************************************************************
subroutine zgedi(a,lda,n,ipvt,det,work,job) subroutine zgedi(a,lda,n,ipvt,det,work,job)
integer lda,n,ipvt(1),job integer lda,n,ipvt(1),job
complex*16 a(lda,1),det(2),work(1) Double Complex a(lda,1),det(2),work(1)
c c
c zgedi computes the determinant and inverse of a matrix c zgedi computes the determinant and inverse of a matrix
c using the factors computed by zgeco or zgefa. c using the factors computed by zgeco or zgefa.
c c
c on entry c on entry
c c
c a complex*16(lda, n) c a Double Complex(lda, n)
c the output from zgeco or zgefa. c the output from zgeco or zgefa.
c c
c lda integer c lda integer
Expand All @@ -300,7 +300,7 @@ subroutine zgedi(a,lda,n,ipvt,det,work,job)
c ipvt integer(n) c ipvt integer(n)
c the pivot vector from zgeco or zgefa. c the pivot vector from zgeco or zgefa.
c c
c work complex*16(n) c work Double Complex(n)
c work vector. contents destroyed. c work vector. contents destroyed.
c c
c job integer c job integer
Expand All @@ -313,7 +313,7 @@ subroutine zgedi(a,lda,n,ipvt,det,work,job)
c a inverse of original matrix if requested. c a inverse of original matrix if requested.
c otherwise unchanged. c otherwise unchanged.
c c
c det complex*16(2) c det Double Complex(2)
c determinant of original matrix if requested. c determinant of original matrix if requested.
c otherwise not referenced. c otherwise not referenced.
c determinant = det(1) * 10.0**det(2) c determinant = det(1) * 10.0**det(2)
Expand All @@ -338,14 +338,14 @@ subroutine zgedi(a,lda,n,ipvt,det,work,job)
c c
c internal variables c internal variables
c c
complex*16 t Double Complex t
double precision ten double precision ten
integer i,j,k,kb,kp1,l,nm1 integer i,j,k,kb,kp1,l,nm1
c c
complex*16 zdum Double Complex zdum
double precision cabs1 double precision cabs1
double precision dreal,dimag double precision dreal,dimag
complex*16 zdumr,zdumi Double Complex zdumr,zdumi
dreal(zdumr) = zdumr dreal(zdumr) = zdumr
dimag(zdumi) = (0.0d0,-1.0d0)*zdumi dimag(zdumi) = (0.0d0,-1.0d0)*zdumi
cabs1(zdum) = dabs(dreal(zdum)) + dabs(dimag(zdum)) cabs1(zdum) = dabs(dreal(zdum)) + dabs(dimag(zdum))
Expand Down
42 changes: 24 additions & 18 deletions nano0903c.f
Expand Up @@ -238,7 +238,7 @@ Subroutine Findk(Emod,kn)
c-------(From the condition of the total energy) c-------(From the condition of the total energy)
IMPLICIT NONE IMPLICIT NONE
Double precision Emod,Etot,V,al,Mass,W,hbar Double precision Emod,Etot,V,al,Mass,W,hbar
Complex*16 kn,imu Double Complex kn,imu
Integer Nfin Integer Nfin
Logical logus Logical logus
common/param/V,al,Mass,W,Etot,hbar,logus,Nfin common/param/V,al,Mass,W,Etot,hbar,logus,Nfin
Expand All @@ -254,13 +254,18 @@ Subroutine Findk(Emod,kn)
c============================================================= c=============================================================
c==== Tight binding Hamiltonian c==== Tight binding Hamiltonian


Subroutine Hamiltonian(Hnn) Subroutine Hamiltonian(Hnn)
complex*16 Hnn IMPLICIT NONE
Double Complex Hnn
integer ii,Nfin,nfin1,jj integer ii,Nfin,nfin1,jj
integer ihelp,infin1,infin2 integer ihelp,infin1,infin2
integer N1, N2

double precision V,al,MAss,W ,Etot,hbar,e0,Wdis double precision V,al,MAss,W ,Etot,hbar,e0,Wdis
double precision lstub,rashb,rashb2,Unitx,dchem double precision lstub,rashb,rashb2,Unitx,dchem, Rashba
complex*16 Hx,EHx,Imunit double precision random
Double Complex Hx,EHx,Imunit

logical logus logical logus
Parameter(N1=10,N2=10,nfin1=N1*N2*2) Parameter(N1=10,N2=10,nfin1=N1*N2*2)
Dimension Hnn(Nfin1,Nfin1),Unitx(Nfin1,Nfin1) Dimension Hnn(Nfin1,Nfin1),Unitx(Nfin1,Nfin1)
Expand Down Expand Up @@ -458,11 +463,11 @@ Subroutine Selfy(sigmR)
double precision V,al,Mass,W,Etot,hbar,rashb,rashb2 double precision V,al,Mass,W,Etot,hbar,rashb,rashb2
double precision Emod,AnorN1,psiN1,lstub,Wle,x double precision Emod,AnorN1,psiN1,lstub,Wle,x


complex*16 Glp1lp1,Glp1lp1n,alpha,theta Double Complex Glp1lp1,Glp1lp1n,alpha,theta
complex*16 Glp1lp1up,G0lm1lm1up,Glp1lp1down,G0lm1lm1down Double Complex Glp1lp1up,G0lm1lm1up,Glp1lp1down,G0lm1lm1down
complex*16 Gxp1xp1up,Gxm1xm1up,Gxp1xp1down,Gxm1xm1down Double Complex Gxp1xp1up,Gxm1xm1up,Gxp1xp1down,Gxm1xm1down
complex*16 sigmR,kn Double Complex sigmR,kn
complex*16 Imunit,Imun0 Double Complex Imunit,Imun0


parameter(N1=10,N2=10,Nle=10,Nfin1=N1*N2*2,nleads=8) parameter(N1=10,N2=10,Nle=10,Nfin1=N1*N2*2,nleads=8)
Parameter(pi=3.14159265358979323846264d0) Parameter(pi=3.14159265358979323846264d0)
Expand Down Expand Up @@ -621,7 +626,7 @@ Subroutine Gamms(sigmR,Gamm)
double precision V,al,MAss,W,Etot,hbar double precision V,al,MAss,W,Etot,hbar
logical logus logical logus
double precision Gamm double precision Gamm
complex*16 sigmR Double Complex sigmR
parameter(N1=10,N2=10,nfin1=N1*N2*2,nleads=8) parameter(N1=10,N2=10,nfin1=N1*N2*2,nleads=8)
Dimension Gamm(nleads,nfin1,nfin1) Dimension Gamm(nleads,nfin1,nfin1)
Dimension sigmR(nleads,nfin1,nfin1) Dimension sigmR(nleads,nfin1,nfin1)
Expand Down Expand Up @@ -672,14 +677,14 @@ Subroutine Greenji(Tpq)
Integer N1! no. of sites in slice k Integer N1! no. of sites in slice k
Integer N2! no. of sites in slice k+1 Integer N2! no. of sites in slice k+1
Integer m,nleads,Nle Integer m,nleads,Nle
Complex*16 theta Double Complex theta
Complex*16 Imunit Double Complex Imunit
COmplex*16 alpha Double Complex alpha
double precision Gamm double precision Gamm
COmplex*16 Hnn Double Complex Hnn
Complex*16 sigmR Double Complex sigmR
Complex*16 GRinv,kn Double Complex GRinv,kn
Complex*16 GR Double Complex GR


Complex GammGR Complex GammGR
Complex GammGad Complex GammGad
Expand Down Expand Up @@ -821,3 +826,4 @@ Subroutine Greenji(Tpq)
end end




c vim: ignorecase

0 comments on commit a47b67f

Please sign in to comment.