- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to compile GEMPAK (a meteorology
visualization package) using Intel Fortran
for Linux v 8.0 and running into a problem
with Hex parameter statements. I've narrowed
it down to a 4-line program
PROGRAM test
CHARACTER*1 CHNULL
PARAMETER(CHNULL=X'00')
END
Here is the compiler message:
fortcom: Error: test.f, line 6: This is an illegal data type value for this parameter. ['00'X]
PARAMETER (CHNULL=X'00')
........................^
compilation aborted for test.f (code 1)
The code compiles using g77 and compiles with warnings
(that the X'00' is a F95 extension) using ifc 6.0 and ifc 7.0.
Is there any way I might get this to compile without having
to go in and modify the source code? I couldn't find any
flags that might help me out.
This GEMPAK is a widely used package in the National
Weather Service, so I'm guessing (perhaps naively), that
even if the statement is nonstandard, that type of construct
is out there in popular packages and should "probably" be
supported in some way :)
Thanks,
Don Morton
Department of Computer Science
The University of Montana
visualization package) using Intel Fortran
for Linux v 8.0 and running into a problem
with Hex parameter statements. I've narrowed
it down to a 4-line program
PROGRAM test
CHARACTER*1 CHNULL
PARAMETER(CHNULL=X'00')
END
Here is the compiler message:
fortcom: Error: test.f, line 6: This is an illegal data type value for this parameter. ['00'X]
PARAMETER (CHNULL=X'00')
........................^
compilation aborted for test.f (code 1)
The code compiles using g77 and compiles with warnings
(that the X'00' is a F95 extension) using ifc 6.0 and ifc 7.0.
Is there any way I might get this to compile without having
to go in and modify the source code? I couldn't find any
flags that might help me out.
This GEMPAK is a widely used package in the National
Weather Service, so I'm guessing (perhaps naively), that
even if the statement is nonstandard, that type of construct
is out there in popular packages and should "probably" be
supported in some way :)
Thanks,
Don Morton
Department of Computer Science
The University of Montana
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fortran hex constants use Z, not X. If in fact this is an extension supported by ifc 7 and g77, but not by ifort, you might file your report and example on premier.intel.com.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry to have missed this. It's complaining about the attempt to initialize a character to an integer value.
parameter(chnull=char(x'0'))
works. I think the standard requires one of the integer to character conversions there. That was VAX style code. Not only was there no standard between x'af' and z'af' 25 years ago, VAX Fortran did no type checking between character, logical, and integer.
g77 may be partly right, f95 explicitly permits achar() and char() in parameter(), while it was a common extension to f77, apparently sometimes implicit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Intel Fortran accepts either X or Z. Z is standard.
The standard allows hex constants only in DATA statements. It is an extension to allow them elsewhere. Tim is correct that trying to set a CHARACTER value to a hex constant is not supported. Use CHAR(0) if that's what you want.
The standard allows hex constants only in DATA statements. It is an extension to allow them elsewhere. Tim is correct that trying to set a CHARACTER value to a hex constant is not supported. Use CHAR(0) if that's what you want.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page