| [Fortran] syntaxhighlighter_viewsource syntaxhighlighter_copycode program main
      implicit none
      real(kind=4)::t1_real, t2_real
      integer i, j ,k
      call CPU_TIME(t1_real)
      do i = 1,10000
          do j = 1,10000
              k = j
          end do
      end do
      call CPU_TIME(t2_real)
      write(*,*) "count1",t1_real
      write(*,*) "count2",t2_real
      write(*,*) "时间",t2_real - t1_real
      end program以上程序的输出结果为: count1  0.0000000E+00
 count2  3.1250000E-02
 时间  3.1250000E-02
 
 当我把以上程序写入abaqus子程序中:
 
 [Fortran] syntaxhighlighter_viewsource syntaxhighlighter_copycode subroutine umat(stress,statev,ddsdde,sse,spd,scd,......)
...
...
...
...
real(kind=4) :: t1_real, t2_real
integer  i,j,k
...
...
...
...
      call CPU_TIME(t1_real)
      do i = 1,10000
          do j = 1,10000
              k = j
          end do
      end do
      call CPU_TIME(t2_real)
      write(*,*) "count1",t1_real                               !默认输出在log文件里
      write(*,*) "count2",t2_real                               !默认输出在log文件里
      write(*,*) "时间",t2_real - t1_real                     !默认输出在log文件里
...
...
...
...
end在log文件中查看输出结果:
 count1   6.250000
 count2   6.250000
 时间  0.0000000E+00
 count1   6.250000
 count2   6.250000
 时间  0.0000000E+00
 ....
 ....
 ...
 
 所有的 count1和count2都相等,时间为0.  是由于某些原因CPU_TIME函数在abaqus子程序中失效了吗?
 
 
 |