|
主要情况:我把下面程序中(! fa=fcint)的注释去掉的时候,计时部分即:epgrah需要跑1.5秒,而保留注释的时候计时部分只需要0.14秒。先上程序:
[Fortran] 纯文本查看 复制代码 01 | subroutine divergent_point_eprgrah ( root , n_root , ww_min , ww_max , e 1 , e 2 , qq , lmd_k , lmd_kq , eef , kt , uu_d , ss , vvo_q , gdelt , layers ) |
04 | real ( 8 ) :: qq , lmd_k , lmd_kq , eef , kt , uu_d , ss , vvo_q , gdelt |
05 | real ( 8 ) :: eprgrah , epigrah |
06 | real ( 8 ) :: e 1 , e 2 , ww_max , ww_min |
07 | real ( 8 ) :: cint , dint , fcint , fdint , a , b , c , fa , fb , fc |
08 | real ( 8 ) :: time_dep , layers , ww 0 |
09 | real ( 8 ) , dimension ( 100 ) :: root |
10 | integer :: i , j , k , n , sign , n_root |
19 | ww 0 = 500.0d0 * 0.02d0 * 0.001d0 |
22 | call CPU_TIME ( time_dep ) |
23 | write ( * , * ) 'time_dep1' , time_dep |
25 | call epgrah ( fdint , epigrah , dint , qq , gdelt , lmd_k , lmd_kq , eef , kt , uu_d , ss , vvo_q , layers ) |
27 | call CPU_TIME ( time_dep ) |
28 | write ( * , * ) 'time_dep2' , time_dep |
以上是包含 计时部分的小的子程序 的子程序。这个子程序有很多别的语句因为调试被注释了,上面发的只是调试时会用到的语句,所以比较乱,请大神多多包涵。
现在的详细情况是:我把子程序 divergent_point_eprgrah中基本上随便注释几个赋值语句,子程序epgrah就会跑得很快(约0.14s),而都保留的时候,就跑的很慢(约1.5s),甚至在子程序epgrah中注释掉几个语句,它也会跑得很快(约0.14s)。请问各位大神,这是什么原因?怎么解决?
|
|