Skip to content

Commit

Permalink
Update English notebook 5
Browse files Browse the repository at this point in the history
+ small grammatical fix in main Spanish notebook 5
  • Loading branch information
ehultee committed Nov 18, 2020
1 parent ef4eca7 commit e471cb6
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 62 deletions.
14 changes: 7 additions & 7 deletions 5_reaccion_variable.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"**Formas un hipótesis: ¿Cómo afecta la inclinación la respuesta a un cambio climático?**\n",
"**Forma un hipótesis: ¿Cómo afecta la inclinación la respuesta a un cambio climático?**\n",
"\n",
"¿Cuál glaciar reaccionará más rápido? ¿Cuál tendrá la respuesta más fuerte?"
]
Expand Down Expand Up @@ -374,21 +374,21 @@
"metadata": {
"hide_input": false,
"kernelspec": {
"display_name": "Python 2",
"display_name": "Python 3",
"language": "python",
"name": "python2"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.17"
"pygments_lexer": "ipython3",
"version": "3.8.3"
},
"toc": {
"base_numbering": 1,
Expand All @@ -405,5 +405,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,33 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# What determines glacial response to climate?"
"# What determines the glacial response to climate?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"(purpose of notebook: students explore how glacier width affects response to the SMB changes studied in cambio_climatico)"
"The image below ([source](https://www.esa.int/Our_Activities/Observing_the_Earth/Glaciers_lose_nine_trillion_tonnes_of_ice_in_half_a_century)) shows changes in mountain glaciers since 1961. You can see that most glaciers lose ice (red) but there are also some that grow (green). The magnitude of the changes is highly variable!\n",
"\n",
"![glacier-changes](http://www.esa.int/var/esa/storage/images/esa_multimedia/images/2019/04/global_glacier_mass_loss_1961_2016/19340812-1-eng-GB/Global_glacier_mass_loss_1961_2016_node_full_image_2.jpg)\n",
"\n",
"The changes visible in this graph are regional and global, and are a very clear sign of climate change in the last decades. But if we look now at the change of some individual glaciers (where we have observations of the change in length), we already see that they are not the same ([source](https://glacierhub.org/2017/02/21/research-confirms-significance-climate-change-glacier-retreat/)):\n",
"\n",
"<img src=\"https://glacierhub.org/wp-content/uploads/2017/02/ngeo2863-f1.jpg\" width=\"40%\" align=\"left\"> <br>\n",
"\n",
"<p style=\"clear:left\">\n",
"So why do some glaciers respond more strongly than others to the same change in climate?\n",
"<p>\n",
" \n",
"There are many important factors, but one is the shape of the glacier. We have seen in the laboratory and also in [notebook 1](1_glacier_bed_slope.ipynb) glaciers of various bed slopes. In this notebook, we will see how the slope affects the response to climate change that we studied in [the previous notebook](4_a_changing_climate.ipynb)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"First, we import our modules as usual and configure the settings that will be the same for each glacier we investigate."
]
},
{
Expand Down Expand Up @@ -47,34 +66,40 @@
"FlowlineModel = partial(FluxBasedModel, min_dt=0, cfl_number=0.01)\n",
"\n",
"# OGGM Edu helper functions\n",
"import oggm_edu as edu"
"import oggm_edu as edu\n",
"import CdeC as cdec"
]
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"## Three glaciers of different slopes"
"# define horizontal resolution of the model:\n",
"# nx: number of grid points\n",
"# map_dx: grid point spacing in meters\n",
"nx = 200\n",
"map_dx = 100\n",
"\n",
"# ELA at 3000 m a.s.l., gradient 4 mm m-1\n",
"initial_ELA = 3000 #equilibrium line altitude in meters above sea level\n",
"altgrad = 4 #altitude gradient in mm/m\n",
"mb_model = LinearMassBalance(initial_ELA, grad=altgrad)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"(set up three glaciers as we did in anchura_del_glaciar, same width and SMB but different slopes)"
"## Three glaciers of differing slopes"
]
},
{
"cell_type": "code",
"execution_count": null,
"cell_type": "markdown",
"metadata": {},
"outputs": [],
"source": [
"# define horizontal resolution of the model:\n",
"# nx: number of grid points\n",
"# map_dx: grid point spacing in meters\n",
"nx = 200\n",
"map_dx = 100"
"We follow similar steps as we did [before](1_glacier_bed_slope.ipynb) to configure the basic model."
]
},
{
Expand All @@ -83,18 +108,13 @@
"metadata": {},
"outputs": [],
"source": [
"# Define the width of the glacier we want to study\n",
"width = 300 # m\n",
"widths = np.zeros(nx) + width / map_dx # express it for the model\n",
"\n",
"# ELA at 3000 m a.s.l., gradient 4 mm m-1\n",
"initial_ELA = 3000 #equilibrium line altitude in meters above sea level\n",
"altgrad = 4 #altitude gradient in mm/m\n",
"mb_model = LinearMassBalance(initial_ELA, grad=altgrad)\n",
"\n",
"# Define the slopes we want to compare, as in inclinacion_de_la_base\n",
"slope_tests = [0.1, 0.15, 0.2]\n",
"top = 3400 # m, the peak elevation"
"top = 3400 # m, the peak elevation\n",
"\n",
"# Define the width of the glacier we want to study\n",
"width = 300 # m\n",
"widths = np.zeros(nx) + width / map_dx # express it for the model"
]
},
{
Expand Down Expand Up @@ -128,7 +148,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"(plot profiles of the three glaciers side-by-side)"
"We plot our glaciers."
]
},
{
Expand Down Expand Up @@ -158,7 +178,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"(students play with applying the same change in ELA to all three glaciers, examining equilibrium length and volume)"
"Due to their differing slopes, our glaciers will have different shapes at equilibrium, and different times needed to reach equilibrium, for a given climate.\n",
"\n",
"**In the cell below, change the altitude of the ELA several times and explore how each glacier changes shape.**"
]
},
{
Expand All @@ -182,7 +204,7 @@
"for k, m in enumerate(models):\n",
" # take the glacier we already spun up\n",
" cm = FlowlineModel(m.fls, mb_model=new_mb_model, y0=0.)\n",
" changed_models.append(cm) # this may be wrong--CHECK THIS\n",
" changed_models.append(cm)\n",
" # examine new equilibrium\n",
" changed_models[k].run_until_equilibrium(rate=0.006) \n",
" lengths.append(changed_models[k].length_m)\n",
Expand All @@ -193,7 +215,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Plot profiles to compare new equilibrium state with previous"
"We make a plot to show the results:"
]
},
{
Expand All @@ -208,7 +230,7 @@
"for k, slope in enumerate(slope_tests):\n",
" ax = ax_list[k]\n",
" ax.plot(distances_along[k], models[k].fls[-1].surface_h, label='ELA = {}'.format(initial_ELA), color='darkorange')\n",
" ax.axhline(y=ELA, color='orange', ls=':')\n",
" ax.axhline(y=initial_ELA, color='orange', ls=':')\n",
" ax.plot(distances_along[k], changed_models[k].fls[-1].surface_h, label='ELA = {}'.format(new_ELA), color='darkblue')\n",
" ax.axhline(y=new_ELA, color='blue', ls=':')\n",
" ax.plot(distances_along[k], beds[k], ls=':', color='k', label='Bedrock')\n",
Expand All @@ -222,21 +244,23 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Response to a changing climate"
"## Response to a climate change"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"(ask students to hypothesise how steeper glaciers will respond to the step changes we examined in cambio_climatico)"
"**Form a hypothesis: How does a glacier's bed slope affect its response to climate change?**\n",
"\n",
"Which glacier will react the fastest? Which one will have the strongest response?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"(step change in ELA on all three, run for ~50 years. examine total volume change)"
"Now we are going to expose our glaciers to sudden climate change. At first the glaciers will be in balance. After a few years (default is 50, `change_time` in cell), we will apply a sudden change in mass balance."
]
},
{
Expand All @@ -248,12 +272,14 @@
"# Time\n",
"yrs = np.arange(0, 201, 5, dtype=np.float32)\n",
"nsteps = len(yrs)\n",
"change_time = 50 #when to apply the step change\n",
"\n",
"# Output containers\n",
"elas = [np.zeros(nsteps) for i in range(len(slope_tests))]\n",
"lengths = [np.zeros(nsteps) for i in range(len(slope_tests))]\n",
"areas = [np.zeros(nsteps) for i in range(len(slope_tests))]\n",
"volumes = [np.zeros(nsteps) for i in range(len(slope_tests))]\n",
"water_vols = [np.zeros(nsteps) for i in range(len(slope_tests))]\n",
"\n",
"# Loop\n",
"current_ELA = initial_ELA\n",
Expand All @@ -263,23 +289,28 @@
" length_arr = lengths[k]\n",
" area_arr = areas[k]\n",
" volume_arr = volumes[k]\n",
" initial_time = m.yr\n",
" water_arr = water_vols[k]\n",
" # establish the glacier in equilibrium first\n",
" m_perturb = FlowlineModel(m.fls, mb_model=new_mb_model, y0=0.)\n",
" m_perturb.run_until_equilibrium(rate=0.006)\n",
" initial_time = m_perturb.yr\n",
" for i, yr in enumerate(yrs):\n",
" m.run_until(initial_time + yr)\n",
" if yr >= 50:\n",
" m_perturb.run_until(initial_time + yr)\n",
" if yr >= change_time:\n",
" current_ELA = initial_ELA + change\n",
" m.mb_model = LinearMassBalance(current_ELA, grad=4)\n",
" m_perturb.mb_model = LinearMassBalance(current_ELA, grad=4)\n",
" ela_arr[i] = current_ELA\n",
" length_arr[i] = m.length_m\n",
" area_arr[i] = m.area_km2\n",
" volume_arr[i] = m.volume_km3"
" length_arr[i] = m_perturb.length_m\n",
" area_arr[i] = m_perturb.area_km2\n",
" volume_arr[i] = m_perturb.volume_km3\n",
" water_arr[i] = cdec.ice_to_freshwater(volume_arr[i])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"(visualise time output of this loop)"
"Let's graph how much water our glaciers hold during this simulation:"
]
},
{
Expand All @@ -288,23 +319,22 @@
"metadata": {},
"outputs": [],
"source": [
"f3, (ax7, ax8, ax9) = plt.subplots(1, 3, figsize=(21,5))\n",
"f3, (ax7, ax8, ax9) = plt.subplots(1, 3, figsize=(21,5), sharey=True)\n",
"ax_list = (ax7, ax8, ax9)\n",
"\n",
"for k, slope in enumerate(slope_tests):\n",
" ax = ax_list[k]\n",
" volume = volumes[k]\n",
" ax.plot(yrs, volume, label='Slope = {}'.format(slope), color=colors[k])\n",
" ax.set_ylim(0, 1)\n",
" ax.set_ylabel('Volume [km3]')\n",
" ax.set_xlabel('Year of simulation')"
" water_vol = water_vols[k]\n",
" ax.plot(yrs, water_vol, label='Slope = {}'.format(slope), color=colors[k])\n",
" ax.set_ylabel('Volumen de agua almacenado [L]')\n",
" ax.set_xlabel('Año del simulación')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"(Normalized)"
"We also make a normalized graph, to compare how much each glacier gains or loses compared to its initial volume."
]
},
{
Expand All @@ -313,24 +343,32 @@
"metadata": {},
"outputs": [],
"source": [
"f4, (ax10, ax11, ax12) = plt.subplots(1, 3, figsize=(21,5))\n",
"f4, (ax10, ax11, ax12) = plt.subplots(1, 3, figsize=(21,5), sharey=True)\n",
"ax_list = (ax10, ax11, ax12)\n",
"\n",
"for k, slope in enumerate(slope_tests):\n",
" ax = ax_list[k]\n",
" volume = (volumes[k])/(volumes[k][0])\n",
" ax.plot(yrs, volume, label='Slope = {}'.format(slope), color=colors[k])\n",
" ax.set_ylabel('Size as fraction of initial volume')\n",
" ax.set_ylim(0, 3)\n",
" ax.set_xlabel('Year of simulation')"
]
},
{
"cell_type": "code",
"execution_count": null,
"cell_type": "markdown",
"metadata": {},
"outputs": [],
"source": []
"source": [
"## More experiments"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This was just a sample of the theoretical experiments that we can explore with OGGM. We could also simulate the effect of different ice temperatures, the effect of ice sliding in addition to deformation, more sophisticated mass balance, and more. You can explore other Jupyter notebooks on the [OGGM-Edu website](http://edu.oggm.org).\n",
"\n",
"For now, let's see how water storage changes in a basin with many different glaciers. [Go to notebook 6!](6_multiple_glaciers.ipynb)"
]
}
],
"metadata": {
Expand All @@ -350,7 +388,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.8.3"
},
"toc": {
"base_numbering": 1,
Expand All @@ -367,5 +405,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}

0 comments on commit e471cb6

Please sign in to comment.