OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
sensor_temp.F File Reference
#include "implicit_f.inc"
#include "comlock.inc"
#include "units_c.inc"
#include "com04_c.inc"
#include "com08_c.inc"
#include "task_c.inc"
#include "lockon.inc"
#include "lockoff.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine sensor_temp (sensor, isens, igrnod)

Function/Subroutine Documentation

◆ sensor_temp()

subroutine sensor_temp ( type (sensor_str_) sensor,
integer isens,
type(group_), dimension(ngrnod), intent(in) igrnod )

Definition at line 31 of file sensor_temp.F.

32c-----------------------------------------------------------------------
33!$COMMENT
34! SENSOR_TEMP description
35! SENSOR_TEMP organization :
36! - sensor state modification
37!$ENDCOMMENT
38c-----------------------------------------------
39C M o d u l e s
40c-----------------------------------------------
41 USE groupdef_mod
42 USE sensor_mod
43C-----------------------------------------------
44C I m p l i c i t T y p e s
45C-----------------------------------------------
46#include "implicit_f.inc"
47#include "comlock.inc"
48C-----------------------------------------------
49C C o m m o n B l o c k s
50C-----------------------------------------------
51#include "units_c.inc"
52#include "com04_c.inc"
53#include "com08_c.inc"
54#include "task_c.inc"
55C-----------------------------------------------
56C D u m m y A r g u m e n t s
57C-----------------------------------------------
58 INTEGER :: ISENS
59 TYPE(GROUP_) ,DIMENSION(NGRNOD) ,INTENT(IN) :: IGRNOD
60 TYPE (SENSOR_STR_) :: SENSOR
61C----------------------------------------------------------
62C Local Variables
63C----------------------------------------------------------
64 INTEGER :: I,IGN,ICRIT,TFLAG
65 my_real :: tstart,tdelay,tmin,temp_max,temp_min,temp_avg
66c----------------------------------------------------------
67c SENSOR%VAR(1) = TEMP_MAX
68c SENSOR%VAR(2) = TEMP_MIN
69c SENSOR%VAR(3) = TEMP_AVG
70c
71c sensor status : ICRIT
72c = 0 : inactive, criterion not met
73c = 1 : criterium reached, testing duration time Tmin
74c = 2 : ready to activate after Tdelay
75c = 3 : activated at Time = TSTART
76C=======================================================================
77 IF (sensor%STATUS == 1) RETURN ! already activated
78c
79 IF (tt == zero) sensor%VAR(2) = ep20 ! initialize Temp min
80 tstart = sensor%TSTART
81 tdelay = sensor%TDELAY
82 tmin = sensor%TMIN
83 ign = sensor%IPARAM(1)
84 temp_max = sensor%VAR(1)
85 temp_min = sensor%VAR(2)
86 temp_avg = sensor%VAR(3)
87 icrit = 0
88 tflag = 0
89
90 IF (temp_avg > sensor%RPARAM(3)) THEN
91 icrit = 1
92 tflag = 3
93 ELSE IF (temp_max > sensor%RPARAM(1)) THEN
94 icrit = 1
95 tflag = 1
96 ELSE IF (temp_min < sensor%RPARAM(2)) THEN
97 icrit = 1
98 tflag = 2
99 END IF
100c----------------------------------------------------------------
101c check activation status
102c----------------------------------------------------------------
103 IF (sensor%TCRIT + tmin > tt) THEN
104 IF (icrit == 0) THEN
105 sensor%TCRIT = infinity
106 ELSE IF (sensor%TCRIT == infinity) THEN
107 sensor%TCRIT = tt
108 END IF
109 END IF
110 tstart = sensor%TCRIT + tmin + tdelay
111 IF (tstart <= tt) THEN ! sensor activation
112 sensor%STATUS = 1
113 sensor%TSTART = tstart
114 END IF
115c-----------------------------------------------------------------------
116 IF (sensor%STATUS == 1 .and. ispmd == 0) THEN
117#include "lockon.inc"
118 WRITE (istdo,1100 ) sensor%SENS_ID,sensor%TSTART
119 WRITE (iout ,1100 ) sensor%SENS_ID,sensor%TSTART
120 IF (tflag == 1) THEN
121 WRITE (iout ,1200) sensor%RPARAM(1),temp_max
122 ELSE IF (tflag == 2) THEN
123 WRITE (iout ,1300) sensor%RPARAM(2),temp_min
124 ELSE IF (tflag == 3) THEN
125 WRITE (iout ,1400) sensor%RPARAM(3),temp_avg
126 END IF
127#include "lockoff.inc"
128 ENDIF
129c-----------------------------------------------------------------------
1301100 FORMAT(' SENSOR TEMPERATURE NUMBER ',i10,' ACTIVATED AT TIME ',1pe12.5)
1311200 FORMAT(' TARGET MAX TEMPERATURE = ',1pe12.5,/
132 . ' CURRENT TEMPERATURE AFTER TMIN and TDELAY = ',1pe12.5)
1331300 FORMAT(' TARGET MIN TEMPERATURE = ',1pe12.5,/
134 . ' CURRENT TEMPERATURE AFTER TMIN and TDELAY = ',1pe12.5)
1351400 FORMAT(' TARGET AVG TEMPERATURE = ',1pe12.5,/
136 . ' CURRENT TEMPERATURE AFTER TMIN and TDELAY = ',1pe12.5)
137c----------------------------------------------------------
138 RETURN
#define my_real
Definition cppsort.cpp:32