else: site_coords = [args.coords[0], args.coords[1]] if args.pnames_file is not None: with open(args.pnames_file) as f: pnames_ens = f.read().splitlines() else: pnames_ens = ['nue_tree', 'gdd_crit'] # 'leafcn', 'slatop_decid'] ndim = len(pnames_ens) nens = args.nens out_prefix = args.out_prefix # create model object model = models.MyModel() # Desired outputs #myoutvars = ['gpp', 'lai', 'npp'] print('Generating ensemble') model.generate_ensemble(nens, pnames_ens, fname=args.psam_file, normalized=False) assert (model.parm_ensemble.shape[0] == nens) assert (model.parm_ensemble.shape[1] == ndim) # Daily output # model.run_selm(spinup_cycles=4, # lon_bounds=[-82, -80], lat_bounds=[40, 42], # prefix='regional', pft=0, use_MPI=False)
print("Dimensions #######################") for ikey in dataset.dimensions.keys(): # time(360),lon(5),lat(7) print(dataset.dimensions[ikey].name + ", size " + str(dataset.dimensions[ikey].size)) # 7 print("Variables #######################") for ikey in dataset.variables.keys(): print(dataset.variables[ikey].name + ", size " + str(dataset.variables[ikey].shape)) lons = dataset.variables['lon'][:] - 360. # .shape lats = dataset.variables['lat'][:] # .shape # create model object model = selm.MyModel() qois = model.outvars qois.remove('ctcpools') years = 1980 + dataset.variables['time'][:] / 365 for qoi in qois: qoi_var = utils.get_qoi_regave(dataset, qoi) fig = plt.figure(figsize=(12, 6)) plt.plot(years, qoi_var.T) plt.savefig(qoi+'_ens.png') plt.clf()