Learn R Programming

insol (version 1.2.2)

p2rho: Air pressure to density

Description

Calculates air density for a given pressure, temperature and relative humidity.

Usage

p2rho(Pz, TempK, RH)

Arguments

Pz

Air pressure in hPa

TempK

Air temperature in K

RH

Relative humidity (%)

Value

Air density (kgm^-3)

References

Brutsaert, W.: 1982, Evaporation into the atmosphere : theory, history, and applications, Reidel, Dordrecht. 1984 edition.

See Also

wvapsat

Examples

Run this code
# NOT RUN {
p2rho(1013, 288, 60)

# plot density vertical profile

z = seq(0, 10000,100)
press = z2p(z)
Tair = 288-0.0065*z
par(mar=c(5.1, 4.5, 4.1, 2.1)) # increase left margin for label
plot(z,p2rho(press,Tair,50),ty='l',xlab='Altitude',
	ylab=expression(paste('Air density [ kg ', m^-3,' ]')))

# }

Run the code above in your browser using DataLab