Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Interfacing REFPROP 2

Status
Not open for further replies.

Stratos13

Programmer
Oct 2, 2012
9
CA
Has anyone been able to interface REFPROP with their fortran code? I am trying to use the REFPROP subroutines which are given in .FOR files to determine density, compressibility, enthalpy, etc. given the temperature and pressure. I am a bit confused because one of the files that are required is a .FLD file which is not in the right format to be compiled..
 
Seems to me, this FLD - file is not a program file but contains FLuid Data. So you should not try to compile it, this file seems to provide input for the REFPROP routines.

See this link:
[link]http://www.boulder.nist.gov/div838/theory/refprop/Frequently_asked_questions.htm#TransportProperties[/url]

and select item 9 to see two of these files referenced.


Norbert


The optimist believes we live in the best of all possible worlds - the pessimist fears this might be true.
 
But if I want to generate a executable file then how will it compile the fluid data information which is needed?
 
If this is a data file, as it seems to be, then it is not part of the executable. It should be present I guess in your working directory to be read by your program during execution. But you may check your documents on this (which I did not do).

Norbert


The optimist believes we live in the best of all possible worlds - the pessimist fears this might be true.
 
I found this

IMO you should move all your *.FLD files in a directory - in the example it's
Code:
character*32, parameter :: base_dir='C:\Program Files\REFPROP\fluids\'
then fill the array
Code:
integer, parameter :: ncmax=3
character*255 hfiles(ncmax)
with all *.FLD names, like this:
Code:
hfiles(1)=base_dir//"filename1"//'.fld'
hfiles(2)=base_dir//"filename2"//'.fld'
hfiles(3)=base_dir//"filename3"//'.fld'
nc = 3
and then call the subroutine setup like this:
Code:
call SETUP (nc,hfiles,hfmix,'DEF',ierr,herr)
 
Ok thank you for the help.

Mikrom - I did what you said and yes that makes alot of sense now, but when I am still getting an error because of how I am calling the FLD files:

when I do hfiles(1)=base_dir//"CO2"//'.fld'
the command prompt says it was unable to open "C:\Program Files\REFPROP\fluids\CO2.fld " with a whole bunch of spaces after it.

is there any way to drop all those extra spaces without specifying the length (some of the filenames are of different lengths)
 
Nevermind, the error was due to not having r134.fld, nitrogen.fld, c12.fld, and propane.fld files in the working directory even if you weren't trying to access them. Problem is now fixed! thanks again for your help guys.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top