Skip to content

Commit

Permalink
update rndgenPL.f90
Browse files Browse the repository at this point in the history
Remove `block` to be compatible with older compilers.
  • Loading branch information
wcota authored Aug 7, 2024
1 parent d05adc0 commit c997ae6
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/rndgenPL.f90
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ subroutine initPL_rndgenPL(this, kmin, kmax, gama, iseed)
integer(kind=i16), intent(in) :: kmin, kmax
real(kind=dp), intent(in) :: gama
integer, intent(in), optional :: iseed
integer(kind=kind(kmax)) :: j

if (present(iseed)) call this%init(iseed)

Expand All @@ -46,18 +47,14 @@ subroutine initPL_rndgenPL(this, kmin, kmax, gama, iseed)
allocate (this%prob(kmin:kmax))

this%AA = 0d0
block
integer(kind=kind(kmax)) :: j

do j = kmin, kmax
this%AA = this%AA + (1.0_dp*j)**(-gama)
this%prob(j) = (1.0_dp*j)**(-gama)
end do

this%AA = 1.0_dp/this%AA
this%prob = this%AA*this%prob
do j = kmin, kmax
this%AA = this%AA + (1.0_dp*j)**(-gama)
this%prob(j) = (1.0_dp*j)**(-gama)
end do

end block
this%AA = 1.0_dp/this%AA
this%prob = this%AA*this%prob

this%x0 = (1.0_dp*(kmin - 1))**(-gama + 1.0_dp)
this%xc = (1.0_dp*kmax)**(-gama + 1.0_dp)
Expand Down

0 comments on commit c997ae6

Please sign in to comment.