40
41
42
43 USE redef3_mod, only: get_python_funct_id
44 USE sensor_mod
45 use glob_therm_mod
46 USE python_funct_mod
47 USE vinter_mixed_mod
48
49
50
51#include "implicit_f.inc"
52
53
54
55#include "mvsiz_p.inc"
56
57
58
59#include "com01_c.inc"
60#include "com04_c.inc"
61#include "com08_c.inc"
62#include "param_c.inc"
63#include "parit_c.inc"
64
65
66
67 type(python_) :: PYTHON
68 type (glob_therm_) ,intent(inout) :: glob_therm
69 INTEGER ,INTENT(IN) :: NSENSOR
70 INTEGER NPC(*)
71 INTEGER IBFT(GLOB_THERM%NIFT,*)
73 my_real :: val(glob_therm%LFACTHER,*)
74 integer, intent(in) :: SNPC
75 TYPE (SENSOR_STR_) ,DIMENSION(NSENSOR) ,INTENT(IN) :: SENSOR_TAB
76
77
78
79 INTEGER I,N,L,II, NN,ISENS,IC, IDEB, ISMOOTH
80 INTEGER ILENC(MVSIZ), IPOSC(MVSIZ), IADC(MVSIZ)
81 INTEGER INDEX(MVSIZ)
82 my_real fac, facx, startt, stopt, ts
83 my_real yc(mvsiz), tsc(mvsiz), dydxc(mvsiz)
84 integer :: pyid
85 logical :: any_python_func
86
87 ideb = 0
88 ismooth = 0
89
90 DO nn=1,glob_therm%NFXTEMP,nvsiz
91 ic = 0
92 IF (nsensor > 0) THEN
93 DO ii = 1,
min(glob_therm%NFXTEMP - ideb,nvsiz)
94 n = ii+ideb
95 startt = val(1,n)
96 stopt = val(2,n)
97
98 isens = ibft(3,n)
99 IF (isens == 0)THEN
100 ts = tt*glob_therm%THEACCFACT - startt
101 ELSE
102 startt = startt + sensor_tab(isens)%TSTART
103 stopt = stopt + sensor_tab
104 ts = tt*glob_therm%THEACCFACT -(startt + sensor_tab(isens)%TSTART)
105 ENDIF
106
107 IF(tt*glob_therm%THEACCFACT < startt) cycle
108 IF(tt*glob_therm%THEACCFACT > stopt) cycle
109 facx = val(3,n)
110 i=iabs(ibft(1,n))
111 ic = ic + 1
112 index(ic)= n
113
114 tsc(ic) = ts*facx
115 ENDDO
116 ELSE
117
118 DO ii = 1,
min(glob_therm%NFXTEMP-ideb,nvsiz)
119 n = ii+ideb
120 startt = val(1,n)
121 stopt = val(2,n)
122 IF (tt*glob_therm%THEACCFACT < startt) cycle
123 IF (tt*glob_therm%THEACCFACT > stopt) cycle
124 facx = val(3,n)
125 i=iabs(ibft(1,n))
126 ic = ic + 1
127 index(ic) = n
128 ts = tt*glob_therm%THEACCFACT - startt
129 tsc(ic) = ts*facx
130 ENDDO
131 ENDIF
132
133 ideb = ideb +
min(glob_therm%NFXTEMP-ideb,nvsiz)
134
135 any_python_func = .false.
136 IF(ncycle == 0)THEN
137 DO ii=1,ic
138 n = index(ii)
139 l = ibft(2,n)
140 IF (l > 0) ismooth = npc(2*nfunct+l+1)
141 iposc(ii) = 0
142 pyid = get_python_funct_id(nfunct,l,npc,snpc)
143 if(pyid > 0) then
144 iadc(ii) =-pyid
145 ilenc(ii) =-pyid
146 any_python_func = .true.
147 else
148 iadc(ii) = npc(l) / 2 + 1
149 ilenc(ii) = npc(l+1) / 2 - iadc(ii) - iposc(ii)
150 endif
151 ENDDO
152 ELSE
153 DO ii=1,ic
154 n = index(ii)
155 l = ibft(2,n)
156 IF (l > 0) ismooth = npc(2*nfunct+l+1)
157 iposc(ii) = ibft(4,n)
158 pyid = get_python_funct_id(nfunct,l,npc,snpc)
159 if(pyid > 0) then
160 iadc(ii) =-pyid
161 ilenc(ii) =-pyid
162 any_python_func = .true.
163 else
164 iadc(ii) = npc(l) / 2 + 1
165 ilenc(ii) = npc(l+1) / 2 - iadc(ii) - iposc(ii)
166 endif
167 ENDDO
168 ENDIF
169
170 if(any_python_func) then
171 call vinter_mixed(python,tf,iadc,iposc,ilenc,ic,tsc,dydxc,yc)
172 else
173 IF (ismooth == 0) THEN
174 CALL vinter(tf,iadc,iposc,ilenc,ic,tsc,dydxc,yc)
175 ELSE
177 ENDIF
178 ENDIF ! if(any_python_func)
179
180 IF(ivector == 0) THEN
181 DO ii=1,ic
182 n = index(ii)
183 ibft(4,n) = iposc(ii)
184 fac = val(4,n)
185 yc(ii) = yc(ii) * fac
186 i=iabs(ibft(1,n))
187 temp(i) = yc(ii)
188 ENDDO
189 ELSE
190
191#include "vectorize.inc"
192 DO ii=1,ic
193 n = index(ii)
194 ibft(4,n) = iposc(ii)
195 fac = val(4,n)
196 yc(ii) = yc(ii) * fac
197 i=iabs(ibft(1,n))
198 temp(i) = yc(ii)
199 ENDDO
200 ENDIF
201
202 ENDDO
203
204 RETURN
subroutine vinter(tf, iad, ipos, ilen, nel, x, dydx, y)
subroutine vinter_smooth(tf, iad, ipos, ilen, nel0, x, dydx, y)