简体   繁体   English

Mac OSX(Fortran)中的IS_IOSTAT_END错误

[英]IS_IOSTAT_END error in Mac OSX (Fortran)

I am writing a code in Fortran to read a list of properties from a file, and am using the IOSTAT function to skip invalid data. 我在Fortran中编写代码以从文件中读取属性列表,并使用IOSTAT函数跳过无效数据。 The relevant section of code is as follows: 代码的相关部分如下:

do j=1,1000
read(22,*,IOSTAT=ios) step,T,K,U,Tot,P
If(IS_IOSTAT_END(ios)) Exit !exits loop if value is not number or end of file
IF(ios.ne.0) cycle

sumT=sumT+T
sumU=sumU+U
sumK = sumK + K
sumKsq = sumKsq + (K**2.d0)

end if
end do

This code has previously worked fine when running on Linux, but when running on Mac OSX I get the error message 'IS_IOSTAT_END has no implicit type'. 这段代码以前在Linux上运行时运行良好,但是在Mac OSX上运行时,出现错误消息“ IS_IOSTAT_END没有隐式类型”。 Could somebody please explain how to correct this? 有人可以解释一下如何更正吗?

Thanks 谢谢

从Fortran 2003开始定义了固有过程IS_IOSTAT_END(i) 。必须使用足够新的编译器版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM