No estaba implementado el calculo del pefil de potencial para la
[ptslat.git] / pzo_slat.f90
blob5987882c01535b5968d0752bfee95faac6dcd9a3
1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2 ! This subroutine calculates the strain distribution !
3 ! inside and around the quantum dot !
4 ! !
5 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 SUBROUTINE PIEZO(P_SPONT,P_PIEZO)
9 Use Input_Data
10 Use Dot_Geometry
11 Use Auxiliar_Procedures, ONLY : AISO
12 Use PZO_CALC
14 IMPLICIT NONE
16 !!!!! 'dummy' and local variables !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
18 REAL ZM,THETA,CTHETA,STHETA,CHI, &
19 PZ_1,PZ_ETA1,PZ_ETA2,&
20 P_SP, P_PZ, X,Y,Z,ZMAUX,&
21 WL_AUX,BR_AUX,POTSP,POTPZ
23 REAL,DIMENSION(:,:,:) :: P_SPONT,P_PIEZO
24 INTEGER I_X,I_Y,I_Z,I_N1,I_N2,I_N3
26 REAL, DIMENSION(3) :: R_SL,X_VEC,XI_VEC
28 !!! COMMON
29 REAL :: RHO,ZETA,ETA
30 COMMON /QAGON/RHO,ZETA,ETA
32 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
34 P_SPONT=0.E0;P_PIEZO=0.E0
36 ZD: DO I_Z=1,ZDim
37 ! WRITE(16,'(A,I3,A,I3)')"I_Z ",I_Z," of ",ZDIM
38 Z=Z_Min+REAL(I_Z-1)*Z_Inc
39 YD: DO I_Y=1,YDim
40 Y=Y_Min+REAL(I_Y-1)*Y_Inc
41 XD: DO I_X=1,XDim
42 X=X_Min+REAL(I_X-1)*X_Inc
44 X_VEC=(/X,Y,Z/)
46 P_SP=0.E0;P_PZ=0.E0
48 N3: DO I_N3=NMin_Z,NMax_Z
49 N2: DO I_N2=NMin_Y,NMax_Y
50 N1: DO I_N1=NMin_X,NMax_X
52 R_SL=REAL(I_N1)*A1_S+REAL(I_N2)*A2_S+REAL(I_N3)*A3_S
54 XI_VEC=X_VEC-R_SL
56 RHO=SQRT(XI_VEC(1)**2+XI_VEC(2)**2)/RC
57 IF(XI_VEC(1).EQ.0.E0.AND.XI_VEC(2).EQ.0.E0) THEN
58 CTHETA=1.E0/SQRT(2.E0); STHETA=1.E0/SQRT(2.E0) ! It is not the Mathematical limit
59 ELSE
60 THETA=ATAN(XI_VEC(2)/XI_VEC(1))
61 CTHETA=Cos(THETA); STHETA=Sin(THETA)
62 END IF
63 ZETA=XI_VEC(3)/ZC
65 IF (RHO.LE.RD) THEN
66 CALL SHAPERTOZ(MIN(RHO*RC,Rqd_Base),ZMAUX)
67 ZM=ZMAUX/ZC
68 ELSE
69 ZM = 0.E0
70 END IF
73 IF (abs(zeta) .EQ. 0.E0 .OR. ZETA .EQ. ZM) THEN
74 ZETA=ZETA-1.E-5
75 END IF
77 CHI = 0.
78 IF (RHO.LE.RD.AND.ZETA.GE.0.E0.AND.ZETA.LE.ZM) THEN
79 CHI = 1.
80 IF(I_N1.NE.0.OR.I_N2.NE.0.OR.I_N3.NE.0) THEN
81 WRITE(16,*)I_N1,I_N2,I_N3
82 WRITE(16,*)X_VEC(3),ZETA*ZC,ZM*ZC
83 END IF
84 END IF
86 IF (HD.NE.0.E0) THEN
87 IF(AISO.EQ.1) THEN
88 CALL PZOISO(POTSP,POTPZ)
89 ELSE
90 CALL PZOANISO(POTSP,POTPZ)
91 END IF
92 ELSE
93 POTSP=0.E0; POTPZ=0.E0
94 END IF
96 P_SP=P_SP+POTSP
97 P_PZ=P_PZ+POTPZ
99 !!!!!!!!!!!!!!!!!! Wetting Layer !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
101 IF(I_N1.EQ.0.AND.I_N2.EQ.0.AND.I_N3.EQ.0) THEN
103 WL_aux = ( abs(ZETA-(-D)) - abs(ZETA) )*ZC/RC
104 BR_aux = ( abs(ZETA-(-C_S/ZC)) - abs(ZETA-(-D)) )*ZC/RC +&
105 ( abs(ZETA) - abs(ZETA-(C_S/ZC-D)) )*ZC/RC
107 P_SP=P_SP+CPZ/2.E0*RC*(CSPWL*WL_aux+CSPBR*BR_Aux)
108 P_PZ=P_PZ+CPZ/2.E0*RC*CPZWL*WL_AUX
110 END IF
112 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
115 END DO N1
116 END DO N2
117 END DO N3
119 P_SPONT(I_X,I_Y,I_Z)= P_SP
120 P_PIEZO(I_X,I_Y,I_Z)= P_PZ
122 ! WRITE(26,'(10(E15.8,1X))')Z,P_SP,P_PZ,P_SP+P_PZ
124 END DO XD
125 END DO YD
126 END DO ZD
128 ! STOP
130 RETURN
131 END SUBROUTINE PIEZO
133 DOUBLE PRECISION FUNCTION I_FI00(X)
134 Use PZO_CALC
135 Use Dot_Geometry
136 Use Input_Data, ONLY: RC,ZC
137 IMPLICIT NONE
139 DOUBLE PRECISION :: X
140 !!! COMMON
141 REAL :: RHO,ZETA,ETA,ZM
142 COMMON /QAGON/RHO,ZETA,ETA
144 CALL SHAPERTOZ(MIN(SNGL(X)*RC,Rqd_Base),ZM)
145 I_FI00=X*FI00(DBLE(RHO),DBLE(ZETA),X,DBLE(ZM/ZC),DBLE(ETA))
147 RETURN
149 END FUNCTION I_FI00
151 DOUBLE PRECISION FUNCTION I_FDA00(X)
152 Use PZO_CALC
153 Use Dot_Geometry
154 Use Input_Data, ONLY: RC,ZC
155 IMPLICIT NONE
157 DOUBLE PRECISION :: X
158 !!! COMMON
159 REAL :: RHO,ZETA,ETA,ZM
160 COMMON /QAGON/RHO,ZETA,ETA
162 CALL SHAPERTOZ(MIN(SNGL(X)*RC,Rqd_Base),ZM)
163 I_FDA00=X*FDA00(DBLE(RHO),DBLE(ZETA),X,DBLE(ZM/ZC),DBLE(ETA))
165 RETURN
167 END FUNCTION I_FDA00