-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcorrenteSO.f90
382 lines (338 loc) · 13.3 KB
/
correnteSO.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
INCLUDE "parametros.f90"
INCLUDE "global.f90"
INCLUDE "./modulos.f90"
INCLUDE "./invers.f90"
INCLUDE "./acRBsinf.f90"
INCLUDE "./sqRBsinf.f90"
INCLUDE "./greensuperficie.f90"
INCLUDE "printtime.f90"
INCLUDE "greenfcSampleImpHexSOLBComp.f90"
! INCLUDE "greenfcSampleCorrente.f90"
INCLUDE "impureza.f90"
!para o gnuplot
! plot "./dados/testeImpHexSO.dat" u 1:2:(1.*$3):(1.*$4):5 notitle w vec lc palette lw 2
! set palette negative
PROGRAM corrente
USE parametros
IMPLICIT NONE
INTEGER, PARAMETER :: Psring=4*P+2 !N. de sitio num anel
INTEGER, PARAMETER :: PsrN=Psring*N, PsrHalf=Psring/2
COMPLEX(KIND=8), PARAMETER :: iimag=(0.d0,1.d0)
COMPLEX(KIND=8), DIMENSION(PsrHalf,PsrHalf) :: Gamma,g1n,gn1
INTEGER :: i,j,l,k,l1,j1,s1,l2,j2,s2,u,v,f,e, flaglc2, couterspin, lenoftipoimp
INTEGER :: impurezaux(N,2,P+1), &
laRaux, laIaux, timaux, VVaux, rhoaux
REAL(KIND=8) :: vetor(3,2), base1(2), base2(2), posicao(2), &
corinho=0.d0, vtcorr(2), splitvec(2)
REAL(KIND=8) :: centrodebanda(Psring,N), icorr(3), maior, txfour=2.d0*t, corrtotal(N)
COMPLEX(KIND=8), DIMENSION(PsrN,PsrN):: Gr, Ga, Gn, Gaux, Gama=0.d0, Gaux2
CHARACTER(LEN=120) :: nome
REAL :: beg_cpu_time, end_cpu_time, timedif
CALL cpu_time (beg_cpu_time)
flaglc2=2
IF(flaglc==1) flaglc2=1
lenoftipoimp=0
DO k=1, 80
IF(tipoimp(k:k).NE." ") THEN
lenoftipoimp=lenoftipoimp+1
ELSE
EXIT
END IF
END DO
laRaux=0; laIaux=0; timaux=0; VVaux=0; rhoaux=0
IF(ABS(REAL(lambda)).NE.0.d0) laRaux=1
IF(ABS(IMAG(lambda)).NE.0.d0) laIaux=1
IF(ABS(aatimp) .NE.0.d0) timaux=1
IF(ABS(VV ) .NE.0.d0) VVaux=1
IF(ABS(rho) .NE.0.d0) rhoaux=1
WRITE(nome, FMT="(a,i0,a,i0,a,f4.1,a,i0,a,i0,a,i0,a,i0,a,i0,a,f4.1,a)") &
"./dados/distcurrP",P,"N",N,"ctc",concentracao,&
"laR", laRaux, "laI", laIaux, &
"tim", timaux, "rho", rhoaux, &
"VV" , VVaux, "E" , ee, ".dat"
WRITE(nome, FMT="(a,a,a,a)") &
"./dados/distcurr", tipoimp(1:lenoftipoimp),term,".dat"
OPEN(UNIT=10, FILE=nome, STATUS="UNKNOWN", ACTION="WRITE")
WRITE(nome, FMT="(a)") &
"./dados/lattice.dat"
OPEN(UNIT=11, FILE=nome, STATUS="UNKNOWN", ACTION="WRITE")
! CALL sortimpureza(impureza)
CALL sortimpureza()
impurezaux=impureza(1,:,:,:)
!To remove all imp. on the left/right to compute the total cross-section current with precision when SOC is on
IF(remove_imp_ONleftORright) THEN
DO i=1, N
impurezaux(i,lado,1)=0
END DO
END IF
! CALL green(Gr,Gamma,g1n,gn1,ee,eta,1,+1.d0)
! Ga=CONJG(TRANSPOSE(Gr))
! Gama=0.d0
! Gama(1:PsrHalf,1:PsrHalf)=Gamma
! !Gama(PsrN-PsrHalf+1:PsrN,PsrN-PsrHalf+1:PsrN)=Gamma
! Gaux=MATMUL(Gr,Gama)
! Gn=MATMUL(Gaux,Ga)
! CALL green(Gr,Gamma,g1n,gn1,ee,eta,1,-1.d0)
! Ga=CONJG(TRANSPOSE(Gr))
! Gaux=MATMUL(Gr,Gama)
! Gaux2=MATMUL(Gaux,Ga)
! Gn=Gn+Gaux2
vetor(1,:)=(/1.d0,0.d0/)
vetor(2,:)=(/-0.5d0, SQRT(3.d0)/2.d0/)
vetor(3,:)=(/-0.5d0,-SQRT(3.d0)/2.d0/)
base1=vetor(1,:)-vetor(3,:)
base2=vetor(1,:)-vetor(2,:)
DO couterspin= 1, -1, -2
! DO couterspin= -1, -1, -2
WRITE(nome, FMT="(a,a,a,i2,a)") &
"./dados/distcurr", tipoimp(1:lenoftipoimp),term,couterspin,".dat"
OPEN(UNIT=10, FILE=nome, STATUS="UNKNOWN", ACTION="WRITE")
CALL green(Gr,Gamma,g1n,gn1,ee,eta,1,dble(couterspin))
Ga=CONJG(TRANSPOSE(Gr))
Gama(1:PsrHalf,1:PsrHalf)=Gamma
Gaux=MATMUL(Gr,Gama)
Gn=MATMUL(Gaux,Ga)
splitvec = (/0.d0,0.15d0/)*couterspin
! vetor(1,:)=(/1.d0,0.d0/) !+(/0.1d0,0.1d0/)*couterspin
! vetor(2,:)=(/-0.5d0, SQRT(3.d0)/2.d0/)!+(/0.1d0,0.1d0/)*couterspin
! vetor(3,:)=(/-0.5d0,-SQRT(3.d0)/2.d0/)!+(/0.1d0,0.1d0/)*couterspin
!Vamos percorrer apenas os sítios pretos, em cada sítio preto, pegamos seus
!tres vizinhos. Onde houve alteracao nesse codigo devido a nova maneira de
!os sitos na matriz da funcao de green, assinalei com '!Mudei aqui'
maior=0.d0
corrtotal=0.d0
DO k=1, N
l1=k
j1=k
DO i=1, PsrHalf
l1=l1+MOD(i+1,2)
j1=j1-MOD(i,2)
posicao=l1*base1+j1*base2
!Posicao do sitio preto na matriz da funcao de green
u = Psring*(k-1) + i*MOD(i,2) + (PsrHalf+i)*MOD(i+1,2) !Mudei aqui
!Posicao do seu vizinho a direita, que fica na proxima linha, mas na
!mesma coluna.
v = Psring*(k-1)+PsrHalf + i*MOD(i,2) + (i+PsrHalf)*MOD(i+1,2) !Mudei aqui
!Se for o primeiro sitio da camada
IF(i==1) THEN
! IF(sitio==1) THEN
! !Se sitio eh impar, vemos trocar u por v e vice-vesa
! icorr(1)=2.d0*timp*DIMAG( Gn(v,u ) )
! icorr(2)=2.d0*timp*DIMAG( Gn(v,v+1) )
! END IF
icorr(1)=corinho+txfour*DIMAG( Gn(u,v ) )
icorr(2)=corinho+txfour*DIMAG( Gn(u,u+1) )
IF(lado.EQ.1) THEN
corrtotal(k)=corrtotal(k)+icorr(1)
END IF
DO j=1,2
IF(ABS(icorr(j))>=maior ) THEN
maior = ABS(icorr(j))
END IF
END DO
ELSE
!Se for o ultimo sitio da camada
IF(i==PsrHalf) THEN
icorr(1)=corinho+txfour*DIMAG( Gn(u,v ) )
icorr(3)=corinho+txfour*DIMAG( Gn(u,u-1) )
IF(lado.EQ.1) THEN
corrtotal(k)=corrtotal(k)+icorr(1)
END IF
DO j=1,3,2
IF(ABS(icorr(j))>=maior ) THEN
maior = ABS(icorr(j))
END IF
END DO
ELSE
!Se for a ultima camada e sitio par
IF(k==N.AND.MOD(i,2)==0) THEN
icorr(2)=corinho+txfour*DIMAG( Gn(u,u+1) ) !Mudei aqui
icorr(3)=corinho+txfour*DIMAG( Gn(u,u-1) ) !Mudei aqui
DO j=2,3
IF(ABS(icorr(j))>=maior ) THEN
maior = ABS(icorr(j))
END IF
END DO
ELSE
icorr(1)=corinho+txfour*DIMAG( Gn(u,v ) )
icorr(2)=corinho+txfour*DIMAG( Gn(u,u+1) ) !Mudei aqui
icorr(3)=corinho+txfour*DIMAG( Gn(u,u-1) ) !Mudei aqui
!Para diminuir o hopping ao redor de vacancias
IF(k==(N/2)) THEN
IF(MOD(sitio,2)==0)THEN
IF(i==sitio) THEN
icorr(1)=2.d0*timp*DIMAG( Gn(u,v ) )
icorr(2)=2.d0*timp*DIMAG( Gn(u,u+1) )
icorr(3)=2.d0*timp*DIMAG( Gn(u,u-1) )
END IF
ELSE
IF(i==sitio)THEN
icorr(1)=2.d0*timp*DIMAG( Gn(u,v ) )
END IF
IF(i==(sitio+1))THEN
icorr(3)=2.d0*timp*DIMAG( Gn(u,u-1) )
END IF
IF(i==(sitio-1))THEN
icorr(2)=2.d0*timp*DIMAG( Gn(u,u+1) )
END IF
END IF
END IF
IF(lado.EQ.MOD(i,2)) THEN
corrtotal(k)=corrtotal(k)+icorr(1)
END IF
DO j=1,3
IF(ABS(icorr(j))>=maior ) THEN
maior = ABS(icorr(j))
END IF
END DO
END IF
END IF
END IF
END DO
END DO
print *, maior
DO i=1, N
print *, corrtotal(i)
END DO
maior=maior*rescale_maior
DO k=1, N
l1=k
j1=k
DO i=1, PsrHalf
l1=l1+MOD(i+1,2)
j1=j1-MOD(i,2)
IF(flaglc==1 .AND. MOD(i,2)==0) CYCLE
posicao=l1*base1+j1*base2
! WRITE(UNIT=11, FMT="(f9.5, ';', f9.5)")posicao
u = Psring*(k-1) + i*MOD(i,2) + (PsrHalf+i)*MOD(i+1,2) !Mudei aqui
v = Psring*(k-1)+PsrHalf + i*MOD(i,2) + (i+PsrHalf)*MOD(i+1,2) !Mudei aqui
IF(i==1) THEN
icorr(1)=corinho+txfour*DIMAG( Gn(u,v ) )
icorr(2)=corinho+txfour*DIMAG( Gn(u,u+1) )
DO j=1, flaglc2!2
vtcorr=icorr(j)*vetor(j,:)/maior
IF( ABS(icorr(j))>=(maior/fator) * fator2 ) THEN
WRITE(UNIT=10, FMT="(4(f9.5,';'),f9.5)") &
posicao+splitvec+vetor(j,:)/2.d0-vtcorr/2.d0, &
vtcorr, ABS(icorr(j))*couterspin
END IF
IF(nlin==0) THEN
WRITE(UNIT=11, FMT="(3(f9.5,';'), f9.5)")posicao, vetor(j,:)
ELSE
IF( .NOT.(cami-1<k .AND. k<=camf) ) WRITE(UNIT=11, FMT="(3(f9.5,';'), f9.5)")posicao, vetor(j,:)
END IF
END DO
ELSE
IF(i==PsrHalf) THEN
icorr(1)=corinho+txfour*DIMAG( Gn(u,v ) )
icorr(3)=corinho+txfour*DIMAG( Gn(u,u-1) )
DO j=1, flaglc, 2!3, 2
vtcorr=icorr(j)*vetor(j,:)/maior
IF( ABS(icorr(j))>=(maior/fator) * fator2 ) THEN
WRITE(UNIT=10, FMT="(4(f9.5,';'),f9.5)") &
posicao+splitvec+vetor(j,:)/2.d0-vtcorr/2.d0, &
vtcorr, ABS(icorr(j))*couterspin
END IF
!To create the constriction
IF(nlin==0) THEN
WRITE(UNIT=11, FMT="(3(f9.5,';'), f9.5)")posicao, vetor(j,:)
ELSE
IF( .NOT.(cami-1<k .AND. k<=camf) ) WRITE(UNIT=11, FMT="(3(f9.5,';'), f9.5)")posicao, vetor(j,:)
END IF
END DO
ELSE
IF(k==N.AND.MOD(i,2)==0) THEN
icorr(2)=corinho+txfour*DIMAG( Gn(u,u+1) ) !Mudei aqui
icorr(3)=corinho+txfour*DIMAG( Gn(u,u-1) ) !Mudei aqui
DO j=2, flaglc!3
vtcorr=icorr(j)*vetor(j,:)/maior
IF( ABS(icorr(j))>=(maior/fator) * fator2 ) THEN
WRITE(UNIT=10, FMT="(4(f9.5,';'),f9.5)") &
posicao+splitvec+vetor(j,:)/2.d0-vtcorr/2.d0, &
vtcorr, ABS(icorr(j))*couterspin
END IF
WRITE(UNIT=11, FMT="(3(f9.5,';'), f9.5)")posicao,vetor(j,:)
END DO
ELSE
icorr(1)=corinho+txfour*DIMAG( Gn(u,v ) )
icorr(2)=corinho+txfour*DIMAG( Gn(u,u+1) ) !Mudei aqui
icorr(3)=corinho+txfour*DIMAG( Gn(u,u-1) ) !Mudei aqui
!Para diminuir o hopping ao redor de vacancias
IF(k==(N/2)) THEN
IF(MOD(sitio,2)==0)THEN
IF(i==sitio) THEN
icorr(1)=2.d0*timp*DIMAG( Gn(u,v ) )
icorr(2)=2.d0*timp*DIMAG( Gn(u,u+1) )
icorr(3)=2.d0*timp*DIMAG( Gn(u,u-1) )
END IF
ELSE
IF(i==(sitio-1))THEN
icorr(2)=2.d0*timp*DIMAG( Gn(u,u+1) )
END IF
IF(i==sitio)THEN
icorr(1)=2.d0*timp*DIMAG( Gn(u,v ) )
END IF
IF(i==(sitio+1))THEN
icorr(3)=2.d0*timp*DIMAG( Gn(u,u-1) )
END IF
END IF
END IF
! IF(k==(N/2+1).AND.i==sitio) THEN
! icorr(1)=2.d0*timp*DIMAG( Gn(u,v ) )
! icorr(2)=2.d0*timp*DIMAG( Gn(u,u+1) )
! icorr(3)=2.d0*timp*DIMAG( Gn(u,u-1) )
! END IF
DO j=1, flaglc!3
vtcorr=icorr(j)*vetor(j,:)/maior
IF( ABS(icorr(j))>=(maior/fator) * fator2 ) THEN
WRITE(UNIT=10, FMT="(4(f9.5,';'),f9.5)") &
posicao+splitvec+vetor(j,:)/2.d0-vtcorr/2.d0, &
vtcorr, ABS(icorr(j))*couterspin
END IF
!To create the constriction
IF(nlin.NE.0 .AND. (cami-1<k .AND. k<=camf) .AND. ( i <= nlin .OR. i >PsrHalf-nlin ) ) THEN
ELSE
IF(i==nlin+1 .AND. j==3 .AND. (cami-1<k .AND. k<=camf)) THEN
ELSE
IF(i==(PsrHalf-nlin) .AND. j==2 .AND. (cami-1<k .AND. k<=camf)) THEN
ELSE
IF(k==cami-1 .AND.( i <= nlin .OR. i >PsrHalf-nlin ) .AND. j==1 .AND. MOD(i,2)==0) THEN
ELSE
WRITE(UNIT=11, FMT="(3(f9.5,';'), f9.5)")posicao, vetor(j,:)
END IF
END IF
END IF
END IF
END DO
END IF
END IF
END IF
END DO
END DO
END DO !couterspin
!Plotting the impurities positions
WRITE(nome, FMT="(a)") &
"./dados/imp_positions.dat"
OPEN(UNIT=12, FILE=nome, STATUS="UNKNOWN", ACTION="WRITE")
DO i=1, N
!For impurities on the left
posicao =i*base1+i*base2-2.5d0*vetor(1,:)
DO j=1,impurezaux(i,1,1)
posicao(2) =(impurezaux(i,1,j+1)+0.5d0)*SQRT(3.d0)
WRITE(UNIT=12, FMT="(1(f9.5,';'), f9.5)")posicao
END DO
!For impurities on the right
posicao=i*base1+i*base2-vetor(1,:)
DO j=1,impurezaux(i,2,1)
posicao(2)=impurezaux(i,2,j+1)*SQRT(3.d0)
WRITE(UNIT=12, FMT="(1(f9.5,';'), f9.5)")posicao
END DO
END DO
!END Plotting the impurities positions
CALL cpu_time (end_cpu_time)
timedif=end_cpu_time - beg_cpu_time
PRINT "('Total running time= ',i0,'h:',i0,'m:',i0,'s')", &
INT(timedif/3600.0), &
INT(MOD(timedif,3600.0)/60.0),&
INT(MOD(MOD(timedif,3600.0),60.0))
END PROGRAM corrente