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!|| ebcs8_inlet ../engine/source/boundary_conditions/ebcs/ebcs8_inlet.F90
27!|| get_hashtable_for_neighbour_segment ../engine/source/interfaces/interf/get_hashtable_for_neighbour_segment.F90
28!|| i24ass2 ../engine/source/interfaces/int24/i24for3.F
29!|| i24cor3 ../engine/source/interfaces/int24/i24cor3.F
30!|| i24ispt2_ini_opttri ../engine/source/interfaces/int24/i24cor3.F
31!|| i24optcd ../engine/source/interfaces/intsort/i24optcd.F
32!|| i25cor3_e2s ../engine/source/interfaces/int25/i25cor3_e2s.F
33!|| i25free_bound ../engine/source/interfaces/int25/i25free_bound.F
34!|| i25normp ../engine/source/interfaces/int25/i25norm.F
35!|| i25optcd_e2s ../engine/source/interfaces/intsort/i25optcd_e2s.F
36!|| i25trivox_edg ../engine/source/interfaces/intsort/i25trivox_edg.F
37!|| prepare_debug ../engine/share/modules/debug_mod.F
38!|| remove_neighbour_segment ../engine/source/interfaces/interf/remove_neighbour_segment.F90
39!|| resol ../engine/source/engine/resol.F
40!|| spmd_collect_multi_fvm ../engine/source/mpi/output/spmd_collect_multi_fvm.F
41!|| spmd_collect_nlocal ../engine/source/mpi/output/spmd_collect_nlocal.F
42!|| spmd_fiadd25e_poff ../engine/source/mpi/interfaces/spmd_fiadd25e_poff.F
43!|| spmd_fiadd25e_pon ../engine/source/mpi/interfaces/spmd_fiadd25e_pon.F
44!|| update_failwave ../engine/source/materials/fail/failwave/update_failwave.F
45!||--- uses -----------------------------------------------------
46!||====================================================================
47 MODULE debug_mod
48
49 USE iso_c_binding
50 INTEGER, DIMENSION(:),ALLOCATABLE :: itab_debug !< User Node Identifiers
51 INTEGER :: ncycle_debug !< Engine Cycle number
52 integer :: ispmd_debug !< processor id
53! Double precision, dimension (:), allocatable:: detach_shell
54
55
56 CONTAINS
57!||====================================================================
58!|| sp_checksum ../engine/share/modules/debug_mod.F
59!||====================================================================
60 PURE FUNCTION sp_checksum(A,SIZ1,SIZ2) RESULT(CHECKSUM)
61C Prints Adler 32 checksum of A(1:SIZ2,1:SIZ1) in *1.out file
62C-----------------------------------------------
63C I m p l i c i t T y p e s
64C-----------------------------------------------
65#include "implicit_f.inc"
66#include "r4r8_p.inc"
67C-----------------------------------------------
68C C o m m o n B l o c k s
69C-----------------------------------------------
70#include "com01_c.inc"
71#include "com04_c.inc"
72#include "task_c.inc"
73#include "spmd_c.inc"
74#include "chara_c.inc"
75#include "units_c.inc"
76C-----------------------------------------------
77C-----------------------------------------------
78C D u m m y A r g u m e n t s
79C-----------------------------------------------
80 INTEGER, INTENT(IN) :: siz1,siz2
81 real*4, INTENT(IN) :: a(siz2,siz1)
82C-----------------------------------------------
83C L o c a l V a r i a b l e s
84C-----------------------------------------------
85 INTEGER, DIMENSION(:), ALLOCATABLE :: tmp
86 INTEGER :: i,checksum,root,s1,s2,two_power_16
87 INTEGER :: prec ! simple or double precision
88 INTEGER :: siz
89C-----------------------------------------------
90 root = 65521
91 two_power_16 = 65536
92 s1 = 1
93 s2 = 0
94 prec = 2
95C If A is in simple precision
96 IF(sizeof(a(1,1)) == 4) prec = 1
97 siz = siz1*siz2 * prec
98 ALLOCATE(tmp(siz))
99 tmp(1:siz) = 0
100c Convert A in integer
101 tmp = transfer(a(1:siz2,1:siz1),s1,siz)
102 DO i = 1,siz
103 s1 = mod(s1 + tmp(i),root)
104 s2 = mod(s1 + s2 ,root)
105 ENDDO
106C (s2 << 16) | s1
107 checksum = ior(s2 * two_power_16,s1)
108 DEALLOCATE(tmp)
109 END FUNCTION
110!||====================================================================
111!|| dp_checksum ../engine/share/modules/debug_mod.F
112!||====================================================================
113 PURE FUNCTION dp_checksum(A,SIZ1,SIZ2) RESULT(CHECKSUM)
114C Prints Adler 32 checksum of A(1:SIZ2,1:SIZ1) in *1.out file
115C-----------------------------------------------
116C I m p l i c i t T y p e s
117C-----------------------------------------------
118#include "implicit_f.inc"
119C-----------------------------------------------
120C C o m m o n B l o c k s
121C-----------------------------------------------
122#include "com01_c.inc"
123#include "com04_c.inc"
124#include "task_c.inc"
125#include "spmd_c.inc"
126#include "chara_c.inc"
127#include "units_c.inc"
128C-----------------------------------------------
129C-----------------------------------------------
130C D u m m y A r g u m e n t s
131C-----------------------------------------------
132 INTEGER, INTENT(IN) :: siz1,siz2
133 DOUBLE PRECISION, INTENT(IN) :: a(siz2,siz1)
134C-----------------------------------------------
135C L o c a l V a r i a b l e s
136C-----------------------------------------------
137 INTEGER, DIMENSION(:), ALLOCATABLE :: tmp
138 INTEGER :: i,checksum,root,s1,s2,two_power_16
139 INTEGER :: prec ! simple or double precision
140 INTEGER :: siz
141C-----------------------------------------------
142 root = 65521
143 two_power_16 = 65536
144 s1 = 1
145 s2 = 0
146 prec = 2
147C If A is in simple precision
148 IF(sizeof(a(1,1)) == 4) prec = 1
149 siz = siz1*siz2 * prec
150 ALLOCATE(tmp(siz))
151 tmp(1:siz) = 0
152c Convert A in integer
153 tmp = transfer(a(1:siz2,1:siz1),s1,siz)
154 DO i = 1,siz
155 s1 = mod(s1 + tmp(i),root)
156 s2 = mod(s1 + s2 ,root)
157 ENDDO
158C (s2 << 16) | s1
159 checksum = ior(s2 * two_power_16,s1)
160 DEALLOCATE(tmp)
161 END FUNCTION
162!||====================================================================
163!|| int_checksum ../engine/share/modules/debug_mod.F
164!||--- called by ------------------------------------------------------
165!|| i25cor3_e2s ../engine/source/interfaces/int25/i25cor3_e2s.F
166!|| i25optcd_e2s ../engine/source/interfaces/intsort/i25optcd_e2s.F
167!|| i25trivox_edg ../engine/source/interfaces/intsort/i25trivox_edg.F
168!||====================================================================
169 PURE FUNCTION int_checksum(A,SIZ1,SIZ2) RESULT(CHECKSUM)
170C Prints Adler 32 checksum of A(1:SIZ2,1:SIZ1) in *1.out file
171C-----------------------------------------------
172C I m p l i c i t T y p e s
173C-----------------------------------------------
174#include "implicit_f.inc"
175C-----------------------------------------------
176C C o m m o n B l o c k s
177C-----------------------------------------------
178#include "com01_c.inc"
179#include "com04_c.inc"
180#include "task_c.inc"
181#include "spmd_c.inc"
182#include "chara_c.inc"
183#include "units_c.inc"
184C-----------------------------------------------
185C-----------------------------------------------
186C D u m m y A r g u m e n t s
187C-----------------------------------------------
188 INTEGER, INTENT(IN) :: siz1,siz2
189 INTEGER, INTENT(IN) :: a(siz2,siz1)
190C-----------------------------------------------
191C L o c a l V a r i a b l e s
192C-----------------------------------------------
193 INTEGER, DIMENSION(:), ALLOCATABLE :: tmp
194 INTEGER :: i,checksum,root,s1,s2,two_power_16
195 INTEGER :: prec ! simple or double precision
196 INTEGER :: siz
197C-----------------------------------------------
198 root = 65521
199 two_power_16 = 65536
200 s1 = 1
201 s2 = 0
202 prec = 2
203C If A is in simple precision
204 IF(sizeof(a(1,1)) == 4) prec = 1
205 siz = siz1*siz2 * prec
206 ALLOCATE(tmp(siz))
207 tmp(1:siz) = 0
208c Convert A in integer
209 tmp = transfer(a(1:siz2,1:siz1),s1,siz)
210 DO i = 1,siz
211 s1 = mod(s1 + tmp(i),root)
212 s2 = mod(s1 + s2 ,root)
213 ENDDO
214C (s2 << 16) | s1
215 checksum = ior(s2 * two_power_16,s1)
216 DEALLOCATE(tmp)
217 END FUNCTION
218 END MODULE debug_mod
219
220
221!||====================================================================
222!|| prepare_debug ../engine/share/modules/debug_mod.F
223!||--- called by ------------------------------------------------------
224!|| resol_alloc_phase1 ../engine/source/engine/resol_alloc.f90
225!||--- uses -----------------------------------------------------
226!|| debug_mod ../engine/share/modules/debug_mod.F
227!||====================================================================
228 SUBROUTINE prepare_debug(ITAB,NUMNOD,ispmd)
229 USE debug_mod
230C-----------------------------------------------
231C I m p l i c i t T y p e s
232C-----------------------------------------------
233#include "implicit_f.inc"
234C-----------------------------------------------
235 INTEGER, INTENT(IN) :: NUMNOD
236 integer, intent(in) :: ispmd !< processor id
237 INTEGER, DIMENSION(:), INTENT(IN) :: ITAB(NUMNOD)
238C-----------------------------------------------
239 ALLOCATE (itab_debug(numnod))
240 itab_debug(1:numnod)=itab(1:numnod)
241C-----------------------------------------------
242 ncycle_debug = 0 ! updated in resol loop
243 ispmd_debug = ispmd
244C-----------------------------------------------
245 END
246
subroutine prepare_debug(itab, numnod, ispmd)
Definition debug_mod.F:229
integer ispmd_debug
processor id
Definition debug_mod.F:52
integer ncycle_debug
Engine Cycle number.
Definition debug_mod.F:51
pure integer function dp_checksum(a, siz1, siz2)
Definition debug_mod.F:114
pure integer function sp_checksum(a, siz1, siz2)
Definition debug_mod.F:61
integer, dimension(:), allocatable itab_debug
User Node Identifiers.
Definition debug_mod.F:50
pure integer function int_checksum(a, siz1, siz2)
Definition debug_mod.F:170