OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
sensor_time.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/.
23C=======================================================================
24!||====================================================================
25!|| sensor_time ../engine/source/tools/sensor/sensor_time.F
26!||--- called by ------------------------------------------------------
27!|| sensor_base ../engine/source/tools/sensor/sensor_base.F
28!|| sensor_init ../engine/source/tools/sensor/sensor_init.F
29!||--- uses -----------------------------------------------------
30!|| sensor_mod ../common_source/modules/sensor_mod.F90
31!||====================================================================
32 SUBROUTINE sensor_time(SENSOR ,TIME ,TIMESTEP)
33C-----------------------------------------------
34C M o d u l e s
35C-----------------------------------------------
36 USE sensor_mod
37C-----------------------------------------------
38C I m p l i c i t T y p e s
39C-----------------------------------------------
40#include "implicit_f.inc"
41C-----------------------------------------------
42C C o m m o n B l o c k s
43C-----------------------------------------------
44#include "units_c.inc"
45#include "comlock.inc"
46#include "task_c.inc"
47C-----------------------------------------------
48C D u m m y A r g u m e n t s
49C-----------------------------------------------
50 my_real ,INTENT(IN) :: time,timestep
51 TYPE (SENSOR_STR_) ,INTENT(INOUT) :: SENSOR
52C----------------------------------------------------------
53C Local Variables
54C----------------------------------------------------------
55 INTEGER :: NSENS
56 my_real :: tdelay,tstop,infinity
57 DOUBLE PRECISION :: TDELAY_DP,TSTOP_DP,NEXT_CYCLE
58 parameter(infinity = 1.0e20)
59C=======================================================================
60 nsens = sensor%SENS_ID
61 tdelay = sensor%TDELAY
62 tstop = sensor%VALUE
63 next_cycle = time + timestep
64 tdelay_dp = tdelay
65 tstop_dp = tstop
66c
67 IF (next_cycle >= tdelay_dp .AND. sensor%STATUS == 0) THEN
68 sensor%STATUS = 1
69 sensor%TSTART = tdelay
70 IF (ispmd == 0) THEN
71#include "lockon.inc"
72 WRITE (iout ,1000) sensor%SENS_ID,tdelay
73 WRITE (istdo,1000) sensor%SENS_ID,tdelay
74#include "lockoff.inc"
75 ENDIF
76 ELSE IF (next_cycle >= tstop_dp .AND. sensor%STATUS == 1) THEN
77 sensor%STATUS = 0
78 sensor%TSTART = infinity
79 sensor%TDELAY = infinity
80 IF (ispmd == 0) THEN
81#include "lockon.inc"
82 WRITE (iout ,2000) sensor%SENS_ID,tstop
83 WRITE (istdo,2000) sensor%SENS_ID,tstop
84#include "lockoff.inc"
85 ENDIF
86 ENDIF
87c-----------------------------------------------------------------------
881000 FORMAT(' SENSOR (TIME) NUMBER ',i10,' ACTIVATED AT TIME ',1pe12.5)
892000 FORMAT(' SENSOR (TIME) NUMBER ',i10,' DESACTIVATED AT TIME ',1pe12.5)
90c-----------
91 RETURN
92 END SUBROUTINE sensor_time
#define my_real
Definition cppsort.cpp:32
subroutine sensor_time(sensor, time, timestep)
Definition sensor_time.F:33