1 |
cafagna |
3.1 |
* |
2 |
|
|
* $Id$ |
3 |
|
|
* |
4 |
|
|
* $Log$ |
5 |
|
|
* |
6 |
|
|
*CMZ : 3.00/00 09/04/2001 15.38.41 by Marialuigia Ambriola |
7 |
|
|
*-- Author : Marialuigia Ambriola 05/04/2001 |
8 |
|
|
REAL FUNCTION XTRINTER(S,Y,X,N) |
9 |
|
|
**************************************** |
10 |
|
|
* makes a linear interpolation |
11 |
|
|
* called by GPUSTEP |
12 |
|
|
**************************************** |
13 |
|
|
REAL X(N),Y(N),S,XX |
14 |
|
|
INTEGER N |
15 |
|
|
XTRINTER=0. |
16 |
|
|
XX=0. |
17 |
|
|
c PRINT*,'N,S',N,S |
18 |
|
|
c PRINT*,'Y=',Y |
19 |
|
|
DO I=2,N |
20 |
|
|
IF(S.EQ.Y(I-1)) THEN |
21 |
|
|
XX=X(I-1) |
22 |
|
|
GOTO 100 |
23 |
|
|
ENDIF |
24 |
|
|
IF(S.LT.Y(I).AND.S.GT.Y(I-1)) THEN |
25 |
|
|
XX=X(I-1)+(X(I)-X(I-1))*(S-Y(I-1))/(Y(I)-Y(I-1)) |
26 |
|
|
GOTO 100 |
27 |
|
|
ENDIF |
28 |
|
|
ENDDO |
29 |
|
|
100 XTRINTER=XX |
30 |
|
|
c PRINT*,'EXTRACTED ENERGY',XX |
31 |
|
|
RETURN |
32 |
|
|
END |