Skip to content

Commit

Permalink
Fix rangen for EPOS (#136)
Browse files Browse the repository at this point in the history
This is a hotfix for a mistake I introduced when I changed the random
number generation. Without this fix, EPOS eventually runs into an
infinite loop at some point after X events generated.

Since this is a simple hotfix, I will merge this myself.
  • Loading branch information
HDembinski authored Feb 27, 2023
1 parent a2b64a3 commit 6990f29
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/fortran/rangen.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ c-----------------------------------------------------------------------
c used by EPOS
c-----------------------------------------------------------------------
double precision rval
call npyrng(rval)
1 rangen=sngl(rval)
if(rangen.le.0.)goto 1
if(rangen.ge.1.)goto 1
20 call npyrng(rval)
if(rval.le.0.or.rval.ge.1) goto 20
rangen=sngl(rval)
end

c=======================================================================
function drangen(dummy)
function drangen( dummy )
c-----------------------------------------------------------------------
c used by EPOS
c-----------------------------------------------------------------------
Expand Down

0 comments on commit 6990f29

Please sign in to comment.