Calculo correcto del desplazamiento en la capa mojante.
[ptslat.git] / poten.f90
blob628623512cf878adc93911fdf51e5b67d824d2fe
1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2 ! Driver for stain0.f subroutine
3 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5 PROGRAM POTDRV
7 Use Dot_Geometry
8 Use Auxiliar_Procedures
9 Use Input_Data
10 Use NCPACK_PZO
11 Use NCPACK_STR
12 Use NCPACK_POT
13 Use NCPACK_DPL
15 IMPLICIT NONE
17 !! GRID RESULTS OF STRAIN0
19 REAL, ALLOCATABLE, DIMENSION(:,:,:) :: P_SPONT,P_PIEZO, &
20 EXX,EYY,EZZ,EXZ,EYZ,EXY, &
21 EEL,EHHUP,EHHDW,ELHUP, &
22 ELHDW,ESOUP,ESODW,ELAST,&
23 UX,UY,UZ,UR
26 INTERFACE
27 SUBROUTINE PIEZO(P_SPONT,P_PIEZO)
28 REAL,DIMENSION(:,:,:) :: P_SPONT,P_PIEZO
29 END SUBROUTINE
30 SUBROUTINE STRAIN0(EXX,EYY,EZZ,EXY,EXZ,EYZ)
31 REAL,DIMENSION(:,:,:) :: EXX,EYY,EZZ,EXY,EXZ,EYZ
32 END SUBROUTINE
33 SUBROUTINE DISPLACEMENT(UR,UX,UY,UZ)
34 REAL,DIMENSION(:,:,:) :: UR,UX,UY,UZ
35 END SUBROUTINE
36 SUBROUTINE POTENTIAL_ZB(EEL,EHHUP,EHHDW,ELHUP,ELHDW,&
37 ESOUP,ESODW,ELAST,EXX,EYY,&
38 EZZ,EXY,EXZ,EYZ)
39 REAL,DIMENSION(:,:,:),OPTIONAL :: EXX,EYY,EZZ,EXY,EXZ,EYZ
41 REAL,DIMENSION(:,:,:) :: EEL,EHHUP,EHHDW,ELHUP,ELHDW,&
42 ESOUP,ESODW,ELAST
43 END SUBROUTINE
44 SUBROUTINE POTENTIAL_WZ(EEL,EHHUP,EHHDW,ELHUP,ELHDW,&
45 ESOUP,ESODW,ELAST,EXX,EYY,&
46 EZZ,EXY,EXZ,EYZ,POT)
47 REAL,DIMENSION(:,:,:),OPTIONAL :: EXX,EYY,EZZ,EXY,EXZ,EYZ,POT
49 REAL,DIMENSION(:,:,:) :: EEL,EHHUP,EHHDW,ELHUP,ELHDW,&
50 ESOUP,ESODW,ELAST
51 END SUBROUTINE
52 END INTERFACE
54 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
56 CALL READ_INPUT()
58 RC=Rqd_Base+23.E0
59 ZC=Hqd+23.E0
62 RD = Rqd_Base/RC ! RD = Rqd_Base normalized to RC
63 HD = Hqd/ZC ! HD = HQD normalized to ZC
65 D=DWL/ZC ! Wetting layer thick. normalized to ZC
68 !!! ELECTROSTATIC POTENTIAL AND STRAIN DISTRIBUTION !!!!!!!!!!!!!!!!!!
70 IF(PZO_Action.EQ.1.AND.STR_Action.EQ.1) THEN
72 ALLOCATE (P_SPONT(1:XDim,1:YDim,1:ZDim),&
73 P_PIEZO(1:XDim,1:YDim,1:ZDim) )
74 ALLOCATE (EXX(1:XDim,1:YDim,1:ZDim),EYY(1:XDim,1:YDim,1:ZDim), &
75 EZZ(1:XDim,1:YDim,1:ZDim),EXZ(1:XDim,1:YDim,1:ZDim), &
76 EXY(1:XDim,1:YDim,1:ZDim),EYZ(1:XDim,1:YDim,1:ZDim) )
78 CALL CONSTANTS( )
80 WRITE(6,*)"Begins the calculation of the Electrostatic Potential"
81 CALL PIEZO(P_SPONT,P_PIEZO)
82 WRITE(6,*)"Calculation of the Electrostatic Potential ended"
83 WRITE(6,*)"Begins the calculation of the Strain Field"
84 CALL STRAIN0(EXX,EYY,EZZ,EXY,EXZ,EYZ)
85 WRITE(6,*)"Calculation of the Strain Field ended"
87 CALL NCPACK_PZ(P_SPONT,P_PIEZO)
88 IF (KCOOR.EQ.0) THEN
89 CALL NCPACK_CART(EXX,EYY,EZZ,EXY,EXZ,EYZ)
90 ELSE
91 CALL NCPACK_CYL(EXX,EYY,EZZ,EXZ)
92 END IF
94 ELSE
96 IF(PZO_Action.EQ.1) THEN
97 ALLOCATE (P_SPONT(1:XDim,1:YDim,1:ZDim),&
98 P_PIEZO(1:XDim,1:YDim,1:ZDim) )
100 CALL CONSTANTS_PZO( )
102 WRITE(6,*)"Begins the calculation of the Electrostatic Potential"
103 CALL PIEZO(P_SPONT,P_PIEZO)
104 WRITE(6,*)"Calculation of the Electrostatic Potential ended"
106 CALL NCPACK_PZ(P_SPONT,P_PIEZO)
108 END IF
109 IF(STR_Action.EQ.1) THEN
110 ALLOCATE (EXX(1:XDim,1:YDim,1:ZDim),EYY(1:XDim,1:YDim,1:ZDim), &
111 EZZ(1:XDim,1:YDim,1:ZDim),EXZ(1:XDim,1:YDim,1:ZDim), &
112 EXY(1:XDim,1:YDim,1:ZDim),EYZ(1:XDim,1:YDim,1:ZDim) )
114 CALL CONSTANTS_STR( )
116 WRITE(6,*)"Begins the calculation of the Strain Field"
117 CALL STRAIN0(EXX,EYY,EZZ,EXY,EXZ,EYZ)
118 WRITE(6,*)"Calculation of the Strain Field ended"
120 IF (KCOOR.EQ.0) THEN
121 CALL NCPACK_CART(EXX,EYY,EZZ,EXY,EXZ,EYZ)
122 ELSE
123 CALL NCPACK_CYL(EXX,EYY,EZZ,EXZ)
124 END IF
126 END IF
128 END IF
130 IF(STR_Action.EQ.2) THEN
131 ALLOCATE (EXX(1:XDim,1:YDim,1:ZDim),EYY(1:XDim,1:YDim,1:ZDim), &
132 EZZ(1:XDim,1:YDim,1:ZDim),EXZ(1:XDim,1:YDim,1:ZDim), &
133 EXY(1:XDim,1:YDim,1:ZDim),EYZ(1:XDim,1:YDim,1:ZDim) )
134 IF (KCOOR.EQ.0) THEN
135 CALL NCREAD_CART(EXX,EYY,EZZ,EXY,EXZ,EYZ)
136 ELSE
137 CALL NCREAD_CYL(EXX,EYY,EZZ,EXZ)
138 END IF
139 END IF
141 IF(PZO_Action.EQ.2) THEN
142 ALLOCATE (P_SPONT(1:XDim,1:YDim,1:ZDim),&
143 P_PIEZO(1:XDim,1:YDim,1:ZDim) )
145 CALL NCREAD_PZ(P_SPONT,P_PIEZO)
147 END IF
149 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
150 !!! CONFINEMENT POTENTIAL !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
151 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
153 IF(POT_Action.NE.0) THEN
155 WRITE(6,*)"Begins the calculation of the Confinement Potential"
157 ALLOCATE (EEL(1:XDim,1:YDim,1:ZDim),EHHUP(1:XDim,1:YDim,1:ZDim), &
158 EHHDW(1:XDim,1:YDim,1:ZDim),ELHUP(1:XDim,1:YDim,1:ZDim), &
159 ELHDW(1:XDim,1:YDim,1:ZDim),ESOUP(1:XDim,1:YDim,1:ZDim), &
160 ESODW(1:XDim,1:YDim,1:ZDim),ELAST(1:XDim,1:YDim,1:ZDim))
162 SELECT CASE(MTYPE)
164 CASE(1)
165 IF(STR_Action.GT.0) THEN
166 CALL POTENTIAL_ZB(EEL,EHHUP,EHHDW,ELHUP,ELHDW,&
167 ESOUP,ESODW,ELAST,EXX,EYY,&
168 EZZ,EXY,EXZ,EYZ)
169 ELSE
170 CALL POTENTIAL_ZB(EEL,EHHUP,EHHDW,ELHUP,ELHDW,&
171 ESOUP,ESODW,ELAST)
172 END IF
173 CASE(2:)
174 IF(STR_Action.NE.0.AND.PZO_Action.NE.0) THEN
175 CALL POTENTIAL_WZ(EEL,EHHUP,EHHDW,ELHUP,ELHDW,&
176 ESOUP,ESODW,ELAST,EXX,EYY,&
177 EZZ,EXY,EXZ,EYZ,&
178 POT=P_SPONT+P_PIEZO)
179 ELSE
181 IF(STR_Action.NE.0) &
182 CALL POTENTIAL_WZ(EEL,EHHUP,EHHDW,ELHUP,ELHDW,&
183 ESOUP,ESODW,ELAST,EXX,EYY,&
184 EZZ,EXY,EXZ,EYZ)
186 IF(PZO_Action.NE.0) &
187 CALL POTENTIAL_WZ(EEL,EHHUP,EHHDW,ELHUP,ELHDW,&
188 ESOUP,ESODW,ELAST,&
189 POT=P_SPONT+P_PIEZO)
190 END IF
191 IF(STR_Action.EQ.0.AND.PZO_Action.EQ.0) THEN
192 CALL POTENTIAL_WZ(EEL,EHHUP,EHHDW,ELHUP,ELHDW,&
193 ESOUP,ESODW,ELAST)
194 END IF
196 END SELECT
198 WRITE(6,*)"Calculation of the Confinement Potential ended"
200 CALL NCPACK_PT(EEL,EHHUP,EHHDW,ELHUP,ELHDW,&
201 ESOUP,ESODW,ELAST)
202 END IF
204 IF(DPL_Action.EQ.1) THEN
206 IF(.NOT.(STR_Action.EQ.1.AND.PZO_Action.EQ.1)) &
207 CALL CONSTANTS_DSP( )
209 ALLOCATE (UX(1:XDim,1:YDim,1:ZDim),UY(1:XDim,1:YDim,1:ZDim), &
210 UZ(1:XDim,1:YDim,1:ZDim), UR(1:XDim,1:YDim,1:ZDim) )
212 WRITE(6,*)"Begins the calculation of the Displacement Field"
213 CALL DISPLACEMENT(UR,UX,UY,UZ)
214 WRITE(6,*)"Calculation of the Displacement Field ended"
216 IF (KCOOR.EQ.0) THEN
217 CALL NCPACK_DPL_CART(UX,UY,UZ)
218 ELSE
219 CALL NCPACK_DPL_CYL(UR,UZ)
220 END IF
223 END IF
225 END PROGRAM POTDRV