Skip to content

Commit

Permalink
Small fix to main tally loop to reduce the number of reductions
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Sep 30, 2019
1 parent 89af790 commit 362a41b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/mare-with-rays-model2/ctem.in
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ doangle T ! Vary the impact angle. Set to
Kd1 0.00312669649143281
psi 2.000
fe 10.0
ejecta_truncation 20.0
ejecta_truncation 10.0
dorays T

! Testing input. These are used to perform non-Monte Carlo tests.
Expand Down
4 changes: 2 additions & 2 deletions examples/mare-with-rays-model2/equilmovie.plt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#gnuplot 5.0 script
do for [ii=78:78] {
do for [ii=119:119] {
reset


Expand Down Expand Up @@ -37,7 +37,7 @@ set label 1 "100 m" at 800+50e0/pix,100 tc rgb "white" front center

set style line 1 lt 1 lc rgb "white" lw 0.1

surf = sprintf("/Users/daminton/work/Projects/Lunar-Saturation/Diffusion/CTEMsims2/ray-fe10-narrow/surf/surf%06d.jpg",ii)
surf = sprintf("surf/surf%06d.jpg",ii)

plot surf binary filetype=auto w rgbimage notitle

Expand Down
5 changes: 2 additions & 3 deletions src/crater/crater_tally_observed.f90
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ subroutine crater_tally_observed(user,surf,domain,nkilled,onum,obsdist,obslist,o
!$OMP SHARED(domain,maxpix,istart,iend,ind,mlist,mposlist,mpxlist,mlayerlist) &
!$OMP SHARED(tnum,totpix,poslist,tlist,tmp_depthdiam,countable,Kval) &
!$OMP REDUCTION(+:nkilled) &
!$OMP REDUCTION(+:onum)
!$OMP DO
do craternum = 1,tnum
! This is the first pixel of this crater, so record the appropriate values
Expand Down Expand Up @@ -184,10 +183,10 @@ subroutine crater_tally_observed(user,surf,domain,nkilled,onum,obsdist,obslist,o
end do
nkilled = nkilled + 1
end if
if (countable(craternum)) onum = onum + 1
end do
!$OMP END DO
!$OMP END PARALLEL
!$OMP END PARALLEL
onum = tnum - nkilled

! Bin the observed craters if required
if (present(obsdist)) then
Expand Down

0 comments on commit 362a41b

Please sign in to comment.