NIST/ASME Steam Properties Database

Appendix D

INCORPORATING STEAM ROUTINES INTO OTHER PROGRAMS

If you have purchased a version of the NIST/ASME Steam Properties Database that includes source code, you can directly access all of the calculations performed by the database by calling the appropriate subroutines. You can incorporate the subroutines directly into your own computer program. You can also make a dynamic link library (DLL) to be accessed by another application. The details of these procedures vary depending on what compiler and potentially what other application you are using. Questions about constructing DLL’s, etc. should be addressed to the suppliers of those products rather than to NIST. The purpose of this Appendix is to provide general information about accessing steam properties directly from the subroutines.

All the source code for the calculations is written in the Fortran 77 language and is compatible with Fortran 90 and Fortran 95. The Fortran source code is divided into five sets of subroutines, as follows:

•   AUXPK.FOR       Miscellaneous subroutines used in the calculations

•   EOSPK.FOR      Subroutines used to evaluate the fundamental equation of state

•   INTPK.FOR     “Interface” subroutines which accept input in SI units, call the appropriate routines and return values in SI units. The subroutines in INTPK are the only ones that should ever be called from another program.

•   PROPPK.FOR    Subroutines to calculate various fluid properties.

•   SOLVPK.FOR    Subroutines to solve various sets of conditions, such as finding the vapor pressure at a given temperature.

 

There are also five common blocks used by the subroutines: COEF.CMN, COEFIG.CMN, NPROP.CMN, WCONST.CMN, and WLIMIT.CMN. These common blocks must be accessible by INCLUDE statements whenever a subroutine is compiled. This is most easily accomplished by putting them in the same directory as the source routine.

All calculations should be performed by calling the appropriate subroutine in INTPK. You should not need to call directly any subroutine in any of the other sets of subroutines. Those subroutines should simply be compiled as is and linked in with the program.

Interface Subroutines

INTPK.FOR contains twelve subroutines through which the STEAM database communicates with the outside world. Here, we list the subroutines and document their argument lists. Note that many of the arrays passed to these routines have a dimension of NPROP, where NPROP (the length of the property array) is set in NPROP.CMN. NPROP.CMN also contains the dimension NRIMAX, which is the maximum number of wavelengths at which the refractive index may be calculated and is needed for some arrays passed to the PROPS subroutine.

The “TYPE” of each argument is R (double precision real), I (integer), RA (double precision real array), or IA (integer array).  The “I/O” column tells whether an argument is input (I) to the subroutine or output (O) from the subroutine. In a few cases a dash appears; this indicates an argument that is used only as internal workspace by the routine.

 

 


Example

Below, we reprint a brief program which demonstrates how routines in INTPK might be called. This program accepts a temperature input and computes the vapor pressure along with the density, enthalpy, entropy, and refractive index of the coexisting liquid and vapor phases.

 

Back to Contents


 [Online Databases] [New and Updated Databases]
[Database Price List] [JPCRD] [CODATA] [FAQ] [Comments] [NIST] [Data]