SCALE-RM
Functions/Subroutines
scale_random Module Reference

module RANDOM More...

Functions/Subroutines

subroutine, public random_setup
 Setup. More...
 
subroutine, public random_get (var)
 Get 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 53 of file scale_random.F90.

References scale_stdio::io_fid_conf, scale_stdio::io_fid_log, scale_stdio::io_fid_nml, scale_stdio::io_l, scale_stdio::io_nml, scale_process::prc_mpistop(), and scale_process::prc_myrank.

Referenced by mod_rm_driver::scalerm(), and mod_rm_prep::scalerm_prep().

53  use scale_process, only: &
55  implicit none
56 
57  namelist / param_random / &
58  random_fix
59 
60  integer :: nseeds, ierr
61  !---------------------------------------------------------------------------
62 
63  if( io_l ) write(io_fid_log,*)
64  if( io_l ) write(io_fid_log,*) '++++++ Module[RANDOM] / Categ[COMMON] / Origin[SCALElib]'
65 
66  !--- read namelist
67  rewind(io_fid_conf)
68  read(io_fid_conf,nml=param_random,iostat=ierr)
69  if( ierr < 0 ) then !--- missing
70  if( io_l ) write(io_fid_log,*) '*** Not found namelist. Default used.'
71  elseif( ierr > 0 ) then !--- fatal error
72  write(*,*) 'xxx Not appropriate names in namelist PARAM_RANDOM. Check!'
73  call prc_mpistop
74  endif
75  if( io_nml ) write(io_fid_nml,nml=param_random)
76 
77  call random_seed
78  call random_seed(size=nseeds)
79 
80  allocate( random_seedvar(nseeds))
81 
82  if( io_l ) write(io_fid_log,*)
83  if( io_l ) write(io_fid_log,*) '*** Array size for random seed:', nseeds
84  if ( random_fix ) then
85  if( io_l ) write(io_fid_log,*) '*** random seed is fixed.'
86  endif
87 
88  return
subroutine, public prc_mpistop
Abort MPI.
module PROCESS
integer, public io_fid_conf
Config file ID.
Definition: scale_stdio.F90:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ random_get()

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

Get random number.

Definition at line 136 of file scale_random.F90.

Referenced by mod_mkinit::interporation_fact(), scale_atmos_phy_mp_suzuki10::mp_suzuki10(), scale_atmos_phy_mp_suzuki10::r_collcoag(), and mod_mkinit::read_sounding().

136  implicit none
137 
138  real(RP), intent(out) :: var(:,:,:)
139  !---------------------------------------------------------------------------
140 
141  call random_reset
142  call random_number(var)
143 
144  return
Here is the caller graph for this function: