Acutalizadas las opciones de compilacion.
[ptslat.git] / dot_geo.f90
blob04958509d2ea6b8a847d7ff9701b869c92dd7311
2 MODULE Dot_Geometry
3 IMPLICIT NONE
5 REAL, SAVE :: Rqd_Base, Rqd_Top, Hqd, DWL
6 REAL, ALLOCATABLE, DIMENSION (:), SAVE :: XR, XZ
7 INTEGER, SAVE :: Ishape
9 CONTAINS
11 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12 ! Profile of the quantum dot !
13 ! !
14 ! ISHAPE = 1 ! TRUNCATED CONE !
15 ! ! Rqd_Top=0 -> CONE !
16 ! ! Rqd_Top=Rqd_Base -> CYLINDER !
17 ! ISHAPE = 2 ! CAP !
18 ! !
19 ! SHAPERTOZ calculates XZ (given XR) !
20 ! SHAPEZTOR calculates XR (given XZ) !
21 ! !
22 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
24 SUBROUTINE SHAPERTOZ(XR,XZ)
25 IMPLICIT NONE
27 REAL, INTENT(IN ) :: XR
28 REAL, INTENT( OUT) :: XZ
30 REAL :: R0
32 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
34 IF (XR.GT.Rqd_Base) THEN
35 WRITE(6,*) 'ERROR IN SHAPERTOZ: XR OUTSIDE THE DOT'
36 WRITE(6,*) XR,Rqd_Base
37 STOP
38 RETURN
39 END IF
41 SELECT CASE (ISHAPE)
43 CASE(1)
44 IF (XR.LE.Rqd_Top) THEN
45 XZ = Hqd
46 ELSE
47 XZ = - ( Hqd/(Rqd_Base-Rqd_Top) )*(XR-Rqd_Top)+Hqd
48 END IF
50 CASE(2)
51 IF (XR.LE.Rqd_Top) THEN
52 XZ = Hqd
53 ELSE
54 R0 = Rqd_Top**2+((Rqd_Base**2-Rqd_Top**2+Hqd**2)/(2.E0*Hqd))**2
55 XZ = sqrt(R0 -XR**2)-Sqrt(R0-Rqd_Top**2)+Hqd
56 END IF
58 END SELECT
60 RETURN
61 END SUBROUTINE SHAPERTOZ
63 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
65 SUBROUTINE SHAPEZTOR(XR,XZ)
66 IMPLICIT NONE
68 REAL, INTENT( OUT) :: XR
69 REAL, INTENT(IN ) :: XZ
71 REAL :: R0
73 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
75 IF (XZ.GT.Hqd) THEN
76 WRITE(6,*) 'ERROR IN SHAPERTOZ: XR OUTSIDE THE DOT'
77 WRITE(6,*) XZ,Hqd
78 STOP
79 RETURN
80 END IF
82 SELECT CASE (ISHAPE)
84 CASE(1)
85 XR = - ( (Rqd_Base-Rqd_Top)/Hqd )*XZ + Rqd_Base
87 CASE(2)
88 R0 = Rqd_Top**2+((Rqd_Base**2-Rqd_Top**2+Hqd**2)/(2.E0*Hqd))**2
89 XR = SQRT( R0-( XZ-Hqd+SQRT(R0-Rqd_Top**2) )**2 )
90 END SELECT
92 RETURN
93 END SUBROUTINE SHAPEZTOR
95 END MODULE Dot_Geometry