|
本帖最后由 Karmi 于 2020-5-19 11:13 编辑
[Fortran] 纯文本查看 复制代码 05 | Real , dimension ( 3 ) :: fact |
10 | Call equation ( fact ( i ) , Maact 1 ) |
17 | Subroutine equation ( f , Ma ) |
24 | Real :: f_Ma 1 , f_Ma 2 , f_Ma |
32 | Do while ( ( abs ( f_ma ) > eps ) .and. ( ( Ma 2 - Ma 1 ) > eps ) ) |
33 | If ( f_Ma * f_Ma 1 < 0 . ) then |
59 | End subroutine equation |
65 | P_Ma = sqrt ( ( gamma +1 ) / ( gamma -1 ) ) * atand ( sqrt ( ( gamma -1 ) / ( gamma +1 ) * ( Ma * * 2 -1 ) ) ) - atand ( sqrt ( Ma * * 2 -1 ) ) |
当我调用子程序的时候,输入如果是一个具体的数字的话,就能得到正确结果,但如果输入一个赋值的变量名的话就结果错误。
二分法也换了种写法,但还是同样的问题,是我的调用有什么问题吗?
|
|