OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
sensor_and.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!|| sensor_and ../engine/source/tools/sensor/sensor_and.F
25!||--- called by ------------------------------------------------------
26!|| sensor_logical ../engine/source/tools/sensor/sensor_logical.F
27!||--- uses -----------------------------------------------------
28!|| sensor_mod ../common_source/modules/sensor_mod.F90
29!||====================================================================
30 SUBROUTINE sensor_and(NSENSOR,SENSOR_TAB,SENS)
31C-----------------------------------------------
32C ROUTINE DESCRIPTION :
33C ===================
34C AND sensor : IS1 && IS2
35C IS1 and IS2 are the sensors given as definition
36C----------------------------------------------------------------
37C DUMMY ARGUMENTS DESCRIPTION:
38C ===================
39C
40C NAME DESCRIPTION
41C
42C SENSOR_TAB Sensor Structure
43C SENS SENSOR ID to treat
44C-----------------------------------------------
45C M o d u l e s
46C-----------------------------------------------
47 USE sensor_mod
48C-----------------------------------------------
49C I m p l i c i t T y p e s
50C-----------------------------------------------
51#include "implicit_f.inc"
52C-----------------------------------------------
53C C o m m o n B l o c k s
54C-----------------------------------------------
55#include "com04_c.inc"
56#include "com08_c.inc"
57#include "units_c.inc"
58#include "task_c.inc"
59C-----------------------------------------------
60C D u m m y A r g u m e n t s
61C-----------------------------------------------
62 INTEGER, INTENT(IN) :: SENS,NSENSOR
63 TYPE (SENSOR_STR_), INTENT(INOUT) ,DIMENSION(NSENSOR) :: SENSOR_TAB
64C-----------------------------------------------
65C L o c a l V a r i a b l e s
66C-----------------------------------------------
67 INTEGER IS1,STATUS_IS1
68 INTEGER IS2,STATUS_IS2
69
70 INTEGER ACTI
71 my_real tstart, infinity
72C-----------------------------------------------
73 infinity = ep20
74 acti = 0
75c
76 is1 = sensor_tab(sens)%IPARAM(1)
77 status_is1 = sensor_tab(is1)%STATUS
78
79 is2 = sensor_tab(sens)%IPARAM(2)
80 status_is2 = sensor_tab(is2)%STATUS
81c
82 IF ( status_is1 == 1 .AND. status_is2 == 1 .AND. sensor_tab(sens)%STATUS == 0 ) THEN ! Context change - AND goes ON
83 sensor_tab(sens)%STATUS = 1
84 sensor_tab(sens)%TSTART = tt
85 acti = 1
86 ENDIF
87
88 IF ( (status_is1 <= 0 .OR. status_is2 <= 0) .AND. sensor_tab(sens)%STATUS == 1 ) THEN ! Context change - AND goes OFF
89 sensor_tab(sens)%STATUS = 0
90 sensor_tab(sens)%TSTART = infinity
91 acti = 2
92 ENDIF
93
94 IF (acti == 1) THEN
95
96 IF (ispmd == 0) THEN
97 WRITE (istdo,1000) sensor_tab(sens)%SENS_ID,sensor_tab(sens)%TSTART
98 WRITE (iout ,1000) sensor_tab(sens)%SENS_ID,sensor_tab(sens)%TSTART
99 ENDIF
100
101 ELSE IF (acti == 2) THEN
102
103 IF (ispmd == 0) THEN
104 WRITE (istdo,1100) sensor_tab(sens)%SENS_ID,tt
105 WRITE (iout ,1100) sensor_tab(sens)%SENS_ID,tt
106 ENDIF
107
108 ENDIF
109c-----------------------------------------------------------------------
1101000 FORMAT(' SENSOR NUMBER ',i10,' ACTIVATED AT TIME ',1pe12.5)
1111100 FORMAT(' SENSOR NUMBER ',i10,' DEACTIVATED AT TIME ',1pe12.5)
112C-----------------------------------------------
113 END
114
115
#define my_real
Definition cppsort.cpp:32
subroutine sensor_and(nsensor, sensor_tab, sens)
Definition sensor_and.F:31