Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
File io gfortran中的INQUIRE(inpunit,flen=iflen)语法错误,但Lahey中没有_File Io_Fortran_Gfortran_Filesize - Fatal编程技术网

File io gfortran中的INQUIRE(inpunit,flen=iflen)语法错误,但Lahey中没有

File io gfortran中的INQUIRE(inpunit,flen=iflen)语法错误,但Lahey中没有,file-io,fortran,gfortran,filesize,File Io,Fortran,Gfortran,Filesize,我尝试使用gfortran编译代码。我得到了这个错误: **INQUIRE(inpunit,flen=iflen) 1 Error: Syntax error in INQUIRE statement at (1)** 这段代码以前是用lahey编译的。通过快速研究,我发现INQUIRE的参数在gfortran中的含义与lahey不同 inpunit是一个计算结果为 外部文件的输入/输出单元号 flen是一个标量默认整数变量,文件长度以字节为单位

我尝试使用gfortran编译代码。我得到了这个错误:

   **INQUIRE(inpunit,flen=iflen)
                  1
   Error: Syntax error in INQUIRE statement at (1)**
这段代码以前是用lahey编译的。通过快速研究,我发现INQUIRE的参数在gfortran中的含义与lahey不同

  • inpunit是一个计算结果为 外部文件的输入/输出单元号
  • flen是一个标量默认整数变量,文件长度以字节为单位
  • 我的问题是,当使用gfortran时,此语句是否正确,以获得与Lahey中相同的功能:

       **INQUIRE(inpunit,RECL=iflen) **
    
    这两种说法相似吗?
    谢谢

    不,这两个完全不同

    flen=
    是特定于Leahy编译器的非标准扩展名,返回文件的长度

    recl=
    是文件中的最大记录长度(如果文件已连接-已打开,否则为0)

    要符合标准,您应使用
    尺寸=
    。请注意,结果将以文件存储单元显示。Gfortran使用字节,但其他编译器可能使用4字节字。

    非常感谢弗拉基米尔