SCALE-RM
Data Types | Functions/Subroutines
scale_random Module Reference

module RANDOM More...

Functions/Subroutines

subroutine, public random_setup
 Setup. More...
 
subroutine random_uniform_1d (var)
 Get uniform random number ( 1D ) More...
 

Detailed Description

module RANDOM

Description
random number generation module
Author
Team SCALE
NAMELIST
  • PARAM_RANDOM
    nametypedefault valuecomment
    RANDOM_FIX logical .false.

History Output
No history output

Function/Subroutine Documentation

◆ random_setup()

subroutine, public scale_random::random_setup

Setup.

Definition at line 64 of file scale_random.F90.

64  use scale_prc, only: &
65  prc_abort
66  implicit none
67 
68  namelist / param_random / &
69  random_fix
70 
71  integer :: nseeds, ierr
72  !---------------------------------------------------------------------------
73 
74  log_newline
75  log_info("RANDOM_setup",*) 'Setup'
76 
77  !--- read namelist
78  rewind(io_fid_conf)
79  read(io_fid_conf,nml=param_random,iostat=ierr)
80  if( ierr < 0 ) then !--- missing
81  log_info("RANDOM_setup",*) 'Not found namelist. Default used.'
82  elseif( ierr > 0 ) then !--- fatal error
83  log_error("RANDOM_setup",*) 'Not appropriate names in namelist PARAM_RANDOM. Check!'
84  call prc_abort
85  endif
86  log_nml(param_random)
87 
88  call random_seed
89  call random_seed(size=nseeds)
90 
91  allocate( random_seedvar(nseeds))
92 
93  log_newline
94  log_info("RANDOM_setup",*) 'Array size for random seed:', nseeds
95  if ( random_fix ) then
96  log_info("RANDOM_setup",*) 'random seed is fixed.'
97  endif
98 
99  call random_reset
100 
101  return

References scale_io::io_fid_conf, scale_prc::prc_abort(), and scale_prc::prc_myrank.

Referenced by mod_rm_driver::rm_driver(), and mod_rm_prep::rm_prep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ random_uniform_1d()

subroutine scale_random::random_uniform_1d ( real(rp), dimension(:), intent(out)  var)

Get uniform random number ( 1D )

Definition at line 149 of file scale_random.F90.

149  implicit none
150  real(RP), intent(out) :: var(:)
151  !---------------------------------------------------------------------------
152 
153  call random_number(var)
154 
155  return

References scale_const::const_pi.

scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:342
scale_prc
module PROCESS
Definition: scale_prc.F90:11