问题
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