OpenRadioss
2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
write_array.F
Go to the documentation of this file.
1
Copyright> OpenRadioss
2
Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3
Copyright>
4
Copyright> This program is free software: you can redistribute it and/or modify
5
Copyright> it under the terms of the GNU Affero General Public License as published by
6
Copyright> the Free Software Foundation, either version 3 of the License, or
7
Copyright> (at your option) any later version.
8
Copyright>
9
Copyright> This program is distributed in the hope that it will be useful,
10
Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11
Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
Copyright> GNU Affero General Public License for more details.
13
Copyright>
14
Copyright> You should have received a copy of the GNU Affero General Public License
15
Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16
Copyright>
17
Copyright>
18
Copyright> Commercial Alternative: Altair Radioss Software
19
Copyright>
20
Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21
Copyright> software under a commercial license. Contact Altair to discuss further if the
22
Copyright> 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)
29
C-----------------------------------------------
30
C Description
31
C-----------------------------------------------
32
C This function is recording a given integer array
33
C from range ARRAY(IDX1,IDX2)
34
C inside TABVINT array which will we used to transmit
35
C data from Strater/Engine
36
C Only nonzero values are stored.
37
C Nonzero values are first counted. This size is also stored.
38
C Then array is parsed to store only non zero values.
39
C-----------------------------------------------
40
C I m p l i c i t T y p e s
41
C-----------------------------------------------
42
#include "implicit_f.inc"
43
C-----------------------------------------------
44
C C o m m o n B l o c k s
45
C-----------------------------------------------
46
#include "scr14_c.inc"
47
C-----------------------------------------------
48
C D u m m y A r g u m e n t s
49
C-----------------------------------------------
50
INTEGER
,
INTENT(IN)
:: ARRAY(*)
51
INTEGER
,
INTENT(IN)
:: IDX1,IDX2
52
INTEGER
,
INTENT(INOUT)
:: LVARINT,TABVINT(*)
53
C-----------------------------------------------
54
C L o c a l V a r i a b l e s
55
C-----------------------------------------------
56
INTEGER
NUM
57
INTEGER
I
58
C-----------------------------------------------
59
C P r e - C o n d i t i o n
60
C-----------------------------------------------
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
67
C-----------------------------------------------
68
C S o u r c e L i n e s
69
C-----------------------------------------------
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
85
C-----------------------------------------------
86
END SUBROUTINE
write_array
write_array
subroutine write_array(array, idx1, idx2, tabvint, lvarint)
Definition
write_array.F:29
common_source
comm
write_array.F
Generated by
1.15.0