OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
write_array.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_array ../common_source/comm/write_array.F
25!||--- called by ------------------------------------------------------
26!|| wrcomi ../engine/source/output/restart/wrcomm.F
27!||====================================================================
28 SUBROUTINE write_array(ARRAY,IDX1,IDX2,TABVINT, LVARINT)
29C-----------------------------------------------
30C Description
31C-----------------------------------------------
32C This function is recording a given integer array
33C from range ARRAY(IDX1,IDX2)
34C inside TABVINT array which will we used to transmit
35C data from Strater/Engine
36C Only nonzero values are stored.
37C Nonzero values are first counted. This size is also stored.
38C Then array is parsed to store only non zero values.
39C-----------------------------------------------
40C I m p l i c i t T y p e s
41C-----------------------------------------------
42#include "implicit_f.inc"
43C-----------------------------------------------
44C C o m m o n B l o c k s
45C-----------------------------------------------
46#include "scr14_c.inc"
47C-----------------------------------------------
48C D u m m y A r g u m e n t s
49C-----------------------------------------------
50 INTEGER,INTENT(IN) :: ARRAY(*)
51 INTEGER,INTENT(IN) :: IDX1,IDX2
52 INTEGER,INTENT(INOUT) :: LVARINT,TABVINT(*)
53C-----------------------------------------------
54C L o c a l V a r i a b l e s
55C-----------------------------------------------
56 INTEGER NUM
57 INTEGER I
58C-----------------------------------------------
59C P r e - C o n d i t i o n
60C-----------------------------------------------
61 !IF (SIZE(ARRAY)<=0)RETURN
62 !LB=LBOUND(ARRAY)
63 !UB=UBOUND(ARRAY)
64 !IF(IDX1<LB)IDX1=LB
65 !IF(IDX2>UB)IDX2=UB
66 !IF (IDX2<IDX1)RETURN
67C-----------------------------------------------
68C S o u r c e L i n e s
69C-----------------------------------------------
70 num=0
71 DO i=idx1,idx2
72 IF(array(i)/=0)num=num+1
73 ENDDO
74 lvarint=lvarint+1
75 tabvint(lvarint)=num
76
77 DO i=idx1,idx2
78 IF(array(i)/=0)THEN
79 lvarint=lvarint+1
80 tabvint(lvarint)=i
81 ENDIF
82 ENDDO
83
84 RETURN
85C-----------------------------------------------
86 END SUBROUTINE write_array
subroutine write_array(array, idx1, idx2, tabvint, lvarint)
Definition write_array.F:29