(j3.2006) Units of measurement in Fortran
Van Snyder
Van.Snyder
Thu Apr 21 21:19:32 UTC 2011
On Thu, 2011-04-21 at 08:15 -0700, Rasmussen, Craig E wrote:
> I'm hoping to get a proposal funded that will allow users to add units
> to Fortran via compiler directives like OpenMP. We now have the
> compiler infrastructure in place with our Open Fortran Parser (OFP)
> and ROSE to build a tools that would ensure that units are maintained
> in the program.
If you plan to use a Fortran parser, add real syntax instead of
directives. I recommend using what I propose in Units-TR-7. You could
even preprocess to provide the conversion units, including during I/O.
> I don't really see a need to add units to the language (Van may
> disagree) because units can be checked with static analysis tools and
> have not effect on runtime behavior of a program.
So I/O is not a runtime behavior? Units conversion is not a runtime
behavior?
We don't really need strong typing, either, since it can be checked by
static analysis tools. Or explicit interfaces. Or.... Should the
processor actually care that you have the correct number of subscripts?
That could be checked by static analysis tools.
Proprocessors can provide control structures.
Derived types can be faked.
Let's just go back to Fortran 77 + Ratfor.
> To me, compiler directives is the correct approach.
I have nothing against compiler directives, but pretending they solve
the whole problem doesn't actually make the problem go away.
More information about the J3
mailing list