From e4700cda25e163a2c778b0a7b11159049e87ffc4 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 7 Nov 2017 14:56:28 -0500 Subject: [PATCH] changed fixed_seed to random_seed for clarity --- examples/ConfigFiles/numerics.config | 2 +- src/math.f90 | 6 +++--- src/numerics.f90 | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/ConfigFiles/numerics.config b/examples/ConfigFiles/numerics.config index 580b58e57..ab8903927 100644 --- a/examples/ConfigFiles/numerics.config +++ b/examples/ConfigFiles/numerics.config @@ -49,7 +49,7 @@ maxVolDiscrepancy_RGC 1.0e-5 # maximum allowable relative volume discr volDiscrepancyMod_RGC 1.0e+12 discrepancyPower_RGC 5.0 -fixed_seed 0 # put any number larger than zero, integer, if you want to have a pseudo random distribution +random_seed 0 # any integer larger than zero seeds the random generator, otherwise random seeding ## spectral parameters ## err_div_tolAbs 1.0e-3 # absolute tolerance for fulfillment of stress equilibrium diff --git a/src/math.f90 b/src/math.f90 index 80bf239a3..29d401162 100644 --- a/src/math.f90 +++ b/src/math.f90 @@ -177,7 +177,7 @@ subroutine math_init compiler_version, & compiler_options #endif - use numerics, only: fixedSeed + use numerics, only: randomSeed use IO, only: IO_timeStamp implicit none @@ -194,8 +194,8 @@ subroutine math_init call random_seed(size=randSize) if (allocated(randInit)) deallocate(randInit) allocate(randInit(randSize)) - if (fixedSeed > 0_pInt) then - randInit(1:randSize) = int(fixedSeed) ! fixedSeed is of type pInt, randInit not + if (randomSeed > 0_pInt) then + randInit(1:randSize) = int(randomSeed) ! randomSeed is of type pInt, randInit not call random_seed(put=randInit) else call random_seed() diff --git a/src/numerics.f90 b/src/numerics.f90 index 2085e221e..70c7f3c30 100644 --- a/src/numerics.f90 +++ b/src/numerics.f90 @@ -25,7 +25,7 @@ module numerics nState = 10_pInt, & !< state loop limit nStress = 40_pInt, & !< stress loop limit pert_method = 1_pInt, & !< method used in perturbation technique for tangent - fixedSeed = 0_pInt, & !< fixed seeding for pseudo-random number generator, Default 0: use random seed + randomSeed = 0_pInt, & !< fixed seeding for pseudo-random number generator, Default 0: use random seed worldrank = 0_pInt, & !< MPI worldrank (/=0 for MPI simulations only) worldsize = 0_pInt !< MPI worldsize (/=0 for MPI simulations only) integer(4), protected, public :: & @@ -359,8 +359,8 @@ subroutine numerics_init !-------------------------------------------------------------------------------------------------- ! random seeding parameter - case ('fixed_seed') - fixedSeed = IO_intValue(line,chunkPos,2_pInt) + case ('random_seed','fixed_seed') + randomSeed = IO_intValue(line,chunkPos,2_pInt) !-------------------------------------------------------------------------------------------------- ! gradient parameter @@ -560,9 +560,9 @@ subroutine numerics_init !-------------------------------------------------------------------------------------------------- ! Random seeding parameter - write(6,'(a24,1x,i16,/)') ' fixed_seed: ',fixedSeed - if (fixedSeed <= 0_pInt) & - write(6,'(a,/)') ' No fixed Seed: Random is random!' + write(6,'(a24,1x,i16,/)') ' random_seed: ',randomSeed + if (randomSeed <= 0_pInt) & + write(6,'(a,/)') ' random seed will be generated!' !-------------------------------------------------------------------------------------------------- ! gradient parameter