Error: Expected a right parenthesis in expression at (1)

∥☆過路亽.° 提交于 2019-12-02 10:06:41

问题


its showing Expected a right parenthesis in expression, although i have checked it many times

do i= 0, m-1
  do j= 0, n-1
k1(i,j)=-0.001*(((y(i,j)/dx)*((0.02651995*pho(i+3,j))-(0.18941314*pho(i+2,j))+(0.79926643*pho(i+1,j))-(0.79926643*pho(i-1,j))+(0.18941314*pho(i-2,j))-(0.02651995*pho(i-3,j))))+((x(i,j)/dy)*((0.02651995*pho(i+3,j))-(0.18941314*pho(i+2,j))+(0.79926643*pho(i+1,j))-(0.79926643*pho(i-1,j))+(0.18941314*pho(i-2,j))-(0.02651995*pho(i-3, j)))))
  enddo
enddo

回答1:


If your question is "why?", then note that Fortran specifies a maximum line length (if the line consists solely of characters of default kind): 72 for fixed-form source and 132 for free-form source. You don't say which you are using, or how the lines are indented, but the location of the "(1)" in the error message will give a good indication as to whether this is your problem.

gfortran will accept a compile-time option to change the line length limit, but for readability and portability it will be best to break the line within the default limit, using continuation.



来源:https://stackoverflow.com/questions/22119286/error-expected-a-right-parenthesis-in-expression-at-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!