| N. Shamsundar 2006-01-22, 3:57 am |
| Grant W. Petty wrote:
>
>
> The latest update of a free F90 package for runtime computation,
> conversion and consistency checking of physical dimensions and units in
> scientific and engineering program is available here:
>
> http://rain.aos.wisc.edu/%7Egpetty/physunits.html
>
> It's available under the Lesser Gnu Public License (LGPL).
>
> ________________________________________
> Prof. Grant W. Petty
> Atmospheric and Oceanic Sciences
> 1225 W. Dayton Street
> University of Wisconsin-Madison
> Madison, WI 53706
>
> gpetty@aos.wisc.edu
> Tel: (608) 263-3265
> Fax: (608) 262-0166
>
>
A utility such as this may be quite useful in avoiding unit-related
errors, some of which have been spectacular in the recent past.
Despite the Fortran 77 style of coding used in your example, this
solution is beyond the reach of standard Fortran 77 compilers (e.g.,
g77) since the solution is based on using program units and USE statements.
There is one class of physical unit-handling that you have not said much
about : units that differ not only by a factor but also by an offset,
such as temperatures, elevations, etc. For example,
type(preal) Tamb
Tamb=77*u_fahrenheit_degree
write(*,*)' Atm Temp = ',(Tamb-c_ice_point)/u_kelvin,' C'
does not work for obvious reasons, but no error message is produced.
Another common source of error is exemplified by the Rayleigh number:
Ra = g\beta\Delta T L^3/(\alpha\nu)
where
g is acceleration due to gravity
\beta is thermal expansion coefficient, units of reciprocal abs.
temperature.
\Delta T is temperature difference, same in kelvin or celsius.
\alph, \nu are diffusivities, units of L^2/time
L is length
How would you handle this formula in your system?
N. Shamsundar
University of Houston
|