35
36
37
38
39
40
41
43
44
45
46#include "implicit_f.inc"
47
48
49
50 INTEGER ,INTENT(IN) :: NFUNC
51 INTEGER ,INTENT(INOUT) :: LMAX
52 INTEGER ,DIMENSION(NFUNC) :: LENGTH
53 my_real ,
DIMENSION(NFUNC) ,
INTENT(IN) :: rate
54 my_real ,
DIMENSION(LMAX,NFUNC) ,
INTENT(IN) :: xi
55 my_real ,
DIMENSION(LMAX,NFUNC) ,
INTENT(IN) :: yi
56 TYPE(TABLE_4D_) ,INTENT(INOUT) :: TABLE
57
58
59
60 INTEGER :: I,,IPT,NPTX,NPTM,IPOS,NDIM,FUNC_ID,IERROR,STAT
61 INTEGER ,DIMENSION(NFUNC) :: PERM
62 INTEGER ,PARAMETER :: NPTMAX = 100
64 my_real ,
DIMENSION(:) ,
ALLOCATABLE :: xf,xs,ys
65 my_real ,
DIMENSION(:,:) ,
ALLOCATABLE :: yf
66
67
68
69 nptx = 0
70 DO i = 1,nfunc
71 nptx = nptx + length(i)
72 END DO
73 ALLOCATE (xf(nptx))
74
75 IF (nfunc == 1) THEN
76 ALLOCATE (yf(nptx,nfunc))
77 xf(1:nptx) = xi(1:nptx,1)
78 yf(1:nptx,1) = yi(1:nptx,1)
79
80 ELSE
81
82
83
84
86
87 ALLOCATE (yf(nptx,nfunc))
88 DO i = 1,nfunc
90 END DO
91
92
93
94
95
97
98 END IF
99
100
101
102 DO i = 1,nfunc
103 DO ipt = 2,nptx
104 IF (yf(ipt,i) < yf(ipt-1,i)) THEN
105 yf(ipt,i) = yf(ipt-1,i)
106 END IF
107 END DO
108 END DO
109
110
111
112
113 IF (nptx > nptmax) THEN
114 nptm = nptx
115 ALLOCATE (xs(nptm))
116 ALLOCATE (ys(nptm))
117 xs(1:nptm) = xf(1:nptm)
118 CALL vw_smooth(nptx,nptmax,xf,yf(1:nptx,1))
119
120 DO i = 2,nfunc
121 ys(1:nptm) = yf(1:nptm,i)
123 END DO
124 DEALLOCATE(ys)
125 DEALLOCATE(xs)
126 END IF
127
128
129
131 table%NDIM = ndim
132 ALLOCATE (table%X(ndim) ,stat=stat)
133 ALLOCATE (table%X(1)%VALUES(nptx) ,stat=stat)
134 IF (nfunc == 1) THEN
135 ALLOCATE (table%Y1D(nptx) ,stat=stat)
136 table%X(1)%VALUES(1:nptx) = xf(1:nptx)
137 table%Y1D(1:nptx) = yf(1:nptx,1)
138 ELSE
139 ALLOCATE (table%X(2)%VALUES(nfunc) ,stat=stat)
140 ALLOCATE (table%Y2D(nptx,nfunc) ,stat=stat)
141 table%X(1)%VALUES(1:nptx) = xf(1:nptx)
142 table%X(2)%VALUES(1:nfunc) = rate(1:nfunc)
143 DO i = 1,nfunc
144 table%Y2D(1:nptx,i) = yf(1:nptx
145 END DO
146 END IF
147
148 length(1:nfunc) = nptx
149
150 DEALLOCATE (xf)
151 DEALLOCATE (yf)
152
153 RETURN
subroutine func2d_deintersect(npt, nfunc, yy)
subroutine table_values_2d(len, nptf, xi, yi, xf, yf)
subroutine unify_abscissa_2d(nfunc, len, lmax, npt, xi, xf)
subroutine vw_smooth(npt, ntarget, x, y)