OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_read_sensors.F File Reference
#include "implicit_f.inc"
#include "param_c.inc"
#include "scr17_c.inc"
#include "com04_c.inc"
#include "units_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine hm_read_sensors (python, sensors, laccelm, itabm1, ipart, lgauge, subset, nsets, igrsurf, igrnod, bufsf, skew, iskwn, unitab, lsubmodel, hm_nsens, sensor_user_struct)

Function/Subroutine Documentation

◆ hm_read_sensors()

subroutine hm_read_sensors ( type(python_), intent(inout) python,
type (sensors_), intent(inout), target sensors,
integer, dimension(3,*), intent(in) laccelm,
integer, dimension(*), intent(in) itabm1,
integer, dimension(lipart1,*), intent(in) ipart,
integer, dimension(3,*), intent(in) lgauge,
type (subset_), dimension(nsubs) subset,
integer, intent(in) nsets,
type (surf_), dimension(nsurf+nsets) igrsurf,
type (group_), dimension(ngrnod) igrnod,
dimension(*) bufsf,
dimension(lskew,*) skew,
integer, dimension(liskn,*), intent(in) iskwn,
type (unit_type_), intent(in) unitab,
type (submodel_data), dimension(nsubmod) lsubmodel,
integer, intent(out) hm_nsens,
type(sensor_user_struct_), intent(inout) sensor_user_struct )

Definition at line 63 of file hm_read_sensors.F.

68C-----------------------------------------------
69C M o d u l e s
70C-----------------------------------------------
71 USE python_funct_mod
72 USE my_alloc_mod
73 USE unitab_mod
74 USE message_mod
75 USE groupdef_mod
77 USE surf_mod
78 USE submodel_mod
79 USE sensor_mod
81 USE read_sensor_python_mod, ONLY : read_sensor_python
83C-----------------------------------------------
84C I m p l i c i t T y p e s
85C-----------------------------------------------
86#include "implicit_f.inc"
87C-----------------------------------------------
88C C o m m o n B l o c k s
89C-----------------------------------------------
90#include "param_c.inc"
91#include "scr17_c.inc"
92#include "com04_c.inc"
93#include "units_c.inc"
94C-----------------------------------------------
95C D u m m y A r g u m e n t s
96C-----------------------------------------------
97 TYPE(PYTHON_), intent(inout) :: PYTHON
98 INTEGER ,INTENT(IN) :: NSETS
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) :: IPART
104 my_real ,DIMENSION(LSKEW,*) :: skew
105 my_real ,DIMENSION(*) :: bufsf
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) :: LSUBMODEL
111 TYPE (UNIT_TYPE_) ,INTENT(IN) ::UNITAB
112 TYPE(SENSOR_USER_STRUCT_) ,INTENT(INOUT) :: SENSOR_USER_STRUCT
113C-----------------------------------------------
114C E x t e r n a l F u n c t i o n s
115C-----------------------------------------------
116 INTEGER USR2SYS
117C-----------------------------------------------
118C L o c a l V a r i a b l e s
119C-----------------------------------------------
120 INTEGER ISEN,IUNIT,IFLAGUNIT,NS,TYP,UNIT_ID,SENS_ID
121 my_real :: bid
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 '/
127C=======================================================================
128c Initialize sensor data structure
129c---------------------------------------------
130 CALL hm_option_count('/SENSOR', hm_nsens)
131 CALL hm_option_count('/SENSOR/PYTHON', ns)
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
147c---------------------------------------------
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
152c
153 CALL sensor_tab_init(sensors)
154c
155 CALL hm_option_start('/SENSOR')
156c
157c---------------------------------------------------
158c
159 DO isen = 1,hm_nsens
160c
161 CALL hm_option_read_key(lsubmodel,
162 . option_id = sens_id,
163 . option_titr = titr ,
164 . unit_id = unit_id ,
165 . keyword2 = key )
166c--------------------------------------------------
167c CHECK IF UNIT_ID EXISTS
168c--------------------------------------------------
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
181c
182 key = key(1:len_trim(key))
183c-----------------------
184 SELECT CASE(key)
185c-----------------------
186 CASE ('TIME' ,'TYPE0')
187 CALL read_sensor_time(sensors%SENSOR_TAB(isen) ,sens_id ,unitab ,lsubmodel)
188c
189 CASE ('ACCE' ,'TYPE1')
190 CALL read_sensor_acc(sensors%SENSOR_TAB(isen) ,sens_id ,titr ,
191 . laccelm ,unitab ,lsubmodel)
192c
193 CASE ('DIST' ,'TYPE2')
194 CALL read_sensor_disp(sensors%SENSOR_TAB(isen) ,sens_id ,
195 . itabm1 ,unitab ,lsubmodel)
196c
197 CASE ('SENS' ,'TYPE3')
198 CALL read_sensor_sens(sensors%SENSOR_TAB(isen) ,sens_id ,unitab ,lsubmodel)
199c
200 CASE ('AND' ,'TYPE4')
201 CALL read_sensor_and(sensors%SENSOR_TAB(isen) ,sens_id ,unitab ,lsubmodel)
202c
203 CASE ('OR' ,'TYPE5')
204 CALL read_sensor_or(sensors%SENSOR_TAB(isen) ,sens_id ,unitab ,lsubmodel)
205c
206 CASE ('INTER' ,'TYPE6')
207 CALL read_sensor_contact(sensors%SENSOR_TAB(isen) ,sens_id ,titr ,
208 . unitab ,lsubmodel)
209c
210 CASE ('RWALL' ,'TYPE7')
211 CALL read_sensor_rwall(sensors%SENSOR_TAB(isen) ,sens_id ,titr ,
212 . unitab ,lsubmodel)
213c
214 CASE ('NOT' ,'TYPE8')
215 CALL read_sensor_not(sensors%SENSOR_TAB(isen) ,sens_id ,unitab ,lsubmodel)
216c
217 CASE ('VEL' ,'TYPE9')
218 CALL read_sensor_vel(sensors%SENSOR_TAB(isen) ,sens_id ,
219 . itabm1 ,unitab ,lsubmodel)
220c
221 CASE ('GAUGE' ,'TYPE10')
222 CALL read_sensor_gauge(sensors%SENSOR_TAB(isen) ,sens_id ,titr ,
223 . lgauge ,unitab ,lsubmodel)
224c
225 CASE ('RBODY' ,'TYPE11')
226 CALL read_sensor_rbody(sensors%SENSOR_TAB(isen) ,sens_id ,titr ,
227 . unitab ,lsubmodel)
228c
229 CASE ('SECT' ,'TYPE12')
230 CALL read_sensor_sect(sensors%SENSOR_TAB(isen) ,sens_id ,titr ,
231 . unitab ,lsubmodel)
232c
233 CASE ('WORK' ,'TYPE13')
234 CALL read_sensor_work(sensors%SENSOR_TAB(isen) ,sens_id ,
235 . itabm1 ,unitab ,lsubmodel)
236c
237 CASE ('ENERGY' ,'TYPE14')
238 CALL read_sensor_energy(sensors%SENSOR_TAB(isen) ,sens_id ,titr ,
239 . ipart ,subset ,unitab ,lsubmodel)
240c
241 CASE ('DIST_SURF' ,'TYPE15')
242 CALL read_sensor_dist_surf(sensors%SENSOR_TAB(isen) ,sens_id ,
243 . itabm1 ,unitab ,lsubmodel)
244c
245 CASE ('HIC' ,'TYPE16')
246 CALL read_sensor_hic(sensors%SENSOR_TAB(isen) ,sens_id ,titr ,
247 . laccelm ,unitab ,lsubmodel)
248c
249 CASE ('TEMP')
250 CALL read_sensor_temp(sensors%SENSOR_TAB(isen) ,sens_id ,titr ,
251 . igrnod ,unitab ,lsubmodel)
252c
253 CASE ('NIC_NIJ')
254 CALL read_sensor_nic(
255 . sensors%SENSOR_TAB(isen) ,sens_id ,titr ,iskwn ,
256 . unitab ,lsubmodel )
257c
258 CASE ('USER1' ,'USER2','USER3')
259
260 sensors%SENSOR_TAB(isen)%TSTART = infinity
261
262 CALL read_sensor_user(hm_nsens ,isen ,titr,
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
276c
277 sensors%SENSOR_TAB(isen)%TITLE = titr
278c-----------------
279 END DO ! NSENSOR
280c-------------------------------------
281c Recherche des ID doubles : activate this code when lecsen is removed
282c-------------------------------------
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)
290c-----------
291 RETURN
#define my_real
Definition cppsort.cpp:32
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_contact(sensor_ptr, sens_id, titr, 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)
Definition message.F:889
subroutine udouble(list, ilist, nlist, mess, ir, rlist)
Definition sysfus.F:589