OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
table_values_2d.F File Reference
#include "my_real.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine table_values_2d (len, nptf, xi, yi, xf, yf)

Function/Subroutine Documentation

◆ table_values_2d()

subroutine table_values_2d ( integer, intent(in) len,
integer, intent(in) nptf,
intent(in) xi,
intent(in) yi,
intent(in) xf,
intent(out) yf )

Definition at line 29 of file table_values_2d.F.

30C-----------------------------------------------
31C D e s c r i p t i o n
32C-----------------------------------------------
33c use common abscissa vector to calculate new interpolated function values
34c NPTF >= LEN
35C-----------------------------------------------
36C I m p l i c i t T y p e s
37C-----------------------------------------------
38 implicit none
39C-----------------------------------------------
40C I n c l u d e F i l e s
41C-----------------------------------------------
42#include "my_real.inc"
43C-----------------------------------------------
44C D u m m y A r g u m e n t s
45C-----------------------------------------------
46 INTEGER ,INTENT(IN) :: LEN ! length of input X vector
47 INTEGER ,INTENT(IN) :: NPTF ! length of output X vector
48 my_real ,DIMENSION(LEN) ,INTENT(IN) :: xi ! initial X coordinates
49 my_real ,DIMENSION(LEN) ,INTENT(IN) :: yi ! initial Y values
50 my_real ,DIMENSION(NPTF) ,INTENT(IN) :: xf ! output X coordinates
51 my_real ,DIMENSION(NPTF) ,INTENT(OUT) :: yf ! output function values
52C-----------------------------------------------
53C L o c a l V a r i a b l e s
54C-----------------------------------------------
55 INTEGER :: IPT,IDX,IPTM1
56 my_real :: x1,x2,y1,y2,deri
57c=======================================================================
58 IF (nptf >= len) THEN
59 idx = 1
60 x1 = xi(idx)
61 y1 = yi(idx)
62 x2 = xi(idx+1)
63 y2 = yi(idx+1)
64 deri = (y2 - y1) / (x2 - x1)
65 DO ipt = 1,nptf
66 IF (xf(ipt) >= x2 .and. idx+1 < len) THEN
67 idx = idx + 1
68 x1 = x2
69 y1 = y2
70 x2 = xi(idx+1)
71 y2 = yi(idx+1)
72 deri = (y2 - y1) / (x2 - x1)
73 END IF
74 yf(ipt) = y1 + deri * (xf(ipt) - x1)
75 END DO
76 ELSE
77 idx = 1
78 x1 = xi(1)
79 y1 = yi(1)
80 x2 = xi(2)
81 y2 = yi(2)
82 deri = (y2 - y1) / (x2 - x1)
83 yf(1) = y1
84 iptm1 = 1
85 DO ipt = 2,len
86 IF (idx < nptf) THEN ! NPTF is the length of XF last IDX is updated bellow
87 IF (xf(idx+1) >= xi(iptm1) .and. xf(idx+1) <= xi(ipt) ) THEN ! XF(IDX+1) - the new X - must be between lower and upper bound of XI
88 ! IPTM1 is the lower bound of previous used IPT
89 idx = idx + 1
90 x1 = xi(iptm1)
91 y1 = yi(iptm1)
92 x2 = xi(ipt)
93 y2 = yi(ipt)
94 deri = (y2 - y1) / (x2 - x1)
95 yf(idx) = y1 + deri * (xf(idx) - x1)
96 iptm1 = ipt
97 ENDIF
98 END IF
99 END DO
100 END IF
101c-----------
102 RETURN
#define my_real
Definition cppsort.cpp:32