Acutalizadas las opciones de compilacion.
[ptslat.git] / displ_mod.f90
blob061df5183535813a9b969756120fcb4ace781404
1 MODULE DISPL_CALC
3 IMPLICIT NONE
5 CONTAINS
7 SUBROUTINE DSPLISO(EESUM,EEDIF,UUZZ,CHI)
8 Use Input_Data
9 IMPLICIT NONE
10 REAL, INTENT(IN ) :: CHI
11 REAL, INTENT( OUT) :: EESUM,EEDIF,UUZZ
13 DOUBLE PRECISION :: AASUM,AADIF,AAZZ
15 !!! COMMON
16 REAL :: RHO,ZETA,ETA
17 COMMON /QAGON/RHO,ZETA,ETA
19 ETA=1.E0
20 CALL DPREST(AASUM,AADIF,AAZZ)
22 EESUM = - BIAUX*(AASUM+CHI)
23 EEDIF = BIAUX*(AADIF-CHI)
24 UUZZ = -BIAUX*AAZZ
26 END SUBROUTINE DSPLISO
28 SUBROUTINE DSPLANISO(EESUM,EEDIF,UUZ,CHI)
29 Use Input_Data
30 IMPLICIT NONE
31 REAL, INTENT(IN ) :: CHI
32 REAL, INTENT( OUT) :: EESUM,EEDIF,UUZ
34 DOUBLE PRECISION :: AASUM1,AADIF1,AAZ1,&
35 AASUM2,AADIF2,AAZ2
37 !!! COMMON
38 REAL :: RHO,ZETA,ETA
39 COMMON /QAGON/RHO,ZETA,ETA
41 ETA=ETA1
42 CALL DPREST(AASUM1,AADIF1,AAZ1)
43 ETA=ETA2
44 CALL DPREST(AASUM2,AADIF2,AAZ2)
46 EESUM = CN1_2G*CHI + & !(2.E0*EPSA + CN1_2G)*CHI + &
47 (CN02_1*AASUM2 - CN02_2*AASUM1)/ETA_DIF
48 EEDIF = +CN1_2G*CHI - &
49 (CN02_1*AADIF2 - CN02_2*AADIF1)/ETA_DIF
50 UUZ = & !(EPSC*CHI)*ZETA + &
51 (U1*AAZ2 - U2*AAZ1)/ETA_DIF
53 ! WRITE(12,'(10(E15.8,1X))')ZETA,RHO,AASUM1,AASUM2,AADIF1,AADIF2
55 RETURN
57 END SUBROUTINE DSPLANISO
59 SUBROUTINE DPREST(AASUM,AADIF,AAZ)
61 Use Input_Data, ONLY: RD,RC,ZC
63 IMPLICIT NONE
65 !! 'dummy' and local variables !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
67 DOUBLE PRECISION AASUM,AADIF,AAZ,RO,ZE
69 !! GAG Variables !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
71 INTEGER, PARAMETER :: LIMITE=100
72 DOUBLE PRECISION AL,AU,ABSERR,EPSABS,EPSREL,WORK(4*LIMITE)
73 INTEGER IER,IWORK(LIMITE),KEY,LAST,LENW,LIMIT,NEVAL
75 DOUBLE PRECISION, EXTERNAL :: I_FA00,I_FA20,I_FI00
77 !!! COMMON
78 REAL :: RHO,ZETA,ETA
79 COMMON /QAGON/RHO,ZETA,ETA
81 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
83 RO=RHO
84 ZE=ZETA
85 AL=0.D0
86 AU=DBLE(RD)
88 EPSABS=0.D0
89 EPSREL=1.D-4
90 KEY=6
91 LIMIT=LIMITE
92 LENW=LIMIT*4
94 CALL DQAG(I_FA00,AL,AU,EPSABS,EPSREL,KEY,AASUM,ABSERR,NEVAL, &
95 IER,LIMIT,LENW,LAST,IWORK,WORK)
97 IF (IER.NE.0) &
98 CALL DQAG_CHECK("FA00","AASUM",AASUM,ABSERR,RO*RC,ZE*ZC,NEVAL,IER,LAST)
100 CALL DQAG(I_FA20,AL,AU,EPSABS,EPSREL,KEY,AADIF,ABSERR,NEVAL, &
101 IER,LIMIT,LENW,LAST,IWORK,WORK)
103 IF (IER.NE.0) &
104 CALL DQAG_CHECK("FA20","AADIF",AADIF,ABSERR,RO*RC,ZE*ZC,NEVAL,IER,LAST)
106 CALL DQAG(I_FI00,AL,AU,EPSABS,EPSREL,KEY,AAZ,ABSERR,NEVAL, &
107 IER,LIMIT,LENW,LAST,IWORK,WORK)
108 IF (IER.NE.0) &
109 CALL DQAG_CHECK("FI00","UUZ",AAZ,ABSERR,RO*RC,ZE*ZC,NEVAL,IER,LAST)
111 RETURN
112 END SUBROUTINE DPREST
114 SUBROUTINE DQAG_CHECK(FUNC,RESNAME,RES,ABSERR,RO,ZE,NEVAL,IER,LAST)
115 IMPLICIT NONE
116 CHARACTER(LEN=*) :: FUNC,RESNAME
117 DOUBLE PRECISION :: RES,ABSERR,RO,ZE
118 INTEGER :: NEVAL,IER,LAST
119 WRITE(6,*)"ERROR AT: RHO: ",RO," ZETA: ",ZE
120 WRITE(6,*)"QAG ",TRIM(FUNC)," ",TRIM(RESNAME)," RESULT=",RES
121 WRITE(6,*)"QAG ABSERR=",ABSERR
122 WRITE(6,*)"QAG NEVAL=",NEVAL
123 WRITE(6,*)"QAG IER=",IER
124 WRITE(6,*)"QAG LAST=",LAST
126 RETURN
127 END SUBROUTINE DQAG_CHECK
129 END MODULE DISPL_CALC