On Thu, 2016-07-07 at 16:24 +0100, Anthony Stone wrote:
> As a theoretical chemist I am certainly concerned with units, especially
> for energy, since many different energy units are in common use, but
> also for length and angle. I deal with it by using a particular unit
> system internally throughout my programs, and requiring users to specify
> units for any input they provide and any output the program generates.
> Conversions are carried out at the point of reading data or writing
> output, and the output includes the name of the unit used. The external
> units can be changed at any point in the data files, but the internal
> units are always the same.
>
> This approach may not be sufficient for all applications, but I find it
> adequate.
This is exactly what we do, and it's not very difficult. It works fine
until somebody drops a new hydrostatic equilibrium module on you, and
doesn't bother to tell you that its internal units for, say, height, are
kilometers, while yours are meters. The processor can't check procedure
interfaces for this error unless there's language support for it, or you
use derived types instead of real variables, which is hideously
expensive both in labor and computer cycles.
> Anthony Stone
>
|