Working on some old, but commercially important code, we found DATA statements of the form, e.g..
DATA (c = 2.99792458D8, pi = 3.1415926536D0)
This compiles in the original VMS environment and (no surprise) under ifort and CVF. gfortran very reasonably doesn't like it.
However, this seems a more regular syntax than the standard. Does anyone know the history?
Working on some old, but commercially important code, we found DATA statements of the form, e.g.
DATA (c = 2.99792458D8, pi = 3.1415926536D0)
This compiles in the original VMS environment and (no surprise) under ifort and CVF. gfortran very reasonably doesn't like it.
However, this seems a more regular syntax than the standard. Does anyone know the history?
...
GNU Fortran however likely fails to parse some "io-implied-do" objects
as we can see from the second example below. Not sure if I faced some
typo in the html page I found the statement of the second example or
it's another variant of a compiler specific DATA statement as well.
Working on some old, but commercially important code, we found DATA statements of the form, e.g.
DATA (c = 2.99792458D8, pi = 3.1415926536D0)
This compiles in the original VMS environment and (no surprise) under ifort and CVF. gfortran very reasonably doesn't like it.
However, this seems a more regular syntax than the standard. Does anyone know the history?
It is not in VAX Fortran of 1984. Which VMS versions have it?
@gah4
It is not in VAX Fortran of 1984. Which VMS versions have it?
We found this on Itanium, listing gives: COMPILER: VSI Fortran V8.3-104956-50P85
This is interesting because if it wasn't on VMS Fortran in 1984 then someone added it later. We found it in code which was running on Itanium VMS but dated from the 1980s or before.
On Saturday, April 2, 2022 at 9:11:41 AM UTC-7, john.c...@simconglobal.com wrote:
@gah4
It is not in VAX Fortran of 1984. Which VMS versions have it?
We found this on Itanium, listing gives: COMPILER: VSI Fortran V8.3-104956-50P85
This is interesting because if it wasn't on VMS Fortran in 1984 then someone added it later. We found it in code which was running on Itanium VMS but dated from the 1980s or before.
The one that I know, is that VAX Fortran didn't get past Fortran 77,
but Alpha and Itanium did. I don't know if that helps, though.
It is not in VAX Fortran of 1984. Which VMS versions have it?
We found this on Itanium, listing gives: COMPILER: VSI Fortran V8.3-104956-50P85
This is interesting because if it wasn't on VMS Fortran in 1984 then someone added it later. We found it in code which was running on Itanium VMS but dated from the 1980s or before.
The one that I know, is that VAX Fortran didn't get past Fortran 77,
but Alpha and Itanium did. I don't know if that helps, though.
I have always been perplexed about that era of computing. The VAX
hardware supported 4-byte, two different 8-byte, and 16-byte floating
point arithmetic. The 4- and 8-byte formats had hardware support
(depending on the VAX model I think), the 16-byte was mixed hardware and software. That was an ideal situation for the way f90 could declare and support all those different kinds. Yet, for some reason, the VAX never supported an f90 compiler.
@gah4
It is not in VAX Fortran of 1984. Which VMS versions have it?
We found this on Itanium, listing gives: COMPILER: VSI Fortran V8.3-104956-50P85
This is interesting because if it wasn't on VMS Fortran in 1984 then someone added it later. We found it in code which was running on Itanium VMS but dated from the 1980s or before.
I like the syntax - standard DATA statement syntax forces a special case handler for a general expression and this doesn't. It is not a major issue - no-one will change the DATA statement syntax now, but I am curious.
It is supported by DVF/CVF and ifort. Perhaps Steve Lionel can comment?
The Alpha and Itanium compilers supported those different floating point formats to various extents, but I think they just did it by converting
the values to ieee format, they did not try to emulate the actual VAX arithmetic.
My advice echoes others - replace the statement with standard syntax.Thank you. We have changed the syntax to standard.
--
The standard syntax for the DATA statement is archaic. It requires an unique meaning for the * operator and an odd use of /. Shows its age!
This syntax is far more in keeping with the principal of least astonishment. Is there any chance of adding it to the standard?
On 4/3/2022 12:14 PM, Ron Shepard wrote:
The Alpha and Itanium compilers supported those different floating point formats to various extents, but I think they just did it by converting
the values to ieee format, they did not try to emulate the actual VAX arithmetic.
I'm not sure about Itanium (tried to forget that), but Alpha had native support for VAX single and double floating point formats and their
semantics. I have a faint recollection of there being something about
VAX D being treated internally as 53-bit mantissa instead of 56 bit, but
I could be misremembering.
On Alpha VMS, you could specify at compile time whether you wanted VAX
F/D, VAX F/G or IEEE S/T. Alpha supported IEEE quad format as "X float"
and software was used to convert VAX "H float" to X.
This is why the "modern Fortran" way is to do initialization on the
statement that declares the variable. DATA itself is archaic (though not
yet obsolescent), dating from the era of implicit type declarations.
Given that there is a newer way to do initialization; one that doesn't require the compiler to stand on its head to make sense of overlapping
DATA statements, I see no motive for simply altering the syntax of DATA.
On Wednesday, April 13, 2022 at 12:18:31 PM UTC-7, Steve Lionel wrote:
(snip)
This is why the "modern Fortran" way is to do initialization on the statement that declares the variable. DATA itself is archaic (though not yet obsolescent), dating from the era of implicit type declarations.
Given that there is a newer way to do initialization; one that doesn't require the compiler to stand on its head to make sense of overlapping DATA statements, I see no motive for simply altering the syntax of DATA.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 159 |
Nodes: | 16 (0 / 16) |
Uptime: | 99:17:30 |
Calls: | 3,209 |
Files: | 10,563 |
Messages: | 3,009,786 |