OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
debug_mod.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!|| debug_mod ../engine/share/modules/debug_mod.F
25!||--- called by ------------------------------------------------------
26!|| i24ass2 ../engine/source/interfaces/int24/i24for3.F
27!|| i24cor3 ../engine/source/interfaces/int24/i24cor3.F
28!|| i24ispt2_ini_opttri ../engine/source/interfaces/int24/i24cor3.F
29!|| i24optcd ../engine/source/interfaces/intsort/i24optcd.F
30!|| i25cor3_e2s ../engine/source/interfaces/int25/i25cor3_e2s.F
31!|| i25free_bound ../engine/source/interfaces/int25/i25free_bound.F
32!|| i25normp ../engine/source/interfaces/int25/i25norm.F
33!|| i25optcd_e2s ../engine/source/interfaces/intsort/i25optcd_e2s.F
34!|| i25trivox_edg ../engine/source/interfaces/intsort/i25trivox_edg.f
35!|| m10law ../engine/source/materials/mat/mat010/m10law.F
36!|| prepare_debug ../engine/share/modules/debug_mod.F
37!|| resol ../engine/source/engine/resol.F
38!|| spmd_collect_multi_fvm ../engine/source/mpi/output/spmd_collect_multi_fvm.F
39!|| spmd_collect_nlocal ../engine/source/mpi/output/spmd_collect_nlocal.F
40!|| spmd_fiadd25e_poff ../engine/source/mpi/interfaces/spmd_fiadd25e_poff.F
41!|| spmd_fiadd25e_pon ../engine/source/mpi/interfaces/spmd_fiadd25e_pon.F
42!|| update_failwave ../engine/source/materials/fail/failwave/update_failwave.F
43!||--- uses -----------------------------------------------------
44!||====================================================================
45 MODULE debug_mod
46
47 USE iso_c_binding
48 INTEGER, DIMENSION(:),ALLOCATABLE :: ITAB_DEBUG !< User Node Identifiers
49 INTEGER :: NC_DEBUG !< Engine Cycle number
50! double precision, DIMENSION(:),ALLOCATABLE :: DETACH_SHELL
51
52
53 CONTAINS
54!||====================================================================
55!|| sp_checksum ../engine/share/modules/debug_mod.F
56!||====================================================================
57 PURE FUNCTION sp_checksum(A,SIZ1,SIZ2) RESULT(CHECKSUM)
58C Prints Adler 32 checksum of A(1:SIZ2,1:SIZ1) in *1.out file
59C-----------------------------------------------
60C I m p l i c i t T y p e s
61C-----------------------------------------------
62#include "implicit_f.inc"
63#include "r4r8_p.inc"
64C-----------------------------------------------
65C C o m m o n B l o c k s
66C-----------------------------------------------
67#include "com01_c.inc"
68#include "com04_c.inc"
69#include "task_c.inc"
70#include "spmd_c.inc"
71#include "chara_c.inc"
72#include "units_c.inc"
73C-----------------------------------------------
74C-----------------------------------------------
75C D u m m y A r g u m e n t s
76C-----------------------------------------------
77 INTEGER, INTENT(IN) :: siz1,siz2
78 real*4, INTENT(IN) :: a(siz2,siz1)
79C-----------------------------------------------
80C L o c a l V a r i a b l e s
81C-----------------------------------------------
82 INTEGER, DIMENSION(:), ALLOCATABLE :: tmp
83 INTEGER :: i,checksum,root,s1,s2,two_power_16
84 INTEGER :: prec ! simple or double precision
85 INTEGER :: siz
86C-----------------------------------------------
87 root = 65521
88 two_power_16 = 65536
89 s1 = 1
90 s2 = 0
91 prec = 2
92C If A is in simple precision
93 IF(sizeof(a(1,1)) == 4) prec = 1
94 siz = siz1*siz2 * prec
95 ALLOCATE(tmp(siz))
96 tmp(1:siz) = 0
97c Convert A in integer
98 tmp = transfer(a(1:siz2,1:siz1),s1,siz)
99 DO i = 1,siz
100 s1 = mod(s1 + tmp(i),root)
101 s2 = mod(s1 + s2 ,root)
102 ENDDO
103C (s2 << 16) | s1
104 checksum = ior(s2 * two_power_16,s1)
105 DEALLOCATE(tmp)
106 END FUNCTION
107!||====================================================================
108!|| dp_checksum ../engine/share/modules/debug_mod.F
109!||====================================================================
110 PURE FUNCTION dp_checksum(A,SIZ1,SIZ2) RESULT(CHECKSUM)
111C Prints Adler 32 checksum of A(1:SIZ2,1:SIZ1) in *1.out file
112C-----------------------------------------------
113C I m p l i c i t T y p e s
114C-----------------------------------------------
115#include "implicit_f.inc"
116C-----------------------------------------------
117C C o m m o n B l o c k s
118C-----------------------------------------------
119#include "com01_c.inc"
120#include "com04_c.inc"
121#include "task_c.inc"
122#include "spmd_c.inc"
123#include "chara_c.inc"
124#include "units_c.inc"
125C-----------------------------------------------
126C-----------------------------------------------
127C D u m m y A r g u m e n t s
128C-----------------------------------------------
129 INTEGER, INTENT(IN) :: siz1,siz2
130 DOUBLE PRECISION, INTENT(IN) :: a(siz2,siz1)
131C-----------------------------------------------
132C L o c a l V a r i a b l e s
133C-----------------------------------------------
134 INTEGER, DIMENSION(:), ALLOCATABLE :: tmp
135 INTEGER :: i,checksum,root,s1,s2,two_power_16
136 INTEGER :: prec ! simple or double precision
137 INTEGER :: siz
138C-----------------------------------------------
139 root = 65521
140 two_power_16 = 65536
141 s1 = 1
142 s2 = 0
143 prec = 2
144C If A is in simple precision
145 IF(sizeof(a(1,1)) == 4) prec = 1
146 siz = siz1*siz2 * prec
147 ALLOCATE(tmp(siz))
148 tmp(1:siz) = 0
149c Convert A in integer
150 tmp = transfer(a(1:siz2,1:siz1),s1,siz)
151 DO i = 1,siz
152 s1 = mod(s1 + tmp(i),root)
153 s2 = mod(s1 + s2 ,root)
154 ENDDO
155C (s2 << 16) | s1
156 checksum = ior(s2 * two_power_16,s1)
157 DEALLOCATE(tmp)
158 END FUNCTION
159!||====================================================================
160!|| int_checksum ../engine/share/modules/debug_mod.F
161!||--- called by ------------------------------------------------------
162!|| i25cor3_e2s ../engine/source/interfaces/int25/i25cor3_e2s.F
163!|| i25optcd_e2s ../engine/source/interfaces/intsort/i25optcd_e2s.F
164!|| i25trivox_edg ../engine/source/interfaces/intsort/i25trivox_edg.F
165!||====================================================================
166 PURE FUNCTION int_checksum(A,SIZ1,SIZ2) RESULT(CHECKSUM)
167C Prints Adler 32 checksum of A(1:SIZ2,1:SIZ1) in *1.out file
168C-----------------------------------------------
169C I m p l i c i t T y p e s
170C-----------------------------------------------
171#include "implicit_f.inc"
172C-----------------------------------------------
173C C o m m o n B l o c k s
174C-----------------------------------------------
175#include "com01_c.inc"
176#include "com04_c.inc"
177#include "task_c.inc"
178#include "spmd_c.inc"
179#include "chara_c.inc"
180#include "units_c.inc"
181C-----------------------------------------------
182C-----------------------------------------------
183C D u m m y A r g u m e n t s
184C-----------------------------------------------
185 INTEGER, INTENT(IN) :: siz1,siz2
186 INTEGER, INTENT(IN) :: a(siz2,siz1)
187C-----------------------------------------------
188C L o c a l V a r i a b l e s
189C-----------------------------------------------
190 INTEGER, DIMENSION(:), ALLOCATABLE :: tmp
191 INTEGER :: i,checksum,root,s1,s2,two_power_16
192 INTEGER :: prec ! simple or double precision
193 INTEGER :: siz
194C-----------------------------------------------
195 root = 65521
196 two_power_16 = 65536
197 s1 = 1
198 s2 = 0
199 prec = 2
200C If A is in simple precision
201 IF(sizeof(a(1,1)) == 4) prec = 1
202 siz = siz1*siz2 * prec
203 ALLOCATE(tmp(siz))
204 tmp(1:siz) = 0
205c Convert A in integer
206 tmp = transfer(a(1:siz2,1:siz1),s1,siz)
207 DO i = 1,siz
208 s1 = mod(s1 + tmp(i),root)
209 s2 = mod(s1 + s2 ,root)
210 ENDDO
211C (s2 << 16) | s1
212 checksum = ior(s2 * two_power_16,s1)
213 DEALLOCATE(tmp)
214 END FUNCTION
215 END MODULE debug_mod
216
217
218!||====================================================================
219!|| prepare_debug ../engine/share/modules/debug_mod.F
220!||--- called by ------------------------------------------------------
221!|| resol ../engine/source/engine/resol.F
222!||--- uses -----------------------------------------------------
223!|| debug_mod ../engine/share/modules/debug_mod.F
224!||====================================================================
225 SUBROUTINE prepare_debug(ITAB,NUMNOD)
226 USE debug_mod
227C-----------------------------------------------
228C I m p l i c i t T y p e s
229C-----------------------------------------------
230#include "implicit_f.inc"
231C-----------------------------------------------
232 INTEGER, INTENT(IN) :: NUMNOD
233 INTEGER, DIMENSION(:), INTENT(IN) :: ITAB(NUMNOD)
234C-----------------------------------------------
235 ALLOCATE (itab_debug(numnod))
236 itab_debug(1:numnod)=itab(1:numnod)
237C-----------------------------------------------
238 nc_debug = 0 ! updated in resol loop
239C-----------------------------------------------
240 END
241
subroutine prepare_debug(itab, numnod)
Definition debug_mod.F:226
integer nc_debug
Engine Cycle number.
Definition debug_mod.F:49
pure integer function dp_checksum(a, siz1, siz2)
Definition debug_mod.F:111
pure integer function sp_checksum(a, siz1, siz2)
Definition debug_mod.F:58
integer, dimension(:), allocatable itab_debug
User Node Identifiers.
Definition debug_mod.F:48
pure integer function int_checksum(a, siz1, siz2)
Definition debug_mod.F:167
subroutine i25trivox_edg(i_mem, vmaxdt, inacti, irect, x, stf, xyzm, ii_stok, cands_e2e, eshift, nedge_t, candm_e2e, mulnsne, noint, bgapemx, sshift, nrtm_t, voxel, nbx, nby, nbz, igap, gap_m, gap_m_l, drad, marge, itask, itab, ll_stok, mulnsns, mbinflg, ebinflg, ilev, cand_a, cand_p, flagremnode, kremnode, remnode, s_remnode_edg, iedge, nedge, ledge, msegtyp, igap0, admsr, edg_bisector, vtx_bisector, candm_e2s, cands_e2s, cand_b, cand_ps, gape, gap_e_l, dgapload, flag_removed_node, s_kremnode_e2s, s_remnode_e2s, kremnode_e2s, remnode_e2s, s_kremnode_edg)