source: trunk/test/src/RpUnitsF_test.f @ 116

Last change on this file since 116 was 116, checked in by dkearney, 18 years ago
  1. rewrote RpUnits::define(...) and RpUnits::convert(...) fxns.
  2. added functionality so you no longer need to call add_presets(...)
  3. RpUnits can now handle conversions as follows 1cm2/Vs -> 1e-7m2/kVus
  4. 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.

  1. still need to add Fo (delta fahrenheit) and Co (delta celcius)

units and conversions. These should not be effected by the notorious
temperature

  1. adjusted RpUnits_test.cc for testing. python.fortran and matlab

bindings have not been tested yet.

File size: 1.1 KB
Line 
1c ----------------------------------------------------------------------
2c  TEST: Fortran's interface to RpUnits.
3c
4c  Basic units conversion tests for the RpUnits portion of Rappture
5c  written in Fortran.
6c ======================================================================
7c  AUTHOR:  Derrick Kearney, Purdue University
8c  Copyright (c) 2004-2005  Purdue Research Foundation
9c
10c  See the file "license.terms" for information on usage and
11c  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
12c ======================================================================
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.