Incluidas las lineas referidas al input del desplazamiento.
[ptslat.git] / displ_slat.f90
blob94717883e657210d331467df04c27fcf615b673b
1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2 ! This subroutine calculates the strain distribution !
3 ! inside and around the quantum dot !
4 ! !
5 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 SUBROUTINE DISPLACEMENT(UR,UX,UY,UZ)
9 Use Input_Data
10 Use Dot_Geometry
11 Use Auxiliar_Procedures, ONLY : AISO
12 Use DISPL_CALC
13 Use STRAIN_CALC
14 Use PZO_CALC
16 IMPLICIT NONE
18 !!!!! 'dummy' and local variables !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
20 REAL ZM,THETA,CTHETA,STHETA,AUXCHI,CHI,UUR,UUR2, &
21 UUX,UUY,UUZ,UUZ2,X,Y,Z,ZMAUX,EESUM,EEDIF,EE00,&
22 R_Profile
23 REAL,DIMENSION(:,:,:) :: UX,UY,UZ,UR
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 UX=0.E0;UY=0.E0;UZ=0.E0;UR=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 UUX=0.E0;UUY=0.E0;UUZ=0.E0;UUZ2=0.E0;UUR=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 (AISO.EQ.1) THEN
87 CALL DSPLISO(EESUM,EEDIF,UUZ2,CHI)
88 ELSE
89 CALL DSPLANISO(EESUM,EEDIF,UUZ2,CHI)
90 END IF
92 IF (RHO .EQ. 0.E0) EEDIF = 0.E0
94 EE00 = (EESUM-EEDIF)/2.E0
95 UUR2=RHO*EE00
98 !!!!!!!!!!!!!!!!!! Wetting Layer !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
100 IF(I_N1.EQ.0.AND.I_N2.EQ.0.AND.I_N3.EQ.0) THEN
102 ! IF (ZETA.LT.0.E0 .AND. ZETA.GE.-D) THEN
104 IF (AISO.EQ.1) THEN
105 UUZ2 = UUZ2-BIAUX/2.E0* &
106 (ZC/RC)*((ZETA-(-D))*SIGN(1.E0,ZETA-(-D))-ZETA*SIGN(1.E0,ZETA))
107 ELSE
108 UUZ2 = UUZ2-(2.E0*C13/C33*EPSA+EPSC)/2.E0* &
109 (ZC/RC)*((ZETA-(-D))*SIGN(1.E0,ZETA-(-D))-ZETA*SIGN(1.E0,ZETA))
110 END IF
112 ! END IF
113 END IF
115 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
117 UUX = UUX + CTHETA*RC*UUR2
118 UUY = UUY + STHETA*RC*UUR2
119 UUR = UUR + RC*UUR2
120 UUZ = UUZ + RC*UUZ2
122 END DO N1
123 END DO N2
124 END DO N3
126 UX(I_X,I_Y,I_Z)= UUX
127 UY(I_X,I_Y,I_Z)= UUY
128 UR(I_X,I_Y,I_Z)= UUR
129 UZ(I_X,I_Y,I_Z)= UUZ
131 ! WRITE(26,'(10(E15.8,1X))')Z,EEXX,EEYY,EEZZ,EEXY,EEXZ,EEYZ
133 END DO XD
134 END DO YD
135 END DO ZD
137 ! STOP
139 RETURN
140 END SUBROUTINE DISPLACEMENT