From c997ae6f137804f0bbad613a19674279368e7ef5 Mon Sep 17 00:00:00 2001 From: Wesley Cota Date: Wed, 7 Aug 2024 13:52:42 -0300 Subject: [PATCH] update rndgenPL.f90 Remove `block` to be compatible with older compilers. --- src/rndgenPL.f90 | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/rndgenPL.f90 b/src/rndgenPL.f90 index a617c3e..448a587 100644 --- a/src/rndgenPL.f90 +++ b/src/rndgenPL.f90 @@ -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) @@ -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)