Skip to content

Commit

Permalink
Cleaning up ISMIP-HOM experiments A-D
Browse files Browse the repository at this point in the history
  • Loading branch information
ckhroulev committed May 5, 2021
1 parent 7811683 commit b335c31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion test/ismip-hom/Makefile
@@ -1,7 +1,7 @@
all: pism ismiphom plot

pism:
mpiexec -n 2 python3 run-ismiphom.py -Mx 101 -My 101 -bp_snes_monitor -bp_ksp_monitor -bp_pc_type mg -bp_pc_mg_levels 2 -stress_balance.blatter.coarsening_factor 4 -bp_mg_coarse_pc_type gamg
mpiexec -n 2 python3 run-ismiphom.py -Mx 101 -My 101 -bp_snes_monitor -bp_pc_type mg -bp_pc_mg_levels 2 -stress_balance.blatter.coarsening_factor 4 -bp_mg_coarse_pc_type gamg

ismiphom: ismip_all
python3 convert-ismiphom.py
Expand Down
19 changes: 4 additions & 15 deletions test/ismip-hom/plot-ismiphom.py
Expand Up @@ -12,15 +12,14 @@

# Set to "True" to remove models that appear to be obviously wrong or produce poor-quality
# results (oscillations).
remove_outliers = False
remove_outliers = True

outliers = {"a" : [],
"b" : [],
"c" : ["mbr1"],
"d" : ["rhi1", "rhi2", "rhi3"]}

def plot_experiment(fig, experiment, length_scale, model_type, N_samples=501, color="blue", plot_models=True,
plot_spread=True):
def plot_experiment(fig, experiment, length_scale, model_type, N_samples=501, color="blue", plot_models=True):

filename = "ismip-hom-{exp}-{length}.npz".format(exp=experiment, length=length_scale)

Expand All @@ -47,15 +46,6 @@ def plot_experiment(fig, experiment, length_scale, model_type, N_samples=501, co
vx_mean = np.mean(data, axis=0)
vx_std = np.std(data, axis=0)

if plot_spread:
b = {"x" : xs,
"lower" : vx_mean - vx_std,
"upper" : vx_mean + vx_std}

band = Band(base="x", lower="lower", upper="upper", source=ColumnDataSource(b),
fill_color=color, fill_alpha=0.5)
fig.add_layout(band)

fig.line(xs, vx_mean,
legend_label="{} mean".format(model_type),
line_width=4,
Expand All @@ -71,9 +61,8 @@ def plot(experiment, length_scales):
p.yaxis.axis_label = 'vx (m / year)'

models = True
spread = False
plot_experiment(p, experiment, length_scale, "BP", color="green", plot_models=models, plot_spread=spread)
plot_experiment(p, experiment, length_scale, "FS", color="orange", plot_models=models, plot_spread=spread)
plot_experiment(p, experiment, length_scale, "BP", color="green", plot_models=models)
plot_experiment(p, experiment, length_scale, "FS", color="orange", plot_models=models)

p.legend.location = "top_left"

Expand Down

0 comments on commit b335c31

Please sign in to comment.