Fortran Coder

查看: 6153|回复: 1
打印 上一主题 下一主题

[求助] do循环的计算性能请教

[复制链接]

10

帖子

4

主题

0

精华

入门

F 币
63 元
贡献
35 点
跳转到指定楼层
楼主
发表于 2021-9-29 10:01:37 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式
请问一下的循环迭代,,执行1.5秒,,算是正常么??有什么好办法优化到毫秒级么?
NoSteadySolutionIter=100
size(Elems)=10000

[Fortran] 纯文本查看 复制代码
do while(iter < NoSteadySolutionIter)
  iter=iter+1
  LastIter=iter
  call IniFrnt
  do k=1,size(Points)
    Points(k).dU=0
  enddo
  do ixelem=1,size(Elems)
    ielem = Front_Order(ixelem)
    if(ielem == 0) cycle
    if(Elems(ielem).infront == 0) cycle
    if(Elems(ielem).tip == PIPE_OBJ) then
      call SteadyPipeMtx(ielem)
    endif
    call FrontU(ielem,LunFrn)
  enddo
  call FrontB(LunFrn)
  call IncVar()

  if (HnorMx <= EpsH .and. QnorMx <= EpsQ .and. OnorMx <= EpsO) then
    if(InitSolution()) then
      call SaveSolutionStage(kstage,curtim)
      call ConvergenceReport(0d0)
      Steady = .true.
      return
    else
      Steady = .false.
      return
    endif
  endif
enddo

分享到:  微信微信
收藏收藏 点赞点赞 点踩点踩
您需要登录后才可以回帖 登录 | 极速注册

本版积分规则

捐赠本站|Archiver|关于我们 About Us|小黑屋|Fcode ( 京ICP备18005632-2号 )

GMT+8, 2024-5-9 04:02

Powered by Tencent X3.4

© 2013-2024 Tencent

快速回复 返回顶部 返回列表