Ejemplo n.º 1
0
    if newfig: plt.figure(figsize=(6,4.5))
    else:plt.figure(1,figsize=(6,4.5))
    plt.plot(s, E); plt.ylabel('m/s')
    plt.title('ET vs. soil moisture')
    
    if newfig: plt.figure(figsize=(6,4.5))
    else:plt.figure(2,figsize=(6,4.5))
    plt.plot(s, P_soil-P_stem); plt.ylabel('MPa')
    plt.plot(s[imax], diffP[imax], 'ro')
    plt.plot(s[ilastmin], diffP[ilastmin], 'bo')
    plt.title('Predawn - midday vs. soil moisture')
    
if __name__ =='__main__':
    # import trait parameters
    traits_path = '../traits_data.xls'
    params = import_traits_data() # import chaparral species params
    
    # designate soil type
    soil_type = 'sandy_loam'; smin = soil_dict[soil_type]['sh']
    s = np.arange(smin,1.00,0.001)   
    sp = 'JUNI'; s0=0.156; VPD=1.0; P_baro = params_constants.P_baro
    
    plant = initialize_plant(sp, params)
    P50 = plant.stem.P50_stem
    c_leaf = plant.canopy.c_leaf; Pg12 = 1.0/c_leaf * np.log(0.12)

    shift_range = np.linspace(0.5, 1.5, 20)
    P50_arr = shift_range*P50
    Pg12_arr = shift_range*Pg12
    sigma_grid = np.zeros((len(P50_arr), len(Pg12_arr)))
    for i, pg12 in enumerate(Pg12_arr):
Ejemplo n.º 2
0
from scipy import stats
from params_soil import soil_dict
from SALib.analyze import sobol
from utility_functions import import_traits_data, get_part, initialize_generic_plant, simulate_ps_t
import matplotlib.ticker as mtick

## soil conditions ##
soil_type = 'loamy_sand'; soil_params = soil_dict[soil_type]
smin = soil_params['sh']
sfc = soil_params['sfc']
sst = soil_params['sst']
n = soil_params['n']
Ks = soil_params['Ksat']
Ps = soil_params['Ps']
b = soil_params['b']
traits = import_traits_data()
s_sat = (-0.005/Ps)**(-1.0/b)
s = np.hstack((np.linspace(smin,sst,500), np.linspace(sst+0.001,1.0,100)))

n_trajectories = 100; dt = 0.1
lam=0.15; alpha=0.010; s1 = sfc; s0 = 0.5; Amax = 1.0/dt; Rmax = 0.10*Amax; plc = 0.5

## prep for sensitivity analysis ##
var_names = np.array(['A_canopy','Gs_leaf','c_leaf','L_stem','A_stem','Ksat_stem','a_stem','P50_stem','L_root','A_root','Rmax'])
n_vars = len(var_names)

sp = 'JUNI'; tmax = 180; VPD=2.0; tRun = np.arange(0,tmax+dt,dt)

with open('../Si_'+sp+'_vpd'+str(int(VPD))+'_tmax'+str(tmax)+'_severe_params.pickle', 'rb') as handle:
    params = pickle.load(handle)
count1 = []