[Fortran] 纯文本查看 复制代码 INTEGER :: i_seed
INTEGER, DIMENSION(:), ALLOCATABLE :: a_seed
INTEGER, DIMENSION(1:8) :: dt_seed
CALL RANDOM_SEED(size=i_seed)
ALLOCATE(a_seed(1:i_seed))
CALL RANDOM_SEED(get=a_seed)
CALL DATE_AND_TIME(values=dt_seed)
a_seed(i_seed)=dt_seed(8); a_seed(1)=dt_seed(8)*dt_seed(7)*dt_seed(6)
CALL RANDOM_SEED(put=a_seed)
DEALLOCATE(a_seed)
CALL RANDOM_NUMBER(AmpValueNew)
主要问题是,CALL RANDOM_SEED(size=i_seed),疑惑的是,也没有对i_seed进行赋值,那么call random seed(size=i_seed),括号里面这是在干嘛,i_seed要是赋值了,可能是定义种子的尺寸大小,可是i_seed啥也木有,不知道是在干啥
第二个问题是,call date and time括号里面的内容也不是很明白
求助Fortran大神
|