rholiq.f
subroutine rholiq(p,tl,rhol,drldp,drldt)
c
c subroutine rholiq evaluates the density of freon liquid and its
c derivatives with respect to total pressure and liquid temper-
c ature as a function of total pressure and liquid temperature
c
c total pressure p in (pa)
c liquid temperature tl in (k)
c liquid density rol in (kg/m**3)
c drol/dp drldp in (kg/m**3/pa)
c drol/dt drldt in (kg/m**3/k)
c
dimension tabl(4,70)
save ilast
data tabl/
& 2.05382200E+02, 1.68225900E+03,-2.24172224E+00, 1.94400389E-03,
& 2.16493300E+02, 1.65759100E+03,-2.19852220E+00, 1.94400389E-03,
& 2.27604400E+02, 1.63340300E+03,-2.15532216E+00,-1.94222311E-03,
& 2.38715600E+02, 1.60921500E+03,-2.19848301E+00, 3.10687963E-03,
& 2.49826700E+02, 1.58517100E+03,-2.12944131E+00,-9.58698827E-03,
& 2.55382200E+02, 1.57304500E+03,-2.23596234E+00, 7.00192902E-03,
& 2.60937800E+02, 1.56083900E+03,-2.15816251E+00,-9.60122552E-03,
& 2.66493300E+02, 1.54855300E+03,-2.26484172E+00, 6.49786762E-03,
& 2.72048900E+02, 1.53617100E+03,-2.19264262E+00,-1.06848894E-02,
& 2.77604400E+02, 1.52366000E+03,-2.31136242E+00, 6.57725932E-03,
& 2.83160000E+02, 1.51102200E+03,-2.23828118E+00,-3.56777965E-02,
& 2.84271100E+02, 1.50849100E+03,-2.31756438E+00, 9.75727809E-03,
& 2.85382200E+02, 1.50592800E+03,-2.29588176E+00, 3.20298111E-03,
& 2.86493300E+02, 1.50338100E+03,-2.28876409E+00,-1.61632403E-02,
& 2.87604400E+02, 1.50081800E+03,-2.32468204E+00, 1.63486004E-02,
& 2.88715600E+02, 1.49825500E+03,-2.28834891E+00,-2.94971625E-02,
& 2.89826700E+02, 1.49567600E+03,-2.35389751E+00, 2.94971625E-02,
& 2.90937800E+02, 1.49309700E+03,-2.28834891E+00,-4.24574217E-02,
& 2.92048900E+02, 1.49050200E+03,-2.38269780E+00, 5.54176809E-02,
& 2.93160000E+02, 1.48792300E+03,-2.25954863E+00,-8.13381993E-02,
& 2.94271100E+02, 1.48531200E+03,-2.44029837E+00, 9.42984585E-02,
& 2.95382200E+02, 1.48271700E+03,-2.23074834E+00,-1.20218977E-01,
& 2.96493300E+02, 1.48009000E+03,-2.49789895E+00, 1.33179236E-01,
& 2.97604400E+02, 1.47747900E+03,-2.20194805E+00,-1.45934864E-01,
& 2.98715600E+02, 1.47485200E+03,-2.52627369E+00, 1.32796243E-01,
& 2.99826700E+02, 1.47220900E+03,-2.23117388E+00,-1.32796243E-01,
& 3.00937800E+02, 1.46956600E+03,-2.52627369E+00, 1.32796243E-01,
& 3.02048900E+02, 1.46692300E+03,-2.23117388E+00,-1.45756502E-01,
& 3.03160000E+02, 1.46426400E+03,-2.55507398E+00, 1.45756502E-01,
& 3.04271100E+02, 1.46160500E+03,-2.23117388E+00,-1.58716761E-01,
& 3.05382200E+02, 1.45893000E+03,-2.58387427E+00, 1.57906745E-01,
& 3.06493300E+02, 1.45625400E+03,-2.23297390E+00,-1.70056988E-01,
& 3.07604400E+02, 1.45356300E+03,-2.61087454E+00, 1.70237828E-01,
& 3.08715600E+02, 1.45087200E+03,-2.23253799E+00,-1.83409571E-01,
& 3.09826700E+02, 1.44816500E+03,-2.64011074E+00, 1.83409571E-01,
& 3.10937800E+02, 1.44545800E+03,-2.23253799E+00,-1.96369830E-01,
& 3.12048900E+02, 1.44273500E+03,-2.66891103E+00, 1.83409571E-01,
& 3.13160000E+02, 1.43999600E+03,-2.26133828E+00,-1.83409571E-01,
& 3.14271100E+02, 1.43725700E+03,-2.66891103E+00, 1.82599555E-01,
& 3.15382200E+02, 1.43451700E+03,-2.26313829E+00,-1.94749798E-01,
& 3.16493300E+02, 1.43176200E+03,-2.69591130E+00, 7.37026515E-02,
& 3.19271100E+02, 1.42484200E+03,-2.28644885E+00,-8.40704856E-02,
& 3.22048900E+02, 1.41784200E+03,-2.75351084E+00, 7.99233519E-02,
& 3.24826700E+02, 1.41081000E+03,-2.30948866E+00,-9.03276200E-02,
& 3.27604400E+02, 1.40369800E+03,-2.81129472E+00, 8.20632830E-02,
& 3.30382200E+02, 1.39652200E+03,-2.35538395E+00,-9.04871483E-02,
& 3.33160000E+02, 1.38928100E+03,-2.85809435E+00, 8.02489121E-02,
& 3.35937800E+02, 1.38196100E+03,-2.41226349E+00,-8.65992105E-02,
& 3.38715600E+02, 1.37459200E+03,-2.89337406E+00, 7.42552562E-02,
& 3.41493300E+02, 1.36712800E+03,-2.48085641E+00,-8.47151906E-02,
& 3.44271100E+02, 1.35958300E+03,-2.95150013E+00, 3.51001114E-02,
& 3.49826700E+02, 1.34426900E+03,-2.56149577E+00,-4.65147026E-02,
& 3.55382200E+02, 1.32860300E+03,-3.07832063E+00, 3.40816007E-02,
& 3.60937800E+02, 1.31255300E+03,-2.69963315E+00,-4.70842345E-02,
& 3.66493300E+02, 1.29610200E+03,-3.22278608E+00, 3.25456139E-02,
& 3.72048900E+02, 1.27920200E+03,-2.86116525E+00,-4.86267774E-02,
& 3.77604400E+02, 1.26180600E+03,-3.40145737E+00, 3.10107294E-02,
& 3.83160000E+02, 1.24386600E+03,-3.05689096E+00,-4.97376298E-02,
& 3.88715600E+02, 1.22534800E+03,-3.60953571E+00, 2.79544898E-02,
& 3.94271100E+02, 1.20615800E+03,-3.29893337E+00,-5.18212130E-02,
& 3.99826700E+02, 1.18623100E+03,-3.87472924E+00, 2.53391948E-02,
& 4.05382200E+02, 1.16548700E+03,-3.59318544E+00,-5.59441510E-02,
& 4.10937800E+02, 1.14379800E+03,-4.21479209E+00, 2.06482031E-02,
& 4.16493300E+02, 1.12102000E+03,-3.98536991E+00,-6.16522911E-02,
& 4.22048900E+02, 1.09697600E+03,-4.67040085E+00,-7.96806019E-03,
& 4.33160000E+02, 1.04409900E+03,-4.84746867E+00,-6.84507327E-02,
& 4.44271100E+02, 9.81787600E+02,-6.36859454E+00,-7.54452451E-02,
& 4.55382200E+02, 9.01711300E+02,-8.04515387E+00,-4.27075710E-01,
& 4.66493300E+02, 7.59595500E+02,-1.75357157E+01,-5.54684004E+00,
& 4.71160000E+02, 5.56962000E+02, 0.00000000E+00, 0.00000000E+00/
data ilast/30/,ntab/70/
c
x=tl
c Start the search from the last point of table use index
c
if (x.le.tabl(1,ilast+1)) then
c
c Search down the table from point of last use
c
do 20 i1=ilast,1,-1
if(x.ge.tabl(1,i1)) go to 60
20 continue
c write(6,*) 'x = ', x, ' is below the table range'
i1=1
go to 60
else
c
c Search up the table from point of last use
c
do 40 i1=ilast+1,ntab-1
if(x.le.tabl(1,i1+1)) go to 60
40 continue
c write(6,*) 'x = ', x, ' is above the table range'
i1=ntab-1
go to 60
endif
c
c Bounding points found, interpolate
c
60 dx=(x-tabl(1,i1))
rhol=tabl(2,i1)+tabl(3,i1)*dx+tabl(4,i1)*dx**2
drldt=tabl(3,i1)+2*tabl(4,i1)*dx
drldp=2.4e-8
rhol=rhol+(p-2.e6)*drldp
ilast=i1
120 continue
return
end