gfortran error: unexpected element '\' in format string at (1)

后端 未结 3 1881
名媛妹妹
名媛妹妹 2020-12-21 15:25

I have a project written in VS2010 with Intel Visual Fortran. I have a dump subroutine to write a 2D matrix into file:

subroutine Dump2D(Name,Nx,Ny,Res)
             


        
3条回答
  •  一向
    一向 (楼主)
    2020-12-21 15:52

    The backslash is not valid in Fortran 77 FORMAT statements. Gfortran will not compile it, unless you fix the code. There is no flag that will change that AFAIK (-fbackslash should not help here).

    If I understand the intention correctly (and I may be wrong), the backslash does the same as the dollar sign in some other compilers and prevents terminating a record (line). In that case the advance="no" put in the write statement should help. It is Fortran 90, but you should not avoid it just for that reason.

提交回复
热议问题