Skip to content

Commit 2c43100

Browse files
Fixed compiler seg fault
1 parent 5989738 commit 2c43100

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

src/common/m_model.fpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ contains
503503
!! from GPU routines/functions
504504
function f_model_random_number(seed) result(rval)
505505

506-
$:GPU_ROUTINE(parallelism='[seq]')
506+
! $:GPU_ROUTINE(parallelism='[seq]')
507507

508508
integer, intent(inout) :: seed
509509
real(wp) :: rval
@@ -585,20 +585,18 @@ contains
585585
!! @param pid Patch ID od this model
586586
!! @param point Point to test.
587587
!! @return fraction The perfentage of candidate rays cast indicate that we are inside the model
588-
impure function f_model_is_inside_flat(ntrs, trs_v, trs_n, pid, point) result(fraction)
588+
function f_model_is_inside_flat(ntrs, pid, point) result(fraction)
589589

590590
$:GPU_ROUTINE(parallelism='[seq]')
591591

592592
integer, intent(in) :: ntrs
593-
real(wp), dimension(:, :, :, :), intent(in) :: trs_v
594-
real(wp), dimension(:, :, :), intent(in) :: trs_n
595593
integer, intent(in) :: pid
596594
real(wp), dimension(1:3), intent(in) :: point
597595

598596
real(wp) :: fraction
599597
type(t_ray) :: ray
600598
type(t_triangle) :: tri
601-
integer :: i, j, k, q, nInOrOut, nHits, spc
599+
integer :: i, j, k, q, nInOrOut, nHits
602600

603601
! cast 26 rays from the point and count the number at leave the boundary
604602
nInOrOut = 0
@@ -617,8 +615,8 @@ contains
617615
! count the number of intersections
618616
nHits = 0
619617
do q = 1, ntrs
620-
tri%v(:, :) = trs_v(:, :, q, pid)
621-
tri%n(:) = trs_n(:, q, pid)
618+
tri%v(:, :) = gpu_trs_v(:, :, q, pid)
619+
tri%n(:) = gpu_trs_n(:, q, pid)
622620
if (f_intersects_triangle(ray, tri)) then
623621
nHits = nHits + 1
624622
end if

src/simulation/m_ib_patches.fpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,6 @@ contains
863863
xy_local = xy_local - offset
864864
865865
eta = f_model_is_inside_flat(gpu_ntrs(patch_id), &
866-
gpu_trs_v, gpu_trs_n, &
867866
patch_id, xy_local)
868867
869868
! Reading STL boundary vertices and compute the levelset and levelset_norm
@@ -953,7 +952,6 @@ contains
953952
xyz_local = xyz_local - offset
954953
955954
eta = f_model_is_inside_flat(gpu_ntrs(patch_id), &
956-
gpu_trs_v, gpu_trs_n, &
957955
patch_id, xyz_local)
958956
959957
if (eta > patch_ib(patch_id)%model_threshold) then

0 commit comments

Comments
 (0)