1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2 ! Program to draw the potential energy from a file containig the strain
4 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15 INTEGER,PARAMETER :: DIMM
=6
17 ***** 'dummy' and local variables
**************************************
19 REAL VWE
,VWH
,DW1
,DW2
,DW3
,VBE
,VBH
,DB1
,DB2
,DB3
21 INTEGER Number_Param
,IGEO
,NWF
22 REAL VBIEL
,VBIHH
,VBILH
,VBILS
,VBISO
23 REAL POTWE
,POTWHH
,POTWLH
,POTWLS
,POTWSO
,
24 & POTBE
,POTBHH
,POTBLH
,POTBLS
,POTBSO
25 REAL C1
,C2
,D1
,D2
,D3
,D4
,D5
,D6
,BISUM
,BIZZ
,BIAUX
27 REAL RC
,ZC
,DWL
,RHO
,ZETA
,ZM
29 INTEGER I
,IIR
,J
,K
,IZ
,IR
31 !! GRID RESULTS OF STRAIN
33 REAL,ALLOCATABLE
,DIMENSION(:,:,:) :: MSUM
, MDIF
, MRR
,
37 !! GRID RESULTS OF PIEZOELECTRIC POTENTIAL
39 REAL,ALLOCATABLE
,DIMENSION(:,:,:) :: PTOT
41 !! GRID RESULTS OF POTENTIALS
43 REAL,ALLOCATABLE
,DIMENSION(:,:,:) :: EEL
, EHHUP
, EHHDW
,
44 & ELHUP
, ELHDW
, ESOUP
,
47 !! FRACTIONAL COORDINATES AND GEOM
. PARAMETERS
49 REAL,ALLOCATABLE
:: XVALS
(:), YVALS
(:), RADI
(:,:), ZETI
(:,:), PAR
(:)
53 REAL HKANE
(1:DIMM
,1:DIMM
)
56 !! DIAGONALIZATION VARIABLES
58 REAL W
(1:DIMM
), WORK
(1:10*DIMM
), AW
(1:DIMM
,1:DIMM
),
59 & ROOT
(DIMM
), CARAC
(DIMM
), SLAMCH
60 INTEGER IWORK
(DIMM*5
), IFAIL
(DIMM
), INFO
, NUM
63 !! DEFROMATION POTENTIALS AND ENERGY PROFILES
64 REAL,DIMENSION(0:1) :: POTE
, POTHH
, POTLH
, POTSO
, POTLS
,
65 & PC1
, PC2
, PD1
, PD2
, PD3
, PD4
, PD5
, PD6
67 REAL ERR
,E00
,EZZ
,ERZ
,ESUM
,EDIF
,PZO
69 !!!!!!! COMMON BLOCKS
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
71 CHARACTER(LEN
=120) :: input_str
,input_pzo
,output_eng
72 COMMON /FILES
/ input_str
,input_pzo
,output_eng
75 COMMON /CARAC
/ CARAC_MAX
77 !! MORE INOUT
.INC VARIABLES
79 LOGICAL :: DIAGLOG
,PZOLOG
,STRLOG
,DWLLOG
80 COMMON /LOGICS
/ DIAGLOG
,PZOLOG
,STRLOG
82 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
84 INCLUDE
'INC/inout.inc'
88 ALLOCATE
(MSUM
(0:NWF
,0:NWF
,1:Number_Param
),
89 & MDIF
(0:NWF
,0:NWF
,1:Number_Param
),
90 & MRR
(0:NWF
,0:NWF
,1:Number_Param
),
91 & M00
(0:NWF
,0:NWF
,1:Number_Param
),
92 & MZZ
(0:NWF
,0:NWF
,1:Number_Param
),
93 & MRZ
(0:NWF
,0:NWF
,1:Number_Param
),
94 & MHID
(0:NWF
,0:NWF
,1:Number_Param
),
95 & MTIL
(0:NWF
,0:NWF
,1:Number_Param
),
96 & PTOT
(0:NWF
,0:NWF
,1:Number_Param
))
98 ALLOCATE
(EEL
(0:NWF
,0:NWF
,1:Number_Param
),
99 & EHHUP
(0:NWF
,0:NWF
,1:Number_Param
),
100 & EHHDW
(0:NWF
,0:NWF
,1:Number_Param
),
101 & ELHUP
(0:NWF
,0:NWF
,1:Number_Param
),
102 & ELHDW
(0:NWF
,0:NWF
,1:Number_Param
),
103 & ESOUP
(0:NWF
,0:NWF
,1:Number_Param
),
104 & ELAST
(0:NWF
,0:NWF
,1:Number_Param
),
105 & ESODW
(0:NWF
,0:NWF
,1:Number_Param
))
107 ALLOCATE
(XVALS
(0:NWF
),YVALS
(0:NWF
),RADI
(1:Number_Param
,1:3),
108 & ZETI
(1:Number_Param
,1:2),PAR
(1:Number_Param
))
110 ! Definition of parameters
for Barrier and Well
116 POTWHH
= (VWH
+DW1
+DW2
)
117 POTWLH
= (VWH
+(DW1
-DW2
+4.E0*DW3
)/3.E0
)
118 POTWSO
= (VWH
+2.E0*
(DW1
-DW2
-2.E0*DW3
)/3.E0
)
119 POTWLS
= (DW1
-DW2
+DW3
)
121 POTBHH
= (VBH
+DB1
+DB2
)
122 POTBLH
= (VBH
+(DB1
-DB2
+4.E0*DB3
)/3.E0
)
123 POTBSO
= (VBH
+2.E0*
(DB1
-DB2
-2.E0*DB3
)/3.E0
)
124 POTBLS
= (DB1
-DB2
+DB3
)
127 VBIEL
= ( C2*BISUM
+ C1*BIZZ
)
128 VBIHH
= ( (D2
+D4
)*BISUM
+ (D1
+D3
)*BIZZ
)
129 VBILH
= ( (D2
+D4
/3.)*BISUM
+ (D1
+D3
/3.)*BIZZ
)
130 VBISO
=( (D2
+2.*D4
/3.)*BISUM
+ (D1
+2.*D3
/3.)*BIZZ
)
131 VBILS
= ( D4*BISUM
+ D3*BIZZ
)
133 ! Potential edges including strain effect
135 POTWHH
= (POTWHH
+VBIHH
)
136 POTWLH
= (POTWLH
+VBILH
)
137 POTWSO
= (POTWSO
+VBISO
)
138 POTWLS
= (POTWLS
+VBILS
)
141 POTE
(0) = POTBE
; POTE
(1) = POTWE
142 POTHH
(0) = POTBHH
; POTHH
(1) = POTWHH
143 POTLH
(0) = POTBLH
; POTLH
(1) = POTWLH
144 POTLS
(0) = POTBLS
; POTLS
(1) = POTWLS
145 POTSO
(0) = POTBSO
; POTSO
(1) = POTWSO
147 ! Deformation potentials
for barrier and well are equal
149 PC1
(0) = C1
; PC1
(1) = C1
150 PC2
(0) = C2
; PC2
(1) = C2
151 PD1
(0) = D1
; PD1
(1) = D1
152 PD2
(0) = D2
; PD2
(1) = D2
153 PD3
(0) = D3
; PD3
(1) = D3
154 PD4
(0) = D4
; PD4
(1) = D4
155 PD5
(0) = D5
; PD5
(1) = D5
156 PD6
(0) = D6
; PD6
(1) = D6
160 CALL STR_UNPACK
(MSUM
,MDIF
,MRR
,M00
,MZZ
,MRZ
,MHID
,MTIL
,Number_Param
,NWF
,
161 & RADI
,ZETI
,PAR
,XVALS
,YVALS
)
164 MSUM
=0.E0
; MDIF
=0.E0
; MRR
=0.E0
; M00
=0.E0
; MZZ
=0.E0
; MRZ
=0.E0
171 CALL PZO_UNPACK
(Number_Param
,NWF
,PTOT
,RADI
,ZETI
,PAR
,XVALS
,YVALS
)
179 DO IGEO
=1,Number_Param
183 Rqd_Base
= RADI
(IGEO
,1)
184 Rqd_Top
= RADI
(IGEO
,2)
188 write(12,*)Rqd_Base
,Rqd_Top
,Hqd
,ZC
,RC
190 !! In case that the
parameter would be DWL
:
191 IF(DWLLOG
) DWL
= PAR
(IGEO
)
197 IF (RHO
.LE
.Rqd_Base
) THEN
198 CALL SHAPERTOZ
(RHO
,ZM
)
210 ERR
= MRR
(IR
,IZ
,Number_Param
)
211 E00
= M00
(IR
,IZ
,Number_Param
)
212 EZZ
= MZZ
(IR
,IZ
,Number_Param
)
213 ERZ
= MRZ
(IR
,IZ
,Number_Param
)
214 ESUM
= MSUM
(IR
,IZ
,Number_Param
)
215 EDIF
= MDIF
(IR
,IZ
,Number_Param
)
216 PZO
= PTOT
(IR
,IZ
,Number_Param
)
219 IF (ZETA
.GE
.-DWL
.AND
. ZETA
.LE
.ZM
) CHI
=1
221 HKANE
(1,1)=POTHH
(CHI
)-PZO
+
222 & (PD1
(CHI
)+PD3
(CHI
))*EZZ
+(PD2
(CHI
)+PD4
(CHI
))*ESUM
224 HKANE
(2,2)=POTLH
(CHI
)-PZO
+(PD1
(CHI
)+PD3
(CHI
)/3.E0
)*EZZ
+
225 & (PD2
(CHI
)+PD4
(CHI
)/3.E0
)*ESUM
226 HKANE
(3,3)=HKANE
(2,2)
227 HKANE
(4,4)=HKANE
(1,1)
228 HKANE
(5,5)=POTSO
(CHI
)-PZO
+(PD1
(CHI
)+2.E0*PD3
(CHI
)/3.E0
)*EZZ
+
229 & (PD2
(CHI
)+2.E0*PD4
(CHI
)/3.E0
)*ESUM
230 HKANE
(6,6)=HKANE
(5,5)
232 IF(.NOT
.DIAGLOG
.AND
.STRLOG
) THEN
234 HKANE
(1,2)=-SQRT
(2.E0
/3.E0
)*PD6
(CHI
)*ERZ
235 HKANE
(1,3)=-1.E0
/SQRT
(3.E0
)*PD5
(CHI
)*EDIF
237 HKANE
(1,5)=1.E0
/SQRT
(3.E0
)*PD6
(CHI
)*ERZ
238 HKANE
(1,6)=SQRT
(2./3.)*PD5
(CHI
)*EDIF
241 HKANE
(2,4)=HKANE
(1,3)
242 HKANE
(2,5)=SQRT
(2.E0
)/3.E0*
(POTLS
(CHI
)+(PD3
(CHI
)*EZZ
+PD4
(CHI
)*ESUM
))
243 HKANE
(2,6)=-PD6
(CHI
)*ERZ
245 HKANE
(3,4)=-HKANE
(1,2)
246 HKANE
(3,5)=HKANE
(2,6)
247 HKANE
(3,6)=-HKANE
(2,5)
249 HKANE
(4,5)=-HKANE
(1,6)
250 HKANE
(4,6)=HKANE
(1,5)
258 HKANE
(J
,I
)=HKANE
(I
,J
)
262 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
263 !! Analytic solutions
for Rho
= 0.
264 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
266 ! ZETA
= ZMIN
+ZINC*IZ
! XZ normalized
to ZC
268 ! W
(1)=(HKANE
(2,2)+HKANE
(5,5))+
269 ! & SQRT
( (HKANE
(2,2)-HKANE
(5,5))**2+4.*HKANE
(3,6)**2 )
270 ! W
(2)=(HKANE
(2,2)+HKANE
(5,5))-
271 ! & SQRT
( (HKANE
(2,2)-HKANE
(5,5))**2+4.*HKANE
(3,6)**2 )
272 ! write(24,'(4(f18.8,1x))')ZETA
,HKANE
(1,1),W
(1)/2.,W
(2)/2.
274 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
277 CALL SSYEVX
('V','A','U',DIMM
,HKANE
,DIMM
,0.,0.,2,2,
278 & 2*SLAMCH
('S'),NUM
,W
,AW
,DIMM
,WORK
,10*DIMM
,IWORK
,IFAIL
,INFO
)
281 write(6,*)"Not Succesful Exit. Stopping. INFO=",INFO
282 write(6,'(A,10(I2,1X))')"IFAIL=",IFAIL
(1:DIMM
)
283 write(6,*)"IR=",IR
," IZ=",IZ
287 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
288 !! Ordering Eigenvalues according
to the Bloch func
. caracter
289 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
294 ! Calculo de la componentes dependientes del spin
296 CARAC
(J
)=AW
(J
,I
)*AW
(J
,I
)
298 ! Suma de componentes independientemente del spin
(hh_up
+ hh_dw
, lh_up
+ lh_dw
)
299 CARAC
(1)=CARAC
(1)+CARAC
(4)
301 CARAC
(2)=CARAC
(2)+CARAC
(3)
303 CARAC
(5)=CARAC
(5)+CARAC
(6)
306 ! Peso de las componentes de las que se extraeran los autovalores
.
308 IF (CARAC
(1).GE
.CARAC_MAX
) THEN ! HH
311 IF (CARAC
(2).GE
.CARAC_MAX
) THEN ! LH
314 IF (CARAC
(5).GE
.CARAC_MAX
) THEN ! SO
320 ELSE ! Only the diagonal elements were calculated
325 ROOT
(2)=HKANE
(6,6) !Redundant
330 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
332 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
334 EEL
(IR
,IZ
,IGEO
) = POTE
(CHI
)-PZO
+(PC1
(CHI
)*EZZ
+PC2
(CHI
)*ESUM
)
336 EHHUP
(IR
,IZ
,IGEO
) = ROOT
(4)
337 ELHUP
(IR
,IZ
,IGEO
) = ROOT
(3)
338 ELHDW
(IR
,IZ
,IGEO
) = ROOT
(3)
339 EHHDW
(IR
,IZ
,IGEO
) = ROOT
(4)
341 ESOUP
(IR
,IZ
,IGEO
) = ROOT
(1)
342 ESODW
(IR
,IZ
,IGEO
) = ROOT
(1)
343 ! ESODW
(IR
,IZ
,IGEO
) = CHI
! To save the Structure
-profile
345 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
346 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
347 !!!!! Calculation of the Elastic Energy
. Since EEL contains no information
348 !!!!! we will use this array
to pack the Elastic Energy
.
350 !!!!! U
=1/2*XLAMB*Tr
(e
)**2+XMU*
(err**2
+e00**2
+ezz**2
+erz**2
)
352 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
353 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
355 ELAST
(IR
,IZ
,IGEO
)=XMU*
(ERR**2
+ E00**2
+ EZZ**2
+ ERZ**2
) +
356 & 0.5*XLAMB*
(ERR
+ E00
+ EZZ
)**2
366 DO IGEO
=1,Number_Param
369 EEL
(ir
,iz
,IGEO
)=EEL
(NWF
-IR
,iz
,IGEO
)
370 EHHUP
(ir
,iz
,IGEO
)=EHHUP
(NWF
-IR
,iz
,IGEO
)
371 EHHDW
(ir
,iz
,IGEO
)=EHHDW
(NWF
-IR
,iz
,IGEO
)
372 ELHUP
(ir
,iz
,IGEO
)=ELHUP
(NWF
-IR
,iz
,IGEO
)
373 ELHDW
(ir
,iz
,IGEO
)=ELHDW
(NWF
-IR
,iz
,IGEO
)
374 ESOUP
(ir
,iz
,IGEO
)=ESOUP
(NWF
-IR
,iz
,IGEO
)
375 ESODW
(ir
,iz
,IGEO
)=ESODW
(NWF
-IR
,iz
,IGEO
)
376 ELAST
(ir
,iz
,IGEO
)=ELAST
(NWF
-IR
,iz
,IGEO
)
381 CALL POT_PACK
(EEL
,EHHUP
,ELHUP
,ELHDW
,EHHDW
,
382 & ESOUP
,ESODW
,ELAST
,Number_Param
,NWF
,RADI
,ZETI
,PAR
,XVals
,YVals
)
384 END PROGRAM POT_PROFILE