68
69
70
71 USE python_funct_mod
72 USE my_alloc_mod
79 USE sensor_mod
81 USE read_sensor_python_mod, ONLY : read_sensor_python
83
84
85
86#include "implicit_f.inc"
87
88
89
90#include "param_c.inc"
91#include "scr17_c.inc"
92#include "com04_c.inc"
93#include "units_c.inc"
94
95
96
97 TYPE(PYTHON_), intent(inout) :: PYTHON
98 INTEGER ,INTENT(IN) ::
99 INTEGER ,INTENT(OUT) :: HM_NSENS
100 INTEGER ,DIMENSION(*) ,INTENT(IN) :: ITABM1
101 INTEGER ,DIMENSION(3,*) ,INTENT(IN) :: LACCELM,LGAUGE
102 INTEGER ,DIMENSION(LISKN,*) ,INTENT(IN) :: ISKWN
103 INTEGER ,DIMENSION(LIPART1,*) ,INTENT(IN) ::
104 my_real ,
DIMENSION(LSKEW,*) :: skew
106 TYPE (SENSORS_) ,INTENT(INOUT) ,TARGET :: SENSORS
107 TYPE (SURF_) ,DIMENSION(NSURF+NSETS) :: IGRSURF
108 TYPE (GROUP_) ,DIMENSION(NGRNOD) :: IGRNOD
109 TYPE (SUBSET_) ,DIMENSION(NSUBS) :: SUBSET
110 TYPE (SUBMODEL_DATA) ,DIMENSION(NSUBMOD) ::
111 TYPE (UNIT_TYPE_) ,INTENT(IN) ::UNITAB
112 TYPE(SENSOR_USER_STRUCT_) ,INTENT(INOUT) :: SENSOR_USER_STRUCT
113
114
115
116 INTEGER USR2SYS
117
118
119
120 INTEGER ISEN,IUNIT,IFLAGUNIT,NS,TYP,UNIT_ID,SENS_ID
122 CHARACTER(LEN=NCHARTITLE) :: TITR
123 CHARACTER KEY*40,MESS*40
124 INTEGER ,DIMENSION(:) ,ALLOCATABLE :: SID
125 TYPE(PYTHON_FUNCTION), DIMENSION(:), ALLOCATABLE :: temp
126 DATA mess/'SENSOR DEFINITION '/
127
128
129
132 IF(ns > 0) THEN
133 call python_initialize(python_error)
134 if(.not. allocated(python%functs)) then
135 allocate(python%functs(ns))
136 else
137 allocate(temp(python%nb_functs + ns))
138 temp(1:python%nb_functs) = python%functs
139 CALL move_alloc(from=temp,to=python%functs)
140 endif
141 END IF
142 IF (hm_nsens > 0) THEN
143 WRITE(istdo,'(A)')' .. SENSORS'
144 WRITE (iout,'(///,A)')' SENSORS'
145 WRITE (iout,'(A/)') ' -------'
146 END IF
147
148 IF (ALLOCATED(sensors%SENSOR_TAB)) DEALLOCATE(sensors%SENSOR_TAB)
149 ALLOCATE(sensors%SENSOR_TAB(hm_nsens))
150 CALL my_alloc (sid,hm_nsens)
151 sensors%NSENSOR = hm_nsens
152
154
156
157
158
159 DO isen = 1,hm_nsens
160
162 . option_id = sens_id,
163 . option_titr = titr ,
164 . unit_id = unit_id ,
165 . keyword2 = key )
166
167
168
169 iflagunit = 0
170 DO iunit=1,unitab%NUNITS
171 IF (unitab%UNIT_ID(iunit) == unit_id) THEN
172 iflagunit = 1
173 EXIT
174 ENDIF
175 ENDDO
176 IF (unit_id > 0 .AND. iflagunit == 0) THEN
177 CALL ancmsg(msgid=659,anmode=aninfo,msgtype=msgerror,
178 . i2=unit_id,i1=sens_id,
179 . c1='SENSOR', c2='SENSOR', c3='TITR')
180 ENDIF
181
182 key = key(1:len_trim(key))
183
184 SELECT CASE(key)
185
186 CASE ('TIME' ,'TYPE0')
188
189 CASE ('ACCE' ,'TYPE1')
191 . laccelm ,unitab ,lsubmodel)
192
193 CASE ('DIST' ,'TYPE2')
195 . itabm1 ,unitab ,lsubmodel)
196
197 CASE ('SENS' ,'TYPE3')
199
200 CASE ('AND' ,'TYPE4')
201 CALL read_sensor_and(sensors%SENSOR_TAB(isen) ,sens_id ,unitab ,lsubmodel)
202
203 CASE ('OR' ,'TYPE5')
204 CALL read_sensor_or(sensors%SENSOR_TAB(isen) ,sens_id ,unitab ,lsubmodel)
205
206 CASE ('INTER' ,'TYPE6')
208 . unitab ,lsubmodel)
209
210 CASE ('RWALL' ,'TYPE7')
212 . unitab ,lsubmodel)
213
214 CASE ('NOT' ,'TYPE8')
215 CALL read_sensor_not(sensors%SENSOR_TAB(isen) ,sens_id ,unitab ,lsubmodel)
216
217 CASE ('VEL' ,'TYPE9')
219 . itabm1 ,unitab ,lsubmodel)
220
221 CASE ('GAUGE' ,'TYPE10')
223 . lgauge ,unitab ,lsubmodel)
224
225 CASE ('RBODY' ,'TYPE11')
227 . unitab ,lsubmodel)
228
229 CASE ('SECT' ,'TYPE12')
231 . unitab ,lsubmodel)
232
233 CASE ('WORK' ,'TYPE13')
235 . itabm1 ,unitab ,lsubmodel)
236
237 CASE ('ENERGY' ,'TYPE14')
239 . ipart ,subset ,unitab ,lsubmodel)
240
241 CASE ('DIST_SURF' ,'TYPE15')
243 . itabm1 ,unitab ,lsubmodel)
244
245 CASE ('HIC' ,'TYPE16')
247 . laccelm ,unitab
248
249 CASE ('TEMP')
251 . igrnod ,unitab ,lsubmodel)
252
253 CASE ('NIC_NIJ')
255 . sensors%SENSOR_TAB(isen) ,sens_id ,titr ,iskwn ,
256 . unitab ,lsubmodel )
257
258 CASE ('USER1' ,'USER2','USER3')
259
260 sensors%SENSOR_TAB(isen)%TSTART = infinity
261
263 . unitab ,lsubmodel ,key ,unit_id ,sens_id ,
264 . sensors%SENSOR_TAB(isen),sensor_user_struct)
265 sensors%SENSOR_TAB(isen)%SENS_ID = sens_id
266 CASE('PYTHON')
267 CALL read_sensor_python(python,
268 . sensors%SENSOR_TAB(isen) ,sens_id , lsubmodel )
269
270 CASE DEFAULT
271 CALL ancmsg(msgid=43, anmode=aninfo, msgtype=msgerror,
272 . c2=key(1:len_trim(key)),
273 . i1=sens_id,
274 . c1=titr)
275 END SELECT
276
277 sensors%SENSOR_TAB(isen)%TITLE = titr
278
279 END DO
280
281
282
283 DO isen = 1,sensors%NSENSOR
284 IF (sensors%SENSOR_TAB(isen)%SENS_ID > 0) THEN
285 sid(isen) = sensors%SENSOR_TAB(isen)%SENS_ID
286 END IF
287 END DO
288 CALL udouble(sid,1,sensors%NSENSOR,mess,0,bid)
289 DEALLOCATE(sid)
290
291 RETURN
subroutine hm_option_count(entity_type, hm_option_number)
subroutine hm_option_start(entity_type)
integer, parameter nchartitle
subroutine read_sensor_acc(sensor_ptr, sens_id, titr, laccelm, unitab, lsubmodel)
subroutine read_sensor_and(sensor_ptr, sens_id, unitab, lsubmodel)
subroutine read_sensor_disp(sensor_ptr, sens_id, itabm1, unitab, lsubmodel)
subroutine read_sensor_dist_surf(sensor_ptr, sens_id, itabm1, unitab, lsubmodel)
subroutine read_sensor_energy(sensor_ptr, sens_id, titr, ipart, subset, unitab, lsubmodel)
subroutine read_sensor_gauge(sensor_ptr, sens_id, titr, lgauge, unitab, lsubmodel)
subroutine read_sensor_hic(sensor_ptr, sens_id, titr, laccelm, unitab, lsubmodel)
subroutine read_sensor_nic(sensor_ptr, sens_id, titr, iskn, unitab, lsubmodel)
subroutine read_sensor_not(sensor_ptr, sens_id, unitab, lsubmodel)
subroutine read_sensor_or(sensor_ptr, sens_id, unitab, lsubmodel)
subroutine read_sensor_rbody(sensor_ptr, sens_id, titr, unitab, lsubmodel)
subroutine read_sensor_rwall(sensor_ptr, sens_id, titr, unitab, lsubmodel)
subroutine read_sensor_sect(sensor_ptr, sens_id, titr, unitab, lsubmodel)
subroutine read_sensor_sens(sensor_ptr, sens_id, unitab, lsubmodel)
subroutine read_sensor_temp(sensor_ptr, sens_id, titr, igrnod, unitab, lsubmodel)
subroutine read_sensor_time(sensor_ptr, sens_id, unitab, lsubmodel)
subroutine read_sensor_user(hm_nsensor, isen, title, unitab, lsubmodel, key, unit_id, sens_id, sensor_ptr, sensor_user_struct)
subroutine read_sensor_vel(sensor_ptr, sens_id, itabm1, unitab, lsubmodel)
subroutine read_sensor_work(sensor_ptr, sens_id, itabm1, unitab, lsubmodel)
subroutine sensor_tab_init(sensors)
subroutine ancmsg(msgid, msgtype, anmode, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, r1, r2, r3, r4, r5, r6, r7, r8, r9, c1, c2, c3, c4, c5, c6, c7, c8, c9, prmode)
subroutine udouble(list, ilist, nlist, mess, ir, rlist)