Last change
on this file since 116 was
116,
checked in by dkearney, 18 years ago
|
- rewrote RpUnits::define(...) and RpUnits::convert(...) fxns.
- added functionality so you no longer need to call add_presets(...)
- RpUnits can now handle conversions as follows 1cm2/Vs -> 1e-7m2/kVus
- Cannot handle conversions dealing with Temperature very well because
Temperature conversions have offsets (+/- 32...). you can still do
F->C and Fs->Cs, but Fms->Cs provides unreliable results. (not to
mention that i'm still unsure how to do a conversion like this.
- still need to add Fo (delta fahrenheit) and Co (delta celcius)
units and conversions. These should not be effected by the notorious
temperature
- adjusted RpUnits_test.cc for testing. python.fortran and matlab
bindings have not been tested yet.
|
File size:
1.1 KB
|
Line | |
---|
1 | c ---------------------------------------------------------------------- |
---|
2 | c TEST: Fortran's interface to RpUnits. |
---|
3 | c |
---|
4 | c Basic units conversion tests for the RpUnits portion of Rappture |
---|
5 | c written in Fortran. |
---|
6 | c ====================================================================== |
---|
7 | c AUTHOR: Derrick Kearney, Purdue University |
---|
8 | c Copyright (c) 2004-2005 Purdue Research Foundation |
---|
9 | c |
---|
10 | c See the file "license.terms" for information on usage and |
---|
11 | c redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
---|
12 | c ====================================================================== |
---|
13 | program units_test |
---|
14 | IMPLICIT NONE |
---|
15 | |
---|
16 | integer rp_units_convert_str, rp_units_add_presets |
---|
17 | integer rp_units_convert_dbl |
---|
18 | |
---|
19 | double precision dblVal |
---|
20 | character*40 retStr |
---|
21 | integer retVal |
---|
22 | |
---|
23 | retVal = rp_units_add_presets("all") |
---|
24 | |
---|
25 | retVal = rp_units_convert_str("72F","C",retStr) |
---|
26 | print *,"72F = ",retStr |
---|
27 | print *,"retVal = ",retVal |
---|
28 | |
---|
29 | retVal = rp_units_convert_dbl("72F","C",dblVal) |
---|
30 | print *,"72F = ",dblVal, " (no units)" |
---|
31 | print *,"retVal = ",retVal |
---|
32 | |
---|
33 | end program units_test |
---|
34 | |
---|
Note: See
TracBrowser
for help on using the repository browser.