Ejemplo n.º 1
0
def _p_hydro_const_th_rv(z_lev, p_0, th_std, r_v, z_0=0.):
    # hydrostatic pressure assuming constatnt theta and r_v
    return common.p_hydro(z_lev, th_std, r_v, z_0, p_0)
Ejemplo n.º 2
0
print(git_revision)

print("common.p_vs(273.16)=", common.p_vs(273.16))
assert abs(common.p_vs(273.16) - 611.73) < .001
#</listing-1>

print("R_d =", common.R_d)
print("c_pd =", common.c_pd)
print("g =", common.g)
print("p_1000 =", common.p_1000)
print("eps =", common.eps)
print("rho_w =", common.rho_w)

th = 300
rv = .01

print(common.th_dry2std(th, rv))
assert common.th_std2dry(common.th_dry2std(th, rv), rv) == th

rd3 = (.2e-6)**3
assert common.rw3_cr(rd3, .5, 300) > rd3
assert common.S_cr(rd3, .5, 300) > 1

# just testing if pressure at 200m is lower than at 100m
assert common.p_hydro(100, 300, .01, 0, 100000) > common.p_hydro(
    200, 300, .01, 0, 100000)

# just testing if the density is > 1 kg / m3
assert common.rhod(100000, 300, 0) > 1
Ejemplo n.º 3
0
def _p_hydro_const_th_rv(z_lev, p_0, th_std, r_v, z_0=0.):
  # hydrostatic pressure assuming constatnt theta and r_v
  return common.p_hydro(z_lev, th_std, r_v, z_0, p_0)
Ejemplo n.º 4
0
from libcloudphxx import common, git_revision

print git_revision

print "common.p_vs(273.16)=", common.p_vs(273.16)
assert abs(common.p_vs(273.16) - 611.73) < .001
#</listing-1>

print "R_d =", common.R_d
print "c_pd =", common.c_pd
print "g =", common.g
print "p_1000 =", common.p_1000
print "eps =", common.eps
print "rho_w =", common.rho_w

th = 300
rv = .01

print common.th_dry2std(th, rv)	
assert common.th_std2dry(common.th_dry2std(th, rv), rv) == th

rd3 = (.2e-6)**3
assert common.rw3_cr(rd3, .5, 300) > rd3
assert common.S_cr(rd3, .5, 300) > 1

# just testing if pressure at 200m is lower than at 100m
assert common.p_hydro(100, 300, .01, 0, 100000) > common.p_hydro(200, 300, .01, 0, 100000)

# just testing if the density is > 1 kg / m3
assert common.rhod(100000, 300, 0) > 1