1 | SUBROUTINE PYPSVFCJ(NPTS,DTT,TTHETA,SIG,GAM,SPH,PRFUNC) |
---|
2 | C DTT in degrees |
---|
3 | C TTHETA in degrees |
---|
4 | C SPH is S/L + H/L |
---|
5 | C RETURNS FUNCTION ONLY |
---|
6 | Cf2py intent(in) NPTS |
---|
7 | Cf2py intent(in) DTT |
---|
8 | cf2py depend(NPTS) DTT |
---|
9 | Cf2py intent(in) TTHETA |
---|
10 | Cf2py intent(in) SIG |
---|
11 | Cf2py intent(in) GAM |
---|
12 | Cf2py intent(in) SPH |
---|
13 | Cf2py intent(out) PRFUNC |
---|
14 | Cf2py depend(NPTS) PRFUNC |
---|
15 | |
---|
16 | REAL*4 DTT(0:NPTS-1),PRFUNC(0:NPTS-1) |
---|
17 | REAL*4 TTHETA,SIG,GAM,SPH |
---|
18 | INTEGER*4 NPTS,I |
---|
19 | DO I=0,NPTS-1 |
---|
20 | CALL PSVFCJ(DTT(I)*100.,TTHETA*100.,SIG,GAM,SPH, |
---|
21 | 1 PRFUNC(I),DPRDT,SIGPART,GAMPART,SLPART) |
---|
22 | END DO |
---|
23 | RETURN |
---|
24 | END |
---|
25 | |
---|
26 | SUBROUTINE PYDPSVFCJ(NPTS,DTT,TTHETA,SIG,GAM,SPH,PRFUNC, |
---|
27 | 1 DPRDT,SIGPART,GAMPART,SLPART) |
---|
28 | C DTT in degrees |
---|
29 | C TTHETA in degrees |
---|
30 | C SPH is S/L + H/L |
---|
31 | C RETURNS FUNCTION & DERIVATIVES |
---|
32 | Cf2py intent(in) NPTS |
---|
33 | Cf2py intent(in) DTT |
---|
34 | cf2py depend(NPTS) DTT |
---|
35 | Cf2py intent(in) TTHETA |
---|
36 | Cf2py intent(in) SIG |
---|
37 | Cf2py intent(in) GAM |
---|
38 | Cf2py intent(in) SPH |
---|
39 | Cf2py intent(out) PRFUNC |
---|
40 | Cf2py depend(NPTS) PRFUNC |
---|
41 | Cf2py intent(out) DPRDT |
---|
42 | Cf2py depend(NPTS) DPRDT |
---|
43 | Cf2py intent(out) SIGPART |
---|
44 | Cf2py depend(NPTS) SIGPART |
---|
45 | Cf2py intent(out) GAMPART |
---|
46 | Cf2py depend(NPTS) GAMPART |
---|
47 | Cf2py intent(out) SLPART |
---|
48 | Cf2py depend(NPTS) SLPART |
---|
49 | |
---|
50 | INTEGER*4 NPTS |
---|
51 | REAL*4 TTHETA,SIG,GAM,SPH |
---|
52 | REAL*4 DTT(0:NPTS-1),DPRDT(0:NPTS-1),SIGPART(0:NPTS-1), |
---|
53 | 1 GAMPART(0:NPTS-1),SLPART(0:NPTS-1),PRFUNC(0:NPTS-1) |
---|
54 | DO I=0,NPTS-1 |
---|
55 | CALL PSVFCJ(DTT(I)*100.,TTHETA*100.,SIG,GAM,SPH, |
---|
56 | 1 PRFUNC(I),DPRDT(I),SIGPART(I),GAMPART(I),SLPART(I)) |
---|
57 | DPRDT(I) = DPRDT(I)*100. |
---|
58 | END DO |
---|
59 | RETURN |
---|
60 | END |
---|
61 | |
---|
62 | SUBROUTINE PYPSVFCJO(NPTS,DTT,TTHETA,SIG,GAM,SPH,PRFUNC) |
---|
63 | C DTT in degrees |
---|
64 | C TTHETA in degrees |
---|
65 | C SPH is S/L + H/L |
---|
66 | C RETURNS FUNCTION ONLY |
---|
67 | Cf2py intent(in) NPTS |
---|
68 | Cf2py intent(in) DTT |
---|
69 | cf2py depend(NPTS) DTT |
---|
70 | Cf2py intent(in) TTHETA |
---|
71 | Cf2py intent(in) SIG |
---|
72 | Cf2py intent(in) GAM |
---|
73 | Cf2py intent(in) SPH |
---|
74 | Cf2py intent(out) PRFUNC |
---|
75 | Cf2py depend(NPTS) PRFUNC |
---|
76 | |
---|
77 | INTEGER*4 NPTS |
---|
78 | REAL*4 TTHETA,SIG,GAM,SPH |
---|
79 | REAL*4 DTT(0:NPTS-1),PRFUNC(0:NPTS-1) |
---|
80 | DO I=0,NPTS-1 |
---|
81 | CALL PSVFCJO(DTT(I)*100.,TTHETA*100.,SIG,GAM,SPH/2.0,SPH/2.0, |
---|
82 | 1 PRFUNC(I),DPRDT,SIGPART,GAMPART,SLPART,HLPART) |
---|
83 | END DO |
---|
84 | RETURN |
---|
85 | END |
---|
86 | |
---|
87 | SUBROUTINE PYDPSVFCJO(NPTS,DTT,TTHETA,SIG,GAM,SHL,PRFUNC, |
---|
88 | 1 DPRDT,SIGPART,GAMPART,SLPART) |
---|
89 | C DTT in degrees |
---|
90 | C TTHETA in degrees |
---|
91 | C SPH is S/L + H/L |
---|
92 | C RETURNS FUNCTION & DERIVATIVES |
---|
93 | Cf2py intent(in) NPTS |
---|
94 | Cf2py intent(in) DTT |
---|
95 | cf2py depend(NPTS) DTT |
---|
96 | Cf2py intent(in) TTHETA |
---|
97 | Cf2py intent(in) SIG |
---|
98 | Cf2py intent(in) GAM |
---|
99 | Cf2py intent(in) SHL |
---|
100 | Cf2py intent(out) PRFUNC |
---|
101 | Cf2py depend(NPTS) PRFUNC |
---|
102 | Cf2py intent(out) DPRDT |
---|
103 | Cf2py depend(NPTS) DPRDT |
---|
104 | Cf2py intent(out) SIGPART |
---|
105 | Cf2py depend(NPTS) SIGPART |
---|
106 | Cf2py intent(out) GAMPART |
---|
107 | Cf2py depend(NPTS) GAMPART |
---|
108 | Cf2py intent(out) SLPART |
---|
109 | Cf2py depend(NPTS) SLPART |
---|
110 | |
---|
111 | INTEGER*4 NPTS |
---|
112 | REAL*4 TTHETA,SIG,GAM,SHL |
---|
113 | REAL*4 DTT(0:NPTS-1),DPRDT(0:NPTS-1),SIGPART(0:NPTS-1), |
---|
114 | 1 GAMPART(0:NPTS-1),SLPART(0:NPTS-1),PRFUNC(0:NPTS-1) |
---|
115 | DO I=0,NPTS-1 |
---|
116 | CALL PSVFCJO(DTT(I)*100.,TTHETA*100.,SIG,GAM,SHL/2.,SHL/2., |
---|
117 | 1 PRFUNC(I),DPRDT(I),SIGPART(I),GAMPART(I),SPART,HPART) |
---|
118 | SLPART(I) = SPART |
---|
119 | DPRDT(I) = DPRDT(I)*100. |
---|
120 | END DO |
---|
121 | RETURN |
---|
122 | END |
---|
123 | |
---|
124 | SUBROUTINE PYEPSVOIGT(NPTS,DTT,ALP,BET,SIG,GAM,PRFUNC) |
---|
125 | C DTT in microsec |
---|
126 | C RETURNS FUNCTION |
---|
127 | Cf2py intent(in) NPTS |
---|
128 | Cf2py intent(in) DTT |
---|
129 | cf2py depend(NPTS) DTT |
---|
130 | Cf2py intent(in) ALP |
---|
131 | Cf2py intent(in) BET |
---|
132 | Cf2py intent(in) SIG |
---|
133 | Cf2py intent(in) GAM |
---|
134 | Cf2py intent(out) PRFUNC |
---|
135 | Cf2py depend(NPTS) PRFUNC |
---|
136 | |
---|
137 | INTEGER*4 NPTS |
---|
138 | REAL*4 ALP,BET,SIG,GAM,SHL |
---|
139 | REAL*4 DTT(0:NPTS-1),PRFUNC(0:NPTS-1),DPRDT,ALPPART, |
---|
140 | 1 BETPART,SIGPART,GAMPART |
---|
141 | DO I=0,NPTS-1 |
---|
142 | CALL EPSVOIGT(DTT(I),ALP,BET,SIG,GAM,PRFUNC(I),DPRDT, |
---|
143 | 1 ALPPART,BETPART,SIGPART,GAMPART) |
---|
144 | END DO |
---|
145 | RETURN |
---|
146 | END |
---|
147 | |
---|
148 | SUBROUTINE PYDEPSVOIGT(NPTS,DTT,ALP,BET,SIG,GAM,PRFUNC, |
---|
149 | 1 DPRDT,ALPPART,BETPART,SIGPART,GAMPART) |
---|
150 | C DTT in microsec |
---|
151 | C RETURNS FUNCTION & DERIVATIVES |
---|
152 | Cf2py intent(in) NPTS |
---|
153 | Cf2py intent(in) DTT |
---|
154 | cf2py depend(NPTS) DTT |
---|
155 | Cf2py intent(in) ALP |
---|
156 | Cf2py intent(in) BET |
---|
157 | Cf2py intent(in) SIG |
---|
158 | Cf2py intent(in) GAM |
---|
159 | Cf2py intent(out) PRFUNC |
---|
160 | Cf2py depend(NPTS) PRFUNC |
---|
161 | Cf2py intent(out) DPRDT |
---|
162 | Cf2py depend(NPTS) DPRDT |
---|
163 | Cf2py intent(out) ALPPART |
---|
164 | Cf2py depend(NPTS) ALPPART |
---|
165 | Cf2py intent(out) BETPART |
---|
166 | Cf2py depend(NPTS) BETPART |
---|
167 | Cf2py intent(out) SIGPART |
---|
168 | Cf2py depend(NPTS) SIGPART |
---|
169 | Cf2py intent(out) GAMPART |
---|
170 | Cf2py depend(NPTS) GAMPART |
---|
171 | |
---|
172 | INTEGER*4 NPTS |
---|
173 | REAL*4 ALP,BET,SIG,GAM,SHL |
---|
174 | REAL*4 DTT(0:NPTS-1),DPRDT(0:NPTS-1),ALPPART(0:NPTS-1), |
---|
175 | 1 BETPART(0:NPTS-1),SIGPART(0:NPTS-1), |
---|
176 | 1 GAMPART(0:NPTS-1),PRFUNC(0:NPTS-1) |
---|
177 | DO I=0,NPTS-1 |
---|
178 | CALL EPSVOIGT(DTT(I),ALP,BET,SIG,GAM,PRFUNC(I),DPRDT(I), |
---|
179 | 1 ALPPART(I),BETPART(I),SIGPART(I),GAMPART(I)) |
---|
180 | END DO |
---|
181 | RETURN |
---|
182 | END |
---|
183 | |
---|
184 | C Fortran (fast) linear interpolation -- B.H. Toby 9/2011 |
---|
185 | SUBROUTINE PYFINTERP(NIN,XIN,YIN,NOUT,XOUT,YOUT) |
---|
186 | C XIN(1:NIN) and YIN(1:NIN) are arrays of (x,y) points to be interpolated |
---|
187 | C Values must be sorted increasing in XIN |
---|
188 | C XOUT(1:NOUT) is an array of x values, must also be sorted increasing in x |
---|
189 | C XOUT may contain values smaller than XIN(1) or larger than XIN(NIN) |
---|
190 | C RETURNS interpolated y values corresponding to XOUT. Values outside the |
---|
191 | C range of XIN are set to zero. |
---|
192 | C Needs a way to signal an error if XIN or XOUT is not sorted -- for now stops |
---|
193 | Cf2py intent(in) NIN |
---|
194 | Cf2py intent(in) XIN |
---|
195 | cf2py depend(NIN) XIN |
---|
196 | Cf2py intent(in) YIN |
---|
197 | cf2py depend(NIN) YIN |
---|
198 | Cf2py intent(in) NOUT |
---|
199 | Cf2py intent(in) XOUT |
---|
200 | cf2py depend(NOUT) XOUT |
---|
201 | Cf2py intent(out) YOUT |
---|
202 | cf2py depend(NOUT) YOUT |
---|
203 | |
---|
204 | INTEGER NIN,NOUT |
---|
205 | REAL XIN(NIN),YIN(NIN) |
---|
206 | REAL XOUT(NOUT),YOUT(NOUT) |
---|
207 | INTEGER IERROR |
---|
208 | REAL X,F |
---|
209 | INTEGER IIN,I |
---|
210 | |
---|
211 | IERROR = 1 |
---|
212 | IIN = 1 |
---|
213 | X = XOUT(1) |
---|
214 | DO I=1,NOUT |
---|
215 | IF (X .GT. XOUT(I)) STOP ! test if Xout not sorted |
---|
216 | X = XOUT(I) |
---|
217 | IF (X .LT. XIN(1) .OR. X .GT. XIN(NIN) ) THEN |
---|
218 | YOUT(I) = 0.0 |
---|
219 | ELSE |
---|
220 | DO WHILE (X .GT. XIN(IIN+1)) |
---|
221 | IF (XIN(IIN) .GT. XIN(IIN+1)) STOP ! test if Xin not sorted |
---|
222 | IIN = IIN + 1 |
---|
223 | ENDDO |
---|
224 | F = (X - XIN(IIN)) / (XIN(IIN+1) - XIN(IIN)) |
---|
225 | YOUT(I) = (1.-F)*YIN(IIN) + F*YIN(IIN+1) |
---|
226 | ENDIF |
---|
227 | !write (*,*) xout(i),iin,f,yout(i) |
---|
228 | END DO |
---|
229 | IERROR = 0 |
---|
230 | RETURN |
---|
231 | END |
---|