OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
read_sensor_gauge.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23!||====================================================================
24!|| read_sensor_gauge ../starter/source/tools/sensor/read_sensor_gauge.F
25!||--- called by ------------------------------------------------------
26!|| hm_read_sensors ../starter/source/tools/sensor/hm_read_sensors.F
27!||--- calls -----------------------------------------------------
28!|| ancmsg ../starter/source/output/message/message.F
29!|| hm_get_float_array_index ../starter/source/devtools/hm_reader/hm_get_float_array_index.f
30!|| hm_get_floatv ../starter/source/devtools/hm_reader/hm_get_floatv.F
31!|| hm_get_int_array_index ../starter/source/devtools/hm_reader/hm_get_int_array_index.F
32!|| hm_get_intv ../starter/source/devtools/hm_reader/hm_get_intv.F
33!||--- uses -----------------------------------------------------
34!|| hm_option_read_mod ../starter/share/modules1/hm_option_read_mod.F
35!|| message_mod ../starter/share/message_module/message_mod.f
36!|| submodel_mod ../starter/share/modules1/submodel_mod.F
37!||====================================================================
38 SUBROUTINE read_sensor_gauge(SENSOR_PTR ,SENS_ID ,TITR ,
39 . LGAUGE ,UNITAB ,LSUBMODEL )
40C-----------------------------------------------
41C M o d u l e s
42C-----------------------------------------------
43 USE unitab_mod
44 USE message_mod
45 USE submodel_mod
46 USE sensor_mod
49C-----------------------------------------------
50C I m p l i c i t T y p e s
51C-----------------------------------------------
52#include "implicit_f.inc"
53C-----------------------------------------------
54C C o m m o n B l o c k s
55C-----------------------------------------------
56#include "com04_c.inc"
57#include "units_c.inc"
58C-----------------------------------------------
59C D u m m y A r g u m e n t s
60C-----------------------------------------------
61 INTEGER ,INTENT(IN) :: SENS_ID
62 INTEGER ,DIMENSION(3,*) ,INTENT(IN) :: LGAUGE
63 CHARACTER(LEN=NCHARTITLE)::TITR
64 TYPE (SENSOR_STR_) :: SENSOR_PTR
65 TYPE (SUBMODEL_DATA) ,DIMENSION(NSUBMOD) :: LSUBMODEL
66 TYPE (UNIT_TYPE_) ,INTENT(IN) ::UNITAB
67C-----------------------------------------------
68C L o c a l V a r i a b l e s
69C-----------------------------------------------
70 INTEGER :: I,J,NGAU,NPARIS,NPARRS,NVAR,SENS_TYPE
71 my_real :: tdel
72 INTEGER ,DIMENSION(6) :: IGAU,G_ID
73 my_real ,DIMENSION(6) :: pres,tmin
74 LOGICAL :: IS_AVAILABLE
75C--------------------------------
76C SENSOR : PRESSURE GAUGE LIST
77C=======================================================================
78 is_available = .false.
79 sens_type = 10
80c--------------------------------------------------
81card1
82 CALL hm_get_floatv('Tdelay' ,tdel ,is_available,lsubmodel,unitab)
83card2
84 CALL hm_get_intv ('NIP' ,ngau ,is_available,lsubmodel)
85card3...
86 DO i=1,min(ngau,6)
87 CALL hm_get_int_array_index ('GaugeArrayIds',g_id(i),i,is_available,lsubmodel)
88 CALL hm_get_float_array_index('Fporp' ,pres(i),i,is_available,lsubmodel,unitab)
89 CALL hm_get_float_array_index('Fport' ,tmin(i),i,is_available,lsubmodel,unitab)
90 ENDDO
91c--------------------------------------------------
92 IF (ngau > 6) THEN
93 CALL ancmsg(msgid=833, msgtype=msgerror, anmode=aninfo, i1=sens_id,c1=titr)
94 ENDIF
95c
96 DO i=1,ngau
97 igau(i) = 0
98 DO j = 1,nbgauge
99 IF (g_id(i) == lgauge(2,j)) THEN
100 igau(i) = j
101 EXIT
102 ENDIF
103 ENDDO
104 IF (igau(i) == 0) THEN
105 CALL ancmsg(msgid=834, msgtype=msgerror, anmode=aninfo_blind_2,
106 . i1=sens_id, c1=titr)
107 EXIT
108 END IF
109 ENDDO
110c--------------------------------------------------
111c
112 sensor_ptr%TYPE = sens_type
113 sensor_ptr%SENS_ID = sens_id
114 sensor_ptr%STATUS = 0 ! status = deactivated
115 sensor_ptr%TSTART = infinity
116 sensor_ptr%TCRIT = infinity
117 sensor_ptr%TMIN = zero ! TMIN global
118 sensor_ptr%TDELAY = tdel ! time delay before activation
119 sensor_ptr%VALUE = zero
120
121 nparis = ngau + 1
122 nparrs = ngau * 3
123 nvar = 0
124c
125 sensor_ptr%NPARI = nparis
126 sensor_ptr%NPARR = nparrs
127 sensor_ptr%NVAR = nvar
128c
129 ALLOCATE (sensor_ptr%IPARAM(nparis))
130 ALLOCATE (sensor_ptr%RPARAM(nparrs))
131 ALLOCATE (sensor_ptr%VAR(nvar))
132 sensor_ptr%VAR(:) = zero
133c
134 sensor_ptr%IPARAM(1) = ngau
135 DO i = 1,ngau
136 sensor_ptr%IPARAM(i+1) = igau(i)
137 END DO
138 j = 0
139 DO i = 1,ngau
140 sensor_ptr%RPARAM(j+1) = pres(i)
141 sensor_ptr%RPARAM(j+2) = tmin(i)
142 sensor_ptr%RPARAM(j+3) = infinity
143 j = j+3
144 END DO
145c------------------------------------------------------------
146 WRITE(iout, 1000) sens_id,tdel
147 WRITE(iout, 2000) ngau
148 DO i = 1,ngau
149 WRITE(iout, 3000) g_id(i),pres(i),tmin(i)
150 END DO
151c------------------------------------------------------------
152 1000 FORMAT(
153 . 5x,' sensor TYPE 10: pressure gauge '/,
154 . 5X,' ------------------------------ '/,
155 . 5X,'sensor id. . . . . . . . . . . . . . . . .=',I10/
156 . 5X,'time delay before activation . . . . . . .=',E12.4)
157 2000 FORMAT(
158 . 5X,'number of gauges . . . . . . . . . . . . .=',I10)
159 3000 FORMAT(
160 . 5X,' gauge id . . . . . . . . . . . . . . .=',I10/
161 . 5X,' min pressure for activation . . . . . .=',E12.4/
162 . 5X,' minimum pres. duration for activation .=',E12.4/)
163c-----------
164 RETURN
165 END
#define my_real
Definition cppsort.cpp:32
subroutine hm_get_float_array_index(name, rval, index, is_available, lsubmodel, unitab)
subroutine hm_get_floatv(name, rval, is_available, lsubmodel, unitab)
subroutine hm_get_int_array_index(name, ival, index, is_available, lsubmodel)
subroutine hm_get_intv(name, ival, is_available, lsubmodel)
#define min(a, b)
Definition macros.h:20
initmumps id
for(i8=*sizetab-1;i8 >=0;i8--)
integer, parameter nchartitle
subroutine read_sensor_gauge(sensor_ptr, sens_id, titr, lgauge, unitab, lsubmodel)
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
program starter
Definition starter.F:39