OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
update_struct_int21.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!|| update_struct_int21 ../engine/source/interfaces/int21/update_struct_int21.F
25!||--- called by ------------------------------------------------------
26!|| i21main_tri ../engine/source/interfaces/intsort/i21main_tri.F
27!||--- calls -----------------------------------------------------
28!|| my_barrier ../engine/source/system/machine.F
29!||--- uses -----------------------------------------------------
30!|| intstamp_glob_mod ../engine/share/modules/intstamp_glob_mod.F
31!|| message_mod ../engine/share/message_module/message_mod.F
32!|| tri7box ../engine/share/modules/tri7box.F
33!||====================================================================
35 1 CAND_E, II_STOK, IFORM , NIN , NMN,
36 2 INTTH, MNDD , MSR_L , IRECTT )
37C-----------------------------------------------
38C M o d u l e s
39C-----------------------------------------------
40 USE message_mod
42 USE tri7box
43C-----------------------------------------------
44C I m p l i c i t T y p e s
45C-----------------------------------------------
46#include "implicit_f.inc"
47#include "comlock.inc"
48C-----------------------------------------------
49C C o m m o n B l o c k s
50C-----------------------------------------------
51#include "com01_c.inc"
52#include "task_c.inc"
53#include "parit_c.inc"
54#include "spmd_c.inc"
55C-----------------------------------------------
56C D u m m y A r g u m e n t s
57C-----------------------------------------------
58 INTEGER NIN,NMN,IFORM
59 INTEGER MSR_L(*),MNDD(*)
60 INTEGER CAND_E(*)
61 INTEGER II_STOK,INTTH,IRECTT(4,*)
62C-----------------------------------------------
63C L o c a l V a r i a b l e s
64C-----------------------------------------------
65 INTEGER I, J, IP0, IP1, II,IFLAGLOADP,
66 . N,L,PP,J_STOK,IAD(NSPMD),
67 . tag(nmn),nm(4),nodfi,ptr, ierror1,ierror2, ierror3,
68 . ierror4,lskyfi
69
70C-----------------------------------------------
71C S o u r c e L i n e s
72C-----------------------------------------------
73C
74C UPDATE STRUCTURE NMNSI and NMNFI FOR SPMD COMMUNICATION
75C
76 iflagloadp = 0
77
78 IF(nspmd > 1.AND.(intth == 2.OR.iflagloadp > 0)) THEN
79 CALL my_barrier
80!$OMP MASTER
81 tag(1:nmn)=0
82 nodfi = 0
83 nmnfi(nin)%P(1:nspmd) = 0
84 DO i=1,ii_stok
85 l = cand_e(i)
86 IF(l/=0) THEN
87 nm(1:4) = irectt(1:4,l)
88 DO j=1,4
89 ii = nm(j)
90 pp = mndd(ii)
91 IF(pp/=0.AND.tag(ii) == 0) THEN
92 nodfi = nodfi + 1
93 nmnfi(nin)%P(pp) = nmnfi(nin)%P(pp) +1
94 tag(ii)=1
95 ENDIF
96 ENDDO
97 ENDIF
98 ENDDO
99
100 IF(ASSOCIATED( nmvfi(nin)%P )) DEALLOCATE(nmvfi(nin)%P)
101 ALLOCATE(nmvfi(nin)%P(nodfi),stat=ierror1)
102C
103 iad(1)=1
104 DO i=1,nspmd-1
105 iad(i+1) = iad(i)+nmnfi(nin)%P(i)
106 ENDDO
107
108C
109 tag(1:nmn)=0
110 DO i=1,ii_stok
111 l = cand_e(i)
112 IF(l/=0) THEN
113 nm(1:4) = irectt(1:4,l)
114 DO j=1,4
115 ii=nm(j)
116 pp = mndd(ii)
117 IF(pp/=0.AND.tag(ii)==0) THEN
118 ptr = iad(pp)
119 nmvfi(nin)%P(ptr) = ii
120 tag(ii)=1
121 iad(pp)=iad(pp)+1
122 msr_l(ii) = -ptr
123 ENDIF
124 ENDDO
125 ENDIF
126 ENDDO
127
128
129C
130 IF(iform /= 0) THEN
131 IF(iparit==0) THEN
132 IF(nodfi>0)ALLOCATE(fthefi(nin)%P(nodfi*nthread),stat=ierror2)
133 DO i = 1, nodfi*nthread
134 fthefi(nin)%P(i) = zero
135 ENDDO
136 ELSE
137 IF(ASSOCIATED(ftheskyfi(nin)%P)) DEALLOCATE(ftheskyfi(nin)%P)
138 lskyfi = nodfi*multimax
139 nlskyfi(nin) = lskyfi
140 IF(lskyfi>0) THEN
141 ALLOCATE(iskyfi(nin)%P(lskyfi),stat=ierror3)
142 ALLOCATE(ftheskyfi(nin)%P(lskyfi),stat=ierror4)
143 ENDIF
144 ENDIF
145 ENDIF
146
147 IF (iflagloadp > 0) THEN
148 IF(nodfi>0) THEN
149 IF(ASSOCIATED( tagncontfi(nin)%P )) DEALLOCATE(tagncontfi(nin)%P)
150 ALLOCATE(tagncontfi(nin)%P(nodfi),stat=ierror2)
151 DO i = 1, nodfi
152 tagncontfi(nin)%P(i) = 0
153 ENDDO
154 ENDIF
155 ENDIF
156!$OMP END MASTER
157 CALL my_barrier ! there isn't any implicit barrier at the end
158 ! of an omp main condition
159 ENDIF
160
161 RETURN
162 END SUBROUTINE update_struct_int21
type(int_pointer), dimension(:), allocatable nmvfi
type(int_pointer), dimension(:), allocatable nmnfi
type(real_pointer), dimension(:), allocatable ftheskyfi
Definition tri7box.F:449
type(int_pointer), dimension(:), allocatable iskyfi
Definition tri7box.F:480
integer, dimension(:), allocatable nlskyfi
Definition tri7box.F:512
type(real_pointer), dimension(:), allocatable fthefi
Definition tri7box.F:449
type(int_pointer), dimension(:), allocatable tagncontfi
Definition tri7box.F:505
subroutine my_barrier
Definition machine.F:31
subroutine update_struct_int21(cand_e, ii_stok, iform, nin, nmn, intth, mndd, msr_l, irectt)