@@ -484,17 +484,17 @@ contains
484484 !! generator because the native generator is not compatible being called
485485 !! from GPU routines/ functions
486486 function f_model_random_number (seed ) result(rval)
487-
487+
488488 $:GPU_ROUTINE(parallelism= ' [seq]' )
489-
489+
490490 integer , intent (inout ) :: seed
491491 real (wp) :: rval
492-
492+
493493 seed = ieor (seed, ishft(seed, 13 ))
494494 seed = ieor (seed, ishft(seed, - 17 ))
495495 seed = ieor (seed, ishft(seed, 5 ))
496-
497- rval = abs (real (seed, wp)) / real (huge (seed), wp)
496+
497+ rval = abs (real (seed, wp))/ real (huge (seed), wp)
498498 end function f_model_random_number
499499
500500 !> This procedure, recursively, finds whether a point is inside an octree.
@@ -521,16 +521,16 @@ contains
521521
522522 real (wp), dimension (1 :spc, 1 :3 ) :: ray_origins, ray_dirs
523523
524- rand_seed = int (point(1 ) * 73856093_wp ) + &
525- int (point(2 ) * 19349663_wp ) + &
526- int (point(3 ) * 83492791_wp )
524+ rand_seed = int (point(1 )* 73856093_wp ) + &
525+ int (point(2 )* 19349663_wp ) + &
526+ int (point(3 )* 83492791_wp )
527527 if (rand_seed == 0 ) rand_seed = 1
528528
529529 ! generate our random collection or rays
530530 do i = 1 , spc
531531 do k = 1 , 3
532532 ! random jitter in the origin helps us estimate volume fraction instead of only at the cell center
533- ray_origins(i, k) = point(k) + (f_model_random_number(rand_seed) - 0.5_wp ) * spacing (k)
533+ ray_origins(i, k) = point(k) + (f_model_random_number(rand_seed) - 0.5_wp )* spacing (k)
534534 ! cast sample rays in all directions
535535 ray_dirs(i, k) = point(k) + f_model_random_number(rand_seed) - 0.5_wp
536536 end do
@@ -561,12 +561,12 @@ contains
561561 end function f_model_is_inside
562562
563563 impure function f_model_is_inside_flat (ntrs , trs_v , trs_n , pid , point , spacing , spc ) result(fraction)
564-
564+
565565 $:GPU_ROUTINE(parallelism= ' [seq]' )
566566
567567 integer , intent (in ) :: ntrs
568- real (wp), dimension (:,:,:, :), intent (in ) :: trs_v
569- real (wp), dimension (:,:, :), intent (in ) :: trs_n
568+ real (wp), dimension (:, :, :, :), intent (in ) :: trs_v
569+ real (wp), dimension (:, :, :), intent (in ) :: trs_n
570570 integer , intent (in ) :: pid
571571 real (wp), dimension (1 :3 ), intent (in ) :: point
572572 real (wp), dimension (1 :3 ), intent (in ) :: spacing
@@ -579,21 +579,21 @@ contains
579579 integer :: i, j, k, nInOrOut, nHits
580580 integer :: rand_seed
581581
582- rand_seed = int (point(1 ) * 73856093_wp ) + &
583- int (point(2 ) * 19349663_wp ) + &
584- int (point(3 ) * 83492791_wp )
582+ rand_seed = int (point(1 )* 73856093_wp ) + &
583+ int (point(2 )* 19349663_wp ) + &
584+ int (point(3 )* 83492791_wp )
585585 if (rand_seed == 0 ) rand_seed = 1
586586
587587 ! generate our random collection of rays
588588 nInOrOut = 0
589589 do i = 1 , spc
590590 ! Generate one ray at a time — no arrays needed
591591 do k = 1 , 3
592- origin(k) = point(k) + (f_model_random_number(rand_seed) - 0.5_wp ) * spacing (k)
592+ origin(k) = point(k) + (f_model_random_number(rand_seed) - 0.5_wp )* spacing (k)
593593 dir(k) = point(k) + f_model_random_number(rand_seed) - 0.5_wp
594594 end do
595595 dir_mag = sqrt (dir(1 )* dir(1 ) + dir(2 )* dir(2 ) + dir(3 )* dir(3 ))
596- dir(:) = dir(:) / dir_mag
596+ dir(:) = dir(:)/ dir_mag
597597
598598 ray%o = origin
599599 ray%d = dir
@@ -1327,14 +1327,14 @@ contains
13271327 subroutine s_pack_model_for_gpu (ma )
13281328 type(t_model_array), intent (inout ) :: ma
13291329 integer :: i
1330-
1330+
13311331 ma%ntrs = ma%model%ntrs
1332- allocate(ma%trs_v(1 :3 , 1 :3 , 1 :ma%ntrs))
1333- allocate(ma%trs_n(1 :3 , 1 :ma%ntrs))
1334-
1332+ allocate (ma%trs_v(1 :3 , 1 :3 , 1 :ma%ntrs))
1333+ allocate (ma%trs_n(1 :3 , 1 :ma%ntrs))
1334+
13351335 do i = 1 , ma%ntrs
13361336 ma%trs_v(:, :, i) = ma%model%trs(i)%v(:, :)
1337- ma%trs_n(:, i) = ma%model%trs(i)%n(:)
1337+ ma%trs_n(:, i) = ma%model%trs(i)%n(:)
13381338 end do
13391339 end subroutine
13401340
0 commit comments