Line truncated, Syntax error in argument list

后端 未结 2 1708
花落未央
花落未央 2020-11-29 12:08

When I compile the program below, I have an error and a warning in the call Coor_Trans command line as

Warning: Line truncated

Error:

2条回答
  •  Happy的楠姐
    2020-11-29 12:15

    The Fortran standard imposes a limit on the length of line that compilers are required to deal with, these days it's 132 characters. You can break the line at a suitable place and use a continuation line. Something like this:

    call Coor_Trans(BEXC1(i,1,1),BEYC1(i,1,1),BEZC1(i,1,1),BEXC1(j,1,1), &
         BEYC1(j,1,1),BEZC1(j,1,1),ANGLE1(j,1,1),LOC_1,LOC_2,LOC_3)
    

    Notice the & at the end of the continued line.

    Once the line is truncated arbitrarily it is syntactically erroneous, which explains the second part of your compiler's complaint.

    Your compiler probably has an option to force it to read longer lines.

提交回复
热议问题