问题
When I compile a project, Intel Visual Fortran keeps giving me this kind of error. The error is found on the code below:
dimension tairgl(12),eairgl(24),windgl(12),psisgl(12),yenang(98),yunazm(98)
This is the error message given by the compiler.
Error: Syntax error, found END-OF-STATEMENT when expecting one of: ( [
Anybody have any idea about this error?
回答1:
The syntax looks OK. I can think of two possibilities: 1) the compiler is configured to only look at source code to column 72 and this line is longer, 2) the error is somewhere else and the message is misleading. Possibility 1 assumes that you are compiling Fortran 77 with its fixed-form source layout, rather than Fortran 90, or that the compiler is mis-configured for Fortran 90. To fix possibility 1, either split the line with a continuation, split it into two dimension statements, or find the compiler option that causes the compiler to accept longer lines
回答2:
From the question, it looks like there's a newline after the dimension statement. Is that right? I wouldn't be surprised if that gave an unexpected END-OF-STATEMENT error.
来源:https://stackoverflow.com/questions/1947183/intel-visual-fortran-compiling-error