0

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. 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'. Could somebody please explain how to correct this?

Thanks

1 Answers1

0

The intrinsic procedure IS_IOSTAT_END(i) is defined since Fortran 2003. Sufficiently recent compiler version must be used.