Exemple #1
0
def test_adj_cellwise(init_sup_sat, r_eps=r_eps_def):
    opts.r_eps = r_eps
    print("[standard adj_cellwise]")
    rhod, th, rv, rc, rr, dt = initial_state(init_sup_sat)
    blk_1m.adj_cellwise(opts, rhod, th, rv, rc, rr, dt)

    T = common.T(th[0], rhod[0])
    p = common.p(rhod[0], rv[0], T)
    ss = supersaturation(T, p, rv[0])
    print("final supersaturation", ss, th[0], rv[0])
    return ss
Exemple #2
0
def test_adj_cellwise(init_sup_sat, r_eps = r_eps_def):
    opts.r_eps = r_eps
    print "[standard adj_cellwise]"
    rhod, th, rv, rc, rr, dt = initial_state(init_sup_sat)
    blk_1m.adj_cellwise(opts, rhod, th, rv, rc, rr, dt)
    
    T = common.T(th[0], rhod[0])
    p = common.p(rhod[0], rv[0], T)
    ss = supersaturation(T, p, rv[0])
    print "final supersaturation", ss, th[0], rv[0]
    return ss
Exemple #3
0
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()
blk_1m.adj_cellwise(opts, rhod, th, rv, rc, rr, dt)
assert th != th_old # some water should have evaporated
assert rv != rv_old
assert rc != rc_old
assert rr == rr_old

# sat adjustment with constant pressure
th   = arr_t([300.])
rv   = arr_t([0.  ])
rc   = arr_t([0.01])
rr   = arr_t([0.  ])
blk_1m.adj_cellwise_constp(opts, rhod, p, th, rv, rc, rr, dt)
assert th != th_old # some water should have evaporated
assert rv != rv_old
assert rc != rc_old
assert rr == rr_old
Exemple #4
0
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()
blk_1m.adj_cellwise(opts, rhod, th, rv, rc, rr, dt)
assert th != th_old  # some water should have evaporated
assert rv != rv_old
assert rc != rc_old
assert rr == rr_old

# sat adjustment with constant pressure
th = arr_t([300.])
rv = arr_t([0.])
rc = arr_t([0.01])
rr = arr_t([0.])
blk_1m.adj_cellwise_constp(opts, rhod, p, th, rv, rc, rr, dt)
assert th != th_old  # some water should have evaporated
assert rv != rv_old
assert rc != rc_old
assert rr == rr_old