OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
write_sensors.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!|| write_sensors ../engine/source/output/restart/write_sensors.F
25!||--- called by ------------------------------------------------------
26!|| wrrestp ../engine/source/output/restart/wrrestp.F
27!||--- calls -----------------------------------------------------
28!|| fretitl ../engine/source/input/freform.F
29!|| write_db ../common_source/tools/input_output/write_db.F
30!|| write_dpdb ../common_source/tools/input_output/write_db.f
31!|| write_i_c ../common_source/tools/input_output/write_routtines.c
32!||--- uses -----------------------------------------------------
33!|| names_and_titles_mod ../common_source/modules/names_and_titles_mod.F
34!|| sensor_mod ../common_source/modules/sensor_mod.F90
35!||====================================================================
36 SUBROUTINE write_sensors(SENSORS)
37C-----------------------------------------------
38C M o d u l e s
39C-----------------------------------------------
40 USE sensor_mod
42C-----------------------------------------------
43C I m p l i c i t T y p e s
44C-----------------------------------------------
45#include "implicit_f.inc"
46#include "scr07_c.inc"
47#include "scr17_c.inc"
48#include "task_c.inc"
49C-----------------------------------------------
50C D u m m y A r g u m e n t s
51C-----------------------------------------------
52 TYPE (SENSORS_) ,INTENT(IN) ,TARGET :: SENSORS
53C-----------------------------------------------
54C L o c a l V a r i a b l e s
55C-----------------------------------------------
56 INTEGER I,ISEN,LEN,IAD,NFIX,NPARI,NPARR,NVAR,TYP
57 INTEGER, DIMENSION(LTITR) :: ITITLE
58 my_real, DIMENSION(:), ALLOCATABLE :: rbuf
59 CHARACTER(LEN = NCHARTITLE) :: TITLE
60 TYPE (SENSOR_STR_) ,POINTER :: SENSOR
61C=======================================================================
62 nfix = 11
63c
64 IF (sensors%NSENSOR > 0) THEN
65 DO isen = 1,sensors%NSENSOR
66 sensor => sensors%SENSOR_TAB(isen)
67 typ = sensor%TYPE
68 npari = sensor%NPARI
69 nparr = sensor%NPARR
70 nvar = sensor%NVAR
71 title = sensor%TITLE
72
73 len = nfix + npari + nparr + nvar
74 ALLOCATE (rbuf(len) )
75c
76 iad = 0
77 rbuf(iad+1) = sensor%TYPE
78 rbuf(iad+2) = sensor%SENS_ID
79 rbuf(iad+3) = sensor%STATUS
80 rbuf(iad+4) = sensor%TCRIT
81 rbuf(iad+5) = sensor%TMIN
82 rbuf(iad+6) = sensor%TDELAY
83 rbuf(iad+7) = sensor%TSTART
84 rbuf(iad+8) = sensor%VALUE
85 rbuf(iad+9) = sensor%NPARI
86 rbuf(iad+10)= sensor%NPARR
87 rbuf(iad+11)= sensor%NVAR
88 iad = iad + nfix
89c
90 IF (npari > 0) THEN
91 DO i = 1,npari
92 rbuf(iad+i) = sensor%IPARAM(i)
93 END DO
94 iad = iad + npari
95 END IF
96 IF (nparr > 0) THEN
97 DO i = 1,nparr
98 rbuf(iad+i) = sensor%RPARAM(i)
99 END DO
100 iad = iad + nparr
101 END IF
102 IF (nvar > 0) THEN
103 DO i = 1,nvar
104 rbuf(iad+i) = sensor%VAR(i)
105 END DO
106 iad = iad + nvar
107 END IF
108c
109 CALL write_db (rbuf,len)
110 DEALLOCATE (rbuf)
111c
112c write sensor title
113 CALL fretitl(title,ititle,ltitr)
114 CALL write_i_c(ititle,ltitr)
115c
116 IF (typ==29.OR.typ==30.OR.typ==31)THEN
117 CALL write_i_c(sensor%INTEGER_USERPARAM,nsenpari)
118 CALL write_i_c(sensor%INTEGER_USERBUF,isenbuf)
119
120 CALL write_db (sensor%FLOAT_USERPARAM,nsenparr)
121 CALL write_db (sensor%FLOAT_USERBUF,lsenbuf)
122
123 ENDIF
124 IF(typ == 40 ) THEN
125 CALL write_i_c(sensor%PYTHON_FUNCTION_ID,1)
126 ENDIF
127 END DO
128c
129c--------------------------------------
130c Write Logical sensor index array
131c--------------------------------------
132
133 CALL write_i_c(sensors%LOGICAL_SENSOR_COUNT,1)
134 CALL write_i_c(sensors%LOGICAL_SENSORS_LIST,sensors%LOGICAL_SENSOR_COUNT)
135c
136c--------------------------------------
137c Write spmd/PON exchange arrays
138c--------------------------------------
139
140 CALL write_dpdb(sensors%FSAV,12*6*sensors%SFSAV)
141 CALL write_i_c(sensors%TABSENSOR,sensors%STABSEN)
142c--------------------------------------
143c Write sensor lists in engine output options (/STOP/LSENSOR, /STAT/LSENSOR...)
144c in case of chkpoint restart
145 IF (wmcheck == 1) THEN
146 CALL write_i_c(sensors%STOP ,sensors%NSTOP) ! Must be read at any chkpt restart
147 ENDIF
148
149 IF (ispmd == 0 .and. wmcheck == 1) THEN
150 CALL write_i_c(sensors%STAT ,sensors%NSTAT)
151 CALL write_i_c(sensors%OUTP ,sensors%NOUTP)
152 CALL write_i_c(sensors%ANIM ,sensors%NANIM)
153 END IF
154c
155 END IF
156c-----------
157 RETURN
158 END
#define my_real
Definition cppsort.cpp:32
subroutine write_sensors(sensors)
integer, parameter nchartitle
subroutine fretitl(titr, iasc, l)
Definition freform.F:620
subroutine write_db(a, n)
Definition write_db.F:140
subroutine write_dpdb(a, n)
Definition write_db.F:302
void write_i_c(int *w, int *len)