OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
init_random.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23!||====================================================================
24!|| init_random ../starter/source/general_controls/computation/init_random.F
25!||--- called by ------------------------------------------------------
26!|| lectur ../starter/source/starter/lectur.F
27!||--- uses -----------------------------------------------------
28!|| random_mod ../starter/share/modules1/random_mod.F
29!||====================================================================
30 SUBROUTINE init_random( )
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 IF(rand_struct%ALEA_NBR<0.d+00.OR.rand_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
99 END SUBROUTINE init_random
subroutine init_random()
Definition init_random.F:31
type(random_struct) rand_struct
Definition random_mod.F:52