OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
init_random.F File Reference
#include "implicit_f.inc"
#include "units_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine init_random ()

Function/Subroutine Documentation

◆ init_random()

subroutine init_random

Definition at line 30 of file init_random.F.

31!$COMMENT
32! init_random description
33! initialization of RAND_STRUCT structure
34!
35! INIT_RANDOM organization :
36! - check -rxalea or -rseed cmd line is used
37! - check the value or -rxalea / -rseed and print
38! a warning if the value is not good
39!$ENDCOMMENT
40C-----------------------------------------------
41C M o d u l e s
42C-----------------------------------------------
43 USE random_mod
44C-----------------------------------------------
45C I m p l i c i t T y p e s
46C-----------------------------------------------
47#include "implicit_f.inc"
48C-----------------------------------------------
49C C o m m o n B l o c k s
50C-----------------------------------------------
51#include "units_c.inc"
52C-----------------------------------------------
53C D u m m y A r g u m e n t s
54C-----------------------------------------------
55 IF(rand_struct%CMD) THEN
56
57 WRITE(iout,1000)
58
59 IF(rand_struct%ALEA.AND.(.NOT.rand_struct%SEED) ) THEN
60 ! apply default value to seed
61 rand_struct%SEED=.true.
62 rand_struct%SEED_NBR=0.d+00
63 WRITE(iout,'(A)') ' '
64 WRITE(iout,'(A)') '** WARNING : -RSEED OPTIONAL OPTION IS NOT USED'
65 WRITE(iout,'(A)') ' DEFAULT VALUE WILL BE APPLIED'
66 WRITE(iout,'(A)') ' '
67 ENDIF
68 IF(rand_struct%SEED) THEN
69 IF(rand_struct%SEED_NBR<0.d+00.OR.rand_struct%SEED_NBR>1.d+00) THEN
70 ! error, 0 <= seed < 1
71 WRITE(iout,'(A)') ' '
72 WRITE(iout,'(A)') '** WARNING : -RSEED VALUE MUST BE DEFINED BETWEEN'
73 WRITE(iout,'(a)') ' 0. and 1.'
74 WRITE(IOUT,'(a)') ' '
75 ENDIF
76 ENDIF
77 IF(RAND_STRUCT%ALEA) THEN
78.OR. IF(RAND_STRUCT%ALEA_NBR<0.d+00RAND_STRUCT%ALEA_NBR>10.d+30) THEN
79 ! error, 0 <= alea < +infinity
80 WRITE(IOUT,'(a)') ' '
81 WRITE(IOUT,'(a)') '** WARNING : -RALEA VALUE MUST BE DEFINED BETWEEN'
82 WRITE(iout,'(A)') ' 0 AND +INFINITY'
83 WRITE(iout,'(A)') ' '
84 ENDIF
85 ELSE
86 rand_struct%CMD=.false.
87 WRITE(iout,'(A)') ' '
88 WRITE(iout,'(A)') '** WARNING : -RSEED OPTIONAL OPTION MUST BE USED WITH -RXALEA OPTION'
89 WRITE(iout,'(A)') ' -rseed option will be ignored'
90 WRITE(IOUT,'(a)') ' '
91 ENDIF
92 ENDIF
93
94 1000 FORMAT(//
95 .' random noise '/
96 .' ------------ ')
97
98 RETURN
subroutine init_random()
Definition init_random.F:31
type(random_struct) rand_struct
Definition random_mod.F:52
subroutine noise(dt2r, in, j, buf, v, a, ixs, elbuf_tab, iparg, weight, ixq)
Definition noise.F:41