OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
thnst_count.F File Reference
#include "implicit_f.inc"
#include "com01_c.inc"
#include "task_c.inc"
#include "param_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine thnst_count (nthgrp2, ithgrp, wa_size, index_wa_nst, iparg, ithbuf, sithbuf)

Function/Subroutine Documentation

◆ thnst_count()

subroutine thnst_count ( integer, intent(in) nthgrp2,
integer, dimension(nithgr,*), intent(in) ithgrp,
integer, intent(inout) wa_size,
integer, dimension(2*nthgrp2+1), intent(inout) index_wa_nst,
integer, dimension(nparg,*) iparg,
integer, dimension(sithbuf) ithbuf,
integer, intent(in) sithbuf )

Definition at line 28 of file thnst_count.F.

30C-----------------------------------------------
31C I m p l i c i t T y p e s
32C-----------------------------------------------
33#include "implicit_f.inc"
34C-----------------------------------------------
35C C o m m o n B l o c k s
36C-----------------------------------------------
37#include "com01_c.inc"
38#include "task_c.inc"
39#include "param_c.inc"
40C-----------------------------------------------
41C D u m m y A r g u m e n t s
42C-----------------------------------------------
43 INTEGER, INTENT(in) ::SITHBUF
44 INTEGER IPARG(NPARG,*),ITHBUF(SITHBUF)
45 INTEGER, INTENT(in) :: NTHGRP2
46 INTEGER, INTENT(inout) :: WA_SIZE
47 INTEGER, DIMENSION(2*NTHGRP2+1), INTENT(inout) :: INDEX_WA_NST
48 INTEGER, DIMENSION(NITHGR,*), INTENT(in) :: ITHGRP
49C-----------------------------------------------
50C L o c a l V a r i a b l e s
51C-----------------------------------------------
52 LOGICAL :: BOOL
53 INTEGER II, I, J, N, IH, NG, ITY,
54 . K,
55 . NXN,NEL,NFT
56 INTEGER :: J_FIRST,NITER,IAD,NN,IADV,NVAR,ITYP,IJK
57 INTEGER, DIMENSION(NTHGRP2) :: INDEX_NST
58C-------------------------
59C ELEMENTS NSTRANDS
60C-------------------------
61
62 ijk = 0
63 wa_size = 0
64 index_nst(1:nthgrp2) = 0
65 DO niter=1,nthgrp2
66 ityp=ithgrp(2,niter)
67 nn =ithgrp(4,niter)
68 iad =ithgrp(5,niter)
69 nvar=ithgrp(6,niter)
70 iadv=ithgrp(7,niter)
71 ii=0
72 IF(ityp==100)THEN
73! -------------------------------
74 ii=0
75 ih=iad
76
77 DO WHILE (ithbuf(ih+nn) /= ispmd .AND. ih < iad+nn)
78 ih = ih + 1
79 ENDDO
80 IF (ih >= iad+nn) GOTO 666
81
82 DO ng=1,ngroup
83 ity=iparg(5,ng)
84 IF (ity == 100) THEN
85C multi-purpose elements are nstrands elements only (to be modified).
86 nel=iparg(2,ng)
87 nft=iparg(3,ng)
88
89 DO i=1,nel
90 n =i+nft
91 k =ithbuf(ih)
92 IF (k == n) THEN
93 DO j=1,nn
94C loop over strands into the ONE NSTRAND TH group.
95C strand to save:
96 wa_size = wa_size + nvar
97 ih=ih+1
98 ENDDO ! DO J=1,NN
99 wa_size = wa_size + 1
100 ENDIF ! IF (K == N)
101 ENDDO ! DO I=1,NEL
102 ENDIF ! IF (ITY == 100)
103 ENDDO ! DO NG=1,NGROUP
104 ENDIF
105 666 continue
106 index_nst(niter) = wa_size
107 ENDDO
108
109
110 j_first = 0
111 bool = .true.
112 DO i=1,nthgrp2
113 IF(bool.EQV..true.) THEN
114 IF( index_nst(i)/=0 ) THEN
115 bool = .false.
116 j_first = i
117 ENDIF
118 ENDIF
119 ENDDO
120
121 j = 0
122 IF(j_first>0) THEN
123 j=j+1
124 index_wa_nst(j) = index_nst(j_first)
125 j=j+1
126 index_wa_nst(j) = j_first
127 DO i=j_first+1,nthgrp2
128 IF( index_nst(i)-index_nst(i-1)>0 ) THEN
129 j=j+1
130 index_wa_nst(j) = index_nst(i)
131 j=j+1
132 index_wa_nst(j) = i
133 ENDIF
134 ENDDO
135 ENDIF
136 index_wa_nst(2*nthgrp2+1) = j ! number of non-zero index
137C-----------
138 RETURN
integer function nvar(text)
Definition nvar.F:32