Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.
29314 Discussions

Namelist input and values of IOSTAT

lklawrie1
Beginner
796 Views
I'm using a namelist input for a selected set of inputs. It seems like (this is CVF) if I don't terminate the block (incomplete data) with a "/" then the value of the IOSTAT returned is -1.
Is there somewhere in the documentation that talks about that?
Linda
0 Kudos
3 Replies
Steven_L_Intel1
Employee
796 Views
If you don't terminate the namelist input, it has to keep reading to see if there's more. If it runs past the end of file, that gets you the -1 IOSTAT. There's nothing in the language definition to say that an EOF implicitly ends namelist input any more than it does any other kind.

As for documentation, yes, it is there, but in the generic way, not specific to namelist.
0 Kudos
lklawrie1
Beginner
796 Views
Thanks, Steve.
It's clear in at least one of my F90/95 references that good practice is to end it with a "/".
Linda
0 Kudos
Steven_L_Intel1
Employee
796 Views
Re: "good practice"

I am reminded of the bit of humor that goes "186,000 miles per second - it's not just a good idea, it's the law!" The ending slash (or $END if you're using the old extension style) is not optional - it is required and is an error to omit it.
0 Kudos
Reply