Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29381 Discussions

non-character command line arguments

jft27
Beginner
614 Views
Hi there,
I'm trying to get an integer and a real into my program and the best way would be through a command line argument.
The routines for getting arguments give a character string out.

I've tried doing an internal read of the form

read(argument, fmt ='(i0)') integerargument

but that didn't seem to work.

Can anyone give me a clue how to do this... or even if it's possible.

Thanks
Jeremy
0 Kudos
2 Replies
joseph-krahn
New Contributor I
614 Views
The easiest way is simply to use free format:

read(argument, fmt=*) integerargument

I think the vairable-width format 'I0' is only valid for output.
0 Kudos
jft27
Beginner
614 Views
fantastic, thanks a lot! Why didn't I think of that?
Jeremy
0 Kudos
Reply