OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
read5p.F File Reference
#include "implicit_f.inc"
#include "units_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine read5p (irec, nbc, key0, iv2, jj)

Function/Subroutine Documentation

◆ read5p()

subroutine read5p ( integer irec,
integer nbc,
character, dimension(*) key0,
integer, dimension(*) iv2,
integer jj )

Definition at line 30 of file read5p.F.

31C-----------------------------------------------
32C I m p l i c i t T y p e s
33C-----------------------------------------------
34#include "implicit_f.inc"
35C-----------------------------------------------
36C D u m m y A r g u m e n t s
37C-----------------------------------------------
38 INTEGER IV2(*), IREC, NBC, JJ
39 CHARACTER KEY0*(*)
40C-----------------------------------------------
41C C o m m o n B l o c k s
42C-----------------------------------------------
43#include "units_c.inc"
44C-----------------------------------------------
45C L o c a l V a r i a b l e s
46C-----------------------------------------------
47 INTEGER K, I, N, J, NC1, NC2, NTOT
48 INTEGER, DIMENSION(:), ALLOCATABLE :: IV0,IV1
49C-----------------------------------------------
50C
51C First pass - count total number of elements
52c
53 ntot=0
54 k=0
55 DO i=1,nbc
56 CALL wciusc2(irec+k,1,n,key0)
57 k=k+1
58 ntot = ntot + n
59 ENDDO ! I
60
61 IF(ntot==0)RETURN ! No elements to read
62
63C Second pass - read all lines of elements as a single big line
64 ALLOCATE(iv0(ntot))
65 ALLOCATE(iv1(2*ntot))
66 iv0(1:ntot) = 0
67 iv1(1:2*ntot) = 0
68C
69 ntot = 0
70 k=0
71 DO i=1,nbc
72 CALL wciusc2(irec+k,1,n,key0)
73 READ(iusc2,*)(iv0(j),j=1,n)
74 DO j=1,n
75 iv1(2*(ntot+j) - 1) = iv0(j)
76 iv1(2*(ntot+j)) = iv0(j)
77 ENDDO
78 ntot = ntot + n
79 k=k+1
80 ENDDO
81C
82C Write the elements in groups of 10 - last line completed with last element
83 n=2*ntot
84 nc1=1
85 nc2 = 0
86 DO WHILE(nc2 < n)
87 jj = 0
88 nc2=min(nc1+9-jj,n)
89 DO j=nc1,nc2
90 jj=jj+1
91 iv2(jj)=iv1(j)
92 ENDDO
93 DO k=jj+1,10,2
94 iv2(k)=iv2(jj-1)
95 iv2(k+1)=iv2(jj)
96 ENDDO
97 WRITE(iin,'(10I10)')(iv2(j),j=1,10)
98 nc1=nc2+1
99 ENDDO
100 jj = 0
101
102 DEALLOCATE(iv0)
103 DEALLOCATE(iv1)
104
105 RETURN
#define min(a, b)
Definition macros.h:20
subroutine wciusc2(irec, nbc, n, key0)
Definition wciusc2.F:38