Esempio n. 1
0
import sys
sys.path.insert(0, "../../bindings/python/")

from numpy import array as arr_t # ndarray dtype default to float64, while array's is int64!

from libcloudphxx import blk_1m

opts = blk_1m.opts_t()
print "cond =", opts.cond
print "cevp =", opts.cevp
print "revp =", opts.revp 
print "conv =", opts.conv 
print "accr =", opts.accr 
print "sedi =", opts.sedi 
print "r_c0 =", opts.r_c0
print "r_eps =", opts.r_eps

rhod = arr_t([1.  ])
p    = arr_t([1.e5])
th   = arr_t([300.])
rv   = arr_t([0.  ])
rc   = arr_t([0.01])
rr   = arr_t([0.  ])
dt   = 1
dz   = 1

# sat adjustment with variable pressure
th_old = th.copy()
rv_old = rv.copy()
rc_old = rc.copy()
rr_old = rr.copy()
Esempio n. 2
0
import sys

sys.path.insert(0, "../../bindings/python/")

from numpy import array as arr_t  # ndarray dtype default to float64, while array's is int64!

from libcloudphxx import blk_1m
from libcloudphxx import common

opts = blk_1m.opts_t()
r_eps_def = opts.r_eps
nwtrph_iters_def = opts.nwtrph_iters


def supersaturation(T, p, rv):
    r_vs = common.r_vs(T, p)
    ss = 100. * (rv / r_vs - 1)
    return ss


def initial_state(init_sup_sat):
    rhod = arr_t([1.])
    th = arr_t([300.])
    if init_sup_sat:
        rv = arr_t([0.02])
    else:
        rv = arr_t([0.002])
    rc = arr_t([0.015])
    rr = arr_t([0.])
    dt = 1