SCALE-RM
Functions/Subroutines
scale_random Module Reference

module RANDOM More...

Functions/Subroutines

subroutine, public random_setup
 Setup. More...
 
subroutine, public random_uniform (var)
 Get uniform random number. More...
 
subroutine, public random_normal (var)
 Get normal random number. More...
 

Detailed Description

module RANDOM

Description
random number generation module
Author
Team SCALE
History
  • 2012-03-28 (H.Yashiro) [new]
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 55 of file scale_random.F90.

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().

55  use scale_prc, only: &
56  prc_abort
57  implicit none
58 
59  namelist / param_random / &
60  random_fix
61 
62  integer :: nseeds, ierr
63  !---------------------------------------------------------------------------
64 
65  log_newline
66  log_info("RANDOM_setup",*) 'Setup'
67 
68  !--- read namelist
69  rewind(io_fid_conf)
70  read(io_fid_conf,nml=param_random,iostat=ierr)
71  if( ierr < 0 ) then !--- missing
72  log_info("RANDOM_setup",*) 'Not found namelist. Default used.'
73  elseif( ierr > 0 ) then !--- fatal error
74  log_error("RANDOM_setup",*) 'Not appropriate names in namelist PARAM_RANDOM. Check!'
75  call prc_abort
76  endif
77  log_nml(param_random)
78 
79  call random_seed
80  call random_seed(size=nseeds)
81 
82  allocate( random_seedvar(nseeds))
83 
84  log_newline
85  log_info("RANDOM_setup",*) 'Array size for random seed:', nseeds
86  if ( random_fix ) then
87  log_info("RANDOM_setup",*) 'random seed is fixed.'
88  endif
89 
90  call random_reset
91 
92  return
integer, public io_fid_conf
Config file ID.
Definition: scale_io.F90:55
module PROCESS
Definition: scale_prc.F90:11
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
Here is the call graph for this function:
Here is the caller graph for this function:

◆ random_uniform()

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

Get uniform random number.

Definition at line 140 of file scale_random.F90.

Referenced by scale_atmos_phy_mp_suzuki10::atmos_phy_mp_suzuki10_qhyd2qtrc(), and mod_mkinit::read_sounding().

140  implicit none
141 
142  real(RP), intent(out) :: var(:,:,:)
143  !---------------------------------------------------------------------------
144 
145  call random_number(var)
146 
147  return
Here is the caller graph for this function:

◆ random_normal()

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

Get normal random number.

Definition at line 153 of file scale_random.F90.

References scale_const::const_pi.

Referenced by scale_atmos_phy_tb_smg::atmos_phy_tb_smg().

153  implicit none
154  real(RP), intent(out) :: var(:,:,:)
155  integer :: n
156 
157  n = size(var)
158  call get_normal( n, var(:,:,:) )
159 
160  return
Here is the caller graph for this function: