-
Notifications
You must be signed in to change notification settings - Fork 102
/
Copy pathstopcondf.F90
662 lines (539 loc) · 21.4 KB
/
stopcondf.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
863
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
module StoppingConditions
implicit none
integer, private, save :: MAX_NUMBER_OF_SIMULTANIOUS_CONDITIONS_SET = 0
integer, private, save :: DELTA_MAX_NUMBER_OF_SIMULTANIOUS_CONDITIONS_SET = 100
integer :: MAX_NUMBER_OF_PARTICLES_PER_INDEX
parameter(MAX_NUMBER_OF_PARTICLES_PER_INDEX = 256)
double precision :: DBL_MAX
parameter(DBL_MAX = 1.d308)
integer, private, allocatable, save :: type_of_stopping_condition_set(:)
integer, private, allocatable, save :: &
& index_of_particle_in_stopping_condition(:,:)
integer, private, allocatable, save :: &
& local_type_of_stopping_condition_set(:)
integer, private, allocatable, save:: &
& local_index_of_particle_in_stopping_condition(:,:)
integer*4, private, save :: enabled_conditions = 0
integer*4, private, save :: set_conditions = 0
integer*4, private, save :: supported_conditions = 0
integer*4, private, save :: number_of_stopping_conditions_set = 0
double precision, private, save :: timeout_parameter = 4.0
double precision, private, save :: out_of_box_parameter = 0.0
integer*4, private, save :: number_of_steps_parameter = 1
double precision, private, save :: minimum_density_parameter = -1.0
double precision, private, save :: maximum_density_parameter = DBL_MAX
double precision, private, save :: minimum_internal_energy_parameter = -1.0
double precision, private, save :: maximum_internal_energy_parameter = DBL_MAX
double precision, private, save :: INTERACTION_OVER_parameter = 0.0
logical, private, save :: use_center_of_mass_parameter = .FALSE.
integer, private, save :: sc_mpi_size;
integer, private, save :: sc_mpi_rank;
INTEGER :: COLLISION_DETECTION_BITMAP
INTEGER :: PAIR_DETECTION_BITMAP
INTEGER :: ESCAPER_DETECTION_BITMAP
INTEGER :: TIMEOUT_DETECTION_BITMAP
INTEGER :: NUMBER_OF_STEPS_DETECTION_BITMAP
INTEGER :: OUT_OF_BOX_DETECTION_BITMAP
INTEGER :: DENSITY_LIMIT_DETECTION_BITMAP
INTEGER :: INTERNAL_ENERGY_LIMIT_DETECTION_BITMAP
INTEGER :: INTERACTION_OVER_DETECTION_BITMAP
INTEGER :: SUPERNOVA_DETECTION_BITMAP
INTEGER :: COLLISION_DETECTION
INTEGER :: PAIR_DETECTION
INTEGER :: ESCAPER_DETECTION
INTEGER :: TIMEOUT_DETECTION
INTEGER :: NUMBER_OF_STEPS_DETECTION
INTEGER :: OUT_OF_BOX_DETECTION
INTEGER :: DENSITY_LIMIT_DETECTION
INTEGER :: INTERNAL_ENERGY_LIMIT_DETECTION
INTEGER :: INTERACTION_OVER_DETECTION
INTEGER :: SUPERNOVA_DETECTION
PARAMETER (COLLISION_DETECTION_BITMAP=1)
PARAMETER (PAIR_DETECTION_BITMAP=2)
PARAMETER (ESCAPER_DETECTION_BITMAP=4)
PARAMETER (TIMEOUT_DETECTION_BITMAP=8)
PARAMETER (NUMBER_OF_STEPS_DETECTION_BITMAP=16)
PARAMETER (OUT_OF_BOX_DETECTION_BITMAP=32)
PARAMETER (DENSITY_LIMIT_DETECTION_BITMAP=64)
PARAMETER (INTERNAL_ENERGY_LIMIT_DETECTION_BITMAP=128)
PARAMETER (INTERACTION_OVER_DETECTION_BITMAP=256)
PARAMETER (SUPERNOVA_DETECTION_BITMAP=512)
PARAMETER (COLLISION_DETECTION=0)
PARAMETER (PAIR_DETECTION=1)
PARAMETER (ESCAPER_DETECTION=2)
PARAMETER (TIMEOUT_DETECTION=3)
PARAMETER (NUMBER_OF_STEPS_DETECTION=4)
PARAMETER (OUT_OF_BOX_DETECTION=5)
PARAMETER (DENSITY_LIMIT_DETECTION=6)
PARAMETER (INTERNAL_ENERGY_LIMIT_DETECTION=7)
PARAMETER (INTERACTION_OVER_DETECTION=8)
PARAMETER (SUPERNOVA_DETECTION=9)
contains
function increase_memory()
implicit none
integer :: old_max, i, j
integer :: increase_memory
integer, allocatable :: saved_type_of_stopping_condition_set(:)
integer, allocatable :: save_index_of_particle_in_stopping_condition(:,:)
old_max = MAX_NUMBER_OF_SIMULTANIOUS_CONDITIONS_SET;
MAX_NUMBER_OF_SIMULTANIOUS_CONDITIONS_SET = &
& MAX_NUMBER_OF_SIMULTANIOUS_CONDITIONS_SET &
& DELTA_MAX_NUMBER_OF_SIMULTANIOUS_CONDITIONS_SET
if (ALLOCATED(type_of_stopping_condition_set)) THEN
ALLOCATE(saved_type_of_stopping_condition_set(0:old_max))
saved_type_of_stopping_condition_set = type_of_stopping_condition_set
DEALLOCATE(type_of_stopping_condition_set)
ALLOCATE(type_of_stopping_condition_set(&
& 0:MAX_NUMBER_OF_SIMULTANIOUS_CONDITIONS_SET))
type_of_stopping_condition_set(0:old_max) = saved_type_of_stopping_condition_set
DEALLOCATE(saved_type_of_stopping_condition_set)
ELSE
ALLOCATE(type_of_stopping_condition_set(&
& 0:MAX_NUMBER_OF_SIMULTANIOUS_CONDITIONS_SET))
ENDIF
if (ALLOCATED(index_of_particle_in_stopping_condition)) THEN
ALLOCATE(save_index_of_particle_in_stopping_condition(0:MAX_NUMBER_OF_PARTICLES_PER_INDEX,0:old_max))
save_index_of_particle_in_stopping_condition = index_of_particle_in_stopping_condition
DEALLOCATE(index_of_particle_in_stopping_condition)
ALLOCATE(index_of_particle_in_stopping_condition(&
& 0:MAX_NUMBER_OF_PARTICLES_PER_INDEX, 0:MAX_NUMBER_OF_SIMULTANIOUS_CONDITIONS_SET))
index_of_particle_in_stopping_condition(&
& 0:MAX_NUMBER_OF_PARTICLES_PER_INDEX, 0:old_max) = save_index_of_particle_in_stopping_condition
DEALLOCATE(save_index_of_particle_in_stopping_condition)
ELSE
ALLOCATE(index_of_particle_in_stopping_condition(&
& 0:MAX_NUMBER_OF_PARTICLES_PER_INDEX, 0:MAX_NUMBER_OF_SIMULTANIOUS_CONDITIONS_SET))
ENDIF
increase_memory = 0
end function
function enable_stopping_condition(type)
implicit none
integer, intent(in) :: type
integer :: enable_stopping_condition
if(type > 32) then
enable_stopping_condition = -1
return
end if
enabled_conditions = IOR(enabled_conditions, ISHFT(1 , type))
enable_stopping_condition = 0
end function
function set_support_for_condition(type)
implicit none
integer, intent(in) :: type
integer :: set_support_for_condition
supported_conditions = IOR(supported_conditions, ISHFT(1 , type))
set_support_for_condition = 0
end function
function get_enabled_conditions()
implicit none
integer :: get_enabled_conditions
get_enabled_conditions = enabled_conditions
end function
function get_set_conditions()
implicit none
integer :: get_set_conditions
get_set_conditions = set_conditions
end function
function get_number_of_stopping_conditions_set(result)
implicit none
integer, intent(out) :: result
integer :: get_number_of_stopping_conditions_set
result = number_of_stopping_conditions_set;
get_number_of_stopping_conditions_set = 0
end function
function is_stopping_condition_set(type, result)
implicit none
integer, intent(in) :: type
integer, intent(out) :: result
integer :: is_stopping_condition_set
if(IAND(ISHFT(1 , type) , set_conditions) > 0) then
result = 1
else
result = 0
end if
is_stopping_condition_set = 0
end function
function is_stopping_condition_enabled(type, result)
implicit none
integer, intent(in) :: type
integer, intent(out) :: result
integer :: is_stopping_condition_enabled
if(IAND(ISHFT(1 , type) , enabled_conditions) > 0) then
result = 1
else
result = 0
end if
is_stopping_condition_enabled = 0
end function
function is_any_condition_set()
implicit none
integer :: is_any_condition_set
if (IAND(set_conditions ,enabled_conditions) > 0) then
is_any_condition_set = 1
else
is_any_condition_set = 0
end if
end function
function disable_stopping_condition(type)
implicit none
integer, intent(in) :: type
integer :: disable_stopping_condition
enabled_conditions = IAND(enabled_conditions, NOT(ISHFT(1 , type)));
disable_stopping_condition = 0
end function
function has_stopping_condition(type, result)
implicit none
integer, intent(in) :: type
integer, intent(out) :: result
integer :: has_stopping_condition
if(IAND(ISHFT(1 , type) , supported_conditions) > 0) then
result = 1
else
result = 0
end if
has_stopping_condition = 0;
end function
function get_stopping_condition_info(index, type, number_of_particles)
implicit none
integer, intent(in) :: index
integer, intent(out) :: type
integer, intent(out) :: number_of_particles
integer :: get_stopping_condition_info
integer :: i, id;
if (index >= number_of_stopping_conditions_set) then
get_stopping_condition_info = -1
return
end if
number_of_particles = 0
do i = 0, MAX_NUMBER_OF_PARTICLES_PER_INDEX
id = index_of_particle_in_stopping_condition(i, index);
if (id >= 0) then
index_of_particle_in_stopping_condition(i, index) = -1;
index_of_particle_in_stopping_condition(number_of_particles, index) = id;
number_of_particles = number_of_particles 1;
end if
end do
type = type_of_stopping_condition_set(index);
get_stopping_condition_info = 0
return
end function
function get_stopping_condition_particle_index(index, index_in_the_condition, index_of_particle)
implicit none
integer, intent(in) :: index
integer, intent(in) :: index_in_the_condition
integer, intent(out) :: index_of_particle
integer :: get_stopping_condition_particle_index
integer :: i, id;
if (index >= number_of_stopping_conditions_set) then
get_stopping_condition_particle_index = -1
return
end if
if (index_in_the_condition >= MAX_NUMBER_OF_PARTICLES_PER_INDEX) then
get_stopping_condition_particle_index = -1
return
end if
index_of_particle = index_of_particle_in_stopping_condition(index_in_the_condition, index)
get_stopping_condition_particle_index = 0
end function
function reset_stopping_conditions()
implicit none
integer :: reset_stopping_conditions
number_of_stopping_conditions_set = 0
set_conditions = 0
reset_stopping_conditions = 0
end function
function next_index_for_stopping_condition()
implicit none
integer :: next_index_for_stopping_condition, i
if (number_of_stopping_conditions_set == MAX_NUMBER_OF_SIMULTANIOUS_CONDITIONS_SET) then
if(increase_memory() .LT. 0) THEN
next_index_for_stopping_condition = -1
return
ENDIF
end if
do i = 0 , MAX_NUMBER_OF_PARTICLES_PER_INDEX
index_of_particle_in_stopping_condition(i, number_of_stopping_conditions_set) = -1
end do
next_index_for_stopping_condition = number_of_stopping_conditions_set
number_of_stopping_conditions_set = number_of_stopping_conditions_set 1
end function
function set_stopping_condition_info(index, type)
implicit none
integer, intent(in) :: index
integer, intent(in) :: type
integer :: set_stopping_condition_info
if (index >= number_of_stopping_conditions_set) then
set_stopping_condition_info = -1
return
end if
set_conditions = IOR(set_conditions, ISHFT(1 , type))
type_of_stopping_condition_set(index) = type;
set_stopping_condition_info = 0
end function
function set_stopping_condition_particle_index(index, index_in_the_condition, id_of_the_particle)
implicit none
integer, intent(in) :: index
integer, intent(in) :: index_in_the_condition
integer, intent(in) :: id_of_the_particle
integer :: set_stopping_condition_particle_index
if (index >= number_of_stopping_conditions_set) then
set_stopping_condition_particle_index = -1
return
end if
if (index_in_the_condition >= MAX_NUMBER_OF_PARTICLES_PER_INDEX) then
set_stopping_condition_particle_index = -1
return
end if
index_of_particle_in_stopping_condition(index_in_the_condition, index) = id_of_the_particle
set_stopping_condition_particle_index = 0
end function
function set_stopping_condition_timeout_parameter(value)
double precision, intent(in) :: value
integer :: set_stopping_condition_timeout_parameter
if(value < 0.0) then
set_stopping_condition_timeout_parameter = -1
return
end if
timeout_parameter = value
set_stopping_condition_timeout_parameter = 0
end function
function get_stopping_condition_timeout_parameter(value)
integer :: get_stopping_condition_timeout_parameter
double precision, intent(out) :: value
value = timeout_parameter
get_stopping_condition_timeout_parameter = 0
end function
function set_stopping_condition_number_of_steps_parameter(value)
integer, intent(in) :: value
integer :: set_stopping_condition_number_of_steps_parameter
if(value < 0.0) then
set_stopping_condition_number_of_steps_parameter = -1
return
end if
number_of_steps_parameter = value
set_stopping_condition_number_of_steps_parameter = 0
end function
function get_stopping_condition_number_of_steps_parameter(value)
integer :: get_stopping_condition_number_of_steps_parameter
integer, intent(out) :: value
value = number_of_steps_parameter
get_stopping_condition_number_of_steps_parameter = 0
end function
function set_stopping_condition_out_of_box_parameter(value)
double precision, intent(in) :: value
integer :: set_stopping_condition_out_of_box_parameter
out_of_box_parameter = value
set_stopping_condition_out_of_box_parameter = 0
end function
function get_stopping_condition_out_of_box_parameter(value)
integer :: get_stopping_condition_out_of_box_parameter
double precision, intent(out) :: value
value = out_of_box_parameter
get_stopping_condition_out_of_box_parameter = 0
end function
function set_stopping_condition_out_of_box_use_center_of_mass_parameter(value)
logical, intent(in) :: value
integer :: set_stopping_condition_out_of_box_use_center_of_mass_parameter
use_center_of_mass_parameter = value
set_stopping_condition_out_of_box_use_center_of_mass_parameter = 0
end function
function get_stopping_condition_out_of_box_use_center_of_mass_parameter(value)
integer :: get_stopping_condition_out_of_box_use_center_of_mass_parameter
logical, intent(out) :: value
value = use_center_of_mass_parameter
get_stopping_condition_out_of_box_use_center_of_mass_parameter = 0
end function
function set_stopping_condition_minimum_density_parameter(value)
double precision, intent(in) :: value
integer :: set_stopping_condition_minimum_density_parameter
minimum_density_parameter = value
set_stopping_condition_minimum_density_parameter = 0
end function
function get_stopping_condition_minimum_density_parameter(value)
integer :: get_stopping_condition_minimum_density_parameter
double precision, intent(out) :: value
value = minimum_density_parameter
get_stopping_condition_minimum_density_parameter = 0
end function
function set_stopping_condition_maximum_density_parameter(value)
double precision, intent(in) :: value
integer :: set_stopping_condition_maximum_density_parameter
maximum_density_parameter = value
if(value < 0.0) then
maximum_density_parameter = DBL_MAX
else
maximum_density_parameter = value
end if
set_stopping_condition_maximum_density_parameter = 0
end function
function get_stopping_condition_maximum_density_parameter(value)
integer :: get_stopping_condition_maximum_density_parameter
double precision, intent(out) :: value
value = maximum_density_parameter
get_stopping_condition_maximum_density_parameter = 0
end function
function set_stopping_condition_minimum_internal_energy_parameter(value)
double precision, intent(in) :: value
integer :: set_stopping_condition_minimum_internal_energy_parameter
minimum_internal_energy_parameter = value
set_stopping_condition_minimum_internal_energy_parameter = 0
end function
function get_stopping_condition_minimum_internal_energy_parameter(value)
integer :: get_stopping_condition_minimum_internal_energy_parameter
double precision, intent(out) :: value
value = minimum_internal_energy_parameter
get_stopping_condition_minimum_internal_energy_parameter = 0
end function
function set_stopping_condition_maximum_internal_energy_parameter(value)
double precision, intent(in) :: value
integer :: set_stopping_condition_maximum_internal_energy_parameter
maximum_internal_energy_parameter = value
if(value < 0.0) then
maximum_internal_energy_parameter = DBL_MAX
else
maximum_internal_energy_parameter = value
end if
set_stopping_condition_maximum_internal_energy_parameter = 0
end function
function get_stopping_condition_maximum_internal_energy_parameter(value)
integer :: get_stopping_condition_maximum_internal_energy_parameter
double precision, intent(out) :: value
value = maximum_internal_energy_parameter
get_stopping_condition_maximum_internal_energy_parameter = 0
end function
#if defined( MPILIB ) && !defined(NOMPI)
function mpi_setup_stopping_conditions()
#if defined( MPILIB ) && !defined(NOMPI)
use mpi
#endif
implicit none
integer :: mpi_setup_stopping_conditions
integer :: error
call MPI_Comm_rank(MPI_COMM_WORLD, sc_mpi_rank, error)
if (error .NE. 0) then
mpi_setup_stopping_conditions = -1
return
end if
call MPI_Comm_size(MPI_COMM_WORLD, sc_mpi_size, error)
if (error .NE. 0) then
mpi_setup_stopping_conditions = -1
return
end if
mpi_setup_stopping_conditions = 0
end function
function mpi_distribute_stopping_conditions()
#if defined( MPILIB ) && !defined(NOMPI)
use mpi
#endif
implicit none
integer :: mpi_distribute_stopping_conditions
mpi_distribute_stopping_conditions = 0
end function
function mpi_collect_stopping_conditions()
#if defined( MPILIB ) && !defined(NOMPI)
use mpi
#endif
implicit none
integer :: mpi_collect_stopping_conditions
integer :: i, error, offset
integer :: local_number_of_stopping_conditions_set
integer :: n, tmp
integer :: counts(sc_mpi_size)
integer :: displs(sc_mpi_size)
integer*4 :: set
mpi_collect_stopping_conditions = 0
counts = 0
displs = 0
set = 0
call MPI_Allreduce(set_conditions, set, 1, MPI_INTEGER, MPI_BOR, MPI_COMM_WORLD, error)
set_conditions = set
call MPI_Gather(number_of_stopping_conditions_set, 1, MPI_INTEGER, counts, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, error)
if (sc_mpi_rank .EQ. 0) then
local_number_of_stopping_conditions_set = 0
do i = 1, sc_mpi_size
local_number_of_stopping_conditions_set = local_number_of_stopping_conditions_set counts(i)
end do
if(local_number_of_stopping_conditions_set &
& > MAX_NUMBER_OF_SIMULTANIOUS_CONDITIONS_SET) THEN
n = ((local_number_of_stopping_conditions_set - &
& MAX_NUMBER_OF_SIMULTANIOUS_CONDITIONS_SET) / &
& DELTA_MAX_NUMBER_OF_SIMULTANIOUS_CONDITIONS_SET) 1;
tmp = DELTA_MAX_NUMBER_OF_SIMULTANIOUS_CONDITIONS_SET;
DELTA_MAX_NUMBER_OF_SIMULTANIOUS_CONDITIONS_SET = n * &
& DELTA_MAX_NUMBER_OF_SIMULTANIOUS_CONDITIONS_SET;
error = increase_memory()
DELTA_MAX_NUMBER_OF_SIMULTANIOUS_CONDITIONS_SET = tmp;
END IF
ALLOCATE(local_type_of_stopping_condition_set(&
& 0:MAX_NUMBER_OF_SIMULTANIOUS_CONDITIONS_SET))
ALLOCATE(local_index_of_particle_in_stopping_condition(&
& 0:MAX_NUMBER_OF_PARTICLES_PER_INDEX, &
& 0:MAX_NUMBER_OF_SIMULTANIOUS_CONDITIONS_SET))
end if
if (sc_mpi_rank .EQ. 0) then
offset = 0
do i = 1, sc_mpi_size
displs(i) = offset;
offset = offset counts(i)
end do
end if
call MPI_Gatherv( &
type_of_stopping_condition_set, &
number_of_stopping_conditions_set, &
MPI_INTEGER, &
local_type_of_stopping_condition_set, &
counts, &
displs, &
MPI_INTEGER, &
0, &
MPI_COMM_WORLD, &
error&
)
if (sc_mpi_rank .EQ. 0) then
offset = 0
do i = 1, sc_mpi_size
displs(i) = offset;
counts(i) = counts(i) * (MAX_NUMBER_OF_PARTICLES_PER_INDEX 1);
offset = offset counts(i)
end do
end if
call MPI_Gatherv( &
index_of_particle_in_stopping_condition,&
number_of_stopping_conditions_set*(MAX_NUMBER_OF_PARTICLES_PER_INDEX 1),&
MPI_INTEGER,&
local_index_of_particle_in_stopping_condition,&
counts, &
displs,&
MPI_INTEGER,&
0, &
MPI_COMM_WORLD&
);
if (sc_mpi_rank .EQ. 0) then
number_of_stopping_conditions_set = local_number_of_stopping_conditions_set
if (number_of_stopping_conditions_set.GT.0) then
index_of_particle_in_stopping_condition = local_index_of_particle_in_stopping_condition
type_of_stopping_condition_set = local_type_of_stopping_condition_set
end if
DEALLOCATE(local_type_of_stopping_condition_set)
DEALLOCATE(local_index_of_particle_in_stopping_condition)
end if
end function
#else
function mpi_setup_stopping_conditions()
integer :: mpi_setup_stopping_conditions
sc_mpi_size = 1
mpi_setup_stopping_conditions = 0
end function
function mpi_collect_stopping_conditions()
integer :: mpi_collect_stopping_conditions
mpi_collect_stopping_conditions = 0
end function
function mpi_distribute_stopping_conditions()
integer :: mpi_distribute_stopping_conditions
mpi_distribute_stopping_conditions = 0
if(enabled_conditions .EQ. 0) then
return
end if
end function
#endif
end module