错误:期望(1)处的表达式中有右括号, [英] Error: Expected a right parenthesis in expression at (1)

查看:963
本文介绍了错误:期望(1)处的表达式中有右括号,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它显示期望在表达式中有一个右括号,虽然我已经多次检查过它了。

  do i = 0,m- (i(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(异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




gfortran将接受编译时选项来更改行长限制,但为了可读性和可移植性,最好在默认限制内使用 continuation


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

解决方案

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.

这篇关于错误:期望(1)处的表达式中有右括号,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆