id
stringlengths
11
27
chunk_id
stringlengths
11
27
text
stringclasses
8 values
start_text
int64
248
8.66k
stop_text
int64
281
8.79k
code
stringclasses
8 values
start_code
int64
0
4.38k
stop_code
int64
75
4.86k
__index_level_0__
int64
0
17
ice_on_incline-0
ice_on_incline-0
Ice on an incline This activity can be run by students after a live experiment with "glacier goo" used on various slopes. In this notebook, we use a numerical simulation to study the difference in ice flow between bed of various slopes. First, we set up the tools that we will use. You won't need to modify these. The essentials Now we set up our first slope and tell the model that we want to study a glacier there. We will keep things simple: a constant slope, constant valley width, and simple formulation for adding and removing ice according to altitude. The glacier bed We will use a helper function to create a simple bed with a constant slope. This requires as input a top and bottom altitude, and a width. We have to decide how wide our glacier is. For now, we will use a default RectangularBedFlowline shape with an initial_width width of 300 m. The "rectangular" cross-sectional shape means that the glacial "valley" walls are straight and the width w is the same throughout: In this image, the black lines signify the walls of the "valley". The blue line shows the surface of the glacier. What do you think *h* means in the picture? Click for details We set up a glacier bed with the specified geometry: Let's plot the bed to make sure that it looks like we expect. The GlacierBed object has a built in method for this which provide us with a side and top-down view of the glacier domain. Check out the glacier bed length. How do you think that the length is computed out of the parameters above? Click for details We have now defined an object called GlacierBed and assigned it to the variable bed, which stores all the information about the bed geometry that the model uses. Notice that bed does not include any information about the ice. So far we have only set up a valley. We have defined its slope, its width, its transverse shape - the geometry of the habitat where our glacier will grow. Now we want to add the climate processes that will put ice into that habitat. Adding the ice Now we want to add ice to our incline and make a glacier. Glaciologists describe the amount of ice that is added or removed over the entire surface of the glacier as the "mass balance". Here's an illustration from the OGGM-edu website: A linear mass balance is defined by an equilibrium line altitude (ELA) and a mass balance gradient with altitude (in [mm m−1]). Above the ELA, we add ice (from snow) and below the line we remove ice (melting it). We will learn more about this in the accumulation and ablation notebook. The mass balance model mb_model gives us the mass balance for any altitude we want. We will plot it below. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, the Glacier object is storing some information that we can recover just by calling it: Since we just created the glacier, there's still no ice! We need some time for ice to accumulate. For this, the mass balance is the relevant process: What did you notice in the graph? What are the axes? At what altitudes is ice added to the glacier (positive mass balance)? At what altitudes does ice melt? Running the numerical model When we did our experiments in the laboratory, we had a slope and some material to pour our "glacier". We also decided how long to let the goo flow -- that is, the "runtime" of our experiment. Setting up our glacier model on the computer is very similar. We have gathered our bed geometry (bed), our mass balance (mb_model), and now we will tell the model how long to run (runtime). First we run the model for one year: Let's take a look. The Glacier object also has a built-in method for us to plot. Here we can see that there is a very thin cover of ice from the top and partway down the glacier bed. Study both plots and interpret what they are showing. How far down the glacier bed does the ice cover reach? We can also take a look at some of statistics of the glacier again to get some more details: The modeled "glacier" already reaches down to the ELA (dashed line)...but it is extremely thin. Looks like we need some more time for the glacier to grow. Let's now run the model for 150 years. In the following code, can you identify where we tell the model how many years we want to study? Let's see how our glacier has changed. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same set of statistics about the glacier as before: Compare this "numerical glacier" with the "glacier goo" we made in the lab: How long does it take for the glacier goo to "grow" and flow down the slope? How long does the numerical glacier need? Below the ELA (3000 m) something happens for the numerical glacier (and for real glaciers too) that did not happen in the glacier goo experiment. What is it? If we want to calculate changes further in time, we have to set the desired date. Try editing the cell below to ask the model to run for 500 years instead of 150. Based on this information, do you think you modified the cell correctly? It is important to note that the model will not go back in time. Once it has run for 500 years, the model will not go back to the 450-year date. It remains at year 500. Try running the cell below. Does the output match what you expected? Accessing the glacier history Lucky for us, the Glacier object has also been storing a history of how the glacier has changed over the simulation. We can access that data through the history: And we can quickly visualise the history of the glacier with the .plot_history() method What is going on in this image? The length of the glacier is a step function in the first year of simulation because, above the equilibrium line altitude (ELA), only accumulation is happening. After that, at first the length of the glacier remains constant. The ice is not very thick, so the portion that reaches below the ELA does not survive the melting that occurs there. But no matter how thick the glacier is, the part above the ELA is always gaining mass. Eventually, there is enough ice to persist below the ELA. We will learn more about ELA in the accumulation and ablation notebook. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume will no longer change, as long as all physical parameters and the climate stay roughly constant. The Glacier object has a method which can progress the glacier to equilibrium .progress_to_equilibrium(). More on this in later notebooks. Can you identify an equilibrium state in the plots above? A first experiment Ok, we have seen the basics. Now, how about a glacier on a different slope? Glaciers are sometimes very steep, like this one in Nepal. Let's adjust the slope in the model to observe a steeper glacier: In the following code, can you identify where we tell the model the new slope we are going to use? What slope did we use for the first experiment? Look for that information at the beginning of the notebook. Comparing glaciers We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. We can get a quick look at the collection by simply calling it: Before we compare the glaciers in the collection, let's make sure to progress them to the same year with the .progress_to_year() method. Now let's compare the glacier we studied first with our new glacier on a different slope. Do you think the new glacier will have more or less ice than the first? Let's make sure we understand what is going on: Explore the characteristics (thickness, length, velocity...). Can you explain the difference between the two glaciers? Click for details Activity Now, try to change the slope to another value, and run the model again. What do you see?
7,284
7,346
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection top_elev = 3400 # m, the peak elevation bottom_elev = 1500 # m, the elevation at the bottom of the glacier bed_width = 300 # m, the constant width of the rectangular valley bed_slope = 10 # degrees, the slope of the bed bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=bed_slope) bed.plot() bed ELA = 3000 # equilibrium line altitude in meters above sea level altgrad = 4 # altitude gradient in mm/m mb_model = MassBalance(ELA, gradient=altgrad) mb_model glacier = Glacier(bed=bed, mass_balance=mb_model) glacier glacier.plot_mass_balance() runtime = 1 glacier.progress_to_year(runtime) glacier.plot() glacier runtime = 150 glacier.progress_to_year(150) glacier.plot() glacier runtime = 150 glacier.progress_to_year(runtime) glacier.plot() glacier glacier.progress_to_year(450) glacier glacier.history glacier.plot_history() new_slope = 20 new_bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=new_slope) new_glacier = Glacier(bed=new_bed, mass_balance=mb_model) collection = GlacierCollection() collection.add([glacier, new_glacier]) collection collection.progress_to_year(600) collection.plot_side_by_side(figsize=(10, 5)) collection.plot_history() collection
1,231
1,242
0
ice_on_incline-1
ice_on_incline-1
Ice on an incline This activity can be run by students after a live experiment with "glacier goo" used on various slopes. In this notebook, we use a numerical simulation to study the difference in ice flow between bed of various slopes. First, we set up the tools that we will use. You won't need to modify these. The essentials Now we set up our first slope and tell the model that we want to study a glacier there. We will keep things simple: a constant slope, constant valley width, and simple formulation for adding and removing ice according to altitude. The glacier bed We will use a helper function to create a simple bed with a constant slope. This requires as input a top and bottom altitude, and a width. We have to decide how wide our glacier is. For now, we will use a default RectangularBedFlowline shape with an initial_width width of 300 m. The "rectangular" cross-sectional shape means that the glacial "valley" walls are straight and the width w is the same throughout: In this image, the black lines signify the walls of the "valley". The blue line shows the surface of the glacier. What do you think *h* means in the picture? Click for details We set up a glacier bed with the specified geometry: Let's plot the bed to make sure that it looks like we expect. The GlacierBed object has a built in method for this which provide us with a side and top-down view of the glacier domain. Check out the glacier bed length. How do you think that the length is computed out of the parameters above? Click for details We have now defined an object called GlacierBed and assigned it to the variable bed, which stores all the information about the bed geometry that the model uses. Notice that bed does not include any information about the ice. So far we have only set up a valley. We have defined its slope, its width, its transverse shape - the geometry of the habitat where our glacier will grow. Now we want to add the climate processes that will put ice into that habitat. Adding the ice Now we want to add ice to our incline and make a glacier. Glaciologists describe the amount of ice that is added or removed over the entire surface of the glacier as the "mass balance". Here's an illustration from the OGGM-edu website: A linear mass balance is defined by an equilibrium line altitude (ELA) and a mass balance gradient with altitude (in [mm m−1]). Above the ELA, we add ice (from snow) and below the line we remove ice (melting it). We will learn more about this in the accumulation and ablation notebook. The mass balance model mb_model gives us the mass balance for any altitude we want. We will plot it below. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, the Glacier object is storing some information that we can recover just by calling it: Since we just created the glacier, there's still no ice! We need some time for ice to accumulate. For this, the mass balance is the relevant process: What did you notice in the graph? What are the axes? At what altitudes is ice added to the glacier (positive mass balance)? At what altitudes does ice melt? Running the numerical model When we did our experiments in the laboratory, we had a slope and some material to pour our "glacier". We also decided how long to let the goo flow -- that is, the "runtime" of our experiment. Setting up our glacier model on the computer is very similar. We have gathered our bed geometry (bed), our mass balance (mb_model), and now we will tell the model how long to run (runtime). First we run the model for one year: Let's take a look. The Glacier object also has a built-in method for us to plot. Here we can see that there is a very thin cover of ice from the top and partway down the glacier bed. Study both plots and interpret what they are showing. How far down the glacier bed does the ice cover reach? We can also take a look at some of statistics of the glacier again to get some more details: The modeled "glacier" already reaches down to the ELA (dashed line)...but it is extremely thin. Looks like we need some more time for the glacier to grow. Let's now run the model for 150 years. In the following code, can you identify where we tell the model how many years we want to study? Let's see how our glacier has changed. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same set of statistics about the glacier as before: Compare this "numerical glacier" with the "glacier goo" we made in the lab: How long does it take for the glacier goo to "grow" and flow down the slope? How long does the numerical glacier need? Below the ELA (3000 m) something happens for the numerical glacier (and for real glaciers too) that did not happen in the glacier goo experiment. What is it? If we want to calculate changes further in time, we have to set the desired date. Try editing the cell below to ask the model to run for 500 years instead of 150. Based on this information, do you think you modified the cell correctly? It is important to note that the model will not go back in time. Once it has run for 500 years, the model will not go back to the 450-year date. It remains at year 500. Try running the cell below. Does the output match what you expected? Accessing the glacier history Lucky for us, the Glacier object has also been storing a history of how the glacier has changed over the simulation. We can access that data through the history: And we can quickly visualise the history of the glacier with the .plot_history() method What is going on in this image? The length of the glacier is a step function in the first year of simulation because, above the equilibrium line altitude (ELA), only accumulation is happening. After that, at first the length of the glacier remains constant. The ice is not very thick, so the portion that reaches below the ELA does not survive the melting that occurs there. But no matter how thick the glacier is, the part above the ELA is always gaining mass. Eventually, there is enough ice to persist below the ELA. We will learn more about ELA in the accumulation and ablation notebook. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume will no longer change, as long as all physical parameters and the climate stay roughly constant. The Glacier object has a method which can progress the glacier to equilibrium .progress_to_equilibrium(). More on this in later notebooks. Can you identify an equilibrium state in the plots above? A first experiment Ok, we have seen the basics. Now, how about a glacier on a different slope? Glaciers are sometimes very steep, like this one in Nepal. Let's adjust the slope in the model to observe a steeper glacier: In the following code, can you identify where we tell the model the new slope we are going to use? What slope did we use for the first experiment? Look for that information at the beginning of the notebook. Comparing glaciers We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. We can get a quick look at the collection by simply calling it: Before we compare the glaciers in the collection, let's make sure to progress them to the same year with the .progress_to_year() method. Now let's compare the glacier we studied first with our new glacier on a different slope. Do you think the new glacier will have more or less ice than the first? Let's make sure we understand what is going on: Explore the characteristics (thickness, length, velocity...). Can you explain the difference between the two glaciers? Click for details Activity Now, try to change the slope to another value, and run the model again. What do you see?
1,230
1,284
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection top_elev = 3400 # m, the peak elevation bottom_elev = 1500 # m, the elevation at the bottom of the glacier bed_width = 300 # m, the constant width of the rectangular valley bed_slope = 10 # degrees, the slope of the bed bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=bed_slope) bed.plot() bed ELA = 3000 # equilibrium line altitude in meters above sea level altgrad = 4 # altitude gradient in mm/m mb_model = MassBalance(ELA, gradient=altgrad) mb_model glacier = Glacier(bed=bed, mass_balance=mb_model) glacier glacier.plot_mass_balance() runtime = 1 glacier.progress_to_year(runtime) glacier.plot() glacier runtime = 150 glacier.progress_to_year(150) glacier.plot() glacier runtime = 150 glacier.progress_to_year(runtime) glacier.plot() glacier glacier.progress_to_year(450) glacier glacier.history glacier.plot_history() new_slope = 20 new_bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=new_slope) new_glacier = Glacier(bed=new_bed, mass_balance=mb_model) collection = GlacierCollection() collection.add([glacier, new_glacier]) collection collection.progress_to_year(600) collection.plot_side_by_side(figsize=(10, 5)) collection.plot_history() collection
393
404
1
ice_on_incline-2
ice_on_incline-2
Ice on an incline This activity can be run by students after a live experiment with "glacier goo" used on various slopes. In this notebook, we use a numerical simulation to study the difference in ice flow between bed of various slopes. First, we set up the tools that we will use. You won't need to modify these. The essentials Now we set up our first slope and tell the model that we want to study a glacier there. We will keep things simple: a constant slope, constant valley width, and simple formulation for adding and removing ice according to altitude. The glacier bed We will use a helper function to create a simple bed with a constant slope. This requires as input a top and bottom altitude, and a width. We have to decide how wide our glacier is. For now, we will use a default RectangularBedFlowline shape with an initial_width width of 300 m. The "rectangular" cross-sectional shape means that the glacial "valley" walls are straight and the width w is the same throughout: In this image, the black lines signify the walls of the "valley". The blue line shows the surface of the glacier. What do you think *h* means in the picture? Click for details We set up a glacier bed with the specified geometry: Let's plot the bed to make sure that it looks like we expect. The GlacierBed object has a built in method for this which provide us with a side and top-down view of the glacier domain. Check out the glacier bed length. How do you think that the length is computed out of the parameters above? Click for details We have now defined an object called GlacierBed and assigned it to the variable bed, which stores all the information about the bed geometry that the model uses. Notice that bed does not include any information about the ice. So far we have only set up a valley. We have defined its slope, its width, its transverse shape - the geometry of the habitat where our glacier will grow. Now we want to add the climate processes that will put ice into that habitat. Adding the ice Now we want to add ice to our incline and make a glacier. Glaciologists describe the amount of ice that is added or removed over the entire surface of the glacier as the "mass balance". Here's an illustration from the OGGM-edu website: A linear mass balance is defined by an equilibrium line altitude (ELA) and a mass balance gradient with altitude (in [mm m−1]). Above the ELA, we add ice (from snow) and below the line we remove ice (melting it). We will learn more about this in the accumulation and ablation notebook. The mass balance model mb_model gives us the mass balance for any altitude we want. We will plot it below. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, the Glacier object is storing some information that we can recover just by calling it: Since we just created the glacier, there's still no ice! We need some time for ice to accumulate. For this, the mass balance is the relevant process: What did you notice in the graph? What are the axes? At what altitudes is ice added to the glacier (positive mass balance)? At what altitudes does ice melt? Running the numerical model When we did our experiments in the laboratory, we had a slope and some material to pour our "glacier". We also decided how long to let the goo flow -- that is, the "runtime" of our experiment. Setting up our glacier model on the computer is very similar. We have gathered our bed geometry (bed), our mass balance (mb_model), and now we will tell the model how long to run (runtime). First we run the model for one year: Let's take a look. The Glacier object also has a built-in method for us to plot. Here we can see that there is a very thin cover of ice from the top and partway down the glacier bed. Study both plots and interpret what they are showing. How far down the glacier bed does the ice cover reach? We can also take a look at some of statistics of the glacier again to get some more details: The modeled "glacier" already reaches down to the ELA (dashed line)...but it is extremely thin. Looks like we need some more time for the glacier to grow. Let's now run the model for 150 years. In the following code, can you identify where we tell the model how many years we want to study? Let's see how our glacier has changed. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same set of statistics about the glacier as before: Compare this "numerical glacier" with the "glacier goo" we made in the lab: How long does it take for the glacier goo to "grow" and flow down the slope? How long does the numerical glacier need? Below the ELA (3000 m) something happens for the numerical glacier (and for real glaciers too) that did not happen in the glacier goo experiment. What is it? If we want to calculate changes further in time, we have to set the desired date. Try editing the cell below to ask the model to run for 500 years instead of 150. Based on this information, do you think you modified the cell correctly? It is important to note that the model will not go back in time. Once it has run for 500 years, the model will not go back to the 450-year date. It remains at year 500. Try running the cell below. Does the output match what you expected? Accessing the glacier history Lucky for us, the Glacier object has also been storing a history of how the glacier has changed over the simulation. We can access that data through the history: And we can quickly visualise the history of the glacier with the .plot_history() method What is going on in this image? The length of the glacier is a step function in the first year of simulation because, above the equilibrium line altitude (ELA), only accumulation is happening. After that, at first the length of the glacier remains constant. The ice is not very thick, so the portion that reaches below the ELA does not survive the melting that occurs there. But no matter how thick the glacier is, the part above the ELA is always gaining mass. Eventually, there is enough ice to persist below the ELA. We will learn more about ELA in the accumulation and ablation notebook. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume will no longer change, as long as all physical parameters and the climate stay roughly constant. The Glacier object has a method which can progress the glacier to equilibrium .progress_to_equilibrium(). More on this in later notebooks. Can you identify an equilibrium state in the plots above? A first experiment Ok, we have seen the basics. Now, how about a glacier on a different slope? Glaciers are sometimes very steep, like this one in Nepal. Let's adjust the slope in the model to observe a steeper glacier: In the following code, can you identify where we tell the model the new slope we are going to use? What slope did we use for the first experiment? Look for that information at the beginning of the notebook. Comparing glaciers We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. We can get a quick look at the collection by simply calling it: Before we compare the glaciers in the collection, let's make sure to progress them to the same year with the .progress_to_year() method. Now let's compare the glacier we studied first with our new glacier on a different slope. Do you think the new glacier will have more or less ice than the first? Let's make sure we understand what is going on: Explore the characteristics (thickness, length, velocity...). Can you explain the difference between the two glaciers? Click for details Activity Now, try to change the slope to another value, and run the model again. What do you see?
2,536
2,618
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection top_elev = 3400 # m, the peak elevation bottom_elev = 1500 # m, the elevation at the bottom of the glacier bed_width = 300 # m, the constant width of the rectangular valley bed_slope = 10 # degrees, the slope of the bed bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=bed_slope) bed.plot() bed ELA = 3000 # equilibrium line altitude in meters above sea level altgrad = 4 # altitude gradient in mm/m mb_model = MassBalance(ELA, gradient=altgrad) mb_model glacier = Glacier(bed=bed, mass_balance=mb_model) glacier glacier.plot_mass_balance() runtime = 1 glacier.progress_to_year(runtime) glacier.plot() glacier runtime = 150 glacier.progress_to_year(150) glacier.plot() glacier runtime = 150 glacier.progress_to_year(runtime) glacier.plot() glacier glacier.progress_to_year(450) glacier glacier.history glacier.plot_history() new_slope = 20 new_bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=new_slope) new_glacier = Glacier(bed=new_bed, mass_balance=mb_model) collection = GlacierCollection() collection.add([glacier, new_glacier]) collection collection.progress_to_year(600) collection.plot_side_by_side(figsize=(10, 5)) collection.plot_history() collection
415
566
2
ice_on_incline-3
ice_on_incline-3
Ice on an incline This activity can be run by students after a live experiment with "glacier goo" used on various slopes. In this notebook, we use a numerical simulation to study the difference in ice flow between bed of various slopes. First, we set up the tools that we will use. You won't need to modify these. The essentials Now we set up our first slope and tell the model that we want to study a glacier there. We will keep things simple: a constant slope, constant valley width, and simple formulation for adding and removing ice according to altitude. The glacier bed We will use a helper function to create a simple bed with a constant slope. This requires as input a top and bottom altitude, and a width. We have to decide how wide our glacier is. For now, we will use a default RectangularBedFlowline shape with an initial_width width of 300 m. The "rectangular" cross-sectional shape means that the glacial "valley" walls are straight and the width w is the same throughout: In this image, the black lines signify the walls of the "valley". The blue line shows the surface of the glacier. What do you think *h* means in the picture? Click for details We set up a glacier bed with the specified geometry: Let's plot the bed to make sure that it looks like we expect. The GlacierBed object has a built in method for this which provide us with a side and top-down view of the glacier domain. Check out the glacier bed length. How do you think that the length is computed out of the parameters above? Click for details We have now defined an object called GlacierBed and assigned it to the variable bed, which stores all the information about the bed geometry that the model uses. Notice that bed does not include any information about the ice. So far we have only set up a valley. We have defined its slope, its width, its transverse shape - the geometry of the habitat where our glacier will grow. Now we want to add the climate processes that will put ice into that habitat. Adding the ice Now we want to add ice to our incline and make a glacier. Glaciologists describe the amount of ice that is added or removed over the entire surface of the glacier as the "mass balance". Here's an illustration from the OGGM-edu website: A linear mass balance is defined by an equilibrium line altitude (ELA) and a mass balance gradient with altitude (in [mm m−1]). Above the ELA, we add ice (from snow) and below the line we remove ice (melting it). We will learn more about this in the accumulation and ablation notebook. The mass balance model mb_model gives us the mass balance for any altitude we want. We will plot it below. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, the Glacier object is storing some information that we can recover just by calling it: Since we just created the glacier, there's still no ice! We need some time for ice to accumulate. For this, the mass balance is the relevant process: What did you notice in the graph? What are the axes? At what altitudes is ice added to the glacier (positive mass balance)? At what altitudes does ice melt? Running the numerical model When we did our experiments in the laboratory, we had a slope and some material to pour our "glacier". We also decided how long to let the goo flow -- that is, the "runtime" of our experiment. Setting up our glacier model on the computer is very similar. We have gathered our bed geometry (bed), our mass balance (mb_model), and now we will tell the model how long to run (runtime). First we run the model for one year: Let's take a look. The Glacier object also has a built-in method for us to plot. Here we can see that there is a very thin cover of ice from the top and partway down the glacier bed. Study both plots and interpret what they are showing. How far down the glacier bed does the ice cover reach? We can also take a look at some of statistics of the glacier again to get some more details: The modeled "glacier" already reaches down to the ELA (dashed line)...but it is extremely thin. Looks like we need some more time for the glacier to grow. Let's now run the model for 150 years. In the following code, can you identify where we tell the model how many years we want to study? Let's see how our glacier has changed. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same set of statistics about the glacier as before: Compare this "numerical glacier" with the "glacier goo" we made in the lab: How long does it take for the glacier goo to "grow" and flow down the slope? How long does the numerical glacier need? Below the ELA (3000 m) something happens for the numerical glacier (and for real glaciers too) that did not happen in the glacier goo experiment. What is it? If we want to calculate changes further in time, we have to set the desired date. Try editing the cell below to ask the model to run for 500 years instead of 150. Based on this information, do you think you modified the cell correctly? It is important to note that the model will not go back in time. Once it has run for 500 years, the model will not go back to the 450-year date. It remains at year 500. Try running the cell below. Does the output match what you expected? Accessing the glacier history Lucky for us, the Glacier object has also been storing a history of how the glacier has changed over the simulation. We can access that data through the history: And we can quickly visualise the history of the glacier with the .plot_history() method What is going on in this image? The length of the glacier is a step function in the first year of simulation because, above the equilibrium line altitude (ELA), only accumulation is happening. After that, at first the length of the glacier remains constant. The ice is not very thick, so the portion that reaches below the ELA does not survive the melting that occurs there. But no matter how thick the glacier is, the part above the ELA is always gaining mass. Eventually, there is enough ice to persist below the ELA. We will learn more about ELA in the accumulation and ablation notebook. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume will no longer change, as long as all physical parameters and the climate stay roughly constant. The Glacier object has a method which can progress the glacier to equilibrium .progress_to_equilibrium(). More on this in later notebooks. Can you identify an equilibrium state in the plots above? A first experiment Ok, we have seen the basics. Now, how about a glacier on a different slope? Glaciers are sometimes very steep, like this one in Nepal. Let's adjust the slope in the model to observe a steeper glacier: In the following code, can you identify where we tell the model the new slope we are going to use? What slope did we use for the first experiment? Look for that information at the beginning of the notebook. Comparing glaciers We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. We can get a quick look at the collection by simply calling it: Before we compare the glaciers in the collection, let's make sure to progress them to the same year with the .progress_to_year() method. Now let's compare the glacier we studied first with our new glacier on a different slope. Do you think the new glacier will have more or less ice than the first? Let's make sure we understand what is going on: Explore the characteristics (thickness, length, velocity...). Can you explain the difference between the two glaciers? Click for details Activity Now, try to change the slope to another value, and run the model again. What do you see?
2,985
3,035
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection top_elev = 3400 # m, the peak elevation bottom_elev = 1500 # m, the elevation at the bottom of the glacier bed_width = 300 # m, the constant width of the rectangular valley bed_slope = 10 # degrees, the slope of the bed bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=bed_slope) bed.plot() bed ELA = 3000 # equilibrium line altitude in meters above sea level altgrad = 4 # altitude gradient in mm/m mb_model = MassBalance(ELA, gradient=altgrad) mb_model glacier = Glacier(bed=bed, mass_balance=mb_model) glacier glacier.plot_mass_balance() runtime = 1 glacier.progress_to_year(runtime) glacier.plot() glacier runtime = 150 glacier.progress_to_year(150) glacier.plot() glacier runtime = 150 glacier.progress_to_year(runtime) glacier.plot() glacier glacier.progress_to_year(450) glacier glacier.history glacier.plot_history() new_slope = 20 new_bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=new_slope) new_glacier = Glacier(bed=new_bed, mass_balance=mb_model) collection = GlacierCollection() collection.add([glacier, new_glacier]) collection collection.progress_to_year(600) collection.plot_side_by_side(figsize=(10, 5)) collection.plot_history() collection
641
669
3
ice_on_incline-4
ice_on_incline-4
Ice on an incline This activity can be run by students after a live experiment with "glacier goo" used on various slopes. In this notebook, we use a numerical simulation to study the difference in ice flow between bed of various slopes. First, we set up the tools that we will use. You won't need to modify these. The essentials Now we set up our first slope and tell the model that we want to study a glacier there. We will keep things simple: a constant slope, constant valley width, and simple formulation for adding and removing ice according to altitude. The glacier bed We will use a helper function to create a simple bed with a constant slope. This requires as input a top and bottom altitude, and a width. We have to decide how wide our glacier is. For now, we will use a default RectangularBedFlowline shape with an initial_width width of 300 m. The "rectangular" cross-sectional shape means that the glacial "valley" walls are straight and the width w is the same throughout: In this image, the black lines signify the walls of the "valley". The blue line shows the surface of the glacier. What do you think *h* means in the picture? Click for details We set up a glacier bed with the specified geometry: Let's plot the bed to make sure that it looks like we expect. The GlacierBed object has a built in method for this which provide us with a side and top-down view of the glacier domain. Check out the glacier bed length. How do you think that the length is computed out of the parameters above? Click for details We have now defined an object called GlacierBed and assigned it to the variable bed, which stores all the information about the bed geometry that the model uses. Notice that bed does not include any information about the ice. So far we have only set up a valley. We have defined its slope, its width, its transverse shape - the geometry of the habitat where our glacier will grow. Now we want to add the climate processes that will put ice into that habitat. Adding the ice Now we want to add ice to our incline and make a glacier. Glaciologists describe the amount of ice that is added or removed over the entire surface of the glacier as the "mass balance". Here's an illustration from the OGGM-edu website: A linear mass balance is defined by an equilibrium line altitude (ELA) and a mass balance gradient with altitude (in [mm m−1]). Above the ELA, we add ice (from snow) and below the line we remove ice (melting it). We will learn more about this in the accumulation and ablation notebook. The mass balance model mb_model gives us the mass balance for any altitude we want. We will plot it below. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, the Glacier object is storing some information that we can recover just by calling it: Since we just created the glacier, there's still no ice! We need some time for ice to accumulate. For this, the mass balance is the relevant process: What did you notice in the graph? What are the axes? At what altitudes is ice added to the glacier (positive mass balance)? At what altitudes does ice melt? Running the numerical model When we did our experiments in the laboratory, we had a slope and some material to pour our "glacier". We also decided how long to let the goo flow -- that is, the "runtime" of our experiment. Setting up our glacier model on the computer is very similar. We have gathered our bed geometry (bed), our mass balance (mb_model), and now we will tell the model how long to run (runtime). First we run the model for one year: Let's take a look. The Glacier object also has a built-in method for us to plot. Here we can see that there is a very thin cover of ice from the top and partway down the glacier bed. Study both plots and interpret what they are showing. How far down the glacier bed does the ice cover reach? We can also take a look at some of statistics of the glacier again to get some more details: The modeled "glacier" already reaches down to the ELA (dashed line)...but it is extremely thin. Looks like we need some more time for the glacier to grow. Let's now run the model for 150 years. In the following code, can you identify where we tell the model how many years we want to study? Let's see how our glacier has changed. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same set of statistics about the glacier as before: Compare this "numerical glacier" with the "glacier goo" we made in the lab: How long does it take for the glacier goo to "grow" and flow down the slope? How long does the numerical glacier need? Below the ELA (3000 m) something happens for the numerical glacier (and for real glaciers too) that did not happen in the glacier goo experiment. What is it? If we want to calculate changes further in time, we have to set the desired date. Try editing the cell below to ask the model to run for 500 years instead of 150. Based on this information, do you think you modified the cell correctly? It is important to note that the model will not go back in time. Once it has run for 500 years, the model will not go back to the 450-year date. It remains at year 500. Try running the cell below. Does the output match what you expected? Accessing the glacier history Lucky for us, the Glacier object has also been storing a history of how the glacier has changed over the simulation. We can access that data through the history: And we can quickly visualise the history of the glacier with the .plot_history() method What is going on in this image? The length of the glacier is a step function in the first year of simulation because, above the equilibrium line altitude (ELA), only accumulation is happening. After that, at first the length of the glacier remains constant. The ice is not very thick, so the portion that reaches below the ELA does not survive the melting that occurs there. But no matter how thick the glacier is, the part above the ELA is always gaining mass. Eventually, there is enough ice to persist below the ELA. We will learn more about ELA in the accumulation and ablation notebook. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume will no longer change, as long as all physical parameters and the climate stay roughly constant. The Glacier object has a method which can progress the glacier to equilibrium .progress_to_equilibrium(). More on this in later notebooks. Can you identify an equilibrium state in the plots above? A first experiment Ok, we have seen the basics. Now, how about a glacier on a different slope? Glaciers are sometimes very steep, like this one in Nepal. Let's adjust the slope in the model to observe a steeper glacier: In the following code, can you identify where we tell the model the new slope we are going to use? What slope did we use for the first experiment? Look for that information at the beginning of the notebook. Comparing glaciers We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. We can get a quick look at the collection by simply calling it: Before we compare the glaciers in the collection, let's make sure to progress them to the same year with the .progress_to_year() method. Now let's compare the glacier we studied first with our new glacier on a different slope. Do you think the new glacier will have more or less ice than the first? Let's make sure we understand what is going on: Explore the characteristics (thickness, length, velocity...). Can you explain the difference between the two glaciers? Click for details Activity Now, try to change the slope to another value, and run the model again. What do you see?
7,111
7,281
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection top_elev = 3400 # m, the peak elevation bottom_elev = 1500 # m, the elevation at the bottom of the glacier bed_width = 300 # m, the constant width of the rectangular valley bed_slope = 10 # degrees, the slope of the bed bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=bed_slope) bed.plot() bed ELA = 3000 # equilibrium line altitude in meters above sea level altgrad = 4 # altitude gradient in mm/m mb_model = MassBalance(ELA, gradient=altgrad) mb_model glacier = Glacier(bed=bed, mass_balance=mb_model) glacier glacier.plot_mass_balance() runtime = 1 glacier.progress_to_year(runtime) glacier.plot() glacier runtime = 150 glacier.progress_to_year(150) glacier.plot() glacier runtime = 150 glacier.progress_to_year(runtime) glacier.plot() glacier glacier.progress_to_year(450) glacier glacier.history glacier.plot_history() new_slope = 20 new_bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=new_slope) new_glacier = Glacier(bed=new_bed, mass_balance=mb_model) collection = GlacierCollection() collection.add([glacier, new_glacier]) collection collection.progress_to_year(600) collection.plot_side_by_side(figsize=(10, 5)) collection.plot_history() collection
1,157
1,229
4
ice_on_incline-5
ice_on_incline-5
Ice on an incline This activity can be run by students after a live experiment with "glacier goo" used on various slopes. In this notebook, we use a numerical simulation to study the difference in ice flow between bed of various slopes. First, we set up the tools that we will use. You won't need to modify these. The essentials Now we set up our first slope and tell the model that we want to study a glacier there. We will keep things simple: a constant slope, constant valley width, and simple formulation for adding and removing ice according to altitude. The glacier bed We will use a helper function to create a simple bed with a constant slope. This requires as input a top and bottom altitude, and a width. We have to decide how wide our glacier is. For now, we will use a default RectangularBedFlowline shape with an initial_width width of 300 m. The "rectangular" cross-sectional shape means that the glacial "valley" walls are straight and the width w is the same throughout: In this image, the black lines signify the walls of the "valley". The blue line shows the surface of the glacier. What do you think *h* means in the picture? Click for details We set up a glacier bed with the specified geometry: Let's plot the bed to make sure that it looks like we expect. The GlacierBed object has a built in method for this which provide us with a side and top-down view of the glacier domain. Check out the glacier bed length. How do you think that the length is computed out of the parameters above? Click for details We have now defined an object called GlacierBed and assigned it to the variable bed, which stores all the information about the bed geometry that the model uses. Notice that bed does not include any information about the ice. So far we have only set up a valley. We have defined its slope, its width, its transverse shape - the geometry of the habitat where our glacier will grow. Now we want to add the climate processes that will put ice into that habitat. Adding the ice Now we want to add ice to our incline and make a glacier. Glaciologists describe the amount of ice that is added or removed over the entire surface of the glacier as the "mass balance". Here's an illustration from the OGGM-edu website: A linear mass balance is defined by an equilibrium line altitude (ELA) and a mass balance gradient with altitude (in [mm m−1]). Above the ELA, we add ice (from snow) and below the line we remove ice (melting it). We will learn more about this in the accumulation and ablation notebook. The mass balance model mb_model gives us the mass balance for any altitude we want. We will plot it below. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, the Glacier object is storing some information that we can recover just by calling it: Since we just created the glacier, there's still no ice! We need some time for ice to accumulate. For this, the mass balance is the relevant process: What did you notice in the graph? What are the axes? At what altitudes is ice added to the glacier (positive mass balance)? At what altitudes does ice melt? Running the numerical model When we did our experiments in the laboratory, we had a slope and some material to pour our "glacier". We also decided how long to let the goo flow -- that is, the "runtime" of our experiment. Setting up our glacier model on the computer is very similar. We have gathered our bed geometry (bed), our mass balance (mb_model), and now we will tell the model how long to run (runtime). First we run the model for one year: Let's take a look. The Glacier object also has a built-in method for us to plot. Here we can see that there is a very thin cover of ice from the top and partway down the glacier bed. Study both plots and interpret what they are showing. How far down the glacier bed does the ice cover reach? We can also take a look at some of statistics of the glacier again to get some more details: The modeled "glacier" already reaches down to the ELA (dashed line)...but it is extremely thin. Looks like we need some more time for the glacier to grow. Let's now run the model for 150 years. In the following code, can you identify where we tell the model how many years we want to study? Let's see how our glacier has changed. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same set of statistics about the glacier as before: Compare this "numerical glacier" with the "glacier goo" we made in the lab: How long does it take for the glacier goo to "grow" and flow down the slope? How long does the numerical glacier need? Below the ELA (3000 m) something happens for the numerical glacier (and for real glaciers too) that did not happen in the glacier goo experiment. What is it? If we want to calculate changes further in time, we have to set the desired date. Try editing the cell below to ask the model to run for 500 years instead of 150. Based on this information, do you think you modified the cell correctly? It is important to note that the model will not go back in time. Once it has run for 500 years, the model will not go back to the 450-year date. It remains at year 500. Try running the cell below. Does the output match what you expected? Accessing the glacier history Lucky for us, the Glacier object has also been storing a history of how the glacier has changed over the simulation. We can access that data through the history: And we can quickly visualise the history of the glacier with the .plot_history() method What is going on in this image? The length of the glacier is a step function in the first year of simulation because, above the equilibrium line altitude (ELA), only accumulation is happening. After that, at first the length of the glacier remains constant. The ice is not very thick, so the portion that reaches below the ELA does not survive the melting that occurs there. But no matter how thick the glacier is, the part above the ELA is always gaining mass. Eventually, there is enough ice to persist below the ELA. We will learn more about ELA in the accumulation and ablation notebook. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume will no longer change, as long as all physical parameters and the climate stay roughly constant. The Glacier object has a method which can progress the glacier to equilibrium .progress_to_equilibrium(). More on this in later notebooks. Can you identify an equilibrium state in the plots above? A first experiment Ok, we have seen the basics. Now, how about a glacier on a different slope? Glaciers are sometimes very steep, like this one in Nepal. Let's adjust the slope in the model to observe a steeper glacier: In the following code, can you identify where we tell the model the new slope we are going to use? What slope did we use for the first experiment? Look for that information at the beginning of the notebook. Comparing glaciers We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. We can get a quick look at the collection by simply calling it: Before we compare the glaciers in the collection, let's make sure to progress them to the same year with the .progress_to_year() method. Now let's compare the glacier we studied first with our new glacier on a different slope. Do you think the new glacier will have more or less ice than the first? Let's make sure we understand what is going on: Explore the characteristics (thickness, length, velocity...). Can you explain the difference between the two glaciers? Click for details Activity Now, try to change the slope to another value, and run the model again. What do you see?
661
717
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection top_elev = 3400 # m, the peak elevation bottom_elev = 1500 # m, the elevation at the bottom of the glacier bed_width = 300 # m, the constant width of the rectangular valley bed_slope = 10 # degrees, the slope of the bed bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=bed_slope) bed.plot() bed ELA = 3000 # equilibrium line altitude in meters above sea level altgrad = 4 # altitude gradient in mm/m mb_model = MassBalance(ELA, gradient=altgrad) mb_model glacier = Glacier(bed=bed, mass_balance=mb_model) glacier glacier.plot_mass_balance() runtime = 1 glacier.progress_to_year(runtime) glacier.plot() glacier runtime = 150 glacier.progress_to_year(150) glacier.plot() glacier runtime = 150 glacier.progress_to_year(runtime) glacier.plot() glacier glacier.progress_to_year(450) glacier glacier.history glacier.plot_history() new_slope = 20 new_bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=new_slope) new_glacier = Glacier(bed=new_bed, mass_balance=mb_model) collection = GlacierCollection() collection.add([glacier, new_glacier]) collection collection.progress_to_year(600) collection.plot_side_by_side(figsize=(10, 5)) collection.plot_history() collection
80
187
5
ice_on_incline-6
ice_on_incline-6
Ice on an incline This activity can be run by students after a live experiment with "glacier goo" used on various slopes. In this notebook, we use a numerical simulation to study the difference in ice flow between bed of various slopes. First, we set up the tools that we will use. You won't need to modify these. The essentials Now we set up our first slope and tell the model that we want to study a glacier there. We will keep things simple: a constant slope, constant valley width, and simple formulation for adding and removing ice according to altitude. The glacier bed We will use a helper function to create a simple bed with a constant slope. This requires as input a top and bottom altitude, and a width. We have to decide how wide our glacier is. For now, we will use a default RectangularBedFlowline shape with an initial_width width of 300 m. The "rectangular" cross-sectional shape means that the glacial "valley" walls are straight and the width w is the same throughout: In this image, the black lines signify the walls of the "valley". The blue line shows the surface of the glacier. What do you think *h* means in the picture? Click for details We set up a glacier bed with the specified geometry: Let's plot the bed to make sure that it looks like we expect. The GlacierBed object has a built in method for this which provide us with a side and top-down view of the glacier domain. Check out the glacier bed length. How do you think that the length is computed out of the parameters above? Click for details We have now defined an object called GlacierBed and assigned it to the variable bed, which stores all the information about the bed geometry that the model uses. Notice that bed does not include any information about the ice. So far we have only set up a valley. We have defined its slope, its width, its transverse shape - the geometry of the habitat where our glacier will grow. Now we want to add the climate processes that will put ice into that habitat. Adding the ice Now we want to add ice to our incline and make a glacier. Glaciologists describe the amount of ice that is added or removed over the entire surface of the glacier as the "mass balance". Here's an illustration from the OGGM-edu website: A linear mass balance is defined by an equilibrium line altitude (ELA) and a mass balance gradient with altitude (in [mm m−1]). Above the ELA, we add ice (from snow) and below the line we remove ice (melting it). We will learn more about this in the accumulation and ablation notebook. The mass balance model mb_model gives us the mass balance for any altitude we want. We will plot it below. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, the Glacier object is storing some information that we can recover just by calling it: Since we just created the glacier, there's still no ice! We need some time for ice to accumulate. For this, the mass balance is the relevant process: What did you notice in the graph? What are the axes? At what altitudes is ice added to the glacier (positive mass balance)? At what altitudes does ice melt? Running the numerical model When we did our experiments in the laboratory, we had a slope and some material to pour our "glacier". We also decided how long to let the goo flow -- that is, the "runtime" of our experiment. Setting up our glacier model on the computer is very similar. We have gathered our bed geometry (bed), our mass balance (mb_model), and now we will tell the model how long to run (runtime). First we run the model for one year: Let's take a look. The Glacier object also has a built-in method for us to plot. Here we can see that there is a very thin cover of ice from the top and partway down the glacier bed. Study both plots and interpret what they are showing. How far down the glacier bed does the ice cover reach? We can also take a look at some of statistics of the glacier again to get some more details: The modeled "glacier" already reaches down to the ELA (dashed line)...but it is extremely thin. Looks like we need some more time for the glacier to grow. Let's now run the model for 150 years. In the following code, can you identify where we tell the model how many years we want to study? Let's see how our glacier has changed. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same set of statistics about the glacier as before: Compare this "numerical glacier" with the "glacier goo" we made in the lab: How long does it take for the glacier goo to "grow" and flow down the slope? How long does the numerical glacier need? Below the ELA (3000 m) something happens for the numerical glacier (and for real glaciers too) that did not happen in the glacier goo experiment. What is it? If we want to calculate changes further in time, we have to set the desired date. Try editing the cell below to ask the model to run for 500 years instead of 150. Based on this information, do you think you modified the cell correctly? It is important to note that the model will not go back in time. Once it has run for 500 years, the model will not go back to the 450-year date. It remains at year 500. Try running the cell below. Does the output match what you expected? Accessing the glacier history Lucky for us, the Glacier object has also been storing a history of how the glacier has changed over the simulation. We can access that data through the history: And we can quickly visualise the history of the glacier with the .plot_history() method What is going on in this image? The length of the glacier is a step function in the first year of simulation because, above the equilibrium line altitude (ELA), only accumulation is happening. After that, at first the length of the glacier remains constant. The ice is not very thick, so the portion that reaches below the ELA does not survive the melting that occurs there. But no matter how thick the glacier is, the part above the ELA is always gaining mass. Eventually, there is enough ice to persist below the ELA. We will learn more about ELA in the accumulation and ablation notebook. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume will no longer change, as long as all physical parameters and the climate stay roughly constant. The Glacier object has a method which can progress the glacier to equilibrium .progress_to_equilibrium(). More on this in later notebooks. Can you identify an equilibrium state in the plots above? A first experiment Ok, we have seen the basics. Now, how about a glacier on a different slope? Glaciers are sometimes very steep, like this one in Nepal. Let's adjust the slope in the model to observe a steeper glacier: In the following code, can you identify where we tell the model the new slope we are going to use? What slope did we use for the first experiment? Look for that information at the beginning of the notebook. Comparing glaciers We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. We can get a quick look at the collection by simply calling it: Before we compare the glaciers in the collection, let's make sure to progress them to the same year with the .progress_to_year() method. Now let's compare the glacier we studied first with our new glacier on a different slope. Do you think the new glacier will have more or less ice than the first? Let's make sure we understand what is going on: Explore the characteristics (thickness, length, velocity...). Can you explain the difference between the two glaciers? Click for details Activity Now, try to change the slope to another value, and run the model again. What do you see?
3,665
3,725
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection top_elev = 3400 # m, the peak elevation bottom_elev = 1500 # m, the elevation at the bottom of the glacier bed_width = 300 # m, the constant width of the rectangular valley bed_slope = 10 # degrees, the slope of the bed bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=bed_slope) bed.plot() bed ELA = 3000 # equilibrium line altitude in meters above sea level altgrad = 4 # altitude gradient in mm/m mb_model = MassBalance(ELA, gradient=altgrad) mb_model glacier = Glacier(bed=bed, mass_balance=mb_model) glacier glacier.plot_mass_balance() runtime = 1 glacier.progress_to_year(runtime) glacier.plot() glacier runtime = 150 glacier.progress_to_year(150) glacier.plot() glacier runtime = 150 glacier.progress_to_year(runtime) glacier.plot() glacier glacier.progress_to_year(450) glacier glacier.history glacier.plot_history() new_slope = 20 new_bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=new_slope) new_glacier = Glacier(bed=new_bed, mass_balance=mb_model) collection = GlacierCollection() collection.add([glacier, new_glacier]) collection collection.progress_to_year(600) collection.plot_side_by_side(figsize=(10, 5)) collection.plot_history() collection
722
737
6
ice_on_incline-7
ice_on_incline-7
Ice on an incline This activity can be run by students after a live experiment with "glacier goo" used on various slopes. In this notebook, we use a numerical simulation to study the difference in ice flow between bed of various slopes. First, we set up the tools that we will use. You won't need to modify these. The essentials Now we set up our first slope and tell the model that we want to study a glacier there. We will keep things simple: a constant slope, constant valley width, and simple formulation for adding and removing ice according to altitude. The glacier bed We will use a helper function to create a simple bed with a constant slope. This requires as input a top and bottom altitude, and a width. We have to decide how wide our glacier is. For now, we will use a default RectangularBedFlowline shape with an initial_width width of 300 m. The "rectangular" cross-sectional shape means that the glacial "valley" walls are straight and the width w is the same throughout: In this image, the black lines signify the walls of the "valley". The blue line shows the surface of the glacier. What do you think *h* means in the picture? Click for details We set up a glacier bed with the specified geometry: Let's plot the bed to make sure that it looks like we expect. The GlacierBed object has a built in method for this which provide us with a side and top-down view of the glacier domain. Check out the glacier bed length. How do you think that the length is computed out of the parameters above? Click for details We have now defined an object called GlacierBed and assigned it to the variable bed, which stores all the information about the bed geometry that the model uses. Notice that bed does not include any information about the ice. So far we have only set up a valley. We have defined its slope, its width, its transverse shape - the geometry of the habitat where our glacier will grow. Now we want to add the climate processes that will put ice into that habitat. Adding the ice Now we want to add ice to our incline and make a glacier. Glaciologists describe the amount of ice that is added or removed over the entire surface of the glacier as the "mass balance". Here's an illustration from the OGGM-edu website: A linear mass balance is defined by an equilibrium line altitude (ELA) and a mass balance gradient with altitude (in [mm m−1]). Above the ELA, we add ice (from snow) and below the line we remove ice (melting it). We will learn more about this in the accumulation and ablation notebook. The mass balance model mb_model gives us the mass balance for any altitude we want. We will plot it below. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, the Glacier object is storing some information that we can recover just by calling it: Since we just created the glacier, there's still no ice! We need some time for ice to accumulate. For this, the mass balance is the relevant process: What did you notice in the graph? What are the axes? At what altitudes is ice added to the glacier (positive mass balance)? At what altitudes does ice melt? Running the numerical model When we did our experiments in the laboratory, we had a slope and some material to pour our "glacier". We also decided how long to let the goo flow -- that is, the "runtime" of our experiment. Setting up our glacier model on the computer is very similar. We have gathered our bed geometry (bed), our mass balance (mb_model), and now we will tell the model how long to run (runtime). First we run the model for one year: Let's take a look. The Glacier object also has a built-in method for us to plot. Here we can see that there is a very thin cover of ice from the top and partway down the glacier bed. Study both plots and interpret what they are showing. How far down the glacier bed does the ice cover reach? We can also take a look at some of statistics of the glacier again to get some more details: The modeled "glacier" already reaches down to the ELA (dashed line)...but it is extremely thin. Looks like we need some more time for the glacier to grow. Let's now run the model for 150 years. In the following code, can you identify where we tell the model how many years we want to study? Let's see how our glacier has changed. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same set of statistics about the glacier as before: Compare this "numerical glacier" with the "glacier goo" we made in the lab: How long does it take for the glacier goo to "grow" and flow down the slope? How long does the numerical glacier need? Below the ELA (3000 m) something happens for the numerical glacier (and for real glaciers too) that did not happen in the glacier goo experiment. What is it? If we want to calculate changes further in time, we have to set the desired date. Try editing the cell below to ask the model to run for 500 years instead of 150. Based on this information, do you think you modified the cell correctly? It is important to note that the model will not go back in time. Once it has run for 500 years, the model will not go back to the 450-year date. It remains at year 500. Try running the cell below. Does the output match what you expected? Accessing the glacier history Lucky for us, the Glacier object has also been storing a history of how the glacier has changed over the simulation. We can access that data through the history: And we can quickly visualise the history of the glacier with the .plot_history() method What is going on in this image? The length of the glacier is a step function in the first year of simulation because, above the equilibrium line altitude (ELA), only accumulation is happening. After that, at first the length of the glacier remains constant. The ice is not very thick, so the portion that reaches below the ELA does not survive the melting that occurs there. But no matter how thick the glacier is, the part above the ELA is always gaining mass. Eventually, there is enough ice to persist below the ELA. We will learn more about ELA in the accumulation and ablation notebook. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume will no longer change, as long as all physical parameters and the climate stay roughly constant. The Glacier object has a method which can progress the glacier to equilibrium .progress_to_equilibrium(). More on this in later notebooks. Can you identify an equilibrium state in the plots above? A first experiment Ok, we have seen the basics. Now, how about a glacier on a different slope? Glaciers are sometimes very steep, like this one in Nepal. Let's adjust the slope in the model to observe a steeper glacier: In the following code, can you identify where we tell the model the new slope we are going to use? What slope did we use for the first experiment? Look for that information at the beginning of the notebook. Comparing glaciers We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. We can get a quick look at the collection by simply calling it: Before we compare the glaciers in the collection, let's make sure to progress them to the same year with the .progress_to_year() method. Now let's compare the glacier we studied first with our new glacier on a different slope. Do you think the new glacier will have more or less ice than the first? Let's make sure we understand what is going on: Explore the characteristics (thickness, length, velocity...). Can you explain the difference between the two glaciers? Click for details Activity Now, try to change the slope to another value, and run the model again. What do you see?
1,173
1,221
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection top_elev = 3400 # m, the peak elevation bottom_elev = 1500 # m, the elevation at the bottom of the glacier bed_width = 300 # m, the constant width of the rectangular valley bed_slope = 10 # degrees, the slope of the bed bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=bed_slope) bed.plot() bed ELA = 3000 # equilibrium line altitude in meters above sea level altgrad = 4 # altitude gradient in mm/m mb_model = MassBalance(ELA, gradient=altgrad) mb_model glacier = Glacier(bed=bed, mass_balance=mb_model) glacier glacier.plot_mass_balance() runtime = 1 glacier.progress_to_year(runtime) glacier.plot() glacier runtime = 150 glacier.progress_to_year(150) glacier.plot() glacier runtime = 150 glacier.progress_to_year(runtime) glacier.plot() glacier glacier.progress_to_year(450) glacier glacier.history glacier.plot_history() new_slope = 20 new_bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=new_slope) new_glacier = Glacier(bed=new_bed, mass_balance=mb_model) collection = GlacierCollection() collection.add([glacier, new_glacier]) collection collection.progress_to_year(600) collection.plot_side_by_side(figsize=(10, 5)) collection.plot_history() collection
190
391
7
ice_on_incline-8
ice_on_incline-8
Ice on an incline This activity can be run by students after a live experiment with "glacier goo" used on various slopes. In this notebook, we use a numerical simulation to study the difference in ice flow between bed of various slopes. First, we set up the tools that we will use. You won't need to modify these. The essentials Now we set up our first slope and tell the model that we want to study a glacier there. We will keep things simple: a constant slope, constant valley width, and simple formulation for adding and removing ice according to altitude. The glacier bed We will use a helper function to create a simple bed with a constant slope. This requires as input a top and bottom altitude, and a width. We have to decide how wide our glacier is. For now, we will use a default RectangularBedFlowline shape with an initial_width width of 300 m. The "rectangular" cross-sectional shape means that the glacial "valley" walls are straight and the width w is the same throughout: In this image, the black lines signify the walls of the "valley". The blue line shows the surface of the glacier. What do you think *h* means in the picture? Click for details We set up a glacier bed with the specified geometry: Let's plot the bed to make sure that it looks like we expect. The GlacierBed object has a built in method for this which provide us with a side and top-down view of the glacier domain. Check out the glacier bed length. How do you think that the length is computed out of the parameters above? Click for details We have now defined an object called GlacierBed and assigned it to the variable bed, which stores all the information about the bed geometry that the model uses. Notice that bed does not include any information about the ice. So far we have only set up a valley. We have defined its slope, its width, its transverse shape - the geometry of the habitat where our glacier will grow. Now we want to add the climate processes that will put ice into that habitat. Adding the ice Now we want to add ice to our incline and make a glacier. Glaciologists describe the amount of ice that is added or removed over the entire surface of the glacier as the "mass balance". Here's an illustration from the OGGM-edu website: A linear mass balance is defined by an equilibrium line altitude (ELA) and a mass balance gradient with altitude (in [mm m−1]). Above the ELA, we add ice (from snow) and below the line we remove ice (melting it). We will learn more about this in the accumulation and ablation notebook. The mass balance model mb_model gives us the mass balance for any altitude we want. We will plot it below. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, the Glacier object is storing some information that we can recover just by calling it: Since we just created the glacier, there's still no ice! We need some time for ice to accumulate. For this, the mass balance is the relevant process: What did you notice in the graph? What are the axes? At what altitudes is ice added to the glacier (positive mass balance)? At what altitudes does ice melt? Running the numerical model When we did our experiments in the laboratory, we had a slope and some material to pour our "glacier". We also decided how long to let the goo flow -- that is, the "runtime" of our experiment. Setting up our glacier model on the computer is very similar. We have gathered our bed geometry (bed), our mass balance (mb_model), and now we will tell the model how long to run (runtime). First we run the model for one year: Let's take a look. The Glacier object also has a built-in method for us to plot. Here we can see that there is a very thin cover of ice from the top and partway down the glacier bed. Study both plots and interpret what they are showing. How far down the glacier bed does the ice cover reach? We can also take a look at some of statistics of the glacier again to get some more details: The modeled "glacier" already reaches down to the ELA (dashed line)...but it is extremely thin. Looks like we need some more time for the glacier to grow. Let's now run the model for 150 years. In the following code, can you identify where we tell the model how many years we want to study? Let's see how our glacier has changed. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same set of statistics about the glacier as before: Compare this "numerical glacier" with the "glacier goo" we made in the lab: How long does it take for the glacier goo to "grow" and flow down the slope? How long does the numerical glacier need? Below the ELA (3000 m) something happens for the numerical glacier (and for real glaciers too) that did not happen in the glacier goo experiment. What is it? If we want to calculate changes further in time, we have to set the desired date. Try editing the cell below to ask the model to run for 500 years instead of 150. Based on this information, do you think you modified the cell correctly? It is important to note that the model will not go back in time. Once it has run for 500 years, the model will not go back to the 450-year date. It remains at year 500. Try running the cell below. Does the output match what you expected? Accessing the glacier history Lucky for us, the Glacier object has also been storing a history of how the glacier has changed over the simulation. We can access that data through the history: And we can quickly visualise the history of the glacier with the .plot_history() method What is going on in this image? The length of the glacier is a step function in the first year of simulation because, above the equilibrium line altitude (ELA), only accumulation is happening. After that, at first the length of the glacier remains constant. The ice is not very thick, so the portion that reaches below the ELA does not survive the melting that occurs there. But no matter how thick the glacier is, the part above the ELA is always gaining mass. Eventually, there is enough ice to persist below the ELA. We will learn more about ELA in the accumulation and ablation notebook. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume will no longer change, as long as all physical parameters and the climate stay roughly constant. The Glacier object has a method which can progress the glacier to equilibrium .progress_to_equilibrium(). More on this in later notebooks. Can you identify an equilibrium state in the plots above? A first experiment Ok, we have seen the basics. Now, how about a glacier on a different slope? Glaciers are sometimes very steep, like this one in Nepal. Let's adjust the slope in the model to observe a steeper glacier: In the following code, can you identify where we tell the model the new slope we are going to use? What slope did we use for the first experiment? Look for that information at the beginning of the notebook. Comparing glaciers We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. We can get a quick look at the collection by simply calling it: Before we compare the glaciers in the collection, let's make sure to progress them to the same year with the .progress_to_year() method. Now let's compare the glacier we studied first with our new glacier on a different slope. Do you think the new glacier will have more or less ice than the first? Let's make sure we understand what is going on: Explore the characteristics (thickness, length, velocity...). Can you explain the difference between the two glaciers? Click for details Activity Now, try to change the slope to another value, and run the model again. What do you see?
4,328
4,366
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection top_elev = 3400 # m, the peak elevation bottom_elev = 1500 # m, the elevation at the bottom of the glacier bed_width = 300 # m, the constant width of the rectangular valley bed_slope = 10 # degrees, the slope of the bed bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=bed_slope) bed.plot() bed ELA = 3000 # equilibrium line altitude in meters above sea level altgrad = 4 # altitude gradient in mm/m mb_model = MassBalance(ELA, gradient=altgrad) mb_model glacier = Glacier(bed=bed, mass_balance=mb_model) glacier glacier.plot_mass_balance() runtime = 1 glacier.progress_to_year(runtime) glacier.plot() glacier runtime = 150 glacier.progress_to_year(150) glacier.plot() glacier runtime = 150 glacier.progress_to_year(runtime) glacier.plot() glacier glacier.progress_to_year(450) glacier glacier.history glacier.plot_history() new_slope = 20 new_bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=new_slope) new_glacier = Glacier(bed=new_bed, mass_balance=mb_model) collection = GlacierCollection() collection.add([glacier, new_glacier]) collection collection.progress_to_year(600) collection.plot_side_by_side(figsize=(10, 5)) collection.plot_history() collection
796
811
8
ice_on_incline-9
ice_on_incline-9
Ice on an incline This activity can be run by students after a live experiment with "glacier goo" used on various slopes. In this notebook, we use a numerical simulation to study the difference in ice flow between bed of various slopes. First, we set up the tools that we will use. You won't need to modify these. The essentials Now we set up our first slope and tell the model that we want to study a glacier there. We will keep things simple: a constant slope, constant valley width, and simple formulation for adding and removing ice according to altitude. The glacier bed We will use a helper function to create a simple bed with a constant slope. This requires as input a top and bottom altitude, and a width. We have to decide how wide our glacier is. For now, we will use a default RectangularBedFlowline shape with an initial_width width of 300 m. The "rectangular" cross-sectional shape means that the glacial "valley" walls are straight and the width w is the same throughout: In this image, the black lines signify the walls of the "valley". The blue line shows the surface of the glacier. What do you think *h* means in the picture? Click for details We set up a glacier bed with the specified geometry: Let's plot the bed to make sure that it looks like we expect. The GlacierBed object has a built in method for this which provide us with a side and top-down view of the glacier domain. Check out the glacier bed length. How do you think that the length is computed out of the parameters above? Click for details We have now defined an object called GlacierBed and assigned it to the variable bed, which stores all the information about the bed geometry that the model uses. Notice that bed does not include any information about the ice. So far we have only set up a valley. We have defined its slope, its width, its transverse shape - the geometry of the habitat where our glacier will grow. Now we want to add the climate processes that will put ice into that habitat. Adding the ice Now we want to add ice to our incline and make a glacier. Glaciologists describe the amount of ice that is added or removed over the entire surface of the glacier as the "mass balance". Here's an illustration from the OGGM-edu website: A linear mass balance is defined by an equilibrium line altitude (ELA) and a mass balance gradient with altitude (in [mm m−1]). Above the ELA, we add ice (from snow) and below the line we remove ice (melting it). We will learn more about this in the accumulation and ablation notebook. The mass balance model mb_model gives us the mass balance for any altitude we want. We will plot it below. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, the Glacier object is storing some information that we can recover just by calling it: Since we just created the glacier, there's still no ice! We need some time for ice to accumulate. For this, the mass balance is the relevant process: What did you notice in the graph? What are the axes? At what altitudes is ice added to the glacier (positive mass balance)? At what altitudes does ice melt? Running the numerical model When we did our experiments in the laboratory, we had a slope and some material to pour our "glacier". We also decided how long to let the goo flow -- that is, the "runtime" of our experiment. Setting up our glacier model on the computer is very similar. We have gathered our bed geometry (bed), our mass balance (mb_model), and now we will tell the model how long to run (runtime). First we run the model for one year: Let's take a look. The Glacier object also has a built-in method for us to plot. Here we can see that there is a very thin cover of ice from the top and partway down the glacier bed. Study both plots and interpret what they are showing. How far down the glacier bed does the ice cover reach? We can also take a look at some of statistics of the glacier again to get some more details: The modeled "glacier" already reaches down to the ELA (dashed line)...but it is extremely thin. Looks like we need some more time for the glacier to grow. Let's now run the model for 150 years. In the following code, can you identify where we tell the model how many years we want to study? Let's see how our glacier has changed. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same set of statistics about the glacier as before: Compare this "numerical glacier" with the "glacier goo" we made in the lab: How long does it take for the glacier goo to "grow" and flow down the slope? How long does the numerical glacier need? Below the ELA (3000 m) something happens for the numerical glacier (and for real glaciers too) that did not happen in the glacier goo experiment. What is it? If we want to calculate changes further in time, we have to set the desired date. Try editing the cell below to ask the model to run for 500 years instead of 150. Based on this information, do you think you modified the cell correctly? It is important to note that the model will not go back in time. Once it has run for 500 years, the model will not go back to the 450-year date. It remains at year 500. Try running the cell below. Does the output match what you expected? Accessing the glacier history Lucky for us, the Glacier object has also been storing a history of how the glacier has changed over the simulation. We can access that data through the history: And we can quickly visualise the history of the glacier with the .plot_history() method What is going on in this image? The length of the glacier is a step function in the first year of simulation because, above the equilibrium line altitude (ELA), only accumulation is happening. After that, at first the length of the glacier remains constant. The ice is not very thick, so the portion that reaches below the ELA does not survive the melting that occurs there. But no matter how thick the glacier is, the part above the ELA is always gaining mass. Eventually, there is enough ice to persist below the ELA. We will learn more about ELA in the accumulation and ablation notebook. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume will no longer change, as long as all physical parameters and the climate stay roughly constant. The Glacier object has a method which can progress the glacier to equilibrium .progress_to_equilibrium(). More on this in later notebooks. Can you identify an equilibrium state in the plots above? A first experiment Ok, we have seen the basics. Now, how about a glacier on a different slope? Glaciers are sometimes very steep, like this one in Nepal. Let's adjust the slope in the model to observe a steeper glacier: In the following code, can you identify where we tell the model the new slope we are going to use? What slope did we use for the first experiment? Look for that information at the beginning of the notebook. Comparing glaciers We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. We can get a quick look at the collection by simply calling it: Before we compare the glaciers in the collection, let's make sure to progress them to the same year with the .progress_to_year() method. Now let's compare the glacier we studied first with our new glacier on a different slope. Do you think the new glacier will have more or less ice than the first? Let's make sure we understand what is going on: Explore the characteristics (thickness, length, velocity...). Can you explain the difference between the two glaciers? Click for details Activity Now, try to change the slope to another value, and run the model again. What do you see?
7,349
7,485
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection top_elev = 3400 # m, the peak elevation bottom_elev = 1500 # m, the elevation at the bottom of the glacier bed_width = 300 # m, the constant width of the rectangular valley bed_slope = 10 # degrees, the slope of the bed bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=bed_slope) bed.plot() bed ELA = 3000 # equilibrium line altitude in meters above sea level altgrad = 4 # altitude gradient in mm/m mb_model = MassBalance(ELA, gradient=altgrad) mb_model glacier = Glacier(bed=bed, mass_balance=mb_model) glacier glacier.plot_mass_balance() runtime = 1 glacier.progress_to_year(runtime) glacier.plot() glacier runtime = 150 glacier.progress_to_year(150) glacier.plot() glacier runtime = 150 glacier.progress_to_year(runtime) glacier.plot() glacier glacier.progress_to_year(450) glacier glacier.history glacier.plot_history() new_slope = 20 new_bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=new_slope) new_glacier = Glacier(bed=new_bed, mass_balance=mb_model) collection = GlacierCollection() collection.add([glacier, new_glacier]) collection collection.progress_to_year(600) collection.plot_side_by_side(figsize=(10, 5)) collection.plot_history() collection
1,244
1,277
9
ice_on_incline-10
ice_on_incline-10
Ice on an incline This activity can be run by students after a live experiment with "glacier goo" used on various slopes. In this notebook, we use a numerical simulation to study the difference in ice flow between bed of various slopes. First, we set up the tools that we will use. You won't need to modify these. The essentials Now we set up our first slope and tell the model that we want to study a glacier there. We will keep things simple: a constant slope, constant valley width, and simple formulation for adding and removing ice according to altitude. The glacier bed We will use a helper function to create a simple bed with a constant slope. This requires as input a top and bottom altitude, and a width. We have to decide how wide our glacier is. For now, we will use a default RectangularBedFlowline shape with an initial_width width of 300 m. The "rectangular" cross-sectional shape means that the glacial "valley" walls are straight and the width w is the same throughout: In this image, the black lines signify the walls of the "valley". The blue line shows the surface of the glacier. What do you think *h* means in the picture? Click for details We set up a glacier bed with the specified geometry: Let's plot the bed to make sure that it looks like we expect. The GlacierBed object has a built in method for this which provide us with a side and top-down view of the glacier domain. Check out the glacier bed length. How do you think that the length is computed out of the parameters above? Click for details We have now defined an object called GlacierBed and assigned it to the variable bed, which stores all the information about the bed geometry that the model uses. Notice that bed does not include any information about the ice. So far we have only set up a valley. We have defined its slope, its width, its transverse shape - the geometry of the habitat where our glacier will grow. Now we want to add the climate processes that will put ice into that habitat. Adding the ice Now we want to add ice to our incline and make a glacier. Glaciologists describe the amount of ice that is added or removed over the entire surface of the glacier as the "mass balance". Here's an illustration from the OGGM-edu website: A linear mass balance is defined by an equilibrium line altitude (ELA) and a mass balance gradient with altitude (in [mm m−1]). Above the ELA, we add ice (from snow) and below the line we remove ice (melting it). We will learn more about this in the accumulation and ablation notebook. The mass balance model mb_model gives us the mass balance for any altitude we want. We will plot it below. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, the Glacier object is storing some information that we can recover just by calling it: Since we just created the glacier, there's still no ice! We need some time for ice to accumulate. For this, the mass balance is the relevant process: What did you notice in the graph? What are the axes? At what altitudes is ice added to the glacier (positive mass balance)? At what altitudes does ice melt? Running the numerical model When we did our experiments in the laboratory, we had a slope and some material to pour our "glacier". We also decided how long to let the goo flow -- that is, the "runtime" of our experiment. Setting up our glacier model on the computer is very similar. We have gathered our bed geometry (bed), our mass balance (mb_model), and now we will tell the model how long to run (runtime). First we run the model for one year: Let's take a look. The Glacier object also has a built-in method for us to plot. Here we can see that there is a very thin cover of ice from the top and partway down the glacier bed. Study both plots and interpret what they are showing. How far down the glacier bed does the ice cover reach? We can also take a look at some of statistics of the glacier again to get some more details: The modeled "glacier" already reaches down to the ELA (dashed line)...but it is extremely thin. Looks like we need some more time for the glacier to grow. Let's now run the model for 150 years. In the following code, can you identify where we tell the model how many years we want to study? Let's see how our glacier has changed. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same set of statistics about the glacier as before: Compare this "numerical glacier" with the "glacier goo" we made in the lab: How long does it take for the glacier goo to "grow" and flow down the slope? How long does the numerical glacier need? Below the ELA (3000 m) something happens for the numerical glacier (and for real glaciers too) that did not happen in the glacier goo experiment. What is it? If we want to calculate changes further in time, we have to set the desired date. Try editing the cell below to ask the model to run for 500 years instead of 150. Based on this information, do you think you modified the cell correctly? It is important to note that the model will not go back in time. Once it has run for 500 years, the model will not go back to the 450-year date. It remains at year 500. Try running the cell below. Does the output match what you expected? Accessing the glacier history Lucky for us, the Glacier object has also been storing a history of how the glacier has changed over the simulation. We can access that data through the history: And we can quickly visualise the history of the glacier with the .plot_history() method What is going on in this image? The length of the glacier is a step function in the first year of simulation because, above the equilibrium line altitude (ELA), only accumulation is happening. After that, at first the length of the glacier remains constant. The ice is not very thick, so the portion that reaches below the ELA does not survive the melting that occurs there. But no matter how thick the glacier is, the part above the ELA is always gaining mass. Eventually, there is enough ice to persist below the ELA. We will learn more about ELA in the accumulation and ablation notebook. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume will no longer change, as long as all physical parameters and the climate stay roughly constant. The Glacier object has a method which can progress the glacier to equilibrium .progress_to_equilibrium(). More on this in later notebooks. Can you identify an equilibrium state in the plots above? A first experiment Ok, we have seen the basics. Now, how about a glacier on a different slope? Glaciers are sometimes very steep, like this one in Nepal. Let's adjust the slope in the model to observe a steeper glacier: In the following code, can you identify where we tell the model the new slope we are going to use? What slope did we use for the first experiment? Look for that information at the beginning of the notebook. Comparing glaciers We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. We can get a quick look at the collection by simply calling it: Before we compare the glaciers in the collection, let's make sure to progress them to the same year with the .progress_to_year() method. Now let's compare the glacier we studied first with our new glacier on a different slope. Do you think the new glacier will have more or less ice than the first? Let's make sure we understand what is going on: Explore the characteristics (thickness, length, velocity...). Can you explain the difference between the two glaciers? Click for details Activity Now, try to change the slope to another value, and run the model again. What do you see?
7,491
7,575
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection top_elev = 3400 # m, the peak elevation bottom_elev = 1500 # m, the elevation at the bottom of the glacier bed_width = 300 # m, the constant width of the rectangular valley bed_slope = 10 # degrees, the slope of the bed bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=bed_slope) bed.plot() bed ELA = 3000 # equilibrium line altitude in meters above sea level altgrad = 4 # altitude gradient in mm/m mb_model = MassBalance(ELA, gradient=altgrad) mb_model glacier = Glacier(bed=bed, mass_balance=mb_model) glacier glacier.plot_mass_balance() runtime = 1 glacier.progress_to_year(runtime) glacier.plot() glacier runtime = 150 glacier.progress_to_year(150) glacier.plot() glacier runtime = 150 glacier.progress_to_year(runtime) glacier.plot() glacier glacier.progress_to_year(450) glacier glacier.history glacier.plot_history() new_slope = 20 new_bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=new_slope) new_glacier = Glacier(bed=new_bed, mass_balance=mb_model) collection = GlacierCollection() collection.add([glacier, new_glacier]) collection collection.progress_to_year(600) collection.plot_side_by_side(figsize=(10, 5)) collection.plot_history() collection
1,279
1,325
10
ice_on_incline-11
ice_on_incline-11
Ice on an incline This activity can be run by students after a live experiment with "glacier goo" used on various slopes. In this notebook, we use a numerical simulation to study the difference in ice flow between bed of various slopes. First, we set up the tools that we will use. You won't need to modify these. The essentials Now we set up our first slope and tell the model that we want to study a glacier there. We will keep things simple: a constant slope, constant valley width, and simple formulation for adding and removing ice according to altitude. The glacier bed We will use a helper function to create a simple bed with a constant slope. This requires as input a top and bottom altitude, and a width. We have to decide how wide our glacier is. For now, we will use a default RectangularBedFlowline shape with an initial_width width of 300 m. The "rectangular" cross-sectional shape means that the glacial "valley" walls are straight and the width w is the same throughout: In this image, the black lines signify the walls of the "valley". The blue line shows the surface of the glacier. What do you think *h* means in the picture? Click for details We set up a glacier bed with the specified geometry: Let's plot the bed to make sure that it looks like we expect. The GlacierBed object has a built in method for this which provide us with a side and top-down view of the glacier domain. Check out the glacier bed length. How do you think that the length is computed out of the parameters above? Click for details We have now defined an object called GlacierBed and assigned it to the variable bed, which stores all the information about the bed geometry that the model uses. Notice that bed does not include any information about the ice. So far we have only set up a valley. We have defined its slope, its width, its transverse shape - the geometry of the habitat where our glacier will grow. Now we want to add the climate processes that will put ice into that habitat. Adding the ice Now we want to add ice to our incline and make a glacier. Glaciologists describe the amount of ice that is added or removed over the entire surface of the glacier as the "mass balance". Here's an illustration from the OGGM-edu website: A linear mass balance is defined by an equilibrium line altitude (ELA) and a mass balance gradient with altitude (in [mm m−1]). Above the ELA, we add ice (from snow) and below the line we remove ice (melting it). We will learn more about this in the accumulation and ablation notebook. The mass balance model mb_model gives us the mass balance for any altitude we want. We will plot it below. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, the Glacier object is storing some information that we can recover just by calling it: Since we just created the glacier, there's still no ice! We need some time for ice to accumulate. For this, the mass balance is the relevant process: What did you notice in the graph? What are the axes? At what altitudes is ice added to the glacier (positive mass balance)? At what altitudes does ice melt? Running the numerical model When we did our experiments in the laboratory, we had a slope and some material to pour our "glacier". We also decided how long to let the goo flow -- that is, the "runtime" of our experiment. Setting up our glacier model on the computer is very similar. We have gathered our bed geometry (bed), our mass balance (mb_model), and now we will tell the model how long to run (runtime). First we run the model for one year: Let's take a look. The Glacier object also has a built-in method for us to plot. Here we can see that there is a very thin cover of ice from the top and partway down the glacier bed. Study both plots and interpret what they are showing. How far down the glacier bed does the ice cover reach? We can also take a look at some of statistics of the glacier again to get some more details: The modeled "glacier" already reaches down to the ELA (dashed line)...but it is extremely thin. Looks like we need some more time for the glacier to grow. Let's now run the model for 150 years. In the following code, can you identify where we tell the model how many years we want to study? Let's see how our glacier has changed. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same set of statistics about the glacier as before: Compare this "numerical glacier" with the "glacier goo" we made in the lab: How long does it take for the glacier goo to "grow" and flow down the slope? How long does the numerical glacier need? Below the ELA (3000 m) something happens for the numerical glacier (and for real glaciers too) that did not happen in the glacier goo experiment. What is it? If we want to calculate changes further in time, we have to set the desired date. Try editing the cell below to ask the model to run for 500 years instead of 150. Based on this information, do you think you modified the cell correctly? It is important to note that the model will not go back in time. Once it has run for 500 years, the model will not go back to the 450-year date. It remains at year 500. Try running the cell below. Does the output match what you expected? Accessing the glacier history Lucky for us, the Glacier object has also been storing a history of how the glacier has changed over the simulation. We can access that data through the history: And we can quickly visualise the history of the glacier with the .plot_history() method What is going on in this image? The length of the glacier is a step function in the first year of simulation because, above the equilibrium line altitude (ELA), only accumulation is happening. After that, at first the length of the glacier remains constant. The ice is not very thick, so the portion that reaches below the ELA does not survive the melting that occurs there. But no matter how thick the glacier is, the part above the ELA is always gaining mass. Eventually, there is enough ice to persist below the ELA. We will learn more about ELA in the accumulation and ablation notebook. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume will no longer change, as long as all physical parameters and the climate stay roughly constant. The Glacier object has a method which can progress the glacier to equilibrium .progress_to_equilibrium(). More on this in later notebooks. Can you identify an equilibrium state in the plots above? A first experiment Ok, we have seen the basics. Now, how about a glacier on a different slope? Glaciers are sometimes very steep, like this one in Nepal. Let's adjust the slope in the model to observe a steeper glacier: In the following code, can you identify where we tell the model the new slope we are going to use? What slope did we use for the first experiment? Look for that information at the beginning of the notebook. Comparing glaciers We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. We can get a quick look at the collection by simply calling it: Before we compare the glaciers in the collection, let's make sure to progress them to the same year with the .progress_to_year() method. Now let's compare the glacier we studied first with our new glacier on a different slope. Do you think the new glacier will have more or less ice than the first? Let's make sure we understand what is going on: Explore the characteristics (thickness, length, velocity...). Can you explain the difference between the two glaciers? Click for details Activity Now, try to change the slope to another value, and run the model again. What do you see?
5,556
5,639
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection top_elev = 3400 # m, the peak elevation bottom_elev = 1500 # m, the elevation at the bottom of the glacier bed_width = 300 # m, the constant width of the rectangular valley bed_slope = 10 # degrees, the slope of the bed bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=bed_slope) bed.plot() bed ELA = 3000 # equilibrium line altitude in meters above sea level altgrad = 4 # altitude gradient in mm/m mb_model = MassBalance(ELA, gradient=altgrad) mb_model glacier = Glacier(bed=bed, mass_balance=mb_model) glacier glacier.plot_mass_balance() runtime = 1 glacier.progress_to_year(runtime) glacier.plot() glacier runtime = 150 glacier.progress_to_year(150) glacier.plot() glacier runtime = 150 glacier.progress_to_year(runtime) glacier.plot() glacier glacier.progress_to_year(450) glacier glacier.history glacier.plot_history() new_slope = 20 new_bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=new_slope) new_glacier = Glacier(bed=new_bed, mass_balance=mb_model) collection = GlacierCollection() collection.add([glacier, new_glacier]) collection collection.progress_to_year(600) collection.plot_side_by_side(figsize=(10, 5)) collection.plot_history() collection
959
982
11
ice_on_incline-12
ice_on_incline-12
Ice on an incline This activity can be run by students after a live experiment with "glacier goo" used on various slopes. In this notebook, we use a numerical simulation to study the difference in ice flow between bed of various slopes. First, we set up the tools that we will use. You won't need to modify these. The essentials Now we set up our first slope and tell the model that we want to study a glacier there. We will keep things simple: a constant slope, constant valley width, and simple formulation for adding and removing ice according to altitude. The glacier bed We will use a helper function to create a simple bed with a constant slope. This requires as input a top and bottom altitude, and a width. We have to decide how wide our glacier is. For now, we will use a default RectangularBedFlowline shape with an initial_width width of 300 m. The "rectangular" cross-sectional shape means that the glacial "valley" walls are straight and the width w is the same throughout: In this image, the black lines signify the walls of the "valley". The blue line shows the surface of the glacier. What do you think *h* means in the picture? Click for details We set up a glacier bed with the specified geometry: Let's plot the bed to make sure that it looks like we expect. The GlacierBed object has a built in method for this which provide us with a side and top-down view of the glacier domain. Check out the glacier bed length. How do you think that the length is computed out of the parameters above? Click for details We have now defined an object called GlacierBed and assigned it to the variable bed, which stores all the information about the bed geometry that the model uses. Notice that bed does not include any information about the ice. So far we have only set up a valley. We have defined its slope, its width, its transverse shape - the geometry of the habitat where our glacier will grow. Now we want to add the climate processes that will put ice into that habitat. Adding the ice Now we want to add ice to our incline and make a glacier. Glaciologists describe the amount of ice that is added or removed over the entire surface of the glacier as the "mass balance". Here's an illustration from the OGGM-edu website: A linear mass balance is defined by an equilibrium line altitude (ELA) and a mass balance gradient with altitude (in [mm m−1]). Above the ELA, we add ice (from snow) and below the line we remove ice (melting it). We will learn more about this in the accumulation and ablation notebook. The mass balance model mb_model gives us the mass balance for any altitude we want. We will plot it below. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, the Glacier object is storing some information that we can recover just by calling it: Since we just created the glacier, there's still no ice! We need some time for ice to accumulate. For this, the mass balance is the relevant process: What did you notice in the graph? What are the axes? At what altitudes is ice added to the glacier (positive mass balance)? At what altitudes does ice melt? Running the numerical model When we did our experiments in the laboratory, we had a slope and some material to pour our "glacier". We also decided how long to let the goo flow -- that is, the "runtime" of our experiment. Setting up our glacier model on the computer is very similar. We have gathered our bed geometry (bed), our mass balance (mb_model), and now we will tell the model how long to run (runtime). First we run the model for one year: Let's take a look. The Glacier object also has a built-in method for us to plot. Here we can see that there is a very thin cover of ice from the top and partway down the glacier bed. Study both plots and interpret what they are showing. How far down the glacier bed does the ice cover reach? We can also take a look at some of statistics of the glacier again to get some more details: The modeled "glacier" already reaches down to the ELA (dashed line)...but it is extremely thin. Looks like we need some more time for the glacier to grow. Let's now run the model for 150 years. In the following code, can you identify where we tell the model how many years we want to study? Let's see how our glacier has changed. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same set of statistics about the glacier as before: Compare this "numerical glacier" with the "glacier goo" we made in the lab: How long does it take for the glacier goo to "grow" and flow down the slope? How long does the numerical glacier need? Below the ELA (3000 m) something happens for the numerical glacier (and for real glaciers too) that did not happen in the glacier goo experiment. What is it? If we want to calculate changes further in time, we have to set the desired date. Try editing the cell below to ask the model to run for 500 years instead of 150. Based on this information, do you think you modified the cell correctly? It is important to note that the model will not go back in time. Once it has run for 500 years, the model will not go back to the 450-year date. It remains at year 500. Try running the cell below. Does the output match what you expected? Accessing the glacier history Lucky for us, the Glacier object has also been storing a history of how the glacier has changed over the simulation. We can access that data through the history: And we can quickly visualise the history of the glacier with the .plot_history() method What is going on in this image? The length of the glacier is a step function in the first year of simulation because, above the equilibrium line altitude (ELA), only accumulation is happening. After that, at first the length of the glacier remains constant. The ice is not very thick, so the portion that reaches below the ELA does not survive the melting that occurs there. But no matter how thick the glacier is, the part above the ELA is always gaining mass. Eventually, there is enough ice to persist below the ELA. We will learn more about ELA in the accumulation and ablation notebook. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume will no longer change, as long as all physical parameters and the climate stay roughly constant. The Glacier object has a method which can progress the glacier to equilibrium .progress_to_equilibrium(). More on this in later notebooks. Can you identify an equilibrium state in the plots above? A first experiment Ok, we have seen the basics. Now, how about a glacier on a different slope? Glaciers are sometimes very steep, like this one in Nepal. Let's adjust the slope in the model to observe a steeper glacier: In the following code, can you identify where we tell the model the new slope we are going to use? What slope did we use for the first experiment? Look for that information at the beginning of the notebook. Comparing glaciers We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. We can get a quick look at the collection by simply calling it: Before we compare the glaciers in the collection, let's make sure to progress them to the same year with the .progress_to_year() method. Now let's compare the glacier we studied first with our new glacier on a different slope. Do you think the new glacier will have more or less ice than the first? Let's make sure we understand what is going on: Explore the characteristics (thickness, length, velocity...). Can you explain the difference between the two glaciers? Click for details Activity Now, try to change the slope to another value, and run the model again. What do you see?
5,506
5,549
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection top_elev = 3400 # m, the peak elevation bottom_elev = 1500 # m, the elevation at the bottom of the glacier bed_width = 300 # m, the constant width of the rectangular valley bed_slope = 10 # degrees, the slope of the bed bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=bed_slope) bed.plot() bed ELA = 3000 # equilibrium line altitude in meters above sea level altgrad = 4 # altitude gradient in mm/m mb_model = MassBalance(ELA, gradient=altgrad) mb_model glacier = Glacier(bed=bed, mass_balance=mb_model) glacier glacier.plot_mass_balance() runtime = 1 glacier.progress_to_year(runtime) glacier.plot() glacier runtime = 150 glacier.progress_to_year(150) glacier.plot() glacier runtime = 150 glacier.progress_to_year(runtime) glacier.plot() glacier glacier.progress_to_year(450) glacier glacier.history glacier.plot_history() new_slope = 20 new_bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=new_slope) new_glacier = Glacier(bed=new_bed, mass_balance=mb_model) collection = GlacierCollection() collection.add([glacier, new_glacier]) collection collection.progress_to_year(600) collection.plot_side_by_side(figsize=(10, 5)) collection.plot_history() collection
941
957
12
ice_on_incline-13
ice_on_incline-13
Ice on an incline This activity can be run by students after a live experiment with "glacier goo" used on various slopes. In this notebook, we use a numerical simulation to study the difference in ice flow between bed of various slopes. First, we set up the tools that we will use. You won't need to modify these. The essentials Now we set up our first slope and tell the model that we want to study a glacier there. We will keep things simple: a constant slope, constant valley width, and simple formulation for adding and removing ice according to altitude. The glacier bed We will use a helper function to create a simple bed with a constant slope. This requires as input a top and bottom altitude, and a width. We have to decide how wide our glacier is. For now, we will use a default RectangularBedFlowline shape with an initial_width width of 300 m. The "rectangular" cross-sectional shape means that the glacial "valley" walls are straight and the width w is the same throughout: In this image, the black lines signify the walls of the "valley". The blue line shows the surface of the glacier. What do you think *h* means in the picture? Click for details We set up a glacier bed with the specified geometry: Let's plot the bed to make sure that it looks like we expect. The GlacierBed object has a built in method for this which provide us with a side and top-down view of the glacier domain. Check out the glacier bed length. How do you think that the length is computed out of the parameters above? Click for details We have now defined an object called GlacierBed and assigned it to the variable bed, which stores all the information about the bed geometry that the model uses. Notice that bed does not include any information about the ice. So far we have only set up a valley. We have defined its slope, its width, its transverse shape - the geometry of the habitat where our glacier will grow. Now we want to add the climate processes that will put ice into that habitat. Adding the ice Now we want to add ice to our incline and make a glacier. Glaciologists describe the amount of ice that is added or removed over the entire surface of the glacier as the "mass balance". Here's an illustration from the OGGM-edu website: A linear mass balance is defined by an equilibrium line altitude (ELA) and a mass balance gradient with altitude (in [mm m−1]). Above the ELA, we add ice (from snow) and below the line we remove ice (melting it). We will learn more about this in the accumulation and ablation notebook. The mass balance model mb_model gives us the mass balance for any altitude we want. We will plot it below. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, the Glacier object is storing some information that we can recover just by calling it: Since we just created the glacier, there's still no ice! We need some time for ice to accumulate. For this, the mass balance is the relevant process: What did you notice in the graph? What are the axes? At what altitudes is ice added to the glacier (positive mass balance)? At what altitudes does ice melt? Running the numerical model When we did our experiments in the laboratory, we had a slope and some material to pour our "glacier". We also decided how long to let the goo flow -- that is, the "runtime" of our experiment. Setting up our glacier model on the computer is very similar. We have gathered our bed geometry (bed), our mass balance (mb_model), and now we will tell the model how long to run (runtime). First we run the model for one year: Let's take a look. The Glacier object also has a built-in method for us to plot. Here we can see that there is a very thin cover of ice from the top and partway down the glacier bed. Study both plots and interpret what they are showing. How far down the glacier bed does the ice cover reach? We can also take a look at some of statistics of the glacier again to get some more details: The modeled "glacier" already reaches down to the ELA (dashed line)...but it is extremely thin. Looks like we need some more time for the glacier to grow. Let's now run the model for 150 years. In the following code, can you identify where we tell the model how many years we want to study? Let's see how our glacier has changed. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same set of statistics about the glacier as before: Compare this "numerical glacier" with the "glacier goo" we made in the lab: How long does it take for the glacier goo to "grow" and flow down the slope? How long does the numerical glacier need? Below the ELA (3000 m) something happens for the numerical glacier (and for real glaciers too) that did not happen in the glacier goo experiment. What is it? If we want to calculate changes further in time, we have to set the desired date. Try editing the cell below to ask the model to run for 500 years instead of 150. Based on this information, do you think you modified the cell correctly? It is important to note that the model will not go back in time. Once it has run for 500 years, the model will not go back to the 450-year date. It remains at year 500. Try running the cell below. Does the output match what you expected? Accessing the glacier history Lucky for us, the Glacier object has also been storing a history of how the glacier has changed over the simulation. We can access that data through the history: And we can quickly visualise the history of the glacier with the .plot_history() method What is going on in this image? The length of the glacier is a step function in the first year of simulation because, above the equilibrium line altitude (ELA), only accumulation is happening. After that, at first the length of the glacier remains constant. The ice is not very thick, so the portion that reaches below the ELA does not survive the melting that occurs there. But no matter how thick the glacier is, the part above the ELA is always gaining mass. Eventually, there is enough ice to persist below the ELA. We will learn more about ELA in the accumulation and ablation notebook. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume will no longer change, as long as all physical parameters and the climate stay roughly constant. The Glacier object has a method which can progress the glacier to equilibrium .progress_to_equilibrium(). More on this in later notebooks. Can you identify an equilibrium state in the plots above? A first experiment Ok, we have seen the basics. Now, how about a glacier on a different slope? Glaciers are sometimes very steep, like this one in Nepal. Let's adjust the slope in the model to observe a steeper glacier: In the following code, can you identify where we tell the model the new slope we are going to use? What slope did we use for the first experiment? Look for that information at the beginning of the notebook. Comparing glaciers We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. We can get a quick look at the collection by simply calling it: Before we compare the glaciers in the collection, let's make sure to progress them to the same year with the .progress_to_year() method. Now let's compare the glacier we studied first with our new glacier on a different slope. Do you think the new glacier will have more or less ice than the first? Let's make sure we understand what is going on: Explore the characteristics (thickness, length, velocity...). Can you explain the difference between the two glaciers? Click for details Activity Now, try to change the slope to another value, and run the model again. What do you see?
2,668
2,774
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection top_elev = 3400 # m, the peak elevation bottom_elev = 1500 # m, the elevation at the bottom of the glacier bed_width = 300 # m, the constant width of the rectangular valley bed_slope = 10 # degrees, the slope of the bed bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=bed_slope) bed.plot() bed ELA = 3000 # equilibrium line altitude in meters above sea level altgrad = 4 # altitude gradient in mm/m mb_model = MassBalance(ELA, gradient=altgrad) mb_model glacier = Glacier(bed=bed, mass_balance=mb_model) glacier glacier.plot_mass_balance() runtime = 1 glacier.progress_to_year(runtime) glacier.plot() glacier runtime = 150 glacier.progress_to_year(150) glacier.plot() glacier runtime = 150 glacier.progress_to_year(runtime) glacier.plot() glacier glacier.progress_to_year(450) glacier glacier.history glacier.plot_history() new_slope = 20 new_bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=new_slope) new_glacier = Glacier(bed=new_bed, mass_balance=mb_model) collection = GlacierCollection() collection.add([glacier, new_glacier]) collection collection.progress_to_year(600) collection.plot_side_by_side(figsize=(10, 5)) collection.plot_history() collection
579
629
13
ice_on_incline-14
ice_on_incline-14
Ice on an incline This activity can be run by students after a live experiment with "glacier goo" used on various slopes. In this notebook, we use a numerical simulation to study the difference in ice flow between bed of various slopes. First, we set up the tools that we will use. You won't need to modify these. The essentials Now we set up our first slope and tell the model that we want to study a glacier there. We will keep things simple: a constant slope, constant valley width, and simple formulation for adding and removing ice according to altitude. The glacier bed We will use a helper function to create a simple bed with a constant slope. This requires as input a top and bottom altitude, and a width. We have to decide how wide our glacier is. For now, we will use a default RectangularBedFlowline shape with an initial_width width of 300 m. The "rectangular" cross-sectional shape means that the glacial "valley" walls are straight and the width w is the same throughout: In this image, the black lines signify the walls of the "valley". The blue line shows the surface of the glacier. What do you think *h* means in the picture? Click for details We set up a glacier bed with the specified geometry: Let's plot the bed to make sure that it looks like we expect. The GlacierBed object has a built in method for this which provide us with a side and top-down view of the glacier domain. Check out the glacier bed length. How do you think that the length is computed out of the parameters above? Click for details We have now defined an object called GlacierBed and assigned it to the variable bed, which stores all the information about the bed geometry that the model uses. Notice that bed does not include any information about the ice. So far we have only set up a valley. We have defined its slope, its width, its transverse shape - the geometry of the habitat where our glacier will grow. Now we want to add the climate processes that will put ice into that habitat. Adding the ice Now we want to add ice to our incline and make a glacier. Glaciologists describe the amount of ice that is added or removed over the entire surface of the glacier as the "mass balance". Here's an illustration from the OGGM-edu website: A linear mass balance is defined by an equilibrium line altitude (ELA) and a mass balance gradient with altitude (in [mm m−1]). Above the ELA, we add ice (from snow) and below the line we remove ice (melting it). We will learn more about this in the accumulation and ablation notebook. The mass balance model mb_model gives us the mass balance for any altitude we want. We will plot it below. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, the Glacier object is storing some information that we can recover just by calling it: Since we just created the glacier, there's still no ice! We need some time for ice to accumulate. For this, the mass balance is the relevant process: What did you notice in the graph? What are the axes? At what altitudes is ice added to the glacier (positive mass balance)? At what altitudes does ice melt? Running the numerical model When we did our experiments in the laboratory, we had a slope and some material to pour our "glacier". We also decided how long to let the goo flow -- that is, the "runtime" of our experiment. Setting up our glacier model on the computer is very similar. We have gathered our bed geometry (bed), our mass balance (mb_model), and now we will tell the model how long to run (runtime). First we run the model for one year: Let's take a look. The Glacier object also has a built-in method for us to plot. Here we can see that there is a very thin cover of ice from the top and partway down the glacier bed. Study both plots and interpret what they are showing. How far down the glacier bed does the ice cover reach? We can also take a look at some of statistics of the glacier again to get some more details: The modeled "glacier" already reaches down to the ELA (dashed line)...but it is extremely thin. Looks like we need some more time for the glacier to grow. Let's now run the model for 150 years. In the following code, can you identify where we tell the model how many years we want to study? Let's see how our glacier has changed. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same set of statistics about the glacier as before: Compare this "numerical glacier" with the "glacier goo" we made in the lab: How long does it take for the glacier goo to "grow" and flow down the slope? How long does the numerical glacier need? Below the ELA (3000 m) something happens for the numerical glacier (and for real glaciers too) that did not happen in the glacier goo experiment. What is it? If we want to calculate changes further in time, we have to set the desired date. Try editing the cell below to ask the model to run for 500 years instead of 150. Based on this information, do you think you modified the cell correctly? It is important to note that the model will not go back in time. Once it has run for 500 years, the model will not go back to the 450-year date. It remains at year 500. Try running the cell below. Does the output match what you expected? Accessing the glacier history Lucky for us, the Glacier object has also been storing a history of how the glacier has changed over the simulation. We can access that data through the history: And we can quickly visualise the history of the glacier with the .plot_history() method What is going on in this image? The length of the glacier is a step function in the first year of simulation because, above the equilibrium line altitude (ELA), only accumulation is happening. After that, at first the length of the glacier remains constant. The ice is not very thick, so the portion that reaches below the ELA does not survive the melting that occurs there. But no matter how thick the glacier is, the part above the ELA is always gaining mass. Eventually, there is enough ice to persist below the ELA. We will learn more about ELA in the accumulation and ablation notebook. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume will no longer change, as long as all physical parameters and the climate stay roughly constant. The Glacier object has a method which can progress the glacier to equilibrium .progress_to_equilibrium(). More on this in later notebooks. Can you identify an equilibrium state in the plots above? A first experiment Ok, we have seen the basics. Now, how about a glacier on a different slope? Glaciers are sometimes very steep, like this one in Nepal. Let's adjust the slope in the model to observe a steeper glacier: In the following code, can you identify where we tell the model the new slope we are going to use? What slope did we use for the first experiment? Look for that information at the beginning of the notebook. Comparing glaciers We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. We can get a quick look at the collection by simply calling it: Before we compare the glaciers in the collection, let's make sure to progress them to the same year with the .progress_to_year() method. Now let's compare the glacier we studied first with our new glacier on a different slope. Do you think the new glacier will have more or less ice than the first? Let's make sure we understand what is going on: Explore the characteristics (thickness, length, velocity...). Can you explain the difference between the two glaciers? Click for details Activity Now, try to change the slope to another value, and run the model again. What do you see?
3,557
3,604
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection top_elev = 3400 # m, the peak elevation bottom_elev = 1500 # m, the elevation at the bottom of the glacier bed_width = 300 # m, the constant width of the rectangular valley bed_slope = 10 # degrees, the slope of the bed bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=bed_slope) bed.plot() bed ELA = 3000 # equilibrium line altitude in meters above sea level altgrad = 4 # altitude gradient in mm/m mb_model = MassBalance(ELA, gradient=altgrad) mb_model glacier = Glacier(bed=bed, mass_balance=mb_model) glacier glacier.plot_mass_balance() runtime = 1 glacier.progress_to_year(runtime) glacier.plot() glacier runtime = 150 glacier.progress_to_year(150) glacier.plot() glacier runtime = 150 glacier.progress_to_year(runtime) glacier.plot() glacier glacier.progress_to_year(450) glacier glacier.history glacier.plot_history() new_slope = 20 new_bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=new_slope) new_glacier = Glacier(bed=new_bed, mass_balance=mb_model) collection = GlacierCollection() collection.add([glacier, new_glacier]) collection collection.progress_to_year(600) collection.plot_side_by_side(figsize=(10, 5)) collection.plot_history() collection
674
720
14
ice_on_incline-15
ice_on_incline-15
Ice on an incline This activity can be run by students after a live experiment with "glacier goo" used on various slopes. In this notebook, we use a numerical simulation to study the difference in ice flow between bed of various slopes. First, we set up the tools that we will use. You won't need to modify these. The essentials Now we set up our first slope and tell the model that we want to study a glacier there. We will keep things simple: a constant slope, constant valley width, and simple formulation for adding and removing ice according to altitude. The glacier bed We will use a helper function to create a simple bed with a constant slope. This requires as input a top and bottom altitude, and a width. We have to decide how wide our glacier is. For now, we will use a default RectangularBedFlowline shape with an initial_width width of 300 m. The "rectangular" cross-sectional shape means that the glacial "valley" walls are straight and the width w is the same throughout: In this image, the black lines signify the walls of the "valley". The blue line shows the surface of the glacier. What do you think *h* means in the picture? Click for details We set up a glacier bed with the specified geometry: Let's plot the bed to make sure that it looks like we expect. The GlacierBed object has a built in method for this which provide us with a side and top-down view of the glacier domain. Check out the glacier bed length. How do you think that the length is computed out of the parameters above? Click for details We have now defined an object called GlacierBed and assigned it to the variable bed, which stores all the information about the bed geometry that the model uses. Notice that bed does not include any information about the ice. So far we have only set up a valley. We have defined its slope, its width, its transverse shape - the geometry of the habitat where our glacier will grow. Now we want to add the climate processes that will put ice into that habitat. Adding the ice Now we want to add ice to our incline and make a glacier. Glaciologists describe the amount of ice that is added or removed over the entire surface of the glacier as the "mass balance". Here's an illustration from the OGGM-edu website: A linear mass balance is defined by an equilibrium line altitude (ELA) and a mass balance gradient with altitude (in [mm m−1]). Above the ELA, we add ice (from snow) and below the line we remove ice (melting it). We will learn more about this in the accumulation and ablation notebook. The mass balance model mb_model gives us the mass balance for any altitude we want. We will plot it below. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, the Glacier object is storing some information that we can recover just by calling it: Since we just created the glacier, there's still no ice! We need some time for ice to accumulate. For this, the mass balance is the relevant process: What did you notice in the graph? What are the axes? At what altitudes is ice added to the glacier (positive mass balance)? At what altitudes does ice melt? Running the numerical model When we did our experiments in the laboratory, we had a slope and some material to pour our "glacier". We also decided how long to let the goo flow -- that is, the "runtime" of our experiment. Setting up our glacier model on the computer is very similar. We have gathered our bed geometry (bed), our mass balance (mb_model), and now we will tell the model how long to run (runtime). First we run the model for one year: Let's take a look. The Glacier object also has a built-in method for us to plot. Here we can see that there is a very thin cover of ice from the top and partway down the glacier bed. Study both plots and interpret what they are showing. How far down the glacier bed does the ice cover reach? We can also take a look at some of statistics of the glacier again to get some more details: The modeled "glacier" already reaches down to the ELA (dashed line)...but it is extremely thin. Looks like we need some more time for the glacier to grow. Let's now run the model for 150 years. In the following code, can you identify where we tell the model how many years we want to study? Let's see how our glacier has changed. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same set of statistics about the glacier as before: Compare this "numerical glacier" with the "glacier goo" we made in the lab: How long does it take for the glacier goo to "grow" and flow down the slope? How long does the numerical glacier need? Below the ELA (3000 m) something happens for the numerical glacier (and for real glaciers too) that did not happen in the glacier goo experiment. What is it? If we want to calculate changes further in time, we have to set the desired date. Try editing the cell below to ask the model to run for 500 years instead of 150. Based on this information, do you think you modified the cell correctly? It is important to note that the model will not go back in time. Once it has run for 500 years, the model will not go back to the 450-year date. It remains at year 500. Try running the cell below. Does the output match what you expected? Accessing the glacier history Lucky for us, the Glacier object has also been storing a history of how the glacier has changed over the simulation. We can access that data through the history: And we can quickly visualise the history of the glacier with the .plot_history() method What is going on in this image? The length of the glacier is a step function in the first year of simulation because, above the equilibrium line altitude (ELA), only accumulation is happening. After that, at first the length of the glacier remains constant. The ice is not very thick, so the portion that reaches below the ELA does not survive the melting that occurs there. But no matter how thick the glacier is, the part above the ELA is always gaining mass. Eventually, there is enough ice to persist below the ELA. We will learn more about ELA in the accumulation and ablation notebook. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume will no longer change, as long as all physical parameters and the climate stay roughly constant. The Glacier object has a method which can progress the glacier to equilibrium .progress_to_equilibrium(). More on this in later notebooks. Can you identify an equilibrium state in the plots above? A first experiment Ok, we have seen the basics. Now, how about a glacier on a different slope? Glaciers are sometimes very steep, like this one in Nepal. Let's adjust the slope in the model to observe a steeper glacier: In the following code, can you identify where we tell the model the new slope we are going to use? What slope did we use for the first experiment? Look for that information at the beginning of the notebook. Comparing glaciers We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. We can get a quick look at the collection by simply calling it: Before we compare the glaciers in the collection, let's make sure to progress them to the same year with the .progress_to_year() method. Now let's compare the glacier we studied first with our new glacier on a different slope. Do you think the new glacier will have more or less ice than the first? Let's make sure we understand what is going on: Explore the characteristics (thickness, length, velocity...). Can you explain the difference between the two glaciers? Click for details Activity Now, try to change the slope to another value, and run the model again. What do you see?
4,190
4,228
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection top_elev = 3400 # m, the peak elevation bottom_elev = 1500 # m, the elevation at the bottom of the glacier bed_width = 300 # m, the constant width of the rectangular valley bed_slope = 10 # degrees, the slope of the bed bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=bed_slope) bed.plot() bed ELA = 3000 # equilibrium line altitude in meters above sea level altgrad = 4 # altitude gradient in mm/m mb_model = MassBalance(ELA, gradient=altgrad) mb_model glacier = Glacier(bed=bed, mass_balance=mb_model) glacier glacier.plot_mass_balance() runtime = 1 glacier.progress_to_year(runtime) glacier.plot() glacier runtime = 150 glacier.progress_to_year(150) glacier.plot() glacier runtime = 150 glacier.progress_to_year(runtime) glacier.plot() glacier glacier.progress_to_year(450) glacier glacier.history glacier.plot_history() new_slope = 20 new_bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=new_slope) new_glacier = Glacier(bed=new_bed, mass_balance=mb_model) collection = GlacierCollection() collection.add([glacier, new_glacier]) collection collection.progress_to_year(600) collection.plot_side_by_side(figsize=(10, 5)) collection.plot_history() collection
750
794
15
ice_on_incline-16
ice_on_incline-16
Ice on an incline This activity can be run by students after a live experiment with "glacier goo" used on various slopes. In this notebook, we use a numerical simulation to study the difference in ice flow between bed of various slopes. First, we set up the tools that we will use. You won't need to modify these. The essentials Now we set up our first slope and tell the model that we want to study a glacier there. We will keep things simple: a constant slope, constant valley width, and simple formulation for adding and removing ice according to altitude. The glacier bed We will use a helper function to create a simple bed with a constant slope. This requires as input a top and bottom altitude, and a width. We have to decide how wide our glacier is. For now, we will use a default RectangularBedFlowline shape with an initial_width width of 300 m. The "rectangular" cross-sectional shape means that the glacial "valley" walls are straight and the width w is the same throughout: In this image, the black lines signify the walls of the "valley". The blue line shows the surface of the glacier. What do you think *h* means in the picture? Click for details We set up a glacier bed with the specified geometry: Let's plot the bed to make sure that it looks like we expect. The GlacierBed object has a built in method for this which provide us with a side and top-down view of the glacier domain. Check out the glacier bed length. How do you think that the length is computed out of the parameters above? Click for details We have now defined an object called GlacierBed and assigned it to the variable bed, which stores all the information about the bed geometry that the model uses. Notice that bed does not include any information about the ice. So far we have only set up a valley. We have defined its slope, its width, its transverse shape - the geometry of the habitat where our glacier will grow. Now we want to add the climate processes that will put ice into that habitat. Adding the ice Now we want to add ice to our incline and make a glacier. Glaciologists describe the amount of ice that is added or removed over the entire surface of the glacier as the "mass balance". Here's an illustration from the OGGM-edu website: A linear mass balance is defined by an equilibrium line altitude (ELA) and a mass balance gradient with altitude (in [mm m−1]). Above the ELA, we add ice (from snow) and below the line we remove ice (melting it). We will learn more about this in the accumulation and ablation notebook. The mass balance model mb_model gives us the mass balance for any altitude we want. We will plot it below. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, the Glacier object is storing some information that we can recover just by calling it: Since we just created the glacier, there's still no ice! We need some time for ice to accumulate. For this, the mass balance is the relevant process: What did you notice in the graph? What are the axes? At what altitudes is ice added to the glacier (positive mass balance)? At what altitudes does ice melt? Running the numerical model When we did our experiments in the laboratory, we had a slope and some material to pour our "glacier". We also decided how long to let the goo flow -- that is, the "runtime" of our experiment. Setting up our glacier model on the computer is very similar. We have gathered our bed geometry (bed), our mass balance (mb_model), and now we will tell the model how long to run (runtime). First we run the model for one year: Let's take a look. The Glacier object also has a built-in method for us to plot. Here we can see that there is a very thin cover of ice from the top and partway down the glacier bed. Study both plots and interpret what they are showing. How far down the glacier bed does the ice cover reach? We can also take a look at some of statistics of the glacier again to get some more details: The modeled "glacier" already reaches down to the ELA (dashed line)...but it is extremely thin. Looks like we need some more time for the glacier to grow. Let's now run the model for 150 years. In the following code, can you identify where we tell the model how many years we want to study? Let's see how our glacier has changed. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same set of statistics about the glacier as before: Compare this "numerical glacier" with the "glacier goo" we made in the lab: How long does it take for the glacier goo to "grow" and flow down the slope? How long does the numerical glacier need? Below the ELA (3000 m) something happens for the numerical glacier (and for real glaciers too) that did not happen in the glacier goo experiment. What is it? If we want to calculate changes further in time, we have to set the desired date. Try editing the cell below to ask the model to run for 500 years instead of 150. Based on this information, do you think you modified the cell correctly? It is important to note that the model will not go back in time. Once it has run for 500 years, the model will not go back to the 450-year date. It remains at year 500. Try running the cell below. Does the output match what you expected? Accessing the glacier history Lucky for us, the Glacier object has also been storing a history of how the glacier has changed over the simulation. We can access that data through the history: And we can quickly visualise the history of the glacier with the .plot_history() method What is going on in this image? The length of the glacier is a step function in the first year of simulation because, above the equilibrium line altitude (ELA), only accumulation is happening. After that, at first the length of the glacier remains constant. The ice is not very thick, so the portion that reaches below the ELA does not survive the melting that occurs there. But no matter how thick the glacier is, the part above the ELA is always gaining mass. Eventually, there is enough ice to persist below the ELA. We will learn more about ELA in the accumulation and ablation notebook. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume will no longer change, as long as all physical parameters and the climate stay roughly constant. The Glacier object has a method which can progress the glacier to equilibrium .progress_to_equilibrium(). More on this in later notebooks. Can you identify an equilibrium state in the plots above? A first experiment Ok, we have seen the basics. Now, how about a glacier on a different slope? Glaciers are sometimes very steep, like this one in Nepal. Let's adjust the slope in the model to observe a steeper glacier: In the following code, can you identify where we tell the model the new slope we are going to use? What slope did we use for the first experiment? Look for that information at the beginning of the notebook. Comparing glaciers We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. We can get a quick look at the collection by simply calling it: Before we compare the glaciers in the collection, let's make sure to progress them to the same year with the .progress_to_year() method. Now let's compare the glacier we studied first with our new glacier on a different slope. Do you think the new glacier will have more or less ice than the first? Let's make sure we understand what is going on: Explore the characteristics (thickness, length, velocity...). Can you explain the difference between the two glaciers? Click for details Activity Now, try to change the slope to another value, and run the model again. What do you see?
248
281
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection top_elev = 3400 # m, the peak elevation bottom_elev = 1500 # m, the elevation at the bottom of the glacier bed_width = 300 # m, the constant width of the rectangular valley bed_slope = 10 # degrees, the slope of the bed bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=bed_slope) bed.plot() bed ELA = 3000 # equilibrium line altitude in meters above sea level altgrad = 4 # altitude gradient in mm/m mb_model = MassBalance(ELA, gradient=altgrad) mb_model glacier = Glacier(bed=bed, mass_balance=mb_model) glacier glacier.plot_mass_balance() runtime = 1 glacier.progress_to_year(runtime) glacier.plot() glacier runtime = 150 glacier.progress_to_year(150) glacier.plot() glacier runtime = 150 glacier.progress_to_year(runtime) glacier.plot() glacier glacier.progress_to_year(450) glacier glacier.history glacier.plot_history() new_slope = 20 new_bed = GlacierBed(top=top_elev, bottom=bottom_elev, width=bed_width, slopes=new_slope) new_glacier = Glacier(bed=new_bed, mass_balance=mb_model) collection = GlacierCollection() collection.add([glacier, new_glacier]) collection collection.progress_to_year(600) collection.plot_side_by_side(figsize=(10, 5)) collection.plot_history() collection
3
76
16
ice_flow_parameters-0
ice_flow_parameters-0
Influence of ice flow parameters on glacier size Goals of this notebook: The student will be able to create a glacier and change Glen's creep parameter and basal sliding parameter. The student will be able to explain the influences of the two parameters on glacier shape. The motion of glaciers is determined by two main processes: One is internal deformation of ice due to gravity and the other is basal sliding. These processes can be described by parameters. In this notebook we will examine their influence on glaciers. First, we have to import the relevant classes from OGGM Edu Let's create a glacier Glen's creep parameter We start with looking at the internal deformation of the ice, which results in so called creeping. To describe it we use Glens's creep parameter. Our glacier, and OGGM, defaults to set Glen's creep parameter to the "standard value" defined by Cuffey and Paterson, (2010): 2.4 ⋅ 10−24. We can check this by accessing the .creep attribute The parameter relates shear stress to the rate of deformation and is assumed to be constant. It depends on crystal size, fabric, concentration and type of impurities, as well as on ice temperature (Oerlemans, 2001) (you can find a more detailed description of it here). Next we will change the creep parameter and see what happens. An easy way to do this is to create a GlacierCollection and change the creep parameter for some of the glaciers in the collection. Here we will also introduce the .fill() method of the GlacierCollection, which is useful to quickly create a collection with multiple glaciers. We can then change the creep parameter of the glaciers within the collection And progress the glaciers within the collection to year 800: And plot the collection Sliding parameter Basal sliding occurs when there is a water film between the ice and the ground. In his seminal paper, Hans Oerlemans uses a so-called "sliding parameter" representing basal sliding. For our glacier this parameter is available under the .basal_sliding attribute. By default it is set to 0, but it can be modified Change the basal sliding parameter of one of the glaciers in the collection to 5.7 ⋅ 10 − 20 and progress the collection Take a look at the glaciers Initially the glacier with higher basal sliding is advancing down the bed quicker compared to the glacier without basal sliding. However, at a certain point in time the larger volume of Glacier 0 lead to a stronger ice flow, and the glacier can extend further down. If you want to learn more about the processes of glacier flow, we recommend to go through these two pages: Deformation and sliding Stress and strain In the documentation of OGGM you find also information about the theory of the ice flow parameters and the application.
1,436
1,578
from oggm_edu import GlacierBed, MassBalance, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier.creep collection = GlacierCollection() collection.fill(glacier, n=3) collection collection.change_attributes({"creep": ["* 10", "", "/ 10"]}) collection.progress_to_year(800) collection.plot() collection.plot_history() glacier.basal_sliding collection = GlacierCollection() collection.fill(glacier, n=2) collection.change_attributes({'basal_sliding':[0, 5.7e-20]}) collection.progress_to_year(800) collection.plot() collection.plot_history()
252
316
0
ice_flow_parameters-1
ice_flow_parameters-1
Influence of ice flow parameters on glacier size Goals of this notebook: The student will be able to create a glacier and change Glen's creep parameter and basal sliding parameter. The student will be able to explain the influences of the two parameters on glacier shape. The motion of glaciers is determined by two main processes: One is internal deformation of ice due to gravity and the other is basal sliding. These processes can be described by parameters. In this notebook we will examine their influence on glaciers. First, we have to import the relevant classes from OGGM Edu Let's create a glacier Glen's creep parameter We start with looking at the internal deformation of the ice, which results in so called creeping. To describe it we use Glens's creep parameter. Our glacier, and OGGM, defaults to set Glen's creep parameter to the "standard value" defined by Cuffey and Paterson, (2010): 2.4 ⋅ 10−24. We can check this by accessing the .creep attribute The parameter relates shear stress to the rate of deformation and is assumed to be constant. It depends on crystal size, fabric, concentration and type of impurities, as well as on ice temperature (Oerlemans, 2001) (you can find a more detailed description of it here). Next we will change the creep parameter and see what happens. An easy way to do this is to create a GlacierCollection and change the creep parameter for some of the glaciers in the collection. Here we will also introduce the .fill() method of the GlacierCollection, which is useful to quickly create a collection with multiple glaciers. We can then change the creep parameter of the glaciers within the collection And progress the glaciers within the collection to year 800: And plot the collection Sliding parameter Basal sliding occurs when there is a water film between the ice and the ground. In his seminal paper, Hans Oerlemans uses a so-called "sliding parameter" representing basal sliding. For our glacier this parameter is available under the .basal_sliding attribute. By default it is set to 0, but it can be modified Change the basal sliding parameter of one of the glaciers in the collection to 5.7 ⋅ 10 − 20 and progress the collection Take a look at the glaciers Initially the glacier with higher basal sliding is advancing down the bed quicker compared to the glacier without basal sliding. However, at a certain point in time the larger volume of Glacier 0 lead to a stronger ice flow, and the glacier can extend further down. If you want to learn more about the processes of glacier flow, we recommend to go through these two pages: Deformation and sliding Stress and strain In the documentation of OGGM you find also information about the theory of the ice flow parameters and the application.
1,581
1,657
from oggm_edu import GlacierBed, MassBalance, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier.creep collection = GlacierCollection() collection.fill(glacier, n=3) collection collection.change_attributes({"creep": ["* 10", "", "/ 10"]}) collection.progress_to_year(800) collection.plot() collection.plot_history() glacier.basal_sliding collection = GlacierCollection() collection.fill(glacier, n=2) collection.change_attributes({'basal_sliding':[0, 5.7e-20]}) collection.progress_to_year(800) collection.plot() collection.plot_history()
329
391
1
ice_flow_parameters-2
ice_flow_parameters-2
Influence of ice flow parameters on glacier size Goals of this notebook: The student will be able to create a glacier and change Glen's creep parameter and basal sliding parameter. The student will be able to explain the influences of the two parameters on glacier shape. The motion of glaciers is determined by two main processes: One is internal deformation of ice due to gravity and the other is basal sliding. These processes can be described by parameters. In this notebook we will examine their influence on glaciers. First, we have to import the relevant classes from OGGM Edu Let's create a glacier Glen's creep parameter We start with looking at the internal deformation of the ice, which results in so called creeping. To describe it we use Glens's creep parameter. Our glacier, and OGGM, defaults to set Glen's creep parameter to the "standard value" defined by Cuffey and Paterson, (2010): 2.4 ⋅ 10−24. We can check this by accessing the .creep attribute The parameter relates shear stress to the rate of deformation and is assumed to be constant. It depends on crystal size, fabric, concentration and type of impurities, as well as on ice temperature (Oerlemans, 2001) (you can find a more detailed description of it here). Next we will change the creep parameter and see what happens. An easy way to do this is to create a GlacierCollection and change the creep parameter for some of the glaciers in the collection. Here we will also introduce the .fill() method of the GlacierCollection, which is useful to quickly create a collection with multiple glaciers. We can then change the creep parameter of the glaciers within the collection And progress the glaciers within the collection to year 800: And plot the collection Sliding parameter Basal sliding occurs when there is a water film between the ice and the ground. In his seminal paper, Hans Oerlemans uses a so-called "sliding parameter" representing basal sliding. For our glacier this parameter is available under the .basal_sliding attribute. By default it is set to 0, but it can be modified Change the basal sliding parameter of one of the glaciers in the collection to 5.7 ⋅ 10 − 20 and progress the collection Take a look at the glaciers Initially the glacier with higher basal sliding is advancing down the bed quicker compared to the glacier without basal sliding. However, at a certain point in time the larger volume of Glacier 0 lead to a stronger ice flow, and the glacier can extend further down. If you want to learn more about the processes of glacier flow, we recommend to go through these two pages: Deformation and sliding Stress and strain In the documentation of OGGM you find also information about the theory of the ice flow parameters and the application.
1,725
1,744
from oggm_edu import GlacierBed, MassBalance, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier.creep collection = GlacierCollection() collection.fill(glacier, n=3) collection collection.change_attributes({"creep": ["* 10", "", "/ 10"]}) collection.progress_to_year(800) collection.plot() collection.plot_history() glacier.basal_sliding collection = GlacierCollection() collection.fill(glacier, n=2) collection.change_attributes({'basal_sliding':[0, 5.7e-20]}) collection.progress_to_year(800) collection.plot() collection.plot_history()
428
446
2
ice_flow_parameters-3
ice_flow_parameters-3
Influence of ice flow parameters on glacier size Goals of this notebook: The student will be able to create a glacier and change Glen's creep parameter and basal sliding parameter. The student will be able to explain the influences of the two parameters on glacier shape. The motion of glaciers is determined by two main processes: One is internal deformation of ice due to gravity and the other is basal sliding. These processes can be described by parameters. In this notebook we will examine their influence on glaciers. First, we have to import the relevant classes from OGGM Edu Let's create a glacier Glen's creep parameter We start with looking at the internal deformation of the ice, which results in so called creeping. To describe it we use Glens's creep parameter. Our glacier, and OGGM, defaults to set Glen's creep parameter to the "standard value" defined by Cuffey and Paterson, (2010): 2.4 ⋅ 10−24. We can check this by accessing the .creep attribute The parameter relates shear stress to the rate of deformation and is assumed to be constant. It depends on crystal size, fabric, concentration and type of impurities, as well as on ice temperature (Oerlemans, 2001) (you can find a more detailed description of it here). Next we will change the creep parameter and see what happens. An easy way to do this is to create a GlacierCollection and change the creep parameter for some of the glaciers in the collection. Here we will also introduce the .fill() method of the GlacierCollection, which is useful to quickly create a collection with multiple glaciers. We can then change the creep parameter of the glaciers within the collection And progress the glaciers within the collection to year 800: And plot the collection Sliding parameter Basal sliding occurs when there is a water film between the ice and the ground. In his seminal paper, Hans Oerlemans uses a so-called "sliding parameter" representing basal sliding. For our glacier this parameter is available under the .basal_sliding attribute. By default it is set to 0, but it can be modified Change the basal sliding parameter of one of the glaciers in the collection to 5.7 ⋅ 10 − 20 and progress the collection Take a look at the glaciers Initially the glacier with higher basal sliding is advancing down the bed quicker compared to the glacier without basal sliding. However, at a certain point in time the larger volume of Glacier 0 lead to a stronger ice flow, and the glacier can extend further down. If you want to learn more about the processes of glacier flow, we recommend to go through these two pages: Deformation and sliding Stress and strain In the documentation of OGGM you find also information about the theory of the ice flow parameters and the application.
587
609
from oggm_edu import GlacierBed, MassBalance, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier.creep collection = GlacierCollection() collection.fill(glacier, n=3) collection collection.change_attributes({"creep": ["* 10", "", "/ 10"]}) collection.progress_to_year(800) collection.plot() collection.plot_history() glacier.basal_sliding collection = GlacierCollection() collection.fill(glacier, n=2) collection.change_attributes({'basal_sliding':[0, 5.7e-20]}) collection.progress_to_year(800) collection.plot() collection.plot_history()
79
233
3
ice_flow_parameters-4
ice_flow_parameters-4
Influence of ice flow parameters on glacier size Goals of this notebook: The student will be able to create a glacier and change Glen's creep parameter and basal sliding parameter. The student will be able to explain the influences of the two parameters on glacier shape. The motion of glaciers is determined by two main processes: One is internal deformation of ice due to gravity and the other is basal sliding. These processes can be described by parameters. In this notebook we will examine their influence on glaciers. First, we have to import the relevant classes from OGGM Edu Let's create a glacier Glen's creep parameter We start with looking at the internal deformation of the ice, which results in so called creeping. To describe it we use Glens's creep parameter. Our glacier, and OGGM, defaults to set Glen's creep parameter to the "standard value" defined by Cuffey and Paterson, (2010): 2.4 ⋅ 10−24. We can check this by accessing the .creep attribute The parameter relates shear stress to the rate of deformation and is assumed to be constant. It depends on crystal size, fabric, concentration and type of impurities, as well as on ice temperature (Oerlemans, 2001) (you can find a more detailed description of it here). Next we will change the creep parameter and see what happens. An easy way to do this is to create a GlacierCollection and change the creep parameter for some of the glaciers in the collection. Here we will also introduce the .fill() method of the GlacierCollection, which is useful to quickly create a collection with multiple glaciers. We can then change the creep parameter of the glaciers within the collection And progress the glaciers within the collection to year 800: And plot the collection Sliding parameter Basal sliding occurs when there is a water film between the ice and the ground. In his seminal paper, Hans Oerlemans uses a so-called "sliding parameter" representing basal sliding. For our glacier this parameter is available under the .basal_sliding attribute. By default it is set to 0, but it can be modified Change the basal sliding parameter of one of the glaciers in the collection to 5.7 ⋅ 10 − 20 and progress the collection Take a look at the glaciers Initially the glacier with higher basal sliding is advancing down the bed quicker compared to the glacier without basal sliding. However, at a certain point in time the larger volume of Glacier 0 lead to a stronger ice flow, and the glacier can extend further down. If you want to learn more about the processes of glacier flow, we recommend to go through these two pages: Deformation and sliding Stress and strain In the documentation of OGGM you find also information about the theory of the ice flow parameters and the application.
2,077
2,197
from oggm_edu import GlacierBed, MassBalance, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier.creep collection = GlacierCollection() collection.fill(glacier, n=3) collection collection.change_attributes({"creep": ["* 10", "", "/ 10"]}) collection.progress_to_year(800) collection.plot() collection.plot_history() glacier.basal_sliding collection = GlacierCollection() collection.fill(glacier, n=2) collection.change_attributes({'basal_sliding':[0, 5.7e-20]}) collection.progress_to_year(800) collection.plot() collection.plot_history()
564
659
4
ice_flow_parameters-5
ice_flow_parameters-5
Influence of ice flow parameters on glacier size Goals of this notebook: The student will be able to create a glacier and change Glen's creep parameter and basal sliding parameter. The student will be able to explain the influences of the two parameters on glacier shape. The motion of glaciers is determined by two main processes: One is internal deformation of ice due to gravity and the other is basal sliding. These processes can be described by parameters. In this notebook we will examine their influence on glaciers. First, we have to import the relevant classes from OGGM Edu Let's create a glacier Glen's creep parameter We start with looking at the internal deformation of the ice, which results in so called creeping. To describe it we use Glens's creep parameter. Our glacier, and OGGM, defaults to set Glen's creep parameter to the "standard value" defined by Cuffey and Paterson, (2010): 2.4 ⋅ 10−24. We can check this by accessing the .creep attribute The parameter relates shear stress to the rate of deformation and is assumed to be constant. It depends on crystal size, fabric, concentration and type of impurities, as well as on ice temperature (Oerlemans, 2001) (you can find a more detailed description of it here). Next we will change the creep parameter and see what happens. An easy way to do this is to create a GlacierCollection and change the creep parameter for some of the glaciers in the collection. Here we will also introduce the .fill() method of the GlacierCollection, which is useful to quickly create a collection with multiple glaciers. We can then change the creep parameter of the glaciers within the collection And progress the glaciers within the collection to year 800: And plot the collection Sliding parameter Basal sliding occurs when there is a water film between the ice and the ground. In his seminal paper, Hans Oerlemans uses a so-called "sliding parameter" representing basal sliding. For our glacier this parameter is available under the .basal_sliding attribute. By default it is set to 0, but it can be modified Change the basal sliding parameter of one of the glaciers in the collection to 5.7 ⋅ 10 − 20 and progress the collection Take a look at the glaciers Initially the glacier with higher basal sliding is advancing down the bed quicker compared to the glacier without basal sliding. However, at a certain point in time the larger volume of Glacier 0 lead to a stronger ice flow, and the glacier can extend further down. If you want to learn more about the processes of glacier flow, we recommend to go through these two pages: Deformation and sliding Stress and strain In the documentation of OGGM you find also information about the theory of the ice flow parameters and the application.
919
970
from oggm_edu import GlacierBed, MassBalance, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier.creep collection = GlacierCollection() collection.fill(glacier, n=3) collection collection.change_attributes({"creep": ["* 10", "", "/ 10"]}) collection.progress_to_year(800) collection.plot() collection.plot_history() glacier.basal_sliding collection = GlacierCollection() collection.fill(glacier, n=2) collection.change_attributes({'basal_sliding':[0, 5.7e-20]}) collection.progress_to_year(800) collection.plot() collection.plot_history()
236
250
5
ice_flow_parameters-6
ice_flow_parameters-6
Influence of ice flow parameters on glacier size Goals of this notebook: The student will be able to create a glacier and change Glen's creep parameter and basal sliding parameter. The student will be able to explain the influences of the two parameters on glacier shape. The motion of glaciers is determined by two main processes: One is internal deformation of ice due to gravity and the other is basal sliding. These processes can be described by parameters. In this notebook we will examine their influence on glaciers. First, we have to import the relevant classes from OGGM Edu Let's create a glacier Glen's creep parameter We start with looking at the internal deformation of the ice, which results in so called creeping. To describe it we use Glens's creep parameter. Our glacier, and OGGM, defaults to set Glen's creep parameter to the "standard value" defined by Cuffey and Paterson, (2010): 2.4 ⋅ 10−24. We can check this by accessing the .creep attribute The parameter relates shear stress to the rate of deformation and is assumed to be constant. It depends on crystal size, fabric, concentration and type of impurities, as well as on ice temperature (Oerlemans, 2001) (you can find a more detailed description of it here). Next we will change the creep parameter and see what happens. An easy way to do this is to create a GlacierCollection and change the creep parameter for some of the glaciers in the collection. Here we will also introduce the .fill() method of the GlacierCollection, which is useful to quickly create a collection with multiple glaciers. We can then change the creep parameter of the glaciers within the collection And progress the glaciers within the collection to year 800: And plot the collection Sliding parameter Basal sliding occurs when there is a water film between the ice and the ground. In his seminal paper, Hans Oerlemans uses a so-called "sliding parameter" representing basal sliding. For our glacier this parameter is available under the .basal_sliding attribute. By default it is set to 0, but it can be modified Change the basal sliding parameter of one of the glaciers in the collection to 5.7 ⋅ 10 − 20 and progress the collection Take a look at the glaciers Initially the glacier with higher basal sliding is advancing down the bed quicker compared to the glacier without basal sliding. However, at a certain point in time the larger volume of Glacier 0 lead to a stronger ice flow, and the glacier can extend further down. If you want to learn more about the processes of glacier flow, we recommend to go through these two pages: Deformation and sliding Stress and strain In the documentation of OGGM you find also information about the theory of the ice flow parameters and the application.
1,663
1,718
from oggm_edu import GlacierBed, MassBalance, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier.creep collection = GlacierCollection() collection.fill(glacier, n=3) collection collection.change_attributes({"creep": ["* 10", "", "/ 10"]}) collection.progress_to_year(800) collection.plot() collection.plot_history() glacier.basal_sliding collection = GlacierCollection() collection.fill(glacier, n=2) collection.change_attributes({'basal_sliding':[0, 5.7e-20]}) collection.progress_to_year(800) collection.plot() collection.plot_history()
393
426
6
ice_flow_parameters-7
ice_flow_parameters-7
Influence of ice flow parameters on glacier size Goals of this notebook: The student will be able to create a glacier and change Glen's creep parameter and basal sliding parameter. The student will be able to explain the influences of the two parameters on glacier shape. The motion of glaciers is determined by two main processes: One is internal deformation of ice due to gravity and the other is basal sliding. These processes can be described by parameters. In this notebook we will examine their influence on glaciers. First, we have to import the relevant classes from OGGM Edu Let's create a glacier Glen's creep parameter We start with looking at the internal deformation of the ice, which results in so called creeping. To describe it we use Glens's creep parameter. Our glacier, and OGGM, defaults to set Glen's creep parameter to the "standard value" defined by Cuffey and Paterson, (2010): 2.4 ⋅ 10−24. We can check this by accessing the .creep attribute The parameter relates shear stress to the rate of deformation and is assumed to be constant. It depends on crystal size, fabric, concentration and type of impurities, as well as on ice temperature (Oerlemans, 2001) (you can find a more detailed description of it here). Next we will change the creep parameter and see what happens. An easy way to do this is to create a GlacierCollection and change the creep parameter for some of the glaciers in the collection. Here we will also introduce the .fill() method of the GlacierCollection, which is useful to quickly create a collection with multiple glaciers. We can then change the creep parameter of the glaciers within the collection And progress the glaciers within the collection to year 800: And plot the collection Sliding parameter Basal sliding occurs when there is a water film between the ice and the ground. In his seminal paper, Hans Oerlemans uses a so-called "sliding parameter" representing basal sliding. For our glacier this parameter is available under the .basal_sliding attribute. By default it is set to 0, but it can be modified Change the basal sliding parameter of one of the glaciers in the collection to 5.7 ⋅ 10 − 20 and progress the collection Take a look at the glaciers Initially the glacier with higher basal sliding is advancing down the bed quicker compared to the glacier without basal sliding. However, at a certain point in time the larger volume of Glacier 0 lead to a stronger ice flow, and the glacier can extend further down. If you want to learn more about the processes of glacier flow, we recommend to go through these two pages: Deformation and sliding Stress and strain In the documentation of OGGM you find also information about the theory of the ice flow parameters and the application.
1,946
2,025
from oggm_edu import GlacierBed, MassBalance, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier.creep collection = GlacierCollection() collection.fill(glacier, n=3) collection collection.change_attributes({"creep": ["* 10", "", "/ 10"]}) collection.progress_to_year(800) collection.plot() collection.plot_history() glacier.basal_sliding collection = GlacierCollection() collection.fill(glacier, n=2) collection.change_attributes({'basal_sliding':[0, 5.7e-20]}) collection.progress_to_year(800) collection.plot() collection.plot_history()
476
498
7
ice_flow_parameters-8
ice_flow_parameters-8
Influence of ice flow parameters on glacier size Goals of this notebook: The student will be able to create a glacier and change Glen's creep parameter and basal sliding parameter. The student will be able to explain the influences of the two parameters on glacier shape. The motion of glaciers is determined by two main processes: One is internal deformation of ice due to gravity and the other is basal sliding. These processes can be described by parameters. In this notebook we will examine their influence on glaciers. First, we have to import the relevant classes from OGGM Edu Let's create a glacier Glen's creep parameter We start with looking at the internal deformation of the ice, which results in so called creeping. To describe it we use Glens's creep parameter. Our glacier, and OGGM, defaults to set Glen's creep parameter to the "standard value" defined by Cuffey and Paterson, (2010): 2.4 ⋅ 10−24. We can check this by accessing the .creep attribute The parameter relates shear stress to the rate of deformation and is assumed to be constant. It depends on crystal size, fabric, concentration and type of impurities, as well as on ice temperature (Oerlemans, 2001) (you can find a more detailed description of it here). Next we will change the creep parameter and see what happens. An easy way to do this is to create a GlacierCollection and change the creep parameter for some of the glaciers in the collection. Here we will also introduce the .fill() method of the GlacierCollection, which is useful to quickly create a collection with multiple glaciers. We can then change the creep parameter of the glaciers within the collection And progress the glaciers within the collection to year 800: And plot the collection Sliding parameter Basal sliding occurs when there is a water film between the ice and the ground. In his seminal paper, Hans Oerlemans uses a so-called "sliding parameter" representing basal sliding. For our glacier this parameter is available under the .basal_sliding attribute. By default it is set to 0, but it can be modified Change the basal sliding parameter of one of the glaciers in the collection to 5.7 ⋅ 10 − 20 and progress the collection Take a look at the glaciers Initially the glacier with higher basal sliding is advancing down the bed quicker compared to the glacier without basal sliding. However, at a certain point in time the larger volume of Glacier 0 lead to a stronger ice flow, and the glacier can extend further down. If you want to learn more about the processes of glacier flow, we recommend to go through these two pages: Deformation and sliding Stress and strain In the documentation of OGGM you find also information about the theory of the ice flow parameters and the application.
2,199
2,226
from oggm_edu import GlacierBed, MassBalance, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier.creep collection = GlacierCollection() collection.fill(glacier, n=3) collection collection.change_attributes({"creep": ["* 10", "", "/ 10"]}) collection.progress_to_year(800) collection.plot() collection.plot_history() glacier.basal_sliding collection = GlacierCollection() collection.fill(glacier, n=2) collection.change_attributes({'basal_sliding':[0, 5.7e-20]}) collection.progress_to_year(800) collection.plot() collection.plot_history()
661
679
8
ice_flow_parameters-9
ice_flow_parameters-9
Influence of ice flow parameters on glacier size Goals of this notebook: The student will be able to create a glacier and change Glen's creep parameter and basal sliding parameter. The student will be able to explain the influences of the two parameters on glacier shape. The motion of glaciers is determined by two main processes: One is internal deformation of ice due to gravity and the other is basal sliding. These processes can be described by parameters. In this notebook we will examine their influence on glaciers. First, we have to import the relevant classes from OGGM Edu Let's create a glacier Glen's creep parameter We start with looking at the internal deformation of the ice, which results in so called creeping. To describe it we use Glens's creep parameter. Our glacier, and OGGM, defaults to set Glen's creep parameter to the "standard value" defined by Cuffey and Paterson, (2010): 2.4 ⋅ 10−24. We can check this by accessing the .creep attribute The parameter relates shear stress to the rate of deformation and is assumed to be constant. It depends on crystal size, fabric, concentration and type of impurities, as well as on ice temperature (Oerlemans, 2001) (you can find a more detailed description of it here). Next we will change the creep parameter and see what happens. An easy way to do this is to create a GlacierCollection and change the creep parameter for some of the glaciers in the collection. Here we will also introduce the .fill() method of the GlacierCollection, which is useful to quickly create a collection with multiple glaciers. We can then change the creep parameter of the glaciers within the collection And progress the glaciers within the collection to year 800: And plot the collection Sliding parameter Basal sliding occurs when there is a water film between the ice and the ground. In his seminal paper, Hans Oerlemans uses a so-called "sliding parameter" representing basal sliding. For our glacier this parameter is available under the .basal_sliding attribute. By default it is set to 0, but it can be modified Change the basal sliding parameter of one of the glaciers in the collection to 5.7 ⋅ 10 − 20 and progress the collection Take a look at the glaciers Initially the glacier with higher basal sliding is advancing down the bed quicker compared to the glacier without basal sliding. However, at a certain point in time the larger volume of Glacier 0 lead to a stronger ice flow, and the glacier can extend further down. If you want to learn more about the processes of glacier flow, we recommend to go through these two pages: Deformation and sliding Stress and strain In the documentation of OGGM you find also information about the theory of the ice flow parameters and the application.
544
585
from oggm_edu import GlacierBed, MassBalance, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier.creep collection = GlacierCollection() collection.fill(glacier, n=3) collection collection.change_attributes({"creep": ["* 10", "", "/ 10"]}) collection.progress_to_year(800) collection.plot() collection.plot_history() glacier.basal_sliding collection = GlacierCollection() collection.fill(glacier, n=2) collection.change_attributes({'basal_sliding':[0, 5.7e-20]}) collection.progress_to_year(800) collection.plot() collection.plot_history()
4
77
9
temperature_index_model-0
temperature_index_model-0
Temperature index models Goals of this notebook: Gain a basic understanding of temperature index models Implement OGGM's temperature index model for a glacier of interest This version of the notebook works for OGGM versions before 1.6. We will keep this notebook here for a while longer (e.g.: for classroom.oggm.org), and we will replace it with an updated notebook at a later stage. If you are running OGGM 1.6, you should ignore this notebook. Some settings: Background Glacier melt significantly influences catchment hydrology. Hence, it is useful to have accurate predictions of runoff from glacierized areas. Generally, there are two classes of melt models: energy balance models temperature index models Energy balance models are physical models quantifying melt as the residual of the energy balance equation. These models require measurements of net radiation, wind speed, temperature and surface properties to predict melt. On a glacier, spatially well resolved measurements are demanding and hard to maintain. Hence, a simpler model, the temperature index model, is the most common approach to model glacier melt. Temperature index models assume an empirical relationship between air temperatures and melt rates and are a simplification of the energy balance models. The reasoning is that melt is predominantly influenced by the longwave atmospheric radiation and the sensible heat flux - energy balance components that are highly influenced by air temperature (Hock, 2003). The main reason(s) why temperature index models are commonly used are the wide availability of air temperature measurements and computational efficiency. Model setup The simplest temperature index model relates the amount of ice or snow melt M (mm) to the sum of positive air temperatures T+ (∘C) by a proportionality factor DDF, the degree-day factor, for each n time intervals Δt: n∑i M = DDF n∑i T+Δt Commonly, Δt=1 day is used - hence the name degree-day factor. However, any other time interval Δt, e.g. hourly or monthly, can be used to determine DDF. In practice, the model requires measurements of air temperature and glacier mass balance to estimate DDF - once calculated, DDF can be used to predict melt by only measuring air temperature (Hock, 2003). However, this temperature index model, also called degree-day model, is not able to predict glacier surface mass balance. To model glacier surface mass balance, a more sophisticated temperature index model was developed by Marzeion et al., (2012). The monthly mass balance Bi at elevation z is computed as Bi(z) = Psolidi(z) − μ∗max(Ti(z)−Tmelt,0) − ϵ where PSolidi is the monthly solid precipitation, Ti the monthly average temperature, TMelt the monthly average temperature above which ice melt is assumed and ϵ the residual. ϵ is assumed to be a random error taking account for uncertainties associated with unresolved physical processes. μ∗ is the temperature sensitivity of the glacier and it depends on many parameters, mostly glacier specific (e.g., avalanches, topographical shading, cloudiness, ...). Degrees of freedom Among others, the temperature sensitivity μ∗, the threshold for melt TMelt and the implicit threshold for solid precipitation TSolid are important degrees of freedom of the model - TSolid is the monthly average temperature below which precipitation is assumed to be solid. Generally, TMelt and TSolid can vary both spatially and temporally on a specific glacier. However, commonly the two thresholds TMelt and TSolid are assumed to be constant. TMelt and TSolid significantly influence the predicted mass balance B by determining the months which are taken into account in the calculation. Both TMelt and TSolid can be determined by a physical reasoning: we know that both snow melts and precipitation becomes solid at around 0∘C. Hence, the two thresholds TMelt and TSolid are within a natural range that depends on the climatological conditions at a specific glacier site. In OGGM, TMelt and TSolid are constants and you can access the default values via the cfg module: Similarly, you can use your own TMelt and TSolid if you feel like it: The temperature sensitivity μ∗ is glacier specific and mostly determined using statistical error minimization techniques, e.g. ordinary least squares (OLS). Such statistical techniques are very sensitive to the sample size - a general issue in glaciology is that the sample size of annual mass balance records is poor for many glaciers. However, assume that a 100 year long mass balance record together with temperature and precipitation measurements is available for a specific glacier (this is a best case example and only very few glaciers actually have such long records). OLS will find a statistically significant μ∗ which you can happily use to model mass balance. But what happens if you only use 30 years out of the 100 year record? OLS will find another statistically significant μ∗ that is different from the one determined by the 100 year record - and another statistically significant μ∗ can be found for each reasonable subset of the original 100 year record. This implies that μ∗ is generally a time dependent temperature sensitivity μ∗(t). For this reason, OGGM implements a calibration procedure, introduced by Marzeion et al., (2012), to determine a constant glacier specific μ∗ out of the time dependent μ∗(t) candidates. This calibration is beyond the scope of this notebook and you can read about it in detail here and check out an example implementation in OGGM here. Implementation in OGGM First, we need to define a glacier directory: If you want to look at your model domain, you can plot it using: In OGGM, the calibrated temperature index model for each glacier is accessible via the PastMassBalance class of the massbalance module: In this case, and its calibrated temperature sensitivity μ∗ is Similarly, the residual ϵ is Climate data Per default, the temperature index model is driven by the 0.5∘×0.5∘ gridded global CRU TS climate dataset. These climate data are then downscaled to a higher resolution grid to allow for an elevation-dependent dataset. The climate data at the reference height used to drive the temperature index model and to determine the calibrated μ∗ of the selected glacier can be accessed via the glacier directory: This is the temporary path where OGGM stored its climate data on your machine. You can read the climate data using xarray: The climate dataset has two variables, the monthly total precipitation prcp and the monthly average temperature temp. Let's calculate the mean annual cycle of average temperature and total precipitation, and plot it, to get an intuitive view on the climate conditions at the selected glacier site. Reference mass balance data OGGM uses in-situ mass balance data from the World Glacier Monitoring Service Fluctuations of Glaciers Database (WGMS FoGD). The Fluctuations of Glaciers (FoG) database contains annual mass-balance records for several hundreds of glaciers worldwide. Currently, 254 mass balance time series are available. These data are shipped automatically with OGGM and can be accessed via the glacier directory: Predict mass balance! Now, we are set to calculate glacier mass balance using the temperature index model - we have the model parameters μ∗ and ϵ, the thresholds for melt and solid precipitation TMelt and TSolid and the climate dataset. The last thing we need to define are the heights at which we want to calculate the mass balance. Here, we use glacier flowlines along which the mass balance is computed: We will calculate the specific mass balance in mm w.e. yr−1 for the years where in-situ mass balance data is available: The specific mass balance along the given flowlines is computed by For this calculation we assumed an average ice density of Now, we can compare the actual in-situ mass balance with the modelled mass balance: Does not look too bad, does it? To assess model performance, it is helpful to plot the data in a scatter plot: If the points were aligned along the red line, the model would perfectly predict mass balance. Generally, the model overestimates mass balance in magnitude - the scatter plot shows a steeper slope than the 1 to 1 red line. This is due to specific mass balance beeing dependent not only on the climate but also on the glacier surface area. OGGM computes the specific mass balance as a glacier area-weighted average using a constant glacier geometry fixed at the Randolph Glacier Inventory date, e.g. 2003 for most glaciers in the European Alps. Glacier geometry is itself a function of climate and may change significantly over time. Hence, assuming a constant glacier geometry over a time period of different climatic conditions can result in a systematic model bias: The bias is positive at the beginning of the in-situ measurements and shows a negative trend. When keeping the glacier area constant, a positive (negative) bias means, that the calibrated temperature sensitivity μ∗ of the glacier is too low (high) during time periods of colder (warmer) climates. You can find a simple experiment about the sensitivity of the specific mass balance on climate change and glacier surface area in this blog post. Take home points There are two different types of melt models: the energy balance model and the temperature index model The temperature index model is the computationally efficient simplification of the energy balance model Temperature index models assume an empirical relationship between air temperature and melt rates Temperature index models can be extended to model glacier mass balance by adding solid precipitation as a model parameter The model outcome is significantly influenced by the choice of TMelt and TSolid The temperature sensitivity of a glacier is not constant in time μ∗ = μ∗(t) The specific mass balance is a function of the climate and the glacier surface area References Hock R., (2003). Temperature index melt modelling in mountain areas. Journal of Hydrology, 281, 104-115. https://doi.org/10.1016/S0022-1694(03)00257-9 Marzeion B., Jarosch A. H. & Hofer M. (2012). Past and future sea-level change from the surface mass balance of glaciers. The Cryosphere, 6, 1295-1322. https://doi.org/10.5194/tc-6-1295-2012
8,662
8,788
import matplotlib.pyplot as plt import seaborn as sns sns.set_context('notebook') sns.set_style('ticks') import numpy as np import oggm from oggm import utils, cfg, workflow, graphics cfg.initialize() cfg.PATHS['working_dir'] = utils.gettempdir('ti_model') cfg.PARAMS['border'] = 10 print('T_solid = {}°C'.format(cfg.PARAMS['temp_all_solid'])) print('T_melt = {}°C'.format(cfg.PARAMS['temp_melt'])) gdir = workflow.init_glacier_directories([utils.demo_glacier_id('hef')], from_prepro_level=3)[0] from oggm.core import massbalance mb_cal = massbalance.PastMassBalance(gdir) print('the glacier selected is {},'.format(gdir.name)) print('mu_star = {:2f} mm K^-1 yr^-1.'.format(mb_cal.mu_star)) print('epsilon = {:2f} mm.'.format(mb_cal.bias)) fpath = gdir.get_filepath('climate_historical') print(fpath) import xarray as xr climate = xr.open_dataset(fpath) climate annual_cycle = climate.groupby('time.month').mean(dim='time') import calendar fig, ax = plt.subplots(1, 2, figsize=(16, 9)) ax[0].plot(annual_cycle.month, annual_cycle.temp); ax[1].plot(annual_cycle.month, annual_cycle.prcp); ax[0].set_title('Average temperature / (°C)'); ax[1].set_title('Total precipitation / (mm)'); for a in ax: a.set_xticks(annual_cycle.month.values) a.set_xticklabels([calendar.month_abbr[m] for m in annual_cycle.month.values]) ref_mb = gdir.get_ref_mb_data() ref_mb[['ANNUAL_BALANCE']].plot(title='Annual mass balance: {}'.format(gdir.name), legend=False); fls = gdir.read_pickle('inversion_flowlines') print(ref_mb.index.values) ref_mb['OGGM (calib)'] = mb_cal.get_specific_mb(fls=fls, year=ref_mb.index.values) print('rho_ice = {} kg m^-3.'.format(cfg.PARAMS['ice_density'])) fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], label='Observed') ax.plot(ref_mb['OGGM (calib)'], label='Modelled') ax.set_ylabel('Specific mass balance / (mm w.e. y$^{-1}$)') ax.legend(frameon=False); fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['OGGM (calib)'], 'ok'); ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['ANNUAL_BALANCE'], '-r'); ax.set_xlim(-3000, 2000) ax.set_ylim(-3000, 2000) ax.set_xlabel('Observed'); ax.set_ylabel('OGGM (calib)'); bias = ref_mb['OGGM (calib)'] - ref_mb['ANNUAL_BALANCE'] fig, ax = plt.subplots(1, 1) ax.plot(bias);
2,209
2,266
0
temperature_index_model-1
temperature_index_model-1
Temperature index models Goals of this notebook: Gain a basic understanding of temperature index models Implement OGGM's temperature index model for a glacier of interest This version of the notebook works for OGGM versions before 1.6. We will keep this notebook here for a while longer (e.g.: for classroom.oggm.org), and we will replace it with an updated notebook at a later stage. If you are running OGGM 1.6, you should ignore this notebook. Some settings: Background Glacier melt significantly influences catchment hydrology. Hence, it is useful to have accurate predictions of runoff from glacierized areas. Generally, there are two classes of melt models: energy balance models temperature index models Energy balance models are physical models quantifying melt as the residual of the energy balance equation. These models require measurements of net radiation, wind speed, temperature and surface properties to predict melt. On a glacier, spatially well resolved measurements are demanding and hard to maintain. Hence, a simpler model, the temperature index model, is the most common approach to model glacier melt. Temperature index models assume an empirical relationship between air temperatures and melt rates and are a simplification of the energy balance models. The reasoning is that melt is predominantly influenced by the longwave atmospheric radiation and the sensible heat flux - energy balance components that are highly influenced by air temperature (Hock, 2003). The main reason(s) why temperature index models are commonly used are the wide availability of air temperature measurements and computational efficiency. Model setup The simplest temperature index model relates the amount of ice or snow melt M (mm) to the sum of positive air temperatures T+ (∘C) by a proportionality factor DDF, the degree-day factor, for each n time intervals Δt: n∑i M = DDF n∑i T+Δt Commonly, Δt=1 day is used - hence the name degree-day factor. However, any other time interval Δt, e.g. hourly or monthly, can be used to determine DDF. In practice, the model requires measurements of air temperature and glacier mass balance to estimate DDF - once calculated, DDF can be used to predict melt by only measuring air temperature (Hock, 2003). However, this temperature index model, also called degree-day model, is not able to predict glacier surface mass balance. To model glacier surface mass balance, a more sophisticated temperature index model was developed by Marzeion et al., (2012). The monthly mass balance Bi at elevation z is computed as Bi(z) = Psolidi(z) − μ∗max(Ti(z)−Tmelt,0) − ϵ where PSolidi is the monthly solid precipitation, Ti the monthly average temperature, TMelt the monthly average temperature above which ice melt is assumed and ϵ the residual. ϵ is assumed to be a random error taking account for uncertainties associated with unresolved physical processes. μ∗ is the temperature sensitivity of the glacier and it depends on many parameters, mostly glacier specific (e.g., avalanches, topographical shading, cloudiness, ...). Degrees of freedom Among others, the temperature sensitivity μ∗, the threshold for melt TMelt and the implicit threshold for solid precipitation TSolid are important degrees of freedom of the model - TSolid is the monthly average temperature below which precipitation is assumed to be solid. Generally, TMelt and TSolid can vary both spatially and temporally on a specific glacier. However, commonly the two thresholds TMelt and TSolid are assumed to be constant. TMelt and TSolid significantly influence the predicted mass balance B by determining the months which are taken into account in the calculation. Both TMelt and TSolid can be determined by a physical reasoning: we know that both snow melts and precipitation becomes solid at around 0∘C. Hence, the two thresholds TMelt and TSolid are within a natural range that depends on the climatological conditions at a specific glacier site. In OGGM, TMelt and TSolid are constants and you can access the default values via the cfg module: Similarly, you can use your own TMelt and TSolid if you feel like it: The temperature sensitivity μ∗ is glacier specific and mostly determined using statistical error minimization techniques, e.g. ordinary least squares (OLS). Such statistical techniques are very sensitive to the sample size - a general issue in glaciology is that the sample size of annual mass balance records is poor for many glaciers. However, assume that a 100 year long mass balance record together with temperature and precipitation measurements is available for a specific glacier (this is a best case example and only very few glaciers actually have such long records). OLS will find a statistically significant μ∗ which you can happily use to model mass balance. But what happens if you only use 30 years out of the 100 year record? OLS will find another statistically significant μ∗ that is different from the one determined by the 100 year record - and another statistically significant μ∗ can be found for each reasonable subset of the original 100 year record. This implies that μ∗ is generally a time dependent temperature sensitivity μ∗(t). For this reason, OGGM implements a calibration procedure, introduced by Marzeion et al., (2012), to determine a constant glacier specific μ∗ out of the time dependent μ∗(t) candidates. This calibration is beyond the scope of this notebook and you can read about it in detail here and check out an example implementation in OGGM here. Implementation in OGGM First, we need to define a glacier directory: If you want to look at your model domain, you can plot it using: In OGGM, the calibrated temperature index model for each glacier is accessible via the PastMassBalance class of the massbalance module: In this case, and its calibrated temperature sensitivity μ∗ is Similarly, the residual ϵ is Climate data Per default, the temperature index model is driven by the 0.5∘×0.5∘ gridded global CRU TS climate dataset. These climate data are then downscaled to a higher resolution grid to allow for an elevation-dependent dataset. The climate data at the reference height used to drive the temperature index model and to determine the calibrated μ∗ of the selected glacier can be accessed via the glacier directory: This is the temporary path where OGGM stored its climate data on your machine. You can read the climate data using xarray: The climate dataset has two variables, the monthly total precipitation prcp and the monthly average temperature temp. Let's calculate the mean annual cycle of average temperature and total precipitation, and plot it, to get an intuitive view on the climate conditions at the selected glacier site. Reference mass balance data OGGM uses in-situ mass balance data from the World Glacier Monitoring Service Fluctuations of Glaciers Database (WGMS FoGD). The Fluctuations of Glaciers (FoG) database contains annual mass-balance records for several hundreds of glaciers worldwide. Currently, 254 mass balance time series are available. These data are shipped automatically with OGGM and can be accessed via the glacier directory: Predict mass balance! Now, we are set to calculate glacier mass balance using the temperature index model - we have the model parameters μ∗ and ϵ, the thresholds for melt and solid precipitation TMelt and TSolid and the climate dataset. The last thing we need to define are the heights at which we want to calculate the mass balance. Here, we use glacier flowlines along which the mass balance is computed: We will calculate the specific mass balance in mm w.e. yr−1 for the years where in-situ mass balance data is available: The specific mass balance along the given flowlines is computed by For this calculation we assumed an average ice density of Now, we can compare the actual in-situ mass balance with the modelled mass balance: Does not look too bad, does it? To assess model performance, it is helpful to plot the data in a scatter plot: If the points were aligned along the red line, the model would perfectly predict mass balance. Generally, the model overestimates mass balance in magnitude - the scatter plot shows a steeper slope than the 1 to 1 red line. This is due to specific mass balance beeing dependent not only on the climate but also on the glacier surface area. OGGM computes the specific mass balance as a glacier area-weighted average using a constant glacier geometry fixed at the Randolph Glacier Inventory date, e.g. 2003 for most glaciers in the European Alps. Glacier geometry is itself a function of climate and may change significantly over time. Hence, assuming a constant glacier geometry over a time period of different climatic conditions can result in a systematic model bias: The bias is positive at the beginning of the in-situ measurements and shows a negative trend. When keeping the glacier area constant, a positive (negative) bias means, that the calibrated temperature sensitivity μ∗ of the glacier is too low (high) during time periods of colder (warmer) climates. You can find a simple experiment about the sensitivity of the specific mass balance on climate change and glacier surface area in this blog post. Take home points There are two different types of melt models: the energy balance model and the temperature index model The temperature index model is the computationally efficient simplification of the energy balance model Temperature index models assume an empirical relationship between air temperature and melt rates Temperature index models can be extended to model glacier mass balance by adding solid precipitation as a model parameter The model outcome is significantly influenced by the choice of TMelt and TSolid The temperature sensitivity of a glacier is not constant in time μ∗ = μ∗(t) The specific mass balance is a function of the climate and the glacier surface area References Hock R., (2003). Temperature index melt modelling in mountain areas. Journal of Hydrology, 281, 104-115. https://doi.org/10.1016/S0022-1694(03)00257-9 Marzeion B., Jarosch A. H. & Hofer M. (2012). Past and future sea-level change from the surface mass balance of glaciers. The Cryosphere, 6, 1295-1322. https://doi.org/10.5194/tc-6-1295-2012
5,674
5,799
import matplotlib.pyplot as plt import seaborn as sns sns.set_context('notebook') sns.set_style('ticks') import numpy as np import oggm from oggm import utils, cfg, workflow, graphics cfg.initialize() cfg.PATHS['working_dir'] = utils.gettempdir('ti_model') cfg.PARAMS['border'] = 10 print('T_solid = {}°C'.format(cfg.PARAMS['temp_all_solid'])) print('T_melt = {}°C'.format(cfg.PARAMS['temp_melt'])) gdir = workflow.init_glacier_directories([utils.demo_glacier_id('hef')], from_prepro_level=3)[0] from oggm.core import massbalance mb_cal = massbalance.PastMassBalance(gdir) print('the glacier selected is {},'.format(gdir.name)) print('mu_star = {:2f} mm K^-1 yr^-1.'.format(mb_cal.mu_star)) print('epsilon = {:2f} mm.'.format(mb_cal.bias)) fpath = gdir.get_filepath('climate_historical') print(fpath) import xarray as xr climate = xr.open_dataset(fpath) climate annual_cycle = climate.groupby('time.month').mean(dim='time') import calendar fig, ax = plt.subplots(1, 2, figsize=(16, 9)) ax[0].plot(annual_cycle.month, annual_cycle.temp); ax[1].plot(annual_cycle.month, annual_cycle.prcp); ax[0].set_title('Average temperature / (°C)'); ax[1].set_title('Total precipitation / (mm)'); for a in ax: a.set_xticks(annual_cycle.month.values) a.set_xticklabels([calendar.month_abbr[m] for m in annual_cycle.month.values]) ref_mb = gdir.get_ref_mb_data() ref_mb[['ANNUAL_BALANCE']].plot(title='Annual mass balance: {}'.format(gdir.name), legend=False); fls = gdir.read_pickle('inversion_flowlines') print(ref_mb.index.values) ref_mb['OGGM (calib)'] = mb_cal.get_specific_mb(fls=fls, year=ref_mb.index.values) print('rho_ice = {} kg m^-3.'.format(cfg.PARAMS['ice_density'])) fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], label='Observed') ax.plot(ref_mb['OGGM (calib)'], label='Modelled') ax.set_ylabel('Specific mass balance / (mm w.e. y$^{-1}$)') ax.legend(frameon=False); fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['OGGM (calib)'], 'ok'); ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['ANNUAL_BALANCE'], '-r'); ax.set_xlim(-3000, 2000) ax.set_ylim(-3000, 2000) ax.set_xlabel('Observed'); ax.set_ylabel('OGGM (calib)'); bias = ref_mb['OGGM (calib)'] - ref_mb['ANNUAL_BALANCE'] fig, ax = plt.subplots(1, 1) ax.plot(bias);
541
584
1
temperature_index_model-2
temperature_index_model-2
Temperature index models Goals of this notebook: Gain a basic understanding of temperature index models Implement OGGM's temperature index model for a glacier of interest This version of the notebook works for OGGM versions before 1.6. We will keep this notebook here for a while longer (e.g.: for classroom.oggm.org), and we will replace it with an updated notebook at a later stage. If you are running OGGM 1.6, you should ignore this notebook. Some settings: Background Glacier melt significantly influences catchment hydrology. Hence, it is useful to have accurate predictions of runoff from glacierized areas. Generally, there are two classes of melt models: energy balance models temperature index models Energy balance models are physical models quantifying melt as the residual of the energy balance equation. These models require measurements of net radiation, wind speed, temperature and surface properties to predict melt. On a glacier, spatially well resolved measurements are demanding and hard to maintain. Hence, a simpler model, the temperature index model, is the most common approach to model glacier melt. Temperature index models assume an empirical relationship between air temperatures and melt rates and are a simplification of the energy balance models. The reasoning is that melt is predominantly influenced by the longwave atmospheric radiation and the sensible heat flux - energy balance components that are highly influenced by air temperature (Hock, 2003). The main reason(s) why temperature index models are commonly used are the wide availability of air temperature measurements and computational efficiency. Model setup The simplest temperature index model relates the amount of ice or snow melt M (mm) to the sum of positive air temperatures T+ (∘C) by a proportionality factor DDF, the degree-day factor, for each n time intervals Δt: n∑i M = DDF n∑i T+Δt Commonly, Δt=1 day is used - hence the name degree-day factor. However, any other time interval Δt, e.g. hourly or monthly, can be used to determine DDF. In practice, the model requires measurements of air temperature and glacier mass balance to estimate DDF - once calculated, DDF can be used to predict melt by only measuring air temperature (Hock, 2003). However, this temperature index model, also called degree-day model, is not able to predict glacier surface mass balance. To model glacier surface mass balance, a more sophisticated temperature index model was developed by Marzeion et al., (2012). The monthly mass balance Bi at elevation z is computed as Bi(z) = Psolidi(z) − μ∗max(Ti(z)−Tmelt,0) − ϵ where PSolidi is the monthly solid precipitation, Ti the monthly average temperature, TMelt the monthly average temperature above which ice melt is assumed and ϵ the residual. ϵ is assumed to be a random error taking account for uncertainties associated with unresolved physical processes. μ∗ is the temperature sensitivity of the glacier and it depends on many parameters, mostly glacier specific (e.g., avalanches, topographical shading, cloudiness, ...). Degrees of freedom Among others, the temperature sensitivity μ∗, the threshold for melt TMelt and the implicit threshold for solid precipitation TSolid are important degrees of freedom of the model - TSolid is the monthly average temperature below which precipitation is assumed to be solid. Generally, TMelt and TSolid can vary both spatially and temporally on a specific glacier. However, commonly the two thresholds TMelt and TSolid are assumed to be constant. TMelt and TSolid significantly influence the predicted mass balance B by determining the months which are taken into account in the calculation. Both TMelt and TSolid can be determined by a physical reasoning: we know that both snow melts and precipitation becomes solid at around 0∘C. Hence, the two thresholds TMelt and TSolid are within a natural range that depends on the climatological conditions at a specific glacier site. In OGGM, TMelt and TSolid are constants and you can access the default values via the cfg module: Similarly, you can use your own TMelt and TSolid if you feel like it: The temperature sensitivity μ∗ is glacier specific and mostly determined using statistical error minimization techniques, e.g. ordinary least squares (OLS). Such statistical techniques are very sensitive to the sample size - a general issue in glaciology is that the sample size of annual mass balance records is poor for many glaciers. However, assume that a 100 year long mass balance record together with temperature and precipitation measurements is available for a specific glacier (this is a best case example and only very few glaciers actually have such long records). OLS will find a statistically significant μ∗ which you can happily use to model mass balance. But what happens if you only use 30 years out of the 100 year record? OLS will find another statistically significant μ∗ that is different from the one determined by the 100 year record - and another statistically significant μ∗ can be found for each reasonable subset of the original 100 year record. This implies that μ∗ is generally a time dependent temperature sensitivity μ∗(t). For this reason, OGGM implements a calibration procedure, introduced by Marzeion et al., (2012), to determine a constant glacier specific μ∗ out of the time dependent μ∗(t) candidates. This calibration is beyond the scope of this notebook and you can read about it in detail here and check out an example implementation in OGGM here. Implementation in OGGM First, we need to define a glacier directory: If you want to look at your model domain, you can plot it using: In OGGM, the calibrated temperature index model for each glacier is accessible via the PastMassBalance class of the massbalance module: In this case, and its calibrated temperature sensitivity μ∗ is Similarly, the residual ϵ is Climate data Per default, the temperature index model is driven by the 0.5∘×0.5∘ gridded global CRU TS climate dataset. These climate data are then downscaled to a higher resolution grid to allow for an elevation-dependent dataset. The climate data at the reference height used to drive the temperature index model and to determine the calibrated μ∗ of the selected glacier can be accessed via the glacier directory: This is the temporary path where OGGM stored its climate data on your machine. You can read the climate data using xarray: The climate dataset has two variables, the monthly total precipitation prcp and the monthly average temperature temp. Let's calculate the mean annual cycle of average temperature and total precipitation, and plot it, to get an intuitive view on the climate conditions at the selected glacier site. Reference mass balance data OGGM uses in-situ mass balance data from the World Glacier Monitoring Service Fluctuations of Glaciers Database (WGMS FoGD). The Fluctuations of Glaciers (FoG) database contains annual mass-balance records for several hundreds of glaciers worldwide. Currently, 254 mass balance time series are available. These data are shipped automatically with OGGM and can be accessed via the glacier directory: Predict mass balance! Now, we are set to calculate glacier mass balance using the temperature index model - we have the model parameters μ∗ and ϵ, the thresholds for melt and solid precipitation TMelt and TSolid and the climate dataset. The last thing we need to define are the heights at which we want to calculate the mass balance. Here, we use glacier flowlines along which the mass balance is computed: We will calculate the specific mass balance in mm w.e. yr−1 for the years where in-situ mass balance data is available: The specific mass balance along the given flowlines is computed by For this calculation we assumed an average ice density of Now, we can compare the actual in-situ mass balance with the modelled mass balance: Does not look too bad, does it? To assess model performance, it is helpful to plot the data in a scatter plot: If the points were aligned along the red line, the model would perfectly predict mass balance. Generally, the model overestimates mass balance in magnitude - the scatter plot shows a steeper slope than the 1 to 1 red line. This is due to specific mass balance beeing dependent not only on the climate but also on the glacier surface area. OGGM computes the specific mass balance as a glacier area-weighted average using a constant glacier geometry fixed at the Randolph Glacier Inventory date, e.g. 2003 for most glaciers in the European Alps. Glacier geometry is itself a function of climate and may change significantly over time. Hence, assuming a constant glacier geometry over a time period of different climatic conditions can result in a systematic model bias: The bias is positive at the beginning of the in-situ measurements and shows a negative trend. When keeping the glacier area constant, a positive (negative) bias means, that the calibrated temperature sensitivity μ∗ of the glacier is too low (high) during time periods of colder (warmer) climates. You can find a simple experiment about the sensitivity of the specific mass balance on climate change and glacier surface area in this blog post. Take home points There are two different types of melt models: the energy balance model and the temperature index model The temperature index model is the computationally efficient simplification of the energy balance model Temperature index models assume an empirical relationship between air temperature and melt rates Temperature index models can be extended to model glacier mass balance by adding solid precipitation as a model parameter The model outcome is significantly influenced by the choice of TMelt and TSolid The temperature sensitivity of a glacier is not constant in time μ∗ = μ∗(t) The specific mass balance is a function of the climate and the glacier surface area References Hock R., (2003). Temperature index melt modelling in mountain areas. Journal of Hydrology, 281, 104-115. https://doi.org/10.1016/S0022-1694(03)00257-9 Marzeion B., Jarosch A. H. & Hofer M. (2012). Past and future sea-level change from the surface mass balance of glaciers. The Cryosphere, 6, 1295-1322. https://doi.org/10.5194/tc-6-1295-2012
5,821
5,865
import matplotlib.pyplot as plt import seaborn as sns sns.set_context('notebook') sns.set_style('ticks') import numpy as np import oggm from oggm import utils, cfg, workflow, graphics cfg.initialize() cfg.PATHS['working_dir'] = utils.gettempdir('ti_model') cfg.PARAMS['border'] = 10 print('T_solid = {}°C'.format(cfg.PARAMS['temp_all_solid'])) print('T_melt = {}°C'.format(cfg.PARAMS['temp_melt'])) gdir = workflow.init_glacier_directories([utils.demo_glacier_id('hef')], from_prepro_level=3)[0] from oggm.core import massbalance mb_cal = massbalance.PastMassBalance(gdir) print('the glacier selected is {},'.format(gdir.name)) print('mu_star = {:2f} mm K^-1 yr^-1.'.format(mb_cal.mu_star)) print('epsilon = {:2f} mm.'.format(mb_cal.bias)) fpath = gdir.get_filepath('climate_historical') print(fpath) import xarray as xr climate = xr.open_dataset(fpath) climate annual_cycle = climate.groupby('time.month').mean(dim='time') import calendar fig, ax = plt.subplots(1, 2, figsize=(16, 9)) ax[0].plot(annual_cycle.month, annual_cycle.temp); ax[1].plot(annual_cycle.month, annual_cycle.prcp); ax[0].set_title('Average temperature / (°C)'); ax[1].set_title('Total precipitation / (mm)'); for a in ax: a.set_xticks(annual_cycle.month.values) a.set_xticklabels([calendar.month_abbr[m] for m in annual_cycle.month.values]) ref_mb = gdir.get_ref_mb_data() ref_mb[['ANNUAL_BALANCE']].plot(title='Annual mass balance: {}'.format(gdir.name), legend=False); fls = gdir.read_pickle('inversion_flowlines') print(ref_mb.index.values) ref_mb['OGGM (calib)'] = mb_cal.get_specific_mb(fls=fls, year=ref_mb.index.values) print('rho_ice = {} kg m^-3.'.format(cfg.PARAMS['ice_density'])) fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], label='Observed') ax.plot(ref_mb['OGGM (calib)'], label='Modelled') ax.set_ylabel('Specific mass balance / (mm w.e. y$^{-1}$)') ax.legend(frameon=False); fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['OGGM (calib)'], 'ok'); ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['ANNUAL_BALANCE'], '-r'); ax.set_xlim(-3000, 2000) ax.set_ylim(-3000, 2000) ax.set_xlabel('Observed'); ax.set_ylabel('OGGM (calib)'); bias = ref_mb['OGGM (calib)'] - ref_mb['ANNUAL_BALANCE'] fig, ax = plt.subplots(1, 1) ax.plot(bias);
643
706
2
temperature_index_model-3
temperature_index_model-3
Temperature index models Goals of this notebook: Gain a basic understanding of temperature index models Implement OGGM's temperature index model for a glacier of interest This version of the notebook works for OGGM versions before 1.6. We will keep this notebook here for a while longer (e.g.: for classroom.oggm.org), and we will replace it with an updated notebook at a later stage. If you are running OGGM 1.6, you should ignore this notebook. Some settings: Background Glacier melt significantly influences catchment hydrology. Hence, it is useful to have accurate predictions of runoff from glacierized areas. Generally, there are two classes of melt models: energy balance models temperature index models Energy balance models are physical models quantifying melt as the residual of the energy balance equation. These models require measurements of net radiation, wind speed, temperature and surface properties to predict melt. On a glacier, spatially well resolved measurements are demanding and hard to maintain. Hence, a simpler model, the temperature index model, is the most common approach to model glacier melt. Temperature index models assume an empirical relationship between air temperatures and melt rates and are a simplification of the energy balance models. The reasoning is that melt is predominantly influenced by the longwave atmospheric radiation and the sensible heat flux - energy balance components that are highly influenced by air temperature (Hock, 2003). The main reason(s) why temperature index models are commonly used are the wide availability of air temperature measurements and computational efficiency. Model setup The simplest temperature index model relates the amount of ice or snow melt M (mm) to the sum of positive air temperatures T+ (∘C) by a proportionality factor DDF, the degree-day factor, for each n time intervals Δt: n∑i M = DDF n∑i T+Δt Commonly, Δt=1 day is used - hence the name degree-day factor. However, any other time interval Δt, e.g. hourly or monthly, can be used to determine DDF. In practice, the model requires measurements of air temperature and glacier mass balance to estimate DDF - once calculated, DDF can be used to predict melt by only measuring air temperature (Hock, 2003). However, this temperature index model, also called degree-day model, is not able to predict glacier surface mass balance. To model glacier surface mass balance, a more sophisticated temperature index model was developed by Marzeion et al., (2012). The monthly mass balance Bi at elevation z is computed as Bi(z) = Psolidi(z) − μ∗max(Ti(z)−Tmelt,0) − ϵ where PSolidi is the monthly solid precipitation, Ti the monthly average temperature, TMelt the monthly average temperature above which ice melt is assumed and ϵ the residual. ϵ is assumed to be a random error taking account for uncertainties associated with unresolved physical processes. μ∗ is the temperature sensitivity of the glacier and it depends on many parameters, mostly glacier specific (e.g., avalanches, topographical shading, cloudiness, ...). Degrees of freedom Among others, the temperature sensitivity μ∗, the threshold for melt TMelt and the implicit threshold for solid precipitation TSolid are important degrees of freedom of the model - TSolid is the monthly average temperature below which precipitation is assumed to be solid. Generally, TMelt and TSolid can vary both spatially and temporally on a specific glacier. However, commonly the two thresholds TMelt and TSolid are assumed to be constant. TMelt and TSolid significantly influence the predicted mass balance B by determining the months which are taken into account in the calculation. Both TMelt and TSolid can be determined by a physical reasoning: we know that both snow melts and precipitation becomes solid at around 0∘C. Hence, the two thresholds TMelt and TSolid are within a natural range that depends on the climatological conditions at a specific glacier site. In OGGM, TMelt and TSolid are constants and you can access the default values via the cfg module: Similarly, you can use your own TMelt and TSolid if you feel like it: The temperature sensitivity μ∗ is glacier specific and mostly determined using statistical error minimization techniques, e.g. ordinary least squares (OLS). Such statistical techniques are very sensitive to the sample size - a general issue in glaciology is that the sample size of annual mass balance records is poor for many glaciers. However, assume that a 100 year long mass balance record together with temperature and precipitation measurements is available for a specific glacier (this is a best case example and only very few glaciers actually have such long records). OLS will find a statistically significant μ∗ which you can happily use to model mass balance. But what happens if you only use 30 years out of the 100 year record? OLS will find another statistically significant μ∗ that is different from the one determined by the 100 year record - and another statistically significant μ∗ can be found for each reasonable subset of the original 100 year record. This implies that μ∗ is generally a time dependent temperature sensitivity μ∗(t). For this reason, OGGM implements a calibration procedure, introduced by Marzeion et al., (2012), to determine a constant glacier specific μ∗ out of the time dependent μ∗(t) candidates. This calibration is beyond the scope of this notebook and you can read about it in detail here and check out an example implementation in OGGM here. Implementation in OGGM First, we need to define a glacier directory: If you want to look at your model domain, you can plot it using: In OGGM, the calibrated temperature index model for each glacier is accessible via the PastMassBalance class of the massbalance module: In this case, and its calibrated temperature sensitivity μ∗ is Similarly, the residual ϵ is Climate data Per default, the temperature index model is driven by the 0.5∘×0.5∘ gridded global CRU TS climate dataset. These climate data are then downscaled to a higher resolution grid to allow for an elevation-dependent dataset. The climate data at the reference height used to drive the temperature index model and to determine the calibrated μ∗ of the selected glacier can be accessed via the glacier directory: This is the temporary path where OGGM stored its climate data on your machine. You can read the climate data using xarray: The climate dataset has two variables, the monthly total precipitation prcp and the monthly average temperature temp. Let's calculate the mean annual cycle of average temperature and total precipitation, and plot it, to get an intuitive view on the climate conditions at the selected glacier site. Reference mass balance data OGGM uses in-situ mass balance data from the World Glacier Monitoring Service Fluctuations of Glaciers Database (WGMS FoGD). The Fluctuations of Glaciers (FoG) database contains annual mass-balance records for several hundreds of glaciers worldwide. Currently, 254 mass balance time series are available. These data are shipped automatically with OGGM and can be accessed via the glacier directory: Predict mass balance! Now, we are set to calculate glacier mass balance using the temperature index model - we have the model parameters μ∗ and ϵ, the thresholds for melt and solid precipitation TMelt and TSolid and the climate dataset. The last thing we need to define are the heights at which we want to calculate the mass balance. Here, we use glacier flowlines along which the mass balance is computed: We will calculate the specific mass balance in mm w.e. yr−1 for the years where in-situ mass balance data is available: The specific mass balance along the given flowlines is computed by For this calculation we assumed an average ice density of Now, we can compare the actual in-situ mass balance with the modelled mass balance: Does not look too bad, does it? To assess model performance, it is helpful to plot the data in a scatter plot: If the points were aligned along the red line, the model would perfectly predict mass balance. Generally, the model overestimates mass balance in magnitude - the scatter plot shows a steeper slope than the 1 to 1 red line. This is due to specific mass balance beeing dependent not only on the climate but also on the glacier surface area. OGGM computes the specific mass balance as a glacier area-weighted average using a constant glacier geometry fixed at the Randolph Glacier Inventory date, e.g. 2003 for most glaciers in the European Alps. Glacier geometry is itself a function of climate and may change significantly over time. Hence, assuming a constant glacier geometry over a time period of different climatic conditions can result in a systematic model bias: The bias is positive at the beginning of the in-situ measurements and shows a negative trend. When keeping the glacier area constant, a positive (negative) bias means, that the calibrated temperature sensitivity μ∗ of the glacier is too low (high) during time periods of colder (warmer) climates. You can find a simple experiment about the sensitivity of the specific mass balance on climate change and glacier surface area in this blog post. Take home points There are two different types of melt models: the energy balance model and the temperature index model The temperature index model is the computationally efficient simplification of the energy balance model Temperature index models assume an empirical relationship between air temperature and melt rates Temperature index models can be extended to model glacier mass balance by adding solid precipitation as a model parameter The model outcome is significantly influenced by the choice of TMelt and TSolid The temperature sensitivity of a glacier is not constant in time μ∗ = μ∗(t) The specific mass balance is a function of the climate and the glacier surface area References Hock R., (2003). Temperature index melt modelling in mountain areas. Journal of Hydrology, 281, 104-115. https://doi.org/10.1016/S0022-1694(03)00257-9 Marzeion B., Jarosch A. H. & Hofer M. (2012). Past and future sea-level change from the surface mass balance of glaciers. The Cryosphere, 6, 1295-1322. https://doi.org/10.5194/tc-6-1295-2012
6,129
6,312
import matplotlib.pyplot as plt import seaborn as sns sns.set_context('notebook') sns.set_style('ticks') import numpy as np import oggm from oggm import utils, cfg, workflow, graphics cfg.initialize() cfg.PATHS['working_dir'] = utils.gettempdir('ti_model') cfg.PARAMS['border'] = 10 print('T_solid = {}°C'.format(cfg.PARAMS['temp_all_solid'])) print('T_melt = {}°C'.format(cfg.PARAMS['temp_melt'])) gdir = workflow.init_glacier_directories([utils.demo_glacier_id('hef')], from_prepro_level=3)[0] from oggm.core import massbalance mb_cal = massbalance.PastMassBalance(gdir) print('the glacier selected is {},'.format(gdir.name)) print('mu_star = {:2f} mm K^-1 yr^-1.'.format(mb_cal.mu_star)) print('epsilon = {:2f} mm.'.format(mb_cal.bias)) fpath = gdir.get_filepath('climate_historical') print(fpath) import xarray as xr climate = xr.open_dataset(fpath) climate annual_cycle = climate.groupby('time.month').mean(dim='time') import calendar fig, ax = plt.subplots(1, 2, figsize=(16, 9)) ax[0].plot(annual_cycle.month, annual_cycle.temp); ax[1].plot(annual_cycle.month, annual_cycle.prcp); ax[0].set_title('Average temperature / (°C)'); ax[1].set_title('Total precipitation / (mm)'); for a in ax: a.set_xticks(annual_cycle.month.values) a.set_xticklabels([calendar.month_abbr[m] for m in annual_cycle.month.values]) ref_mb = gdir.get_ref_mb_data() ref_mb[['ANNUAL_BALANCE']].plot(title='Annual mass balance: {}'.format(gdir.name), legend=False); fls = gdir.read_pickle('inversion_flowlines') print(ref_mb.index.values) ref_mb['OGGM (calib)'] = mb_cal.get_specific_mb(fls=fls, year=ref_mb.index.values) print('rho_ice = {} kg m^-3.'.format(cfg.PARAMS['ice_density'])) fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], label='Observed') ax.plot(ref_mb['OGGM (calib)'], label='Modelled') ax.set_ylabel('Specific mass balance / (mm w.e. y$^{-1}$)') ax.legend(frameon=False); fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['OGGM (calib)'], 'ok'); ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['ANNUAL_BALANCE'], '-r'); ax.set_xlim(-3000, 2000) ax.set_ylim(-3000, 2000) ax.set_xlabel('Observed'); ax.set_ylabel('OGGM (calib)'); bias = ref_mb['OGGM (calib)'] - ref_mb['ANNUAL_BALANCE'] fig, ax = plt.subplots(1, 1) ax.plot(bias);
760
808
3
temperature_index_model-4
temperature_index_model-4
Temperature index models Goals of this notebook: Gain a basic understanding of temperature index models Implement OGGM's temperature index model for a glacier of interest This version of the notebook works for OGGM versions before 1.6. We will keep this notebook here for a while longer (e.g.: for classroom.oggm.org), and we will replace it with an updated notebook at a later stage. If you are running OGGM 1.6, you should ignore this notebook. Some settings: Background Glacier melt significantly influences catchment hydrology. Hence, it is useful to have accurate predictions of runoff from glacierized areas. Generally, there are two classes of melt models: energy balance models temperature index models Energy balance models are physical models quantifying melt as the residual of the energy balance equation. These models require measurements of net radiation, wind speed, temperature and surface properties to predict melt. On a glacier, spatially well resolved measurements are demanding and hard to maintain. Hence, a simpler model, the temperature index model, is the most common approach to model glacier melt. Temperature index models assume an empirical relationship between air temperatures and melt rates and are a simplification of the energy balance models. The reasoning is that melt is predominantly influenced by the longwave atmospheric radiation and the sensible heat flux - energy balance components that are highly influenced by air temperature (Hock, 2003). The main reason(s) why temperature index models are commonly used are the wide availability of air temperature measurements and computational efficiency. Model setup The simplest temperature index model relates the amount of ice or snow melt M (mm) to the sum of positive air temperatures T+ (∘C) by a proportionality factor DDF, the degree-day factor, for each n time intervals Δt: n∑i M = DDF n∑i T+Δt Commonly, Δt=1 day is used - hence the name degree-day factor. However, any other time interval Δt, e.g. hourly or monthly, can be used to determine DDF. In practice, the model requires measurements of air temperature and glacier mass balance to estimate DDF - once calculated, DDF can be used to predict melt by only measuring air temperature (Hock, 2003). However, this temperature index model, also called degree-day model, is not able to predict glacier surface mass balance. To model glacier surface mass balance, a more sophisticated temperature index model was developed by Marzeion et al., (2012). The monthly mass balance Bi at elevation z is computed as Bi(z) = Psolidi(z) − μ∗max(Ti(z)−Tmelt,0) − ϵ where PSolidi is the monthly solid precipitation, Ti the monthly average temperature, TMelt the monthly average temperature above which ice melt is assumed and ϵ the residual. ϵ is assumed to be a random error taking account for uncertainties associated with unresolved physical processes. μ∗ is the temperature sensitivity of the glacier and it depends on many parameters, mostly glacier specific (e.g., avalanches, topographical shading, cloudiness, ...). Degrees of freedom Among others, the temperature sensitivity μ∗, the threshold for melt TMelt and the implicit threshold for solid precipitation TSolid are important degrees of freedom of the model - TSolid is the monthly average temperature below which precipitation is assumed to be solid. Generally, TMelt and TSolid can vary both spatially and temporally on a specific glacier. However, commonly the two thresholds TMelt and TSolid are assumed to be constant. TMelt and TSolid significantly influence the predicted mass balance B by determining the months which are taken into account in the calculation. Both TMelt and TSolid can be determined by a physical reasoning: we know that both snow melts and precipitation becomes solid at around 0∘C. Hence, the two thresholds TMelt and TSolid are within a natural range that depends on the climatological conditions at a specific glacier site. In OGGM, TMelt and TSolid are constants and you can access the default values via the cfg module: Similarly, you can use your own TMelt and TSolid if you feel like it: The temperature sensitivity μ∗ is glacier specific and mostly determined using statistical error minimization techniques, e.g. ordinary least squares (OLS). Such statistical techniques are very sensitive to the sample size - a general issue in glaciology is that the sample size of annual mass balance records is poor for many glaciers. However, assume that a 100 year long mass balance record together with temperature and precipitation measurements is available for a specific glacier (this is a best case example and only very few glaciers actually have such long records). OLS will find a statistically significant μ∗ which you can happily use to model mass balance. But what happens if you only use 30 years out of the 100 year record? OLS will find another statistically significant μ∗ that is different from the one determined by the 100 year record - and another statistically significant μ∗ can be found for each reasonable subset of the original 100 year record. This implies that μ∗ is generally a time dependent temperature sensitivity μ∗(t). For this reason, OGGM implements a calibration procedure, introduced by Marzeion et al., (2012), to determine a constant glacier specific μ∗ out of the time dependent μ∗(t) candidates. This calibration is beyond the scope of this notebook and you can read about it in detail here and check out an example implementation in OGGM here. Implementation in OGGM First, we need to define a glacier directory: If you want to look at your model domain, you can plot it using: In OGGM, the calibrated temperature index model for each glacier is accessible via the PastMassBalance class of the massbalance module: In this case, and its calibrated temperature sensitivity μ∗ is Similarly, the residual ϵ is Climate data Per default, the temperature index model is driven by the 0.5∘×0.5∘ gridded global CRU TS climate dataset. These climate data are then downscaled to a higher resolution grid to allow for an elevation-dependent dataset. The climate data at the reference height used to drive the temperature index model and to determine the calibrated μ∗ of the selected glacier can be accessed via the glacier directory: This is the temporary path where OGGM stored its climate data on your machine. You can read the climate data using xarray: The climate dataset has two variables, the monthly total precipitation prcp and the monthly average temperature temp. Let's calculate the mean annual cycle of average temperature and total precipitation, and plot it, to get an intuitive view on the climate conditions at the selected glacier site. Reference mass balance data OGGM uses in-situ mass balance data from the World Glacier Monitoring Service Fluctuations of Glaciers Database (WGMS FoGD). The Fluctuations of Glaciers (FoG) database contains annual mass-balance records for several hundreds of glaciers worldwide. Currently, 254 mass balance time series are available. These data are shipped automatically with OGGM and can be accessed via the glacier directory: Predict mass balance! Now, we are set to calculate glacier mass balance using the temperature index model - we have the model parameters μ∗ and ϵ, the thresholds for melt and solid precipitation TMelt and TSolid and the climate dataset. The last thing we need to define are the heights at which we want to calculate the mass balance. Here, we use glacier flowlines along which the mass balance is computed: We will calculate the specific mass balance in mm w.e. yr−1 for the years where in-situ mass balance data is available: The specific mass balance along the given flowlines is computed by For this calculation we assumed an average ice density of Now, we can compare the actual in-situ mass balance with the modelled mass balance: Does not look too bad, does it? To assess model performance, it is helpful to plot the data in a scatter plot: If the points were aligned along the red line, the model would perfectly predict mass balance. Generally, the model overestimates mass balance in magnitude - the scatter plot shows a steeper slope than the 1 to 1 red line. This is due to specific mass balance beeing dependent not only on the climate but also on the glacier surface area. OGGM computes the specific mass balance as a glacier area-weighted average using a constant glacier geometry fixed at the Randolph Glacier Inventory date, e.g. 2003 for most glaciers in the European Alps. Glacier geometry is itself a function of climate and may change significantly over time. Hence, assuming a constant glacier geometry over a time period of different climatic conditions can result in a systematic model bias: The bias is positive at the beginning of the in-situ measurements and shows a negative trend. When keeping the glacier area constant, a positive (negative) bias means, that the calibrated temperature sensitivity μ∗ of the glacier is too low (high) during time periods of colder (warmer) climates. You can find a simple experiment about the sensitivity of the specific mass balance on climate change and glacier surface area in this blog post. Take home points There are two different types of melt models: the energy balance model and the temperature index model The temperature index model is the computationally efficient simplification of the energy balance model Temperature index models assume an empirical relationship between air temperature and melt rates Temperature index models can be extended to model glacier mass balance by adding solid precipitation as a model parameter The model outcome is significantly influenced by the choice of TMelt and TSolid The temperature sensitivity of a glacier is not constant in time μ∗ = μ∗(t) The specific mass balance is a function of the climate and the glacier surface area References Hock R., (2003). Temperature index melt modelling in mountain areas. Journal of Hydrology, 281, 104-115. https://doi.org/10.1016/S0022-1694(03)00257-9 Marzeion B., Jarosch A. H. & Hofer M. (2012). Past and future sea-level change from the surface mass balance of glaciers. The Cryosphere, 6, 1295-1322. https://doi.org/10.5194/tc-6-1295-2012
7,987
8,018
import matplotlib.pyplot as plt import seaborn as sns sns.set_context('notebook') sns.set_style('ticks') import numpy as np import oggm from oggm import utils, cfg, workflow, graphics cfg.initialize() cfg.PATHS['working_dir'] = utils.gettempdir('ti_model') cfg.PARAMS['border'] = 10 print('T_solid = {}°C'.format(cfg.PARAMS['temp_all_solid'])) print('T_melt = {}°C'.format(cfg.PARAMS['temp_melt'])) gdir = workflow.init_glacier_directories([utils.demo_glacier_id('hef')], from_prepro_level=3)[0] from oggm.core import massbalance mb_cal = massbalance.PastMassBalance(gdir) print('the glacier selected is {},'.format(gdir.name)) print('mu_star = {:2f} mm K^-1 yr^-1.'.format(mb_cal.mu_star)) print('epsilon = {:2f} mm.'.format(mb_cal.bias)) fpath = gdir.get_filepath('climate_historical') print(fpath) import xarray as xr climate = xr.open_dataset(fpath) climate annual_cycle = climate.groupby('time.month').mean(dim='time') import calendar fig, ax = plt.subplots(1, 2, figsize=(16, 9)) ax[0].plot(annual_cycle.month, annual_cycle.temp); ax[1].plot(annual_cycle.month, annual_cycle.prcp); ax[0].set_title('Average temperature / (°C)'); ax[1].set_title('Total precipitation / (mm)'); for a in ax: a.set_xticks(annual_cycle.month.values) a.set_xticklabels([calendar.month_abbr[m] for m in annual_cycle.month.values]) ref_mb = gdir.get_ref_mb_data() ref_mb[['ANNUAL_BALANCE']].plot(title='Annual mass balance: {}'.format(gdir.name), legend=False); fls = gdir.read_pickle('inversion_flowlines') print(ref_mb.index.values) ref_mb['OGGM (calib)'] = mb_cal.get_specific_mb(fls=fls, year=ref_mb.index.values) print('rho_ice = {} kg m^-3.'.format(cfg.PARAMS['ice_density'])) fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], label='Observed') ax.plot(ref_mb['OGGM (calib)'], label='Modelled') ax.set_ylabel('Specific mass balance / (mm w.e. y$^{-1}$)') ax.legend(frameon=False); fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['OGGM (calib)'], 'ok'); ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['ANNUAL_BALANCE'], '-r'); ax.set_xlim(-3000, 2000) ax.set_ylim(-3000, 2000) ax.set_xlabel('Observed'); ax.set_ylabel('OGGM (calib)'); bias = ref_mb['OGGM (calib)'] - ref_mb['ANNUAL_BALANCE'] fig, ax = plt.subplots(1, 1) ax.plot(bias);
1,937
2,206
4
temperature_index_model-5
temperature_index_model-5
Temperature index models Goals of this notebook: Gain a basic understanding of temperature index models Implement OGGM's temperature index model for a glacier of interest This version of the notebook works for OGGM versions before 1.6. We will keep this notebook here for a while longer (e.g.: for classroom.oggm.org), and we will replace it with an updated notebook at a later stage. If you are running OGGM 1.6, you should ignore this notebook. Some settings: Background Glacier melt significantly influences catchment hydrology. Hence, it is useful to have accurate predictions of runoff from glacierized areas. Generally, there are two classes of melt models: energy balance models temperature index models Energy balance models are physical models quantifying melt as the residual of the energy balance equation. These models require measurements of net radiation, wind speed, temperature and surface properties to predict melt. On a glacier, spatially well resolved measurements are demanding and hard to maintain. Hence, a simpler model, the temperature index model, is the most common approach to model glacier melt. Temperature index models assume an empirical relationship between air temperatures and melt rates and are a simplification of the energy balance models. The reasoning is that melt is predominantly influenced by the longwave atmospheric radiation and the sensible heat flux - energy balance components that are highly influenced by air temperature (Hock, 2003). The main reason(s) why temperature index models are commonly used are the wide availability of air temperature measurements and computational efficiency. Model setup The simplest temperature index model relates the amount of ice or snow melt M (mm) to the sum of positive air temperatures T+ (∘C) by a proportionality factor DDF, the degree-day factor, for each n time intervals Δt: n∑i M = DDF n∑i T+Δt Commonly, Δt=1 day is used - hence the name degree-day factor. However, any other time interval Δt, e.g. hourly or monthly, can be used to determine DDF. In practice, the model requires measurements of air temperature and glacier mass balance to estimate DDF - once calculated, DDF can be used to predict melt by only measuring air temperature (Hock, 2003). However, this temperature index model, also called degree-day model, is not able to predict glacier surface mass balance. To model glacier surface mass balance, a more sophisticated temperature index model was developed by Marzeion et al., (2012). The monthly mass balance Bi at elevation z is computed as Bi(z) = Psolidi(z) − μ∗max(Ti(z)−Tmelt,0) − ϵ where PSolidi is the monthly solid precipitation, Ti the monthly average temperature, TMelt the monthly average temperature above which ice melt is assumed and ϵ the residual. ϵ is assumed to be a random error taking account for uncertainties associated with unresolved physical processes. μ∗ is the temperature sensitivity of the glacier and it depends on many parameters, mostly glacier specific (e.g., avalanches, topographical shading, cloudiness, ...). Degrees of freedom Among others, the temperature sensitivity μ∗, the threshold for melt TMelt and the implicit threshold for solid precipitation TSolid are important degrees of freedom of the model - TSolid is the monthly average temperature below which precipitation is assumed to be solid. Generally, TMelt and TSolid can vary both spatially and temporally on a specific glacier. However, commonly the two thresholds TMelt and TSolid are assumed to be constant. TMelt and TSolid significantly influence the predicted mass balance B by determining the months which are taken into account in the calculation. Both TMelt and TSolid can be determined by a physical reasoning: we know that both snow melts and precipitation becomes solid at around 0∘C. Hence, the two thresholds TMelt and TSolid are within a natural range that depends on the climatological conditions at a specific glacier site. In OGGM, TMelt and TSolid are constants and you can access the default values via the cfg module: Similarly, you can use your own TMelt and TSolid if you feel like it: The temperature sensitivity μ∗ is glacier specific and mostly determined using statistical error minimization techniques, e.g. ordinary least squares (OLS). Such statistical techniques are very sensitive to the sample size - a general issue in glaciology is that the sample size of annual mass balance records is poor for many glaciers. However, assume that a 100 year long mass balance record together with temperature and precipitation measurements is available for a specific glacier (this is a best case example and only very few glaciers actually have such long records). OLS will find a statistically significant μ∗ which you can happily use to model mass balance. But what happens if you only use 30 years out of the 100 year record? OLS will find another statistically significant μ∗ that is different from the one determined by the 100 year record - and another statistically significant μ∗ can be found for each reasonable subset of the original 100 year record. This implies that μ∗ is generally a time dependent temperature sensitivity μ∗(t). For this reason, OGGM implements a calibration procedure, introduced by Marzeion et al., (2012), to determine a constant glacier specific μ∗ out of the time dependent μ∗(t) candidates. This calibration is beyond the scope of this notebook and you can read about it in detail here and check out an example implementation in OGGM here. Implementation in OGGM First, we need to define a glacier directory: If you want to look at your model domain, you can plot it using: In OGGM, the calibrated temperature index model for each glacier is accessible via the PastMassBalance class of the massbalance module: In this case, and its calibrated temperature sensitivity μ∗ is Similarly, the residual ϵ is Climate data Per default, the temperature index model is driven by the 0.5∘×0.5∘ gridded global CRU TS climate dataset. These climate data are then downscaled to a higher resolution grid to allow for an elevation-dependent dataset. The climate data at the reference height used to drive the temperature index model and to determine the calibrated μ∗ of the selected glacier can be accessed via the glacier directory: This is the temporary path where OGGM stored its climate data on your machine. You can read the climate data using xarray: The climate dataset has two variables, the monthly total precipitation prcp and the monthly average temperature temp. Let's calculate the mean annual cycle of average temperature and total precipitation, and plot it, to get an intuitive view on the climate conditions at the selected glacier site. Reference mass balance data OGGM uses in-situ mass balance data from the World Glacier Monitoring Service Fluctuations of Glaciers Database (WGMS FoGD). The Fluctuations of Glaciers (FoG) database contains annual mass-balance records for several hundreds of glaciers worldwide. Currently, 254 mass balance time series are available. These data are shipped automatically with OGGM and can be accessed via the glacier directory: Predict mass balance! Now, we are set to calculate glacier mass balance using the temperature index model - we have the model parameters μ∗ and ϵ, the thresholds for melt and solid precipitation TMelt and TSolid and the climate dataset. The last thing we need to define are the heights at which we want to calculate the mass balance. Here, we use glacier flowlines along which the mass balance is computed: We will calculate the specific mass balance in mm w.e. yr−1 for the years where in-situ mass balance data is available: The specific mass balance along the given flowlines is computed by For this calculation we assumed an average ice density of Now, we can compare the actual in-situ mass balance with the modelled mass balance: Does not look too bad, does it? To assess model performance, it is helpful to plot the data in a scatter plot: If the points were aligned along the red line, the model would perfectly predict mass balance. Generally, the model overestimates mass balance in magnitude - the scatter plot shows a steeper slope than the 1 to 1 red line. This is due to specific mass balance beeing dependent not only on the climate but also on the glacier surface area. OGGM computes the specific mass balance as a glacier area-weighted average using a constant glacier geometry fixed at the Randolph Glacier Inventory date, e.g. 2003 for most glaciers in the European Alps. Glacier geometry is itself a function of climate and may change significantly over time. Hence, assuming a constant glacier geometry over a time period of different climatic conditions can result in a systematic model bias: The bias is positive at the beginning of the in-situ measurements and shows a negative trend. When keeping the glacier area constant, a positive (negative) bias means, that the calibrated temperature sensitivity μ∗ of the glacier is too low (high) during time periods of colder (warmer) climates. You can find a simple experiment about the sensitivity of the specific mass balance on climate change and glacier surface area in this blog post. Take home points There are two different types of melt models: the energy balance model and the temperature index model The temperature index model is the computationally efficient simplification of the energy balance model Temperature index models assume an empirical relationship between air temperature and melt rates Temperature index models can be extended to model glacier mass balance by adding solid precipitation as a model parameter The model outcome is significantly influenced by the choice of TMelt and TSolid The temperature sensitivity of a glacier is not constant in time μ∗ = μ∗(t) The specific mass balance is a function of the climate and the glacier surface area References Hock R., (2003). Temperature index melt modelling in mountain areas. Journal of Hydrology, 281, 104-115. https://doi.org/10.1016/S0022-1694(03)00257-9 Marzeion B., Jarosch A. H. & Hofer M. (2012). Past and future sea-level change from the surface mass balance of glaciers. The Cryosphere, 6, 1295-1322. https://doi.org/10.5194/tc-6-1295-2012
3,976
4,063
import matplotlib.pyplot as plt import seaborn as sns sns.set_context('notebook') sns.set_style('ticks') import numpy as np import oggm from oggm import utils, cfg, workflow, graphics cfg.initialize() cfg.PATHS['working_dir'] = utils.gettempdir('ti_model') cfg.PARAMS['border'] = 10 print('T_solid = {}°C'.format(cfg.PARAMS['temp_all_solid'])) print('T_melt = {}°C'.format(cfg.PARAMS['temp_melt'])) gdir = workflow.init_glacier_directories([utils.demo_glacier_id('hef')], from_prepro_level=3)[0] from oggm.core import massbalance mb_cal = massbalance.PastMassBalance(gdir) print('the glacier selected is {},'.format(gdir.name)) print('mu_star = {:2f} mm K^-1 yr^-1.'.format(mb_cal.mu_star)) print('epsilon = {:2f} mm.'.format(mb_cal.bias)) fpath = gdir.get_filepath('climate_historical') print(fpath) import xarray as xr climate = xr.open_dataset(fpath) climate annual_cycle = climate.groupby('time.month').mean(dim='time') import calendar fig, ax = plt.subplots(1, 2, figsize=(16, 9)) ax[0].plot(annual_cycle.month, annual_cycle.temp); ax[1].plot(annual_cycle.month, annual_cycle.prcp); ax[0].set_title('Average temperature / (°C)'); ax[1].set_title('Total precipitation / (mm)'); for a in ax: a.set_xticks(annual_cycle.month.values) a.set_xticklabels([calendar.month_abbr[m] for m in annual_cycle.month.values]) ref_mb = gdir.get_ref_mb_data() ref_mb[['ANNUAL_BALANCE']].plot(title='Annual mass balance: {}'.format(gdir.name), legend=False); fls = gdir.read_pickle('inversion_flowlines') print(ref_mb.index.values) ref_mb['OGGM (calib)'] = mb_cal.get_specific_mb(fls=fls, year=ref_mb.index.values) print('rho_ice = {} kg m^-3.'.format(cfg.PARAMS['ice_density'])) fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], label='Observed') ax.plot(ref_mb['OGGM (calib)'], label='Modelled') ax.set_ylabel('Specific mass balance / (mm w.e. y$^{-1}$)') ax.legend(frameon=False); fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['OGGM (calib)'], 'ok'); ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['ANNUAL_BALANCE'], '-r'); ax.set_xlim(-3000, 2000) ax.set_ylim(-3000, 2000) ax.set_xlabel('Observed'); ax.set_ylabel('OGGM (calib)'); bias = ref_mb['OGGM (calib)'] - ref_mb['ANNUAL_BALANCE'] fig, ax = plt.subplots(1, 1) ax.plot(bias);
291
407
5
temperature_index_model-6
temperature_index_model-6
Temperature index models Goals of this notebook: Gain a basic understanding of temperature index models Implement OGGM's temperature index model for a glacier of interest This version of the notebook works for OGGM versions before 1.6. We will keep this notebook here for a while longer (e.g.: for classroom.oggm.org), and we will replace it with an updated notebook at a later stage. If you are running OGGM 1.6, you should ignore this notebook. Some settings: Background Glacier melt significantly influences catchment hydrology. Hence, it is useful to have accurate predictions of runoff from glacierized areas. Generally, there are two classes of melt models: energy balance models temperature index models Energy balance models are physical models quantifying melt as the residual of the energy balance equation. These models require measurements of net radiation, wind speed, temperature and surface properties to predict melt. On a glacier, spatially well resolved measurements are demanding and hard to maintain. Hence, a simpler model, the temperature index model, is the most common approach to model glacier melt. Temperature index models assume an empirical relationship between air temperatures and melt rates and are a simplification of the energy balance models. The reasoning is that melt is predominantly influenced by the longwave atmospheric radiation and the sensible heat flux - energy balance components that are highly influenced by air temperature (Hock, 2003). The main reason(s) why temperature index models are commonly used are the wide availability of air temperature measurements and computational efficiency. Model setup The simplest temperature index model relates the amount of ice or snow melt M (mm) to the sum of positive air temperatures T+ (∘C) by a proportionality factor DDF, the degree-day factor, for each n time intervals Δt: n∑i M = DDF n∑i T+Δt Commonly, Δt=1 day is used - hence the name degree-day factor. However, any other time interval Δt, e.g. hourly or monthly, can be used to determine DDF. In practice, the model requires measurements of air temperature and glacier mass balance to estimate DDF - once calculated, DDF can be used to predict melt by only measuring air temperature (Hock, 2003). However, this temperature index model, also called degree-day model, is not able to predict glacier surface mass balance. To model glacier surface mass balance, a more sophisticated temperature index model was developed by Marzeion et al., (2012). The monthly mass balance Bi at elevation z is computed as Bi(z) = Psolidi(z) − μ∗max(Ti(z)−Tmelt,0) − ϵ where PSolidi is the monthly solid precipitation, Ti the monthly average temperature, TMelt the monthly average temperature above which ice melt is assumed and ϵ the residual. ϵ is assumed to be a random error taking account for uncertainties associated with unresolved physical processes. μ∗ is the temperature sensitivity of the glacier and it depends on many parameters, mostly glacier specific (e.g., avalanches, topographical shading, cloudiness, ...). Degrees of freedom Among others, the temperature sensitivity μ∗, the threshold for melt TMelt and the implicit threshold for solid precipitation TSolid are important degrees of freedom of the model - TSolid is the monthly average temperature below which precipitation is assumed to be solid. Generally, TMelt and TSolid can vary both spatially and temporally on a specific glacier. However, commonly the two thresholds TMelt and TSolid are assumed to be constant. TMelt and TSolid significantly influence the predicted mass balance B by determining the months which are taken into account in the calculation. Both TMelt and TSolid can be determined by a physical reasoning: we know that both snow melts and precipitation becomes solid at around 0∘C. Hence, the two thresholds TMelt and TSolid are within a natural range that depends on the climatological conditions at a specific glacier site. In OGGM, TMelt and TSolid are constants and you can access the default values via the cfg module: Similarly, you can use your own TMelt and TSolid if you feel like it: The temperature sensitivity μ∗ is glacier specific and mostly determined using statistical error minimization techniques, e.g. ordinary least squares (OLS). Such statistical techniques are very sensitive to the sample size - a general issue in glaciology is that the sample size of annual mass balance records is poor for many glaciers. However, assume that a 100 year long mass balance record together with temperature and precipitation measurements is available for a specific glacier (this is a best case example and only very few glaciers actually have such long records). OLS will find a statistically significant μ∗ which you can happily use to model mass balance. But what happens if you only use 30 years out of the 100 year record? OLS will find another statistically significant μ∗ that is different from the one determined by the 100 year record - and another statistically significant μ∗ can be found for each reasonable subset of the original 100 year record. This implies that μ∗ is generally a time dependent temperature sensitivity μ∗(t). For this reason, OGGM implements a calibration procedure, introduced by Marzeion et al., (2012), to determine a constant glacier specific μ∗ out of the time dependent μ∗(t) candidates. This calibration is beyond the scope of this notebook and you can read about it in detail here and check out an example implementation in OGGM here. Implementation in OGGM First, we need to define a glacier directory: If you want to look at your model domain, you can plot it using: In OGGM, the calibrated temperature index model for each glacier is accessible via the PastMassBalance class of the massbalance module: In this case, and its calibrated temperature sensitivity μ∗ is Similarly, the residual ϵ is Climate data Per default, the temperature index model is driven by the 0.5∘×0.5∘ gridded global CRU TS climate dataset. These climate data are then downscaled to a higher resolution grid to allow for an elevation-dependent dataset. The climate data at the reference height used to drive the temperature index model and to determine the calibrated μ∗ of the selected glacier can be accessed via the glacier directory: This is the temporary path where OGGM stored its climate data on your machine. You can read the climate data using xarray: The climate dataset has two variables, the monthly total precipitation prcp and the monthly average temperature temp. Let's calculate the mean annual cycle of average temperature and total precipitation, and plot it, to get an intuitive view on the climate conditions at the selected glacier site. Reference mass balance data OGGM uses in-situ mass balance data from the World Glacier Monitoring Service Fluctuations of Glaciers Database (WGMS FoGD). The Fluctuations of Glaciers (FoG) database contains annual mass-balance records for several hundreds of glaciers worldwide. Currently, 254 mass balance time series are available. These data are shipped automatically with OGGM and can be accessed via the glacier directory: Predict mass balance! Now, we are set to calculate glacier mass balance using the temperature index model - we have the model parameters μ∗ and ϵ, the thresholds for melt and solid precipitation TMelt and TSolid and the climate dataset. The last thing we need to define are the heights at which we want to calculate the mass balance. Here, we use glacier flowlines along which the mass balance is computed: We will calculate the specific mass balance in mm w.e. yr−1 for the years where in-situ mass balance data is available: The specific mass balance along the given flowlines is computed by For this calculation we assumed an average ice density of Now, we can compare the actual in-situ mass balance with the modelled mass balance: Does not look too bad, does it? To assess model performance, it is helpful to plot the data in a scatter plot: If the points were aligned along the red line, the model would perfectly predict mass balance. Generally, the model overestimates mass balance in magnitude - the scatter plot shows a steeper slope than the 1 to 1 red line. This is due to specific mass balance beeing dependent not only on the climate but also on the glacier surface area. OGGM computes the specific mass balance as a glacier area-weighted average using a constant glacier geometry fixed at the Randolph Glacier Inventory date, e.g. 2003 for most glaciers in the European Alps. Glacier geometry is itself a function of climate and may change significantly over time. Hence, assuming a constant glacier geometry over a time period of different climatic conditions can result in a systematic model bias: The bias is positive at the beginning of the in-situ measurements and shows a negative trend. When keeping the glacier area constant, a positive (negative) bias means, that the calibrated temperature sensitivity μ∗ of the glacier is too low (high) during time periods of colder (warmer) climates. You can find a simple experiment about the sensitivity of the specific mass balance on climate change and glacier surface area in this blog post. Take home points There are two different types of melt models: the energy balance model and the temperature index model The temperature index model is the computationally efficient simplification of the energy balance model Temperature index models assume an empirical relationship between air temperature and melt rates Temperature index models can be extended to model glacier mass balance by adding solid precipitation as a model parameter The model outcome is significantly influenced by the choice of TMelt and TSolid The temperature sensitivity of a glacier is not constant in time μ∗ = μ∗(t) The specific mass balance is a function of the climate and the glacier surface area References Hock R., (2003). Temperature index melt modelling in mountain areas. Journal of Hydrology, 281, 104-115. https://doi.org/10.1016/S0022-1694(03)00257-9 Marzeion B., Jarosch A. H. & Hofer M. (2012). Past and future sea-level change from the surface mass balance of glaciers. The Cryosphere, 6, 1295-1322. https://doi.org/10.5194/tc-6-1295-2012
6,563
6,641
import matplotlib.pyplot as plt import seaborn as sns sns.set_context('notebook') sns.set_style('ticks') import numpy as np import oggm from oggm import utils, cfg, workflow, graphics cfg.initialize() cfg.PATHS['working_dir'] = utils.gettempdir('ti_model') cfg.PARAMS['border'] = 10 print('T_solid = {}°C'.format(cfg.PARAMS['temp_all_solid'])) print('T_melt = {}°C'.format(cfg.PARAMS['temp_melt'])) gdir = workflow.init_glacier_directories([utils.demo_glacier_id('hef')], from_prepro_level=3)[0] from oggm.core import massbalance mb_cal = massbalance.PastMassBalance(gdir) print('the glacier selected is {},'.format(gdir.name)) print('mu_star = {:2f} mm K^-1 yr^-1.'.format(mb_cal.mu_star)) print('epsilon = {:2f} mm.'.format(mb_cal.bias)) fpath = gdir.get_filepath('climate_historical') print(fpath) import xarray as xr climate = xr.open_dataset(fpath) climate annual_cycle = climate.groupby('time.month').mean(dim='time') import calendar fig, ax = plt.subplots(1, 2, figsize=(16, 9)) ax[0].plot(annual_cycle.month, annual_cycle.temp); ax[1].plot(annual_cycle.month, annual_cycle.prcp); ax[0].set_title('Average temperature / (°C)'); ax[1].set_title('Total precipitation / (mm)'); for a in ax: a.set_xticks(annual_cycle.month.values) a.set_xticklabels([calendar.month_abbr[m] for m in annual_cycle.month.values]) ref_mb = gdir.get_ref_mb_data() ref_mb[['ANNUAL_BALANCE']].plot(title='Annual mass balance: {}'.format(gdir.name), legend=False); fls = gdir.read_pickle('inversion_flowlines') print(ref_mb.index.values) ref_mb['OGGM (calib)'] = mb_cal.get_specific_mb(fls=fls, year=ref_mb.index.values) print('rho_ice = {} kg m^-3.'.format(cfg.PARAMS['ice_density'])) fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], label='Observed') ax.plot(ref_mb['OGGM (calib)'], label='Modelled') ax.set_ylabel('Specific mass balance / (mm w.e. y$^{-1}$)') ax.legend(frameon=False); fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['OGGM (calib)'], 'ok'); ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['ANNUAL_BALANCE'], '-r'); ax.set_xlim(-3000, 2000) ax.set_ylim(-3000, 2000) ax.set_xlabel('Observed'); ax.set_ylabel('OGGM (calib)'); bias = ref_mb['OGGM (calib)'] - ref_mb['ANNUAL_BALANCE'] fig, ax = plt.subplots(1, 1) ax.plot(bias);
888
950
6
temperature_index_model-7
temperature_index_model-7
Temperature index models Goals of this notebook: Gain a basic understanding of temperature index models Implement OGGM's temperature index model for a glacier of interest This version of the notebook works for OGGM versions before 1.6. We will keep this notebook here for a while longer (e.g.: for classroom.oggm.org), and we will replace it with an updated notebook at a later stage. If you are running OGGM 1.6, you should ignore this notebook. Some settings: Background Glacier melt significantly influences catchment hydrology. Hence, it is useful to have accurate predictions of runoff from glacierized areas. Generally, there are two classes of melt models: energy balance models temperature index models Energy balance models are physical models quantifying melt as the residual of the energy balance equation. These models require measurements of net radiation, wind speed, temperature and surface properties to predict melt. On a glacier, spatially well resolved measurements are demanding and hard to maintain. Hence, a simpler model, the temperature index model, is the most common approach to model glacier melt. Temperature index models assume an empirical relationship between air temperatures and melt rates and are a simplification of the energy balance models. The reasoning is that melt is predominantly influenced by the longwave atmospheric radiation and the sensible heat flux - energy balance components that are highly influenced by air temperature (Hock, 2003). The main reason(s) why temperature index models are commonly used are the wide availability of air temperature measurements and computational efficiency. Model setup The simplest temperature index model relates the amount of ice or snow melt M (mm) to the sum of positive air temperatures T+ (∘C) by a proportionality factor DDF, the degree-day factor, for each n time intervals Δt: n∑i M = DDF n∑i T+Δt Commonly, Δt=1 day is used - hence the name degree-day factor. However, any other time interval Δt, e.g. hourly or monthly, can be used to determine DDF. In practice, the model requires measurements of air temperature and glacier mass balance to estimate DDF - once calculated, DDF can be used to predict melt by only measuring air temperature (Hock, 2003). However, this temperature index model, also called degree-day model, is not able to predict glacier surface mass balance. To model glacier surface mass balance, a more sophisticated temperature index model was developed by Marzeion et al., (2012). The monthly mass balance Bi at elevation z is computed as Bi(z) = Psolidi(z) − μ∗max(Ti(z)−Tmelt,0) − ϵ where PSolidi is the monthly solid precipitation, Ti the monthly average temperature, TMelt the monthly average temperature above which ice melt is assumed and ϵ the residual. ϵ is assumed to be a random error taking account for uncertainties associated with unresolved physical processes. μ∗ is the temperature sensitivity of the glacier and it depends on many parameters, mostly glacier specific (e.g., avalanches, topographical shading, cloudiness, ...). Degrees of freedom Among others, the temperature sensitivity μ∗, the threshold for melt TMelt and the implicit threshold for solid precipitation TSolid are important degrees of freedom of the model - TSolid is the monthly average temperature below which precipitation is assumed to be solid. Generally, TMelt and TSolid can vary both spatially and temporally on a specific glacier. However, commonly the two thresholds TMelt and TSolid are assumed to be constant. TMelt and TSolid significantly influence the predicted mass balance B by determining the months which are taken into account in the calculation. Both TMelt and TSolid can be determined by a physical reasoning: we know that both snow melts and precipitation becomes solid at around 0∘C. Hence, the two thresholds TMelt and TSolid are within a natural range that depends on the climatological conditions at a specific glacier site. In OGGM, TMelt and TSolid are constants and you can access the default values via the cfg module: Similarly, you can use your own TMelt and TSolid if you feel like it: The temperature sensitivity μ∗ is glacier specific and mostly determined using statistical error minimization techniques, e.g. ordinary least squares (OLS). Such statistical techniques are very sensitive to the sample size - a general issue in glaciology is that the sample size of annual mass balance records is poor for many glaciers. However, assume that a 100 year long mass balance record together with temperature and precipitation measurements is available for a specific glacier (this is a best case example and only very few glaciers actually have such long records). OLS will find a statistically significant μ∗ which you can happily use to model mass balance. But what happens if you only use 30 years out of the 100 year record? OLS will find another statistically significant μ∗ that is different from the one determined by the 100 year record - and another statistically significant μ∗ can be found for each reasonable subset of the original 100 year record. This implies that μ∗ is generally a time dependent temperature sensitivity μ∗(t). For this reason, OGGM implements a calibration procedure, introduced by Marzeion et al., (2012), to determine a constant glacier specific μ∗ out of the time dependent μ∗(t) candidates. This calibration is beyond the scope of this notebook and you can read about it in detail here and check out an example implementation in OGGM here. Implementation in OGGM First, we need to define a glacier directory: If you want to look at your model domain, you can plot it using: In OGGM, the calibrated temperature index model for each glacier is accessible via the PastMassBalance class of the massbalance module: In this case, and its calibrated temperature sensitivity μ∗ is Similarly, the residual ϵ is Climate data Per default, the temperature index model is driven by the 0.5∘×0.5∘ gridded global CRU TS climate dataset. These climate data are then downscaled to a higher resolution grid to allow for an elevation-dependent dataset. The climate data at the reference height used to drive the temperature index model and to determine the calibrated μ∗ of the selected glacier can be accessed via the glacier directory: This is the temporary path where OGGM stored its climate data on your machine. You can read the climate data using xarray: The climate dataset has two variables, the monthly total precipitation prcp and the monthly average temperature temp. Let's calculate the mean annual cycle of average temperature and total precipitation, and plot it, to get an intuitive view on the climate conditions at the selected glacier site. Reference mass balance data OGGM uses in-situ mass balance data from the World Glacier Monitoring Service Fluctuations of Glaciers Database (WGMS FoGD). The Fluctuations of Glaciers (FoG) database contains annual mass-balance records for several hundreds of glaciers worldwide. Currently, 254 mass balance time series are available. These data are shipped automatically with OGGM and can be accessed via the glacier directory: Predict mass balance! Now, we are set to calculate glacier mass balance using the temperature index model - we have the model parameters μ∗ and ϵ, the thresholds for melt and solid precipitation TMelt and TSolid and the climate dataset. The last thing we need to define are the heights at which we want to calculate the mass balance. Here, we use glacier flowlines along which the mass balance is computed: We will calculate the specific mass balance in mm w.e. yr−1 for the years where in-situ mass balance data is available: The specific mass balance along the given flowlines is computed by For this calculation we assumed an average ice density of Now, we can compare the actual in-situ mass balance with the modelled mass balance: Does not look too bad, does it? To assess model performance, it is helpful to plot the data in a scatter plot: If the points were aligned along the red line, the model would perfectly predict mass balance. Generally, the model overestimates mass balance in magnitude - the scatter plot shows a steeper slope than the 1 to 1 red line. This is due to specific mass balance beeing dependent not only on the climate but also on the glacier surface area. OGGM computes the specific mass balance as a glacier area-weighted average using a constant glacier geometry fixed at the Randolph Glacier Inventory date, e.g. 2003 for most glaciers in the European Alps. Glacier geometry is itself a function of climate and may change significantly over time. Hence, assuming a constant glacier geometry over a time period of different climatic conditions can result in a systematic model bias: The bias is positive at the beginning of the in-situ measurements and shows a negative trend. When keeping the glacier area constant, a positive (negative) bias means, that the calibrated temperature sensitivity μ∗ of the glacier is too low (high) during time periods of colder (warmer) climates. You can find a simple experiment about the sensitivity of the specific mass balance on climate change and glacier surface area in this blog post. Take home points There are two different types of melt models: the energy balance model and the temperature index model The temperature index model is the computationally efficient simplification of the energy balance model Temperature index models assume an empirical relationship between air temperature and melt rates Temperature index models can be extended to model glacier mass balance by adding solid precipitation as a model parameter The model outcome is significantly influenced by the choice of TMelt and TSolid The temperature sensitivity of a glacier is not constant in time μ∗ = μ∗(t) The specific mass balance is a function of the climate and the glacier surface area References Hock R., (2003). Temperature index melt modelling in mountain areas. Journal of Hydrology, 281, 104-115. https://doi.org/10.1016/S0022-1694(03)00257-9 Marzeion B., Jarosch A. H. & Hofer M. (2012). Past and future sea-level change from the surface mass balance of glaciers. The Cryosphere, 6, 1295-1322. https://doi.org/10.5194/tc-6-1295-2012
5,559
5,596
import matplotlib.pyplot as plt import seaborn as sns sns.set_context('notebook') sns.set_style('ticks') import numpy as np import oggm from oggm import utils, cfg, workflow, graphics cfg.initialize() cfg.PATHS['working_dir'] = utils.gettempdir('ti_model') cfg.PARAMS['border'] = 10 print('T_solid = {}°C'.format(cfg.PARAMS['temp_all_solid'])) print('T_melt = {}°C'.format(cfg.PARAMS['temp_melt'])) gdir = workflow.init_glacier_directories([utils.demo_glacier_id('hef')], from_prepro_level=3)[0] from oggm.core import massbalance mb_cal = massbalance.PastMassBalance(gdir) print('the glacier selected is {},'.format(gdir.name)) print('mu_star = {:2f} mm K^-1 yr^-1.'.format(mb_cal.mu_star)) print('epsilon = {:2f} mm.'.format(mb_cal.bias)) fpath = gdir.get_filepath('climate_historical') print(fpath) import xarray as xr climate = xr.open_dataset(fpath) climate annual_cycle = climate.groupby('time.month').mean(dim='time') import calendar fig, ax = plt.subplots(1, 2, figsize=(16, 9)) ax[0].plot(annual_cycle.month, annual_cycle.temp); ax[1].plot(annual_cycle.month, annual_cycle.prcp); ax[0].set_title('Average temperature / (°C)'); ax[1].set_title('Total precipitation / (mm)'); for a in ax: a.set_xticks(annual_cycle.month.values) a.set_xticklabels([calendar.month_abbr[m] for m in annual_cycle.month.values]) ref_mb = gdir.get_ref_mb_data() ref_mb[['ANNUAL_BALANCE']].plot(title='Annual mass balance: {}'.format(gdir.name), legend=False); fls = gdir.read_pickle('inversion_flowlines') print(ref_mb.index.values) ref_mb['OGGM (calib)'] = mb_cal.get_specific_mb(fls=fls, year=ref_mb.index.values) print('rho_ice = {} kg m^-3.'.format(cfg.PARAMS['ice_density'])) fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], label='Observed') ax.plot(ref_mb['OGGM (calib)'], label='Modelled') ax.set_ylabel('Specific mass balance / (mm w.e. y$^{-1}$)') ax.legend(frameon=False); fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['OGGM (calib)'], 'ok'); ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['ANNUAL_BALANCE'], '-r'); ax.set_xlim(-3000, 2000) ax.set_ylim(-3000, 2000) ax.set_xlabel('Observed'); ax.set_ylabel('OGGM (calib)'); bias = ref_mb['OGGM (calib)'] - ref_mb['ANNUAL_BALANCE'] fig, ax = plt.subplots(1, 1) ax.plot(bias);
408
505
7
temperature_index_model-8
temperature_index_model-8
Temperature index models Goals of this notebook: Gain a basic understanding of temperature index models Implement OGGM's temperature index model for a glacier of interest This version of the notebook works for OGGM versions before 1.6. We will keep this notebook here for a while longer (e.g.: for classroom.oggm.org), and we will replace it with an updated notebook at a later stage. If you are running OGGM 1.6, you should ignore this notebook. Some settings: Background Glacier melt significantly influences catchment hydrology. Hence, it is useful to have accurate predictions of runoff from glacierized areas. Generally, there are two classes of melt models: energy balance models temperature index models Energy balance models are physical models quantifying melt as the residual of the energy balance equation. These models require measurements of net radiation, wind speed, temperature and surface properties to predict melt. On a glacier, spatially well resolved measurements are demanding and hard to maintain. Hence, a simpler model, the temperature index model, is the most common approach to model glacier melt. Temperature index models assume an empirical relationship between air temperatures and melt rates and are a simplification of the energy balance models. The reasoning is that melt is predominantly influenced by the longwave atmospheric radiation and the sensible heat flux - energy balance components that are highly influenced by air temperature (Hock, 2003). The main reason(s) why temperature index models are commonly used are the wide availability of air temperature measurements and computational efficiency. Model setup The simplest temperature index model relates the amount of ice or snow melt M (mm) to the sum of positive air temperatures T+ (∘C) by a proportionality factor DDF, the degree-day factor, for each n time intervals Δt: n∑i M = DDF n∑i T+Δt Commonly, Δt=1 day is used - hence the name degree-day factor. However, any other time interval Δt, e.g. hourly or monthly, can be used to determine DDF. In practice, the model requires measurements of air temperature and glacier mass balance to estimate DDF - once calculated, DDF can be used to predict melt by only measuring air temperature (Hock, 2003). However, this temperature index model, also called degree-day model, is not able to predict glacier surface mass balance. To model glacier surface mass balance, a more sophisticated temperature index model was developed by Marzeion et al., (2012). The monthly mass balance Bi at elevation z is computed as Bi(z) = Psolidi(z) − μ∗max(Ti(z)−Tmelt,0) − ϵ where PSolidi is the monthly solid precipitation, Ti the monthly average temperature, TMelt the monthly average temperature above which ice melt is assumed and ϵ the residual. ϵ is assumed to be a random error taking account for uncertainties associated with unresolved physical processes. μ∗ is the temperature sensitivity of the glacier and it depends on many parameters, mostly glacier specific (e.g., avalanches, topographical shading, cloudiness, ...). Degrees of freedom Among others, the temperature sensitivity μ∗, the threshold for melt TMelt and the implicit threshold for solid precipitation TSolid are important degrees of freedom of the model - TSolid is the monthly average temperature below which precipitation is assumed to be solid. Generally, TMelt and TSolid can vary both spatially and temporally on a specific glacier. However, commonly the two thresholds TMelt and TSolid are assumed to be constant. TMelt and TSolid significantly influence the predicted mass balance B by determining the months which are taken into account in the calculation. Both TMelt and TSolid can be determined by a physical reasoning: we know that both snow melts and precipitation becomes solid at around 0∘C. Hence, the two thresholds TMelt and TSolid are within a natural range that depends on the climatological conditions at a specific glacier site. In OGGM, TMelt and TSolid are constants and you can access the default values via the cfg module: Similarly, you can use your own TMelt and TSolid if you feel like it: The temperature sensitivity μ∗ is glacier specific and mostly determined using statistical error minimization techniques, e.g. ordinary least squares (OLS). Such statistical techniques are very sensitive to the sample size - a general issue in glaciology is that the sample size of annual mass balance records is poor for many glaciers. However, assume that a 100 year long mass balance record together with temperature and precipitation measurements is available for a specific glacier (this is a best case example and only very few glaciers actually have such long records). OLS will find a statistically significant μ∗ which you can happily use to model mass balance. But what happens if you only use 30 years out of the 100 year record? OLS will find another statistically significant μ∗ that is different from the one determined by the 100 year record - and another statistically significant μ∗ can be found for each reasonable subset of the original 100 year record. This implies that μ∗ is generally a time dependent temperature sensitivity μ∗(t). For this reason, OGGM implements a calibration procedure, introduced by Marzeion et al., (2012), to determine a constant glacier specific μ∗ out of the time dependent μ∗(t) candidates. This calibration is beyond the scope of this notebook and you can read about it in detail here and check out an example implementation in OGGM here. Implementation in OGGM First, we need to define a glacier directory: If you want to look at your model domain, you can plot it using: In OGGM, the calibrated temperature index model for each glacier is accessible via the PastMassBalance class of the massbalance module: In this case, and its calibrated temperature sensitivity μ∗ is Similarly, the residual ϵ is Climate data Per default, the temperature index model is driven by the 0.5∘×0.5∘ gridded global CRU TS climate dataset. These climate data are then downscaled to a higher resolution grid to allow for an elevation-dependent dataset. The climate data at the reference height used to drive the temperature index model and to determine the calibrated μ∗ of the selected glacier can be accessed via the glacier directory: This is the temporary path where OGGM stored its climate data on your machine. You can read the climate data using xarray: The climate dataset has two variables, the monthly total precipitation prcp and the monthly average temperature temp. Let's calculate the mean annual cycle of average temperature and total precipitation, and plot it, to get an intuitive view on the climate conditions at the selected glacier site. Reference mass balance data OGGM uses in-situ mass balance data from the World Glacier Monitoring Service Fluctuations of Glaciers Database (WGMS FoGD). The Fluctuations of Glaciers (FoG) database contains annual mass-balance records for several hundreds of glaciers worldwide. Currently, 254 mass balance time series are available. These data are shipped automatically with OGGM and can be accessed via the glacier directory: Predict mass balance! Now, we are set to calculate glacier mass balance using the temperature index model - we have the model parameters μ∗ and ϵ, the thresholds for melt and solid precipitation TMelt and TSolid and the climate dataset. The last thing we need to define are the heights at which we want to calculate the mass balance. Here, we use glacier flowlines along which the mass balance is computed: We will calculate the specific mass balance in mm w.e. yr−1 for the years where in-situ mass balance data is available: The specific mass balance along the given flowlines is computed by For this calculation we assumed an average ice density of Now, we can compare the actual in-situ mass balance with the modelled mass balance: Does not look too bad, does it? To assess model performance, it is helpful to plot the data in a scatter plot: If the points were aligned along the red line, the model would perfectly predict mass balance. Generally, the model overestimates mass balance in magnitude - the scatter plot shows a steeper slope than the 1 to 1 red line. This is due to specific mass balance beeing dependent not only on the climate but also on the glacier surface area. OGGM computes the specific mass balance as a glacier area-weighted average using a constant glacier geometry fixed at the Randolph Glacier Inventory date, e.g. 2003 for most glaciers in the European Alps. Glacier geometry is itself a function of climate and may change significantly over time. Hence, assuming a constant glacier geometry over a time period of different climatic conditions can result in a systematic model bias: The bias is positive at the beginning of the in-situ measurements and shows a negative trend. When keeping the glacier area constant, a positive (negative) bias means, that the calibrated temperature sensitivity μ∗ of the glacier is too low (high) during time periods of colder (warmer) climates. You can find a simple experiment about the sensitivity of the specific mass balance on climate change and glacier surface area in this blog post. Take home points There are two different types of melt models: the energy balance model and the temperature index model The temperature index model is the computationally efficient simplification of the energy balance model Temperature index models assume an empirical relationship between air temperature and melt rates Temperature index models can be extended to model glacier mass balance by adding solid precipitation as a model parameter The model outcome is significantly influenced by the choice of TMelt and TSolid The temperature sensitivity of a glacier is not constant in time μ∗ = μ∗(t) The specific mass balance is a function of the climate and the glacier surface area References Hock R., (2003). Temperature index melt modelling in mountain areas. Journal of Hydrology, 281, 104-115. https://doi.org/10.1016/S0022-1694(03)00257-9 Marzeion B., Jarosch A. H. & Hofer M. (2012). Past and future sea-level change from the surface mass balance of glaciers. The Cryosphere, 6, 1295-1322. https://doi.org/10.5194/tc-6-1295-2012
6,892
7,165
import matplotlib.pyplot as plt import seaborn as sns sns.set_context('notebook') sns.set_style('ticks') import numpy as np import oggm from oggm import utils, cfg, workflow, graphics cfg.initialize() cfg.PATHS['working_dir'] = utils.gettempdir('ti_model') cfg.PARAMS['border'] = 10 print('T_solid = {}°C'.format(cfg.PARAMS['temp_all_solid'])) print('T_melt = {}°C'.format(cfg.PARAMS['temp_melt'])) gdir = workflow.init_glacier_directories([utils.demo_glacier_id('hef')], from_prepro_level=3)[0] from oggm.core import massbalance mb_cal = massbalance.PastMassBalance(gdir) print('the glacier selected is {},'.format(gdir.name)) print('mu_star = {:2f} mm K^-1 yr^-1.'.format(mb_cal.mu_star)) print('epsilon = {:2f} mm.'.format(mb_cal.bias)) fpath = gdir.get_filepath('climate_historical') print(fpath) import xarray as xr climate = xr.open_dataset(fpath) climate annual_cycle = climate.groupby('time.month').mean(dim='time') import calendar fig, ax = plt.subplots(1, 2, figsize=(16, 9)) ax[0].plot(annual_cycle.month, annual_cycle.temp); ax[1].plot(annual_cycle.month, annual_cycle.prcp); ax[0].set_title('Average temperature / (°C)'); ax[1].set_title('Total precipitation / (mm)'); for a in ax: a.set_xticks(annual_cycle.month.values) a.set_xticklabels([calendar.month_abbr[m] for m in annual_cycle.month.values]) ref_mb = gdir.get_ref_mb_data() ref_mb[['ANNUAL_BALANCE']].plot(title='Annual mass balance: {}'.format(gdir.name), legend=False); fls = gdir.read_pickle('inversion_flowlines') print(ref_mb.index.values) ref_mb['OGGM (calib)'] = mb_cal.get_specific_mb(fls=fls, year=ref_mb.index.values) print('rho_ice = {} kg m^-3.'.format(cfg.PARAMS['ice_density'])) fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], label='Observed') ax.plot(ref_mb['OGGM (calib)'], label='Modelled') ax.set_ylabel('Specific mass balance / (mm w.e. y$^{-1}$)') ax.legend(frameon=False); fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['OGGM (calib)'], 'ok'); ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['ANNUAL_BALANCE'], '-r'); ax.set_xlim(-3000, 2000) ax.set_ylim(-3000, 2000) ax.set_xlabel('Observed'); ax.set_ylabel('OGGM (calib)'); bias = ref_mb['OGGM (calib)'] - ref_mb['ANNUAL_BALANCE'] fig, ax = plt.subplots(1, 1) ax.plot(bias);
1,355
1,486
8
temperature_index_model-9
temperature_index_model-9
Temperature index models Goals of this notebook: Gain a basic understanding of temperature index models Implement OGGM's temperature index model for a glacier of interest This version of the notebook works for OGGM versions before 1.6. We will keep this notebook here for a while longer (e.g.: for classroom.oggm.org), and we will replace it with an updated notebook at a later stage. If you are running OGGM 1.6, you should ignore this notebook. Some settings: Background Glacier melt significantly influences catchment hydrology. Hence, it is useful to have accurate predictions of runoff from glacierized areas. Generally, there are two classes of melt models: energy balance models temperature index models Energy balance models are physical models quantifying melt as the residual of the energy balance equation. These models require measurements of net radiation, wind speed, temperature and surface properties to predict melt. On a glacier, spatially well resolved measurements are demanding and hard to maintain. Hence, a simpler model, the temperature index model, is the most common approach to model glacier melt. Temperature index models assume an empirical relationship between air temperatures and melt rates and are a simplification of the energy balance models. The reasoning is that melt is predominantly influenced by the longwave atmospheric radiation and the sensible heat flux - energy balance components that are highly influenced by air temperature (Hock, 2003). The main reason(s) why temperature index models are commonly used are the wide availability of air temperature measurements and computational efficiency. Model setup The simplest temperature index model relates the amount of ice or snow melt M (mm) to the sum of positive air temperatures T+ (∘C) by a proportionality factor DDF, the degree-day factor, for each n time intervals Δt: n∑i M = DDF n∑i T+Δt Commonly, Δt=1 day is used - hence the name degree-day factor. However, any other time interval Δt, e.g. hourly or monthly, can be used to determine DDF. In practice, the model requires measurements of air temperature and glacier mass balance to estimate DDF - once calculated, DDF can be used to predict melt by only measuring air temperature (Hock, 2003). However, this temperature index model, also called degree-day model, is not able to predict glacier surface mass balance. To model glacier surface mass balance, a more sophisticated temperature index model was developed by Marzeion et al., (2012). The monthly mass balance Bi at elevation z is computed as Bi(z) = Psolidi(z) − μ∗max(Ti(z)−Tmelt,0) − ϵ where PSolidi is the monthly solid precipitation, Ti the monthly average temperature, TMelt the monthly average temperature above which ice melt is assumed and ϵ the residual. ϵ is assumed to be a random error taking account for uncertainties associated with unresolved physical processes. μ∗ is the temperature sensitivity of the glacier and it depends on many parameters, mostly glacier specific (e.g., avalanches, topographical shading, cloudiness, ...). Degrees of freedom Among others, the temperature sensitivity μ∗, the threshold for melt TMelt and the implicit threshold for solid precipitation TSolid are important degrees of freedom of the model - TSolid is the monthly average temperature below which precipitation is assumed to be solid. Generally, TMelt and TSolid can vary both spatially and temporally on a specific glacier. However, commonly the two thresholds TMelt and TSolid are assumed to be constant. TMelt and TSolid significantly influence the predicted mass balance B by determining the months which are taken into account in the calculation. Both TMelt and TSolid can be determined by a physical reasoning: we know that both snow melts and precipitation becomes solid at around 0∘C. Hence, the two thresholds TMelt and TSolid are within a natural range that depends on the climatological conditions at a specific glacier site. In OGGM, TMelt and TSolid are constants and you can access the default values via the cfg module: Similarly, you can use your own TMelt and TSolid if you feel like it: The temperature sensitivity μ∗ is glacier specific and mostly determined using statistical error minimization techniques, e.g. ordinary least squares (OLS). Such statistical techniques are very sensitive to the sample size - a general issue in glaciology is that the sample size of annual mass balance records is poor for many glaciers. However, assume that a 100 year long mass balance record together with temperature and precipitation measurements is available for a specific glacier (this is a best case example and only very few glaciers actually have such long records). OLS will find a statistically significant μ∗ which you can happily use to model mass balance. But what happens if you only use 30 years out of the 100 year record? OLS will find another statistically significant μ∗ that is different from the one determined by the 100 year record - and another statistically significant μ∗ can be found for each reasonable subset of the original 100 year record. This implies that μ∗ is generally a time dependent temperature sensitivity μ∗(t). For this reason, OGGM implements a calibration procedure, introduced by Marzeion et al., (2012), to determine a constant glacier specific μ∗ out of the time dependent μ∗(t) candidates. This calibration is beyond the scope of this notebook and you can read about it in detail here and check out an example implementation in OGGM here. Implementation in OGGM First, we need to define a glacier directory: If you want to look at your model domain, you can plot it using: In OGGM, the calibrated temperature index model for each glacier is accessible via the PastMassBalance class of the massbalance module: In this case, and its calibrated temperature sensitivity μ∗ is Similarly, the residual ϵ is Climate data Per default, the temperature index model is driven by the 0.5∘×0.5∘ gridded global CRU TS climate dataset. These climate data are then downscaled to a higher resolution grid to allow for an elevation-dependent dataset. The climate data at the reference height used to drive the temperature index model and to determine the calibrated μ∗ of the selected glacier can be accessed via the glacier directory: This is the temporary path where OGGM stored its climate data on your machine. You can read the climate data using xarray: The climate dataset has two variables, the monthly total precipitation prcp and the monthly average temperature temp. Let's calculate the mean annual cycle of average temperature and total precipitation, and plot it, to get an intuitive view on the climate conditions at the selected glacier site. Reference mass balance data OGGM uses in-situ mass balance data from the World Glacier Monitoring Service Fluctuations of Glaciers Database (WGMS FoGD). The Fluctuations of Glaciers (FoG) database contains annual mass-balance records for several hundreds of glaciers worldwide. Currently, 254 mass balance time series are available. These data are shipped automatically with OGGM and can be accessed via the glacier directory: Predict mass balance! Now, we are set to calculate glacier mass balance using the temperature index model - we have the model parameters μ∗ and ϵ, the thresholds for melt and solid precipitation TMelt and TSolid and the climate dataset. The last thing we need to define are the heights at which we want to calculate the mass balance. Here, we use glacier flowlines along which the mass balance is computed: We will calculate the specific mass balance in mm w.e. yr−1 for the years where in-situ mass balance data is available: The specific mass balance along the given flowlines is computed by For this calculation we assumed an average ice density of Now, we can compare the actual in-situ mass balance with the modelled mass balance: Does not look too bad, does it? To assess model performance, it is helpful to plot the data in a scatter plot: If the points were aligned along the red line, the model would perfectly predict mass balance. Generally, the model overestimates mass balance in magnitude - the scatter plot shows a steeper slope than the 1 to 1 red line. This is due to specific mass balance beeing dependent not only on the climate but also on the glacier surface area. OGGM computes the specific mass balance as a glacier area-weighted average using a constant glacier geometry fixed at the Randolph Glacier Inventory date, e.g. 2003 for most glaciers in the European Alps. Glacier geometry is itself a function of climate and may change significantly over time. Hence, assuming a constant glacier geometry over a time period of different climatic conditions can result in a systematic model bias: The bias is positive at the beginning of the in-situ measurements and shows a negative trend. When keeping the glacier area constant, a positive (negative) bias means, that the calibrated temperature sensitivity μ∗ of the glacier is too low (high) during time periods of colder (warmer) climates. You can find a simple experiment about the sensitivity of the specific mass balance on climate change and glacier surface area in this blog post. Take home points There are two different types of melt models: the energy balance model and the temperature index model The temperature index model is the computationally efficient simplification of the energy balance model Temperature index models assume an empirical relationship between air temperature and melt rates Temperature index models can be extended to model glacier mass balance by adding solid precipitation as a model parameter The model outcome is significantly influenced by the choice of TMelt and TSolid The temperature sensitivity of a glacier is not constant in time μ∗ = μ∗(t) The specific mass balance is a function of the climate and the glacier surface area References Hock R., (2003). Temperature index melt modelling in mountain areas. Journal of Hydrology, 281, 104-115. https://doi.org/10.1016/S0022-1694(03)00257-9 Marzeion B., Jarosch A. H. & Hofer M. (2012). Past and future sea-level change from the surface mass balance of glaciers. The Cryosphere, 6, 1295-1322. https://doi.org/10.5194/tc-6-1295-2012
7,829
7,906
import matplotlib.pyplot as plt import seaborn as sns sns.set_context('notebook') sns.set_style('ticks') import numpy as np import oggm from oggm import utils, cfg, workflow, graphics cfg.initialize() cfg.PATHS['working_dir'] = utils.gettempdir('ti_model') cfg.PARAMS['border'] = 10 print('T_solid = {}°C'.format(cfg.PARAMS['temp_all_solid'])) print('T_melt = {}°C'.format(cfg.PARAMS['temp_melt'])) gdir = workflow.init_glacier_directories([utils.demo_glacier_id('hef')], from_prepro_level=3)[0] from oggm.core import massbalance mb_cal = massbalance.PastMassBalance(gdir) print('the glacier selected is {},'.format(gdir.name)) print('mu_star = {:2f} mm K^-1 yr^-1.'.format(mb_cal.mu_star)) print('epsilon = {:2f} mm.'.format(mb_cal.bias)) fpath = gdir.get_filepath('climate_historical') print(fpath) import xarray as xr climate = xr.open_dataset(fpath) climate annual_cycle = climate.groupby('time.month').mean(dim='time') import calendar fig, ax = plt.subplots(1, 2, figsize=(16, 9)) ax[0].plot(annual_cycle.month, annual_cycle.temp); ax[1].plot(annual_cycle.month, annual_cycle.prcp); ax[0].set_title('Average temperature / (°C)'); ax[1].set_title('Total precipitation / (mm)'); for a in ax: a.set_xticks(annual_cycle.month.values) a.set_xticklabels([calendar.month_abbr[m] for m in annual_cycle.month.values]) ref_mb = gdir.get_ref_mb_data() ref_mb[['ANNUAL_BALANCE']].plot(title='Annual mass balance: {}'.format(gdir.name), legend=False); fls = gdir.read_pickle('inversion_flowlines') print(ref_mb.index.values) ref_mb['OGGM (calib)'] = mb_cal.get_specific_mb(fls=fls, year=ref_mb.index.values) print('rho_ice = {} kg m^-3.'.format(cfg.PARAMS['ice_density'])) fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], label='Observed') ax.plot(ref_mb['OGGM (calib)'], label='Modelled') ax.set_ylabel('Specific mass balance / (mm w.e. y$^{-1}$)') ax.legend(frameon=False); fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['OGGM (calib)'], 'ok'); ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['ANNUAL_BALANCE'], '-r'); ax.set_xlim(-3000, 2000) ax.set_ylim(-3000, 2000) ax.set_xlabel('Observed'); ax.set_ylabel('OGGM (calib)'); bias = ref_mb['OGGM (calib)'] - ref_mb['ANNUAL_BALANCE'] fig, ax = plt.subplots(1, 1) ax.plot(bias);
1,718
1,935
9
temperature_index_model-10
temperature_index_model-10
Temperature index models Goals of this notebook: Gain a basic understanding of temperature index models Implement OGGM's temperature index model for a glacier of interest This version of the notebook works for OGGM versions before 1.6. We will keep this notebook here for a while longer (e.g.: for classroom.oggm.org), and we will replace it with an updated notebook at a later stage. If you are running OGGM 1.6, you should ignore this notebook. Some settings: Background Glacier melt significantly influences catchment hydrology. Hence, it is useful to have accurate predictions of runoff from glacierized areas. Generally, there are two classes of melt models: energy balance models temperature index models Energy balance models are physical models quantifying melt as the residual of the energy balance equation. These models require measurements of net radiation, wind speed, temperature and surface properties to predict melt. On a glacier, spatially well resolved measurements are demanding and hard to maintain. Hence, a simpler model, the temperature index model, is the most common approach to model glacier melt. Temperature index models assume an empirical relationship between air temperatures and melt rates and are a simplification of the energy balance models. The reasoning is that melt is predominantly influenced by the longwave atmospheric radiation and the sensible heat flux - energy balance components that are highly influenced by air temperature (Hock, 2003). The main reason(s) why temperature index models are commonly used are the wide availability of air temperature measurements and computational efficiency. Model setup The simplest temperature index model relates the amount of ice or snow melt M (mm) to the sum of positive air temperatures T+ (∘C) by a proportionality factor DDF, the degree-day factor, for each n time intervals Δt: n∑i M = DDF n∑i T+Δt Commonly, Δt=1 day is used - hence the name degree-day factor. However, any other time interval Δt, e.g. hourly or monthly, can be used to determine DDF. In practice, the model requires measurements of air temperature and glacier mass balance to estimate DDF - once calculated, DDF can be used to predict melt by only measuring air temperature (Hock, 2003). However, this temperature index model, also called degree-day model, is not able to predict glacier surface mass balance. To model glacier surface mass balance, a more sophisticated temperature index model was developed by Marzeion et al., (2012). The monthly mass balance Bi at elevation z is computed as Bi(z) = Psolidi(z) − μ∗max(Ti(z)−Tmelt,0) − ϵ where PSolidi is the monthly solid precipitation, Ti the monthly average temperature, TMelt the monthly average temperature above which ice melt is assumed and ϵ the residual. ϵ is assumed to be a random error taking account for uncertainties associated with unresolved physical processes. μ∗ is the temperature sensitivity of the glacier and it depends on many parameters, mostly glacier specific (e.g., avalanches, topographical shading, cloudiness, ...). Degrees of freedom Among others, the temperature sensitivity μ∗, the threshold for melt TMelt and the implicit threshold for solid precipitation TSolid are important degrees of freedom of the model - TSolid is the monthly average temperature below which precipitation is assumed to be solid. Generally, TMelt and TSolid can vary both spatially and temporally on a specific glacier. However, commonly the two thresholds TMelt and TSolid are assumed to be constant. TMelt and TSolid significantly influence the predicted mass balance B by determining the months which are taken into account in the calculation. Both TMelt and TSolid can be determined by a physical reasoning: we know that both snow melts and precipitation becomes solid at around 0∘C. Hence, the two thresholds TMelt and TSolid are within a natural range that depends on the climatological conditions at a specific glacier site. In OGGM, TMelt and TSolid are constants and you can access the default values via the cfg module: Similarly, you can use your own TMelt and TSolid if you feel like it: The temperature sensitivity μ∗ is glacier specific and mostly determined using statistical error minimization techniques, e.g. ordinary least squares (OLS). Such statistical techniques are very sensitive to the sample size - a general issue in glaciology is that the sample size of annual mass balance records is poor for many glaciers. However, assume that a 100 year long mass balance record together with temperature and precipitation measurements is available for a specific glacier (this is a best case example and only very few glaciers actually have such long records). OLS will find a statistically significant μ∗ which you can happily use to model mass balance. But what happens if you only use 30 years out of the 100 year record? OLS will find another statistically significant μ∗ that is different from the one determined by the 100 year record - and another statistically significant μ∗ can be found for each reasonable subset of the original 100 year record. This implies that μ∗ is generally a time dependent temperature sensitivity μ∗(t). For this reason, OGGM implements a calibration procedure, introduced by Marzeion et al., (2012), to determine a constant glacier specific μ∗ out of the time dependent μ∗(t) candidates. This calibration is beyond the scope of this notebook and you can read about it in detail here and check out an example implementation in OGGM here. Implementation in OGGM First, we need to define a glacier directory: If you want to look at your model domain, you can plot it using: In OGGM, the calibrated temperature index model for each glacier is accessible via the PastMassBalance class of the massbalance module: In this case, and its calibrated temperature sensitivity μ∗ is Similarly, the residual ϵ is Climate data Per default, the temperature index model is driven by the 0.5∘×0.5∘ gridded global CRU TS climate dataset. These climate data are then downscaled to a higher resolution grid to allow for an elevation-dependent dataset. The climate data at the reference height used to drive the temperature index model and to determine the calibrated μ∗ of the selected glacier can be accessed via the glacier directory: This is the temporary path where OGGM stored its climate data on your machine. You can read the climate data using xarray: The climate dataset has two variables, the monthly total precipitation prcp and the monthly average temperature temp. Let's calculate the mean annual cycle of average temperature and total precipitation, and plot it, to get an intuitive view on the climate conditions at the selected glacier site. Reference mass balance data OGGM uses in-situ mass balance data from the World Glacier Monitoring Service Fluctuations of Glaciers Database (WGMS FoGD). The Fluctuations of Glaciers (FoG) database contains annual mass-balance records for several hundreds of glaciers worldwide. Currently, 254 mass balance time series are available. These data are shipped automatically with OGGM and can be accessed via the glacier directory: Predict mass balance! Now, we are set to calculate glacier mass balance using the temperature index model - we have the model parameters μ∗ and ϵ, the thresholds for melt and solid precipitation TMelt and TSolid and the climate dataset. The last thing we need to define are the heights at which we want to calculate the mass balance. Here, we use glacier flowlines along which the mass balance is computed: We will calculate the specific mass balance in mm w.e. yr−1 for the years where in-situ mass balance data is available: The specific mass balance along the given flowlines is computed by For this calculation we assumed an average ice density of Now, we can compare the actual in-situ mass balance with the modelled mass balance: Does not look too bad, does it? To assess model performance, it is helpful to plot the data in a scatter plot: If the points were aligned along the red line, the model would perfectly predict mass balance. Generally, the model overestimates mass balance in magnitude - the scatter plot shows a steeper slope than the 1 to 1 red line. This is due to specific mass balance beeing dependent not only on the climate but also on the glacier surface area. OGGM computes the specific mass balance as a glacier area-weighted average using a constant glacier geometry fixed at the Randolph Glacier Inventory date, e.g. 2003 for most glaciers in the European Alps. Glacier geometry is itself a function of climate and may change significantly over time. Hence, assuming a constant glacier geometry over a time period of different climatic conditions can result in a systematic model bias: The bias is positive at the beginning of the in-situ measurements and shows a negative trend. When keeping the glacier area constant, a positive (negative) bias means, that the calibrated temperature sensitivity μ∗ of the glacier is too low (high) during time periods of colder (warmer) climates. You can find a simple experiment about the sensitivity of the specific mass balance on climate change and glacier surface area in this blog post. Take home points There are two different types of melt models: the energy balance model and the temperature index model The temperature index model is the computationally efficient simplification of the energy balance model Temperature index models assume an empirical relationship between air temperature and melt rates Temperature index models can be extended to model glacier mass balance by adding solid precipitation as a model parameter The model outcome is significantly influenced by the choice of TMelt and TSolid The temperature sensitivity of a glacier is not constant in time μ∗ = μ∗(t) The specific mass balance is a function of the climate and the glacier surface area References Hock R., (2003). Temperature index melt modelling in mountain areas. Journal of Hydrology, 281, 104-115. https://doi.org/10.1016/S0022-1694(03)00257-9 Marzeion B., Jarosch A. H. & Hofer M. (2012). Past and future sea-level change from the surface mass balance of glaciers. The Cryosphere, 6, 1295-1322. https://doi.org/10.5194/tc-6-1295-2012
7,508
7,573
import matplotlib.pyplot as plt import seaborn as sns sns.set_context('notebook') sns.set_style('ticks') import numpy as np import oggm from oggm import utils, cfg, workflow, graphics cfg.initialize() cfg.PATHS['working_dir'] = utils.gettempdir('ti_model') cfg.PARAMS['border'] = 10 print('T_solid = {}°C'.format(cfg.PARAMS['temp_all_solid'])) print('T_melt = {}°C'.format(cfg.PARAMS['temp_melt'])) gdir = workflow.init_glacier_directories([utils.demo_glacier_id('hef')], from_prepro_level=3)[0] from oggm.core import massbalance mb_cal = massbalance.PastMassBalance(gdir) print('the glacier selected is {},'.format(gdir.name)) print('mu_star = {:2f} mm K^-1 yr^-1.'.format(mb_cal.mu_star)) print('epsilon = {:2f} mm.'.format(mb_cal.bias)) fpath = gdir.get_filepath('climate_historical') print(fpath) import xarray as xr climate = xr.open_dataset(fpath) climate annual_cycle = climate.groupby('time.month').mean(dim='time') import calendar fig, ax = plt.subplots(1, 2, figsize=(16, 9)) ax[0].plot(annual_cycle.month, annual_cycle.temp); ax[1].plot(annual_cycle.month, annual_cycle.prcp); ax[0].set_title('Average temperature / (°C)'); ax[1].set_title('Total precipitation / (mm)'); for a in ax: a.set_xticks(annual_cycle.month.values) a.set_xticklabels([calendar.month_abbr[m] for m in annual_cycle.month.values]) ref_mb = gdir.get_ref_mb_data() ref_mb[['ANNUAL_BALANCE']].plot(title='Annual mass balance: {}'.format(gdir.name), legend=False); fls = gdir.read_pickle('inversion_flowlines') print(ref_mb.index.values) ref_mb['OGGM (calib)'] = mb_cal.get_specific_mb(fls=fls, year=ref_mb.index.values) print('rho_ice = {} kg m^-3.'.format(cfg.PARAMS['ice_density'])) fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], label='Observed') ax.plot(ref_mb['OGGM (calib)'], label='Modelled') ax.set_ylabel('Specific mass balance / (mm w.e. y$^{-1}$)') ax.legend(frameon=False); fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['OGGM (calib)'], 'ok'); ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['ANNUAL_BALANCE'], '-r'); ax.set_xlim(-3000, 2000) ax.set_ylim(-3000, 2000) ax.set_xlabel('Observed'); ax.set_ylabel('OGGM (calib)'); bias = ref_mb['OGGM (calib)'] - ref_mb['ANNUAL_BALANCE'] fig, ax = plt.subplots(1, 1) ax.plot(bias);
1,489
1,535
10
temperature_index_model-11
temperature_index_model-11
Temperature index models Goals of this notebook: Gain a basic understanding of temperature index models Implement OGGM's temperature index model for a glacier of interest This version of the notebook works for OGGM versions before 1.6. We will keep this notebook here for a while longer (e.g.: for classroom.oggm.org), and we will replace it with an updated notebook at a later stage. If you are running OGGM 1.6, you should ignore this notebook. Some settings: Background Glacier melt significantly influences catchment hydrology. Hence, it is useful to have accurate predictions of runoff from glacierized areas. Generally, there are two classes of melt models: energy balance models temperature index models Energy balance models are physical models quantifying melt as the residual of the energy balance equation. These models require measurements of net radiation, wind speed, temperature and surface properties to predict melt. On a glacier, spatially well resolved measurements are demanding and hard to maintain. Hence, a simpler model, the temperature index model, is the most common approach to model glacier melt. Temperature index models assume an empirical relationship between air temperatures and melt rates and are a simplification of the energy balance models. The reasoning is that melt is predominantly influenced by the longwave atmospheric radiation and the sensible heat flux - energy balance components that are highly influenced by air temperature (Hock, 2003). The main reason(s) why temperature index models are commonly used are the wide availability of air temperature measurements and computational efficiency. Model setup The simplest temperature index model relates the amount of ice or snow melt M (mm) to the sum of positive air temperatures T+ (∘C) by a proportionality factor DDF, the degree-day factor, for each n time intervals Δt: n∑i M = DDF n∑i T+Δt Commonly, Δt=1 day is used - hence the name degree-day factor. However, any other time interval Δt, e.g. hourly or monthly, can be used to determine DDF. In practice, the model requires measurements of air temperature and glacier mass balance to estimate DDF - once calculated, DDF can be used to predict melt by only measuring air temperature (Hock, 2003). However, this temperature index model, also called degree-day model, is not able to predict glacier surface mass balance. To model glacier surface mass balance, a more sophisticated temperature index model was developed by Marzeion et al., (2012). The monthly mass balance Bi at elevation z is computed as Bi(z) = Psolidi(z) − μ∗max(Ti(z)−Tmelt,0) − ϵ where PSolidi is the monthly solid precipitation, Ti the monthly average temperature, TMelt the monthly average temperature above which ice melt is assumed and ϵ the residual. ϵ is assumed to be a random error taking account for uncertainties associated with unresolved physical processes. μ∗ is the temperature sensitivity of the glacier and it depends on many parameters, mostly glacier specific (e.g., avalanches, topographical shading, cloudiness, ...). Degrees of freedom Among others, the temperature sensitivity μ∗, the threshold for melt TMelt and the implicit threshold for solid precipitation TSolid are important degrees of freedom of the model - TSolid is the monthly average temperature below which precipitation is assumed to be solid. Generally, TMelt and TSolid can vary both spatially and temporally on a specific glacier. However, commonly the two thresholds TMelt and TSolid are assumed to be constant. TMelt and TSolid significantly influence the predicted mass balance B by determining the months which are taken into account in the calculation. Both TMelt and TSolid can be determined by a physical reasoning: we know that both snow melts and precipitation becomes solid at around 0∘C. Hence, the two thresholds TMelt and TSolid are within a natural range that depends on the climatological conditions at a specific glacier site. In OGGM, TMelt and TSolid are constants and you can access the default values via the cfg module: Similarly, you can use your own TMelt and TSolid if you feel like it: The temperature sensitivity μ∗ is glacier specific and mostly determined using statistical error minimization techniques, e.g. ordinary least squares (OLS). Such statistical techniques are very sensitive to the sample size - a general issue in glaciology is that the sample size of annual mass balance records is poor for many glaciers. However, assume that a 100 year long mass balance record together with temperature and precipitation measurements is available for a specific glacier (this is a best case example and only very few glaciers actually have such long records). OLS will find a statistically significant μ∗ which you can happily use to model mass balance. But what happens if you only use 30 years out of the 100 year record? OLS will find another statistically significant μ∗ that is different from the one determined by the 100 year record - and another statistically significant μ∗ can be found for each reasonable subset of the original 100 year record. This implies that μ∗ is generally a time dependent temperature sensitivity μ∗(t). For this reason, OGGM implements a calibration procedure, introduced by Marzeion et al., (2012), to determine a constant glacier specific μ∗ out of the time dependent μ∗(t) candidates. This calibration is beyond the scope of this notebook and you can read about it in detail here and check out an example implementation in OGGM here. Implementation in OGGM First, we need to define a glacier directory: If you want to look at your model domain, you can plot it using: In OGGM, the calibrated temperature index model for each glacier is accessible via the PastMassBalance class of the massbalance module: In this case, and its calibrated temperature sensitivity μ∗ is Similarly, the residual ϵ is Climate data Per default, the temperature index model is driven by the 0.5∘×0.5∘ gridded global CRU TS climate dataset. These climate data are then downscaled to a higher resolution grid to allow for an elevation-dependent dataset. The climate data at the reference height used to drive the temperature index model and to determine the calibrated μ∗ of the selected glacier can be accessed via the glacier directory: This is the temporary path where OGGM stored its climate data on your machine. You can read the climate data using xarray: The climate dataset has two variables, the monthly total precipitation prcp and the monthly average temperature temp. Let's calculate the mean annual cycle of average temperature and total precipitation, and plot it, to get an intuitive view on the climate conditions at the selected glacier site. Reference mass balance data OGGM uses in-situ mass balance data from the World Glacier Monitoring Service Fluctuations of Glaciers Database (WGMS FoGD). The Fluctuations of Glaciers (FoG) database contains annual mass-balance records for several hundreds of glaciers worldwide. Currently, 254 mass balance time series are available. These data are shipped automatically with OGGM and can be accessed via the glacier directory: Predict mass balance! Now, we are set to calculate glacier mass balance using the temperature index model - we have the model parameters μ∗ and ϵ, the thresholds for melt and solid precipitation TMelt and TSolid and the climate dataset. The last thing we need to define are the heights at which we want to calculate the mass balance. Here, we use glacier flowlines along which the mass balance is computed: We will calculate the specific mass balance in mm w.e. yr−1 for the years where in-situ mass balance data is available: The specific mass balance along the given flowlines is computed by For this calculation we assumed an average ice density of Now, we can compare the actual in-situ mass balance with the modelled mass balance: Does not look too bad, does it? To assess model performance, it is helpful to plot the data in a scatter plot: If the points were aligned along the red line, the model would perfectly predict mass balance. Generally, the model overestimates mass balance in magnitude - the scatter plot shows a steeper slope than the 1 to 1 red line. This is due to specific mass balance beeing dependent not only on the climate but also on the glacier surface area. OGGM computes the specific mass balance as a glacier area-weighted average using a constant glacier geometry fixed at the Randolph Glacier Inventory date, e.g. 2003 for most glaciers in the European Alps. Glacier geometry is itself a function of climate and may change significantly over time. Hence, assuming a constant glacier geometry over a time period of different climatic conditions can result in a systematic model bias: The bias is positive at the beginning of the in-situ measurements and shows a negative trend. When keeping the glacier area constant, a positive (negative) bias means, that the calibrated temperature sensitivity μ∗ of the glacier is too low (high) during time periods of colder (warmer) climates. You can find a simple experiment about the sensitivity of the specific mass balance on climate change and glacier surface area in this blog post. Take home points There are two different types of melt models: the energy balance model and the temperature index model The temperature index model is the computationally efficient simplification of the energy balance model Temperature index models assume an empirical relationship between air temperature and melt rates Temperature index models can be extended to model glacier mass balance by adding solid precipitation as a model parameter The model outcome is significantly influenced by the choice of TMelt and TSolid The temperature sensitivity of a glacier is not constant in time μ∗ = μ∗(t) The specific mass balance is a function of the climate and the glacier surface area References Hock R., (2003). Temperature index melt modelling in mountain areas. Journal of Hydrology, 281, 104-115. https://doi.org/10.1016/S0022-1694(03)00257-9 Marzeion B., Jarosch A. H. & Hofer M. (2012). Past and future sea-level change from the surface mass balance of glaciers. The Cryosphere, 6, 1295-1322. https://doi.org/10.5194/tc-6-1295-2012
5,878
5,895
import matplotlib.pyplot as plt import seaborn as sns sns.set_context('notebook') sns.set_style('ticks') import numpy as np import oggm from oggm import utils, cfg, workflow, graphics cfg.initialize() cfg.PATHS['working_dir'] = utils.gettempdir('ti_model') cfg.PARAMS['border'] = 10 print('T_solid = {}°C'.format(cfg.PARAMS['temp_all_solid'])) print('T_melt = {}°C'.format(cfg.PARAMS['temp_melt'])) gdir = workflow.init_glacier_directories([utils.demo_glacier_id('hef')], from_prepro_level=3)[0] from oggm.core import massbalance mb_cal = massbalance.PastMassBalance(gdir) print('the glacier selected is {},'.format(gdir.name)) print('mu_star = {:2f} mm K^-1 yr^-1.'.format(mb_cal.mu_star)) print('epsilon = {:2f} mm.'.format(mb_cal.bias)) fpath = gdir.get_filepath('climate_historical') print(fpath) import xarray as xr climate = xr.open_dataset(fpath) climate annual_cycle = climate.groupby('time.month').mean(dim='time') import calendar fig, ax = plt.subplots(1, 2, figsize=(16, 9)) ax[0].plot(annual_cycle.month, annual_cycle.temp); ax[1].plot(annual_cycle.month, annual_cycle.prcp); ax[0].set_title('Average temperature / (°C)'); ax[1].set_title('Total precipitation / (mm)'); for a in ax: a.set_xticks(annual_cycle.month.values) a.set_xticklabels([calendar.month_abbr[m] for m in annual_cycle.month.values]) ref_mb = gdir.get_ref_mb_data() ref_mb[['ANNUAL_BALANCE']].plot(title='Annual mass balance: {}'.format(gdir.name), legend=False); fls = gdir.read_pickle('inversion_flowlines') print(ref_mb.index.values) ref_mb['OGGM (calib)'] = mb_cal.get_specific_mb(fls=fls, year=ref_mb.index.values) print('rho_ice = {} kg m^-3.'.format(cfg.PARAMS['ice_density'])) fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], label='Observed') ax.plot(ref_mb['OGGM (calib)'], label='Modelled') ax.set_ylabel('Specific mass balance / (mm w.e. y$^{-1}$)') ax.legend(frameon=False); fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['OGGM (calib)'], 'ok'); ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['ANNUAL_BALANCE'], '-r'); ax.set_xlim(-3000, 2000) ax.set_ylim(-3000, 2000) ax.set_xlabel('Observed'); ax.set_ylabel('OGGM (calib)'); bias = ref_mb['OGGM (calib)'] - ref_mb['ANNUAL_BALANCE'] fig, ax = plt.subplots(1, 1) ax.plot(bias);
708
757
11
temperature_index_model-12
temperature_index_model-12
Temperature index models Goals of this notebook: Gain a basic understanding of temperature index models Implement OGGM's temperature index model for a glacier of interest This version of the notebook works for OGGM versions before 1.6. We will keep this notebook here for a while longer (e.g.: for classroom.oggm.org), and we will replace it with an updated notebook at a later stage. If you are running OGGM 1.6, you should ignore this notebook. Some settings: Background Glacier melt significantly influences catchment hydrology. Hence, it is useful to have accurate predictions of runoff from glacierized areas. Generally, there are two classes of melt models: energy balance models temperature index models Energy balance models are physical models quantifying melt as the residual of the energy balance equation. These models require measurements of net radiation, wind speed, temperature and surface properties to predict melt. On a glacier, spatially well resolved measurements are demanding and hard to maintain. Hence, a simpler model, the temperature index model, is the most common approach to model glacier melt. Temperature index models assume an empirical relationship between air temperatures and melt rates and are a simplification of the energy balance models. The reasoning is that melt is predominantly influenced by the longwave atmospheric radiation and the sensible heat flux - energy balance components that are highly influenced by air temperature (Hock, 2003). The main reason(s) why temperature index models are commonly used are the wide availability of air temperature measurements and computational efficiency. Model setup The simplest temperature index model relates the amount of ice or snow melt M (mm) to the sum of positive air temperatures T+ (∘C) by a proportionality factor DDF, the degree-day factor, for each n time intervals Δt: n∑i M = DDF n∑i T+Δt Commonly, Δt=1 day is used - hence the name degree-day factor. However, any other time interval Δt, e.g. hourly or monthly, can be used to determine DDF. In practice, the model requires measurements of air temperature and glacier mass balance to estimate DDF - once calculated, DDF can be used to predict melt by only measuring air temperature (Hock, 2003). However, this temperature index model, also called degree-day model, is not able to predict glacier surface mass balance. To model glacier surface mass balance, a more sophisticated temperature index model was developed by Marzeion et al., (2012). The monthly mass balance Bi at elevation z is computed as Bi(z) = Psolidi(z) − μ∗max(Ti(z)−Tmelt,0) − ϵ where PSolidi is the monthly solid precipitation, Ti the monthly average temperature, TMelt the monthly average temperature above which ice melt is assumed and ϵ the residual. ϵ is assumed to be a random error taking account for uncertainties associated with unresolved physical processes. μ∗ is the temperature sensitivity of the glacier and it depends on many parameters, mostly glacier specific (e.g., avalanches, topographical shading, cloudiness, ...). Degrees of freedom Among others, the temperature sensitivity μ∗, the threshold for melt TMelt and the implicit threshold for solid precipitation TSolid are important degrees of freedom of the model - TSolid is the monthly average temperature below which precipitation is assumed to be solid. Generally, TMelt and TSolid can vary both spatially and temporally on a specific glacier. However, commonly the two thresholds TMelt and TSolid are assumed to be constant. TMelt and TSolid significantly influence the predicted mass balance B by determining the months which are taken into account in the calculation. Both TMelt and TSolid can be determined by a physical reasoning: we know that both snow melts and precipitation becomes solid at around 0∘C. Hence, the two thresholds TMelt and TSolid are within a natural range that depends on the climatological conditions at a specific glacier site. In OGGM, TMelt and TSolid are constants and you can access the default values via the cfg module: Similarly, you can use your own TMelt and TSolid if you feel like it: The temperature sensitivity μ∗ is glacier specific and mostly determined using statistical error minimization techniques, e.g. ordinary least squares (OLS). Such statistical techniques are very sensitive to the sample size - a general issue in glaciology is that the sample size of annual mass balance records is poor for many glaciers. However, assume that a 100 year long mass balance record together with temperature and precipitation measurements is available for a specific glacier (this is a best case example and only very few glaciers actually have such long records). OLS will find a statistically significant μ∗ which you can happily use to model mass balance. But what happens if you only use 30 years out of the 100 year record? OLS will find another statistically significant μ∗ that is different from the one determined by the 100 year record - and another statistically significant μ∗ can be found for each reasonable subset of the original 100 year record. This implies that μ∗ is generally a time dependent temperature sensitivity μ∗(t). For this reason, OGGM implements a calibration procedure, introduced by Marzeion et al., (2012), to determine a constant glacier specific μ∗ out of the time dependent μ∗(t) candidates. This calibration is beyond the scope of this notebook and you can read about it in detail here and check out an example implementation in OGGM here. Implementation in OGGM First, we need to define a glacier directory: If you want to look at your model domain, you can plot it using: In OGGM, the calibrated temperature index model for each glacier is accessible via the PastMassBalance class of the massbalance module: In this case, and its calibrated temperature sensitivity μ∗ is Similarly, the residual ϵ is Climate data Per default, the temperature index model is driven by the 0.5∘×0.5∘ gridded global CRU TS climate dataset. These climate data are then downscaled to a higher resolution grid to allow for an elevation-dependent dataset. The climate data at the reference height used to drive the temperature index model and to determine the calibrated μ∗ of the selected glacier can be accessed via the glacier directory: This is the temporary path where OGGM stored its climate data on your machine. You can read the climate data using xarray: The climate dataset has two variables, the monthly total precipitation prcp and the monthly average temperature temp. Let's calculate the mean annual cycle of average temperature and total precipitation, and plot it, to get an intuitive view on the climate conditions at the selected glacier site. Reference mass balance data OGGM uses in-situ mass balance data from the World Glacier Monitoring Service Fluctuations of Glaciers Database (WGMS FoGD). The Fluctuations of Glaciers (FoG) database contains annual mass-balance records for several hundreds of glaciers worldwide. Currently, 254 mass balance time series are available. These data are shipped automatically with OGGM and can be accessed via the glacier directory: Predict mass balance! Now, we are set to calculate glacier mass balance using the temperature index model - we have the model parameters μ∗ and ϵ, the thresholds for melt and solid precipitation TMelt and TSolid and the climate dataset. The last thing we need to define are the heights at which we want to calculate the mass balance. Here, we use glacier flowlines along which the mass balance is computed: We will calculate the specific mass balance in mm w.e. yr−1 for the years where in-situ mass balance data is available: The specific mass balance along the given flowlines is computed by For this calculation we assumed an average ice density of Now, we can compare the actual in-situ mass balance with the modelled mass balance: Does not look too bad, does it? To assess model performance, it is helpful to plot the data in a scatter plot: If the points were aligned along the red line, the model would perfectly predict mass balance. Generally, the model overestimates mass balance in magnitude - the scatter plot shows a steeper slope than the 1 to 1 red line. This is due to specific mass balance beeing dependent not only on the climate but also on the glacier surface area. OGGM computes the specific mass balance as a glacier area-weighted average using a constant glacier geometry fixed at the Randolph Glacier Inventory date, e.g. 2003 for most glaciers in the European Alps. Glacier geometry is itself a function of climate and may change significantly over time. Hence, assuming a constant glacier geometry over a time period of different climatic conditions can result in a systematic model bias: The bias is positive at the beginning of the in-situ measurements and shows a negative trend. When keeping the glacier area constant, a positive (negative) bias means, that the calibrated temperature sensitivity μ∗ of the glacier is too low (high) during time periods of colder (warmer) climates. You can find a simple experiment about the sensitivity of the specific mass balance on climate change and glacier surface area in this blog post. Take home points There are two different types of melt models: the energy balance model and the temperature index model The temperature index model is the computationally efficient simplification of the energy balance model Temperature index models assume an empirical relationship between air temperature and melt rates Temperature index models can be extended to model glacier mass balance by adding solid precipitation as a model parameter The model outcome is significantly influenced by the choice of TMelt and TSolid The temperature sensitivity of a glacier is not constant in time μ∗ = μ∗(t) The specific mass balance is a function of the climate and the glacier surface area References Hock R., (2003). Temperature index melt modelling in mountain areas. Journal of Hydrology, 281, 104-115. https://doi.org/10.1016/S0022-1694(03)00257-9 Marzeion B., Jarosch A. H. & Hofer M. (2012). Past and future sea-level change from the surface mass balance of glaciers. The Cryosphere, 6, 1295-1322. https://doi.org/10.5194/tc-6-1295-2012
6,394
6,436
import matplotlib.pyplot as plt import seaborn as sns sns.set_context('notebook') sns.set_style('ticks') import numpy as np import oggm from oggm import utils, cfg, workflow, graphics cfg.initialize() cfg.PATHS['working_dir'] = utils.gettempdir('ti_model') cfg.PARAMS['border'] = 10 print('T_solid = {}°C'.format(cfg.PARAMS['temp_all_solid'])) print('T_melt = {}°C'.format(cfg.PARAMS['temp_melt'])) gdir = workflow.init_glacier_directories([utils.demo_glacier_id('hef')], from_prepro_level=3)[0] from oggm.core import massbalance mb_cal = massbalance.PastMassBalance(gdir) print('the glacier selected is {},'.format(gdir.name)) print('mu_star = {:2f} mm K^-1 yr^-1.'.format(mb_cal.mu_star)) print('epsilon = {:2f} mm.'.format(mb_cal.bias)) fpath = gdir.get_filepath('climate_historical') print(fpath) import xarray as xr climate = xr.open_dataset(fpath) climate annual_cycle = climate.groupby('time.month').mean(dim='time') import calendar fig, ax = plt.subplots(1, 2, figsize=(16, 9)) ax[0].plot(annual_cycle.month, annual_cycle.temp); ax[1].plot(annual_cycle.month, annual_cycle.prcp); ax[0].set_title('Average temperature / (°C)'); ax[1].set_title('Total precipitation / (mm)'); for a in ax: a.set_xticks(annual_cycle.month.values) a.set_xticklabels([calendar.month_abbr[m] for m in annual_cycle.month.values]) ref_mb = gdir.get_ref_mb_data() ref_mb[['ANNUAL_BALANCE']].plot(title='Annual mass balance: {}'.format(gdir.name), legend=False); fls = gdir.read_pickle('inversion_flowlines') print(ref_mb.index.values) ref_mb['OGGM (calib)'] = mb_cal.get_specific_mb(fls=fls, year=ref_mb.index.values) print('rho_ice = {} kg m^-3.'.format(cfg.PARAMS['ice_density'])) fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], label='Observed') ax.plot(ref_mb['OGGM (calib)'], label='Modelled') ax.set_ylabel('Specific mass balance / (mm w.e. y$^{-1}$)') ax.legend(frameon=False); fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['OGGM (calib)'], 'ok'); ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['ANNUAL_BALANCE'], '-r'); ax.set_xlim(-3000, 2000) ax.set_ylim(-3000, 2000) ax.set_xlabel('Observed'); ax.set_ylabel('OGGM (calib)'); bias = ref_mb['OGGM (calib)'] - ref_mb['ANNUAL_BALANCE'] fig, ax = plt.subplots(1, 1) ax.plot(bias);
824
878
12
temperature_index_model-13
temperature_index_model-13
Temperature index models Goals of this notebook: Gain a basic understanding of temperature index models Implement OGGM's temperature index model for a glacier of interest This version of the notebook works for OGGM versions before 1.6. We will keep this notebook here for a while longer (e.g.: for classroom.oggm.org), and we will replace it with an updated notebook at a later stage. If you are running OGGM 1.6, you should ignore this notebook. Some settings: Background Glacier melt significantly influences catchment hydrology. Hence, it is useful to have accurate predictions of runoff from glacierized areas. Generally, there are two classes of melt models: energy balance models temperature index models Energy balance models are physical models quantifying melt as the residual of the energy balance equation. These models require measurements of net radiation, wind speed, temperature and surface properties to predict melt. On a glacier, spatially well resolved measurements are demanding and hard to maintain. Hence, a simpler model, the temperature index model, is the most common approach to model glacier melt. Temperature index models assume an empirical relationship between air temperatures and melt rates and are a simplification of the energy balance models. The reasoning is that melt is predominantly influenced by the longwave atmospheric radiation and the sensible heat flux - energy balance components that are highly influenced by air temperature (Hock, 2003). The main reason(s) why temperature index models are commonly used are the wide availability of air temperature measurements and computational efficiency. Model setup The simplest temperature index model relates the amount of ice or snow melt M (mm) to the sum of positive air temperatures T+ (∘C) by a proportionality factor DDF, the degree-day factor, for each n time intervals Δt: n∑i M = DDF n∑i T+Δt Commonly, Δt=1 day is used - hence the name degree-day factor. However, any other time interval Δt, e.g. hourly or monthly, can be used to determine DDF. In practice, the model requires measurements of air temperature and glacier mass balance to estimate DDF - once calculated, DDF can be used to predict melt by only measuring air temperature (Hock, 2003). However, this temperature index model, also called degree-day model, is not able to predict glacier surface mass balance. To model glacier surface mass balance, a more sophisticated temperature index model was developed by Marzeion et al., (2012). The monthly mass balance Bi at elevation z is computed as Bi(z) = Psolidi(z) − μ∗max(Ti(z)−Tmelt,0) − ϵ where PSolidi is the monthly solid precipitation, Ti the monthly average temperature, TMelt the monthly average temperature above which ice melt is assumed and ϵ the residual. ϵ is assumed to be a random error taking account for uncertainties associated with unresolved physical processes. μ∗ is the temperature sensitivity of the glacier and it depends on many parameters, mostly glacier specific (e.g., avalanches, topographical shading, cloudiness, ...). Degrees of freedom Among others, the temperature sensitivity μ∗, the threshold for melt TMelt and the implicit threshold for solid precipitation TSolid are important degrees of freedom of the model - TSolid is the monthly average temperature below which precipitation is assumed to be solid. Generally, TMelt and TSolid can vary both spatially and temporally on a specific glacier. However, commonly the two thresholds TMelt and TSolid are assumed to be constant. TMelt and TSolid significantly influence the predicted mass balance B by determining the months which are taken into account in the calculation. Both TMelt and TSolid can be determined by a physical reasoning: we know that both snow melts and precipitation becomes solid at around 0∘C. Hence, the two thresholds TMelt and TSolid are within a natural range that depends on the climatological conditions at a specific glacier site. In OGGM, TMelt and TSolid are constants and you can access the default values via the cfg module: Similarly, you can use your own TMelt and TSolid if you feel like it: The temperature sensitivity μ∗ is glacier specific and mostly determined using statistical error minimization techniques, e.g. ordinary least squares (OLS). Such statistical techniques are very sensitive to the sample size - a general issue in glaciology is that the sample size of annual mass balance records is poor for many glaciers. However, assume that a 100 year long mass balance record together with temperature and precipitation measurements is available for a specific glacier (this is a best case example and only very few glaciers actually have such long records). OLS will find a statistically significant μ∗ which you can happily use to model mass balance. But what happens if you only use 30 years out of the 100 year record? OLS will find another statistically significant μ∗ that is different from the one determined by the 100 year record - and another statistically significant μ∗ can be found for each reasonable subset of the original 100 year record. This implies that μ∗ is generally a time dependent temperature sensitivity μ∗(t). For this reason, OGGM implements a calibration procedure, introduced by Marzeion et al., (2012), to determine a constant glacier specific μ∗ out of the time dependent μ∗(t) candidates. This calibration is beyond the scope of this notebook and you can read about it in detail here and check out an example implementation in OGGM here. Implementation in OGGM First, we need to define a glacier directory: If you want to look at your model domain, you can plot it using: In OGGM, the calibrated temperature index model for each glacier is accessible via the PastMassBalance class of the massbalance module: In this case, and its calibrated temperature sensitivity μ∗ is Similarly, the residual ϵ is Climate data Per default, the temperature index model is driven by the 0.5∘×0.5∘ gridded global CRU TS climate dataset. These climate data are then downscaled to a higher resolution grid to allow for an elevation-dependent dataset. The climate data at the reference height used to drive the temperature index model and to determine the calibrated μ∗ of the selected glacier can be accessed via the glacier directory: This is the temporary path where OGGM stored its climate data on your machine. You can read the climate data using xarray: The climate dataset has two variables, the monthly total precipitation prcp and the monthly average temperature temp. Let's calculate the mean annual cycle of average temperature and total precipitation, and plot it, to get an intuitive view on the climate conditions at the selected glacier site. Reference mass balance data OGGM uses in-situ mass balance data from the World Glacier Monitoring Service Fluctuations of Glaciers Database (WGMS FoGD). The Fluctuations of Glaciers (FoG) database contains annual mass-balance records for several hundreds of glaciers worldwide. Currently, 254 mass balance time series are available. These data are shipped automatically with OGGM and can be accessed via the glacier directory: Predict mass balance! Now, we are set to calculate glacier mass balance using the temperature index model - we have the model parameters μ∗ and ϵ, the thresholds for melt and solid precipitation TMelt and TSolid and the climate dataset. The last thing we need to define are the heights at which we want to calculate the mass balance. Here, we use glacier flowlines along which the mass balance is computed: We will calculate the specific mass balance in mm w.e. yr−1 for the years where in-situ mass balance data is available: The specific mass balance along the given flowlines is computed by For this calculation we assumed an average ice density of Now, we can compare the actual in-situ mass balance with the modelled mass balance: Does not look too bad, does it? To assess model performance, it is helpful to plot the data in a scatter plot: If the points were aligned along the red line, the model would perfectly predict mass balance. Generally, the model overestimates mass balance in magnitude - the scatter plot shows a steeper slope than the 1 to 1 red line. This is due to specific mass balance beeing dependent not only on the climate but also on the glacier surface area. OGGM computes the specific mass balance as a glacier area-weighted average using a constant glacier geometry fixed at the Randolph Glacier Inventory date, e.g. 2003 for most glaciers in the European Alps. Glacier geometry is itself a function of climate and may change significantly over time. Hence, assuming a constant glacier geometry over a time period of different climatic conditions can result in a systematic model bias: The bias is positive at the beginning of the in-situ measurements and shows a negative trend. When keeping the glacier area constant, a positive (negative) bias means, that the calibrated temperature sensitivity μ∗ of the glacier is too low (high) during time periods of colder (warmer) climates. You can find a simple experiment about the sensitivity of the specific mass balance on climate change and glacier surface area in this blog post. Take home points There are two different types of melt models: the energy balance model and the temperature index model The temperature index model is the computationally efficient simplification of the energy balance model Temperature index models assume an empirical relationship between air temperature and melt rates Temperature index models can be extended to model glacier mass balance by adding solid precipitation as a model parameter The model outcome is significantly influenced by the choice of TMelt and TSolid The temperature sensitivity of a glacier is not constant in time μ∗ = μ∗(t) The specific mass balance is a function of the climate and the glacier surface area References Hock R., (2003). Temperature index melt modelling in mountain areas. Journal of Hydrology, 281, 104-115. https://doi.org/10.1016/S0022-1694(03)00257-9 Marzeion B., Jarosch A. H. & Hofer M. (2012). Past and future sea-level change from the surface mass balance of glaciers. The Cryosphere, 6, 1295-1322. https://doi.org/10.5194/tc-6-1295-2012
6,648
6,736
import matplotlib.pyplot as plt import seaborn as sns sns.set_context('notebook') sns.set_style('ticks') import numpy as np import oggm from oggm import utils, cfg, workflow, graphics cfg.initialize() cfg.PATHS['working_dir'] = utils.gettempdir('ti_model') cfg.PARAMS['border'] = 10 print('T_solid = {}°C'.format(cfg.PARAMS['temp_all_solid'])) print('T_melt = {}°C'.format(cfg.PARAMS['temp_melt'])) gdir = workflow.init_glacier_directories([utils.demo_glacier_id('hef')], from_prepro_level=3)[0] from oggm.core import massbalance mb_cal = massbalance.PastMassBalance(gdir) print('the glacier selected is {},'.format(gdir.name)) print('mu_star = {:2f} mm K^-1 yr^-1.'.format(mb_cal.mu_star)) print('epsilon = {:2f} mm.'.format(mb_cal.bias)) fpath = gdir.get_filepath('climate_historical') print(fpath) import xarray as xr climate = xr.open_dataset(fpath) climate annual_cycle = climate.groupby('time.month').mean(dim='time') import calendar fig, ax = plt.subplots(1, 2, figsize=(16, 9)) ax[0].plot(annual_cycle.month, annual_cycle.temp); ax[1].plot(annual_cycle.month, annual_cycle.prcp); ax[0].set_title('Average temperature / (°C)'); ax[1].set_title('Total precipitation / (mm)'); for a in ax: a.set_xticks(annual_cycle.month.values) a.set_xticklabels([calendar.month_abbr[m] for m in annual_cycle.month.values]) ref_mb = gdir.get_ref_mb_data() ref_mb[['ANNUAL_BALANCE']].plot(title='Annual mass balance: {}'.format(gdir.name), legend=False); fls = gdir.read_pickle('inversion_flowlines') print(ref_mb.index.values) ref_mb['OGGM (calib)'] = mb_cal.get_specific_mb(fls=fls, year=ref_mb.index.values) print('rho_ice = {} kg m^-3.'.format(cfg.PARAMS['ice_density'])) fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], label='Observed') ax.plot(ref_mb['OGGM (calib)'], label='Modelled') ax.set_ylabel('Specific mass balance / (mm w.e. y$^{-1}$)') ax.legend(frameon=False); fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['OGGM (calib)'], 'ok'); ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['ANNUAL_BALANCE'], '-r'); ax.set_xlim(-3000, 2000) ax.set_ylim(-3000, 2000) ax.set_xlabel('Observed'); ax.set_ylabel('OGGM (calib)'); bias = ref_mb['OGGM (calib)'] - ref_mb['ANNUAL_BALANCE'] fig, ax = plt.subplots(1, 1) ax.plot(bias);
969
1,351
13
temperature_index_model-14
temperature_index_model-14
Temperature index models Goals of this notebook: Gain a basic understanding of temperature index models Implement OGGM's temperature index model for a glacier of interest This version of the notebook works for OGGM versions before 1.6. We will keep this notebook here for a while longer (e.g.: for classroom.oggm.org), and we will replace it with an updated notebook at a later stage. If you are running OGGM 1.6, you should ignore this notebook. Some settings: Background Glacier melt significantly influences catchment hydrology. Hence, it is useful to have accurate predictions of runoff from glacierized areas. Generally, there are two classes of melt models: energy balance models temperature index models Energy balance models are physical models quantifying melt as the residual of the energy balance equation. These models require measurements of net radiation, wind speed, temperature and surface properties to predict melt. On a glacier, spatially well resolved measurements are demanding and hard to maintain. Hence, a simpler model, the temperature index model, is the most common approach to model glacier melt. Temperature index models assume an empirical relationship between air temperatures and melt rates and are a simplification of the energy balance models. The reasoning is that melt is predominantly influenced by the longwave atmospheric radiation and the sensible heat flux - energy balance components that are highly influenced by air temperature (Hock, 2003). The main reason(s) why temperature index models are commonly used are the wide availability of air temperature measurements and computational efficiency. Model setup The simplest temperature index model relates the amount of ice or snow melt M (mm) to the sum of positive air temperatures T+ (∘C) by a proportionality factor DDF, the degree-day factor, for each n time intervals Δt: n∑i M = DDF n∑i T+Δt Commonly, Δt=1 day is used - hence the name degree-day factor. However, any other time interval Δt, e.g. hourly or monthly, can be used to determine DDF. In practice, the model requires measurements of air temperature and glacier mass balance to estimate DDF - once calculated, DDF can be used to predict melt by only measuring air temperature (Hock, 2003). However, this temperature index model, also called degree-day model, is not able to predict glacier surface mass balance. To model glacier surface mass balance, a more sophisticated temperature index model was developed by Marzeion et al., (2012). The monthly mass balance Bi at elevation z is computed as Bi(z) = Psolidi(z) − μ∗max(Ti(z)−Tmelt,0) − ϵ where PSolidi is the monthly solid precipitation, Ti the monthly average temperature, TMelt the monthly average temperature above which ice melt is assumed and ϵ the residual. ϵ is assumed to be a random error taking account for uncertainties associated with unresolved physical processes. μ∗ is the temperature sensitivity of the glacier and it depends on many parameters, mostly glacier specific (e.g., avalanches, topographical shading, cloudiness, ...). Degrees of freedom Among others, the temperature sensitivity μ∗, the threshold for melt TMelt and the implicit threshold for solid precipitation TSolid are important degrees of freedom of the model - TSolid is the monthly average temperature below which precipitation is assumed to be solid. Generally, TMelt and TSolid can vary both spatially and temporally on a specific glacier. However, commonly the two thresholds TMelt and TSolid are assumed to be constant. TMelt and TSolid significantly influence the predicted mass balance B by determining the months which are taken into account in the calculation. Both TMelt and TSolid can be determined by a physical reasoning: we know that both snow melts and precipitation becomes solid at around 0∘C. Hence, the two thresholds TMelt and TSolid are within a natural range that depends on the climatological conditions at a specific glacier site. In OGGM, TMelt and TSolid are constants and you can access the default values via the cfg module: Similarly, you can use your own TMelt and TSolid if you feel like it: The temperature sensitivity μ∗ is glacier specific and mostly determined using statistical error minimization techniques, e.g. ordinary least squares (OLS). Such statistical techniques are very sensitive to the sample size - a general issue in glaciology is that the sample size of annual mass balance records is poor for many glaciers. However, assume that a 100 year long mass balance record together with temperature and precipitation measurements is available for a specific glacier (this is a best case example and only very few glaciers actually have such long records). OLS will find a statistically significant μ∗ which you can happily use to model mass balance. But what happens if you only use 30 years out of the 100 year record? OLS will find another statistically significant μ∗ that is different from the one determined by the 100 year record - and another statistically significant μ∗ can be found for each reasonable subset of the original 100 year record. This implies that μ∗ is generally a time dependent temperature sensitivity μ∗(t). For this reason, OGGM implements a calibration procedure, introduced by Marzeion et al., (2012), to determine a constant glacier specific μ∗ out of the time dependent μ∗(t) candidates. This calibration is beyond the scope of this notebook and you can read about it in detail here and check out an example implementation in OGGM here. Implementation in OGGM First, we need to define a glacier directory: If you want to look at your model domain, you can plot it using: In OGGM, the calibrated temperature index model for each glacier is accessible via the PastMassBalance class of the massbalance module: In this case, and its calibrated temperature sensitivity μ∗ is Similarly, the residual ϵ is Climate data Per default, the temperature index model is driven by the 0.5∘×0.5∘ gridded global CRU TS climate dataset. These climate data are then downscaled to a higher resolution grid to allow for an elevation-dependent dataset. The climate data at the reference height used to drive the temperature index model and to determine the calibrated μ∗ of the selected glacier can be accessed via the glacier directory: This is the temporary path where OGGM stored its climate data on your machine. You can read the climate data using xarray: The climate dataset has two variables, the monthly total precipitation prcp and the monthly average temperature temp. Let's calculate the mean annual cycle of average temperature and total precipitation, and plot it, to get an intuitive view on the climate conditions at the selected glacier site. Reference mass balance data OGGM uses in-situ mass balance data from the World Glacier Monitoring Service Fluctuations of Glaciers Database (WGMS FoGD). The Fluctuations of Glaciers (FoG) database contains annual mass-balance records for several hundreds of glaciers worldwide. Currently, 254 mass balance time series are available. These data are shipped automatically with OGGM and can be accessed via the glacier directory: Predict mass balance! Now, we are set to calculate glacier mass balance using the temperature index model - we have the model parameters μ∗ and ϵ, the thresholds for melt and solid precipitation TMelt and TSolid and the climate dataset. The last thing we need to define are the heights at which we want to calculate the mass balance. Here, we use glacier flowlines along which the mass balance is computed: We will calculate the specific mass balance in mm w.e. yr−1 for the years where in-situ mass balance data is available: The specific mass balance along the given flowlines is computed by For this calculation we assumed an average ice density of Now, we can compare the actual in-situ mass balance with the modelled mass balance: Does not look too bad, does it? To assess model performance, it is helpful to plot the data in a scatter plot: If the points were aligned along the red line, the model would perfectly predict mass balance. Generally, the model overestimates mass balance in magnitude - the scatter plot shows a steeper slope than the 1 to 1 red line. This is due to specific mass balance beeing dependent not only on the climate but also on the glacier surface area. OGGM computes the specific mass balance as a glacier area-weighted average using a constant glacier geometry fixed at the Randolph Glacier Inventory date, e.g. 2003 for most glaciers in the European Alps. Glacier geometry is itself a function of climate and may change significantly over time. Hence, assuming a constant glacier geometry over a time period of different climatic conditions can result in a systematic model bias: The bias is positive at the beginning of the in-situ measurements and shows a negative trend. When keeping the glacier area constant, a positive (negative) bias means, that the calibrated temperature sensitivity μ∗ of the glacier is too low (high) during time periods of colder (warmer) climates. You can find a simple experiment about the sensitivity of the specific mass balance on climate change and glacier surface area in this blog post. Take home points There are two different types of melt models: the energy balance model and the temperature index model The temperature index model is the computationally efficient simplification of the energy balance model Temperature index models assume an empirical relationship between air temperature and melt rates Temperature index models can be extended to model glacier mass balance by adding solid precipitation as a model parameter The model outcome is significantly influenced by the choice of TMelt and TSolid The temperature sensitivity of a glacier is not constant in time μ∗ = μ∗(t) The specific mass balance is a function of the climate and the glacier surface area References Hock R., (2003). Temperature index melt modelling in mountain areas. Journal of Hydrology, 281, 104-115. https://doi.org/10.1016/S0022-1694(03)00257-9 Marzeion B., Jarosch A. H. & Hofer M. (2012). Past and future sea-level change from the surface mass balance of glaciers. The Cryosphere, 6, 1295-1322. https://doi.org/10.5194/tc-6-1295-2012
449
463
import matplotlib.pyplot as plt import seaborn as sns sns.set_context('notebook') sns.set_style('ticks') import numpy as np import oggm from oggm import utils, cfg, workflow, graphics cfg.initialize() cfg.PATHS['working_dir'] = utils.gettempdir('ti_model') cfg.PARAMS['border'] = 10 print('T_solid = {}°C'.format(cfg.PARAMS['temp_all_solid'])) print('T_melt = {}°C'.format(cfg.PARAMS['temp_melt'])) gdir = workflow.init_glacier_directories([utils.demo_glacier_id('hef')], from_prepro_level=3)[0] from oggm.core import massbalance mb_cal = massbalance.PastMassBalance(gdir) print('the glacier selected is {},'.format(gdir.name)) print('mu_star = {:2f} mm K^-1 yr^-1.'.format(mb_cal.mu_star)) print('epsilon = {:2f} mm.'.format(mb_cal.bias)) fpath = gdir.get_filepath('climate_historical') print(fpath) import xarray as xr climate = xr.open_dataset(fpath) climate annual_cycle = climate.groupby('time.month').mean(dim='time') import calendar fig, ax = plt.subplots(1, 2, figsize=(16, 9)) ax[0].plot(annual_cycle.month, annual_cycle.temp); ax[1].plot(annual_cycle.month, annual_cycle.prcp); ax[0].set_title('Average temperature / (°C)'); ax[1].set_title('Total precipitation / (mm)'); for a in ax: a.set_xticks(annual_cycle.month.values) a.set_xticklabels([calendar.month_abbr[m] for m in annual_cycle.month.values]) ref_mb = gdir.get_ref_mb_data() ref_mb[['ANNUAL_BALANCE']].plot(title='Annual mass balance: {}'.format(gdir.name), legend=False); fls = gdir.read_pickle('inversion_flowlines') print(ref_mb.index.values) ref_mb['OGGM (calib)'] = mb_cal.get_specific_mb(fls=fls, year=ref_mb.index.values) print('rho_ice = {} kg m^-3.'.format(cfg.PARAMS['ice_density'])) fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], label='Observed') ax.plot(ref_mb['OGGM (calib)'], label='Modelled') ax.set_ylabel('Specific mass balance / (mm w.e. y$^{-1}$)') ax.legend(frameon=False); fig, ax = plt.subplots(1, 1) ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['OGGM (calib)'], 'ok'); ax.plot(ref_mb['ANNUAL_BALANCE'], ref_mb['ANNUAL_BALANCE'], '-r'); ax.set_xlim(-3000, 2000) ax.set_ylim(-3000, 2000) ax.set_xlabel('Observed'); ax.set_ylabel('OGGM (calib)'); bias = ref_mb['OGGM (calib)'] - ref_mb['ANNUAL_BALANCE'] fig, ax = plt.subplots(1, 1) ax.plot(bias);
206
289
14
edu_intro-0
edu_intro-0
Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Let's plot the bed to make sure that it looks like we expect. The bed object has a built in method for this which provide us with a side and top-down view of the glacier domain. For finer control over the bed slope you can pass a single value to slopes during the creation You can also pass a sequence of slope angles in slopes - for this you also need to specify the altitude spans of the sections with the slope_sections argument. There should be one more entry in slope_sections compared to the entries in slopes. The first and last value in slope_sections should match the top and bottom of the glacier. Mass balance For the glacier to grow it needs a mass balance model. The mass balance is responsible for adding snow and removing ice through melt on the glacier. In our case it will be a simple linear mass balance, meaning that it decreases linearly with altitude. The mass balance is defined by the equilibrium line altitude (ELA) and the altitude gradient (in mm yr − 1 m−1). The ELA defines at what altitude the mass balance is zero and the altitude gradient how much the mass balance changes with altitude. More on this in upcoming notebooks! We set the ELA of our glacier to 3000 meters and the altitude gradient to 4 mm yr − 1m−1. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, we can get some statistics about the glacier by simply calling it. However since we just created the glacier, everything will be zero. Progressing the glacier Now the glacier has all the ingredients needed to evolve. Let's first progress the glacier to year 1. And let's take a look at the glacier. As the bed, it has a in method for this. Here we can see that there is thin cover of ice from the top and 4 km down the glacier bed. So the glacier almost reaches the point where the bed intersects the ELA (~4 km). We can also take a look at some of statistics of the glacier again to get some more details: From the statistics we can read that the glacier has a length of 4 km and covers an area of 1.2 km2. The glacier will grow considerably in the upcoming years, and the ice thickness should become apparent even in the altitude - distance plot. Let us progress the glacier to year 150 and take a look. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same statistics about the glacier as before: The glacier length and area has increased by ~20% while the volume has increased by more than 1000%. This is because the glacier has to build enough mass (i.e. ice thickness) before it can begin to flow downhill and increase its length. Note that the glacier is now 150 years old. If we try progressing the glacier to the same year again, nothing will happen. It evens gives us a warning. We can easily progress the glacier even longer: The glaciers has now grown considerably further down our made up mountain, well below the ELA. It is important to note that the model can not progress back in time. Once at year 500, we can not de-age the glacier. Let's do the same with one of the glaciers with a non-linear bed profile! Glacier history This brings us to the glacier history. This is just what it sounds like, a history of the length, volume and area of the glacier. We can access the data through the .history attribute And we can quickly visualise the history of the glacier with the .plot_history() method The glacier length and area has a step in the first year. This has to do with how OGGM internally deals with snow and ice, it does not differentiate between them. And since the mass balance is always positive above the ELA, any snowfall in the first year above the ELA will remain and be classified as part of the glacier, and contribute to the length and area. This is why after the first year, the glacier's length and area remains constant for a few years. In this initial stage, the ice is so thin that any flow bringing ice below the ELA will not be large enough to compensate for the high ablation rate, and any ice melts away. When the ice thickness has increased enough for the ice flow to surpass the ablation rate below the ELA, the glacier length can begin to increase. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume won't change anymore, as long as all physical parameters and the climate stay constant. The Glacier has a method which progress the glacier to equilibrium .progress_to_equilibrium(), more on this in later notebooks. A first experiment We have now seen how to setup a simple glacier and progress it to any year. Now we will move a little bit closer to reality and define a glacier with changing widths. Like many real glaciers the new glacier will be wider at the top (in the accumulation area) and have a constant width below the ELA. We can achieve this by creating a new Bed and instead of specifying the top and bottom altitudes along with the width, we specify altitudes and widths in pairs: Here the first and last values in altitudes and widths correspond to the top/bottom altitude/width. Any values in between will change the shape of the bed further. We use the new bed to create a new glacier We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. The GlacierCollection will be used extensively throughout these notebooks and its functionality will be explained further as we go along. We can get a quick look at the collection by simply calling it Before plotting the glaciers in the collection, we can progress them to the same year with the .progress_to_year() method. We can then plot the collection Similarly to the glacier the collection has a method for easily plotting the histories of the held glaciers.
6,413
6,455
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) bed bed.plot() bed_with_slope = GlacierBed(top=3400, bottom=1500, width=300, slopes=25) bed_with_slope.plot() bed_with_multiple_slopes = GlacierBed(top=3400, bottom=1500, width=300, slopes=[25, 10], # Slope sections are defined by altitude # pairs. Here we have two parirs. slope_sections=[3400, 2200, 1500]) bed_with_multiple_slopes.plot() mass_balance = MassBalance(ela=3000, gradient=4) mass_balance glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier glacier.progress_to_year(1) glacier.plot() glacier glacier.progress_to_year(150) glacier.plot() glacier glacier.progress_to_year(150) glacier.progress_to_year(500) glacier.plot() glacier glacier.progress_to_year(450) mass_balance_2 = MassBalance(ela=2500, gradient=4) glacier_multiple_slopes = Glacier(bed=bed_with_multiple_slopes, mass_balance=mass_balance_2) glacier_multiple_slopes.progress_to_year(400) glacier_multiple_slopes.plot() glacier.history glacier.plot_history() wide_narrow_bed = GlacierBed(altitudes=[3400, 2800, 1500], widths=[600, 300, 300]) wide_narrow_bed wide_narrow_bed.plot() wide_narrow_glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) wide_narrow_glacier collection = GlacierCollection() collection.add([glacier, wide_narrow_glacier]) collection collection.progress_to_year(600) collection.plot() collection.plot_history()
1,593
1,626
0
edu_intro-1
edu_intro-1
Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Let's plot the bed to make sure that it looks like we expect. The bed object has a built in method for this which provide us with a side and top-down view of the glacier domain. For finer control over the bed slope you can pass a single value to slopes during the creation You can also pass a sequence of slope angles in slopes - for this you also need to specify the altitude spans of the sections with the slope_sections argument. There should be one more entry in slope_sections compared to the entries in slopes. The first and last value in slope_sections should match the top and bottom of the glacier. Mass balance For the glacier to grow it needs a mass balance model. The mass balance is responsible for adding snow and removing ice through melt on the glacier. In our case it will be a simple linear mass balance, meaning that it decreases linearly with altitude. The mass balance is defined by the equilibrium line altitude (ELA) and the altitude gradient (in mm yr − 1 m−1). The ELA defines at what altitude the mass balance is zero and the altitude gradient how much the mass balance changes with altitude. More on this in upcoming notebooks! We set the ELA of our glacier to 3000 meters and the altitude gradient to 4 mm yr − 1m−1. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, we can get some statistics about the glacier by simply calling it. However since we just created the glacier, everything will be zero. Progressing the glacier Now the glacier has all the ingredients needed to evolve. Let's first progress the glacier to year 1. And let's take a look at the glacier. As the bed, it has a in method for this. Here we can see that there is thin cover of ice from the top and 4 km down the glacier bed. So the glacier almost reaches the point where the bed intersects the ELA (~4 km). We can also take a look at some of statistics of the glacier again to get some more details: From the statistics we can read that the glacier has a length of 4 km and covers an area of 1.2 km2. The glacier will grow considerably in the upcoming years, and the ice thickness should become apparent even in the altitude - distance plot. Let us progress the glacier to year 150 and take a look. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same statistics about the glacier as before: The glacier length and area has increased by ~20% while the volume has increased by more than 1000%. This is because the glacier has to build enough mass (i.e. ice thickness) before it can begin to flow downhill and increase its length. Note that the glacier is now 150 years old. If we try progressing the glacier to the same year again, nothing will happen. It evens gives us a warning. We can easily progress the glacier even longer: The glaciers has now grown considerably further down our made up mountain, well below the ELA. It is important to note that the model can not progress back in time. Once at year 500, we can not de-age the glacier. Let's do the same with one of the glaciers with a non-linear bed profile! Glacier history This brings us to the glacier history. This is just what it sounds like, a history of the length, volume and area of the glacier. We can access the data through the .history attribute And we can quickly visualise the history of the glacier with the .plot_history() method The glacier length and area has a step in the first year. This has to do with how OGGM internally deals with snow and ice, it does not differentiate between them. And since the mass balance is always positive above the ELA, any snowfall in the first year above the ELA will remain and be classified as part of the glacier, and contribute to the length and area. This is why after the first year, the glacier's length and area remains constant for a few years. In this initial stage, the ice is so thin that any flow bringing ice below the ELA will not be large enough to compensate for the high ablation rate, and any ice melts away. When the ice thickness has increased enough for the ice flow to surpass the ablation rate below the ELA, the glacier length can begin to increase. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume won't change anymore, as long as all physical parameters and the climate stay constant. The Glacier has a method which progress the glacier to equilibrium .progress_to_equilibrium(), more on this in later notebooks. A first experiment We have now seen how to setup a simple glacier and progress it to any year. Now we will move a little bit closer to reality and define a glacier with changing widths. Like many real glaciers the new glacier will be wider at the top (in the accumulation area) and have a constant width below the ELA. We can achieve this by creating a new Bed and instead of specifying the top and bottom altitudes along with the width, we specify altitudes and widths in pairs: Here the first and last values in altitudes and widths correspond to the top/bottom altitude/width. Any values in between will change the shape of the bed further. We use the new bed to create a new glacier We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. The GlacierCollection will be used extensively throughout these notebooks and its functionality will be explained further as we go along. We can get a quick look at the collection by simply calling it Before plotting the glaciers in the collection, we can progress them to the same year with the .progress_to_year() method. We can then plot the collection Similarly to the glacier the collection has a method for easily plotting the histories of the held glaciers.
1,371
1,706
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) bed bed.plot() bed_with_slope = GlacierBed(top=3400, bottom=1500, width=300, slopes=25) bed_with_slope.plot() bed_with_multiple_slopes = GlacierBed(top=3400, bottom=1500, width=300, slopes=[25, 10], # Slope sections are defined by altitude # pairs. Here we have two parirs. slope_sections=[3400, 2200, 1500]) bed_with_multiple_slopes.plot() mass_balance = MassBalance(ela=3000, gradient=4) mass_balance glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier glacier.progress_to_year(1) glacier.plot() glacier glacier.progress_to_year(150) glacier.plot() glacier glacier.progress_to_year(150) glacier.progress_to_year(500) glacier.plot() glacier glacier.progress_to_year(450) mass_balance_2 = MassBalance(ela=2500, gradient=4) glacier_multiple_slopes = Glacier(bed=bed_with_multiple_slopes, mass_balance=mass_balance_2) glacier_multiple_slopes.progress_to_year(400) glacier_multiple_slopes.plot() glacier.history glacier.plot_history() wide_narrow_bed = GlacierBed(altitudes=[3400, 2800, 1500], widths=[600, 300, 300]) wide_narrow_bed wide_narrow_bed.plot() wide_narrow_glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) wide_narrow_glacier collection = GlacierCollection() collection.add([glacier, wide_narrow_glacier]) collection collection.progress_to_year(600) collection.plot() collection.plot_history()
249
600
1
edu_intro-2
edu_intro-2
Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Let's plot the bed to make sure that it looks like we expect. The bed object has a built in method for this which provide us with a side and top-down view of the glacier domain. For finer control over the bed slope you can pass a single value to slopes during the creation You can also pass a sequence of slope angles in slopes - for this you also need to specify the altitude spans of the sections with the slope_sections argument. There should be one more entry in slope_sections compared to the entries in slopes. The first and last value in slope_sections should match the top and bottom of the glacier. Mass balance For the glacier to grow it needs a mass balance model. The mass balance is responsible for adding snow and removing ice through melt on the glacier. In our case it will be a simple linear mass balance, meaning that it decreases linearly with altitude. The mass balance is defined by the equilibrium line altitude (ELA) and the altitude gradient (in mm yr − 1 m−1). The ELA defines at what altitude the mass balance is zero and the altitude gradient how much the mass balance changes with altitude. More on this in upcoming notebooks! We set the ELA of our glacier to 3000 meters and the altitude gradient to 4 mm yr − 1m−1. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, we can get some statistics about the glacier by simply calling it. However since we just created the glacier, everything will be zero. Progressing the glacier Now the glacier has all the ingredients needed to evolve. Let's first progress the glacier to year 1. And let's take a look at the glacier. As the bed, it has a in method for this. Here we can see that there is thin cover of ice from the top and 4 km down the glacier bed. So the glacier almost reaches the point where the bed intersects the ELA (~4 km). We can also take a look at some of statistics of the glacier again to get some more details: From the statistics we can read that the glacier has a length of 4 km and covers an area of 1.2 km2. The glacier will grow considerably in the upcoming years, and the ice thickness should become apparent even in the altitude - distance plot. Let us progress the glacier to year 150 and take a look. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same statistics about the glacier as before: The glacier length and area has increased by ~20% while the volume has increased by more than 1000%. This is because the glacier has to build enough mass (i.e. ice thickness) before it can begin to flow downhill and increase its length. Note that the glacier is now 150 years old. If we try progressing the glacier to the same year again, nothing will happen. It evens gives us a warning. We can easily progress the glacier even longer: The glaciers has now grown considerably further down our made up mountain, well below the ELA. It is important to note that the model can not progress back in time. Once at year 500, we can not de-age the glacier. Let's do the same with one of the glaciers with a non-linear bed profile! Glacier history This brings us to the glacier history. This is just what it sounds like, a history of the length, volume and area of the glacier. We can access the data through the .history attribute And we can quickly visualise the history of the glacier with the .plot_history() method The glacier length and area has a step in the first year. This has to do with how OGGM internally deals with snow and ice, it does not differentiate between them. And since the mass balance is always positive above the ELA, any snowfall in the first year above the ELA will remain and be classified as part of the glacier, and contribute to the length and area. This is why after the first year, the glacier's length and area remains constant for a few years. In this initial stage, the ice is so thin that any flow bringing ice below the ELA will not be large enough to compensate for the high ablation rate, and any ice melts away. When the ice thickness has increased enough for the ice flow to surpass the ablation rate below the ELA, the glacier length can begin to increase. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume won't change anymore, as long as all physical parameters and the climate stay constant. The Glacier has a method which progress the glacier to equilibrium .progress_to_equilibrium(), more on this in later notebooks. A first experiment We have now seen how to setup a simple glacier and progress it to any year. Now we will move a little bit closer to reality and define a glacier with changing widths. Like many real glaciers the new glacier will be wider at the top (in the accumulation area) and have a constant width below the ELA. We can achieve this by creating a new Bed and instead of specifying the top and bottom altitudes along with the width, we specify altitudes and widths in pairs: Here the first and last values in altitudes and widths correspond to the top/bottom altitude/width. Any values in between will change the shape of the bed further. We use the new bed to create a new glacier We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. The GlacierCollection will be used extensively throughout these notebooks and its functionality will be explained further as we go along. We can get a quick look at the collection by simply calling it Before plotting the glaciers in the collection, we can progress them to the same year with the .progress_to_year() method. We can then plot the collection Similarly to the glacier the collection has a method for easily plotting the histories of the held glaciers.
6,912
6,943
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) bed bed.plot() bed_with_slope = GlacierBed(top=3400, bottom=1500, width=300, slopes=25) bed_with_slope.plot() bed_with_multiple_slopes = GlacierBed(top=3400, bottom=1500, width=300, slopes=[25, 10], # Slope sections are defined by altitude # pairs. Here we have two parirs. slope_sections=[3400, 2200, 1500]) bed_with_multiple_slopes.plot() mass_balance = MassBalance(ela=3000, gradient=4) mass_balance glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier glacier.progress_to_year(1) glacier.plot() glacier glacier.progress_to_year(150) glacier.plot() glacier glacier.progress_to_year(150) glacier.progress_to_year(500) glacier.plot() glacier glacier.progress_to_year(450) mass_balance_2 = MassBalance(ela=2500, gradient=4) glacier_multiple_slopes = Glacier(bed=bed_with_multiple_slopes, mass_balance=mass_balance_2) glacier_multiple_slopes.progress_to_year(400) glacier_multiple_slopes.plot() glacier.history glacier.plot_history() wide_narrow_bed = GlacierBed(altitudes=[3400, 2800, 1500], widths=[600, 300, 300]) wide_narrow_bed wide_narrow_bed.plot() wide_narrow_glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) wide_narrow_glacier collection = GlacierCollection() collection.add([glacier, wide_narrow_glacier]) collection collection.progress_to_year(600) collection.plot() collection.plot_history()
1,723
1,741
2
edu_intro-3
edu_intro-3
Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Let's plot the bed to make sure that it looks like we expect. The bed object has a built in method for this which provide us with a side and top-down view of the glacier domain. For finer control over the bed slope you can pass a single value to slopes during the creation You can also pass a sequence of slope angles in slopes - for this you also need to specify the altitude spans of the sections with the slope_sections argument. There should be one more entry in slope_sections compared to the entries in slopes. The first and last value in slope_sections should match the top and bottom of the glacier. Mass balance For the glacier to grow it needs a mass balance model. The mass balance is responsible for adding snow and removing ice through melt on the glacier. In our case it will be a simple linear mass balance, meaning that it decreases linearly with altitude. The mass balance is defined by the equilibrium line altitude (ELA) and the altitude gradient (in mm yr − 1 m−1). The ELA defines at what altitude the mass balance is zero and the altitude gradient how much the mass balance changes with altitude. More on this in upcoming notebooks! We set the ELA of our glacier to 3000 meters and the altitude gradient to 4 mm yr − 1m−1. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, we can get some statistics about the glacier by simply calling it. However since we just created the glacier, everything will be zero. Progressing the glacier Now the glacier has all the ingredients needed to evolve. Let's first progress the glacier to year 1. And let's take a look at the glacier. As the bed, it has a in method for this. Here we can see that there is thin cover of ice from the top and 4 km down the glacier bed. So the glacier almost reaches the point where the bed intersects the ELA (~4 km). We can also take a look at some of statistics of the glacier again to get some more details: From the statistics we can read that the glacier has a length of 4 km and covers an area of 1.2 km2. The glacier will grow considerably in the upcoming years, and the ice thickness should become apparent even in the altitude - distance plot. Let us progress the glacier to year 150 and take a look. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same statistics about the glacier as before: The glacier length and area has increased by ~20% while the volume has increased by more than 1000%. This is because the glacier has to build enough mass (i.e. ice thickness) before it can begin to flow downhill and increase its length. Note that the glacier is now 150 years old. If we try progressing the glacier to the same year again, nothing will happen. It evens gives us a warning. We can easily progress the glacier even longer: The glaciers has now grown considerably further down our made up mountain, well below the ELA. It is important to note that the model can not progress back in time. Once at year 500, we can not de-age the glacier. Let's do the same with one of the glaciers with a non-linear bed profile! Glacier history This brings us to the glacier history. This is just what it sounds like, a history of the length, volume and area of the glacier. We can access the data through the .history attribute And we can quickly visualise the history of the glacier with the .plot_history() method The glacier length and area has a step in the first year. This has to do with how OGGM internally deals with snow and ice, it does not differentiate between them. And since the mass balance is always positive above the ELA, any snowfall in the first year above the ELA will remain and be classified as part of the glacier, and contribute to the length and area. This is why after the first year, the glacier's length and area remains constant for a few years. In this initial stage, the ice is so thin that any flow bringing ice below the ELA will not be large enough to compensate for the high ablation rate, and any ice melts away. When the ice thickness has increased enough for the ice flow to surpass the ablation rate below the ELA, the glacier length can begin to increase. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume won't change anymore, as long as all physical parameters and the climate stay constant. The Glacier has a method which progress the glacier to equilibrium .progress_to_equilibrium(), more on this in later notebooks. A first experiment We have now seen how to setup a simple glacier and progress it to any year. Now we will move a little bit closer to reality and define a glacier with changing widths. Like many real glaciers the new glacier will be wider at the top (in the accumulation area) and have a constant width below the ELA. We can achieve this by creating a new Bed and instead of specifying the top and bottom altitudes along with the width, we specify altitudes and widths in pairs: Here the first and last values in altitudes and widths correspond to the top/bottom altitude/width. Any values in between will change the shape of the bed further. We use the new bed to create a new glacier We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. The GlacierCollection will be used extensively throughout these notebooks and its functionality will be explained further as we go along. We can get a quick look at the collection by simply calling it Before plotting the glaciers in the collection, we can progress them to the same year with the .progress_to_year() method. We can then plot the collection Similarly to the glacier the collection has a method for easily plotting the histories of the held glaciers.
2,258
2,333
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) bed bed.plot() bed_with_slope = GlacierBed(top=3400, bottom=1500, width=300, slopes=25) bed_with_slope.plot() bed_with_multiple_slopes = GlacierBed(top=3400, bottom=1500, width=300, slopes=[25, 10], # Slope sections are defined by altitude # pairs. Here we have two parirs. slope_sections=[3400, 2200, 1500]) bed_with_multiple_slopes.plot() mass_balance = MassBalance(ela=3000, gradient=4) mass_balance glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier glacier.progress_to_year(1) glacier.plot() glacier glacier.progress_to_year(150) glacier.plot() glacier glacier.progress_to_year(150) glacier.progress_to_year(500) glacier.plot() glacier glacier.progress_to_year(450) mass_balance_2 = MassBalance(ela=2500, gradient=4) glacier_multiple_slopes = Glacier(bed=bed_with_multiple_slopes, mass_balance=mass_balance_2) glacier_multiple_slopes.progress_to_year(400) glacier_multiple_slopes.plot() glacier.history glacier.plot_history() wide_narrow_bed = GlacierBed(altitudes=[3400, 2800, 1500], widths=[600, 300, 300]) wide_narrow_bed wide_narrow_bed.plot() wide_narrow_glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) wide_narrow_glacier collection = GlacierCollection() collection.add([glacier, wide_narrow_glacier]) collection collection.progress_to_year(600) collection.plot() collection.plot_history()
634
683
3
edu_intro-4
edu_intro-4
Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Let's plot the bed to make sure that it looks like we expect. The bed object has a built in method for this which provide us with a side and top-down view of the glacier domain. For finer control over the bed slope you can pass a single value to slopes during the creation You can also pass a sequence of slope angles in slopes - for this you also need to specify the altitude spans of the sections with the slope_sections argument. There should be one more entry in slope_sections compared to the entries in slopes. The first and last value in slope_sections should match the top and bottom of the glacier. Mass balance For the glacier to grow it needs a mass balance model. The mass balance is responsible for adding snow and removing ice through melt on the glacier. In our case it will be a simple linear mass balance, meaning that it decreases linearly with altitude. The mass balance is defined by the equilibrium line altitude (ELA) and the altitude gradient (in mm yr − 1 m−1). The ELA defines at what altitude the mass balance is zero and the altitude gradient how much the mass balance changes with altitude. More on this in upcoming notebooks! We set the ELA of our glacier to 3000 meters and the altitude gradient to 4 mm yr − 1m−1. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, we can get some statistics about the glacier by simply calling it. However since we just created the glacier, everything will be zero. Progressing the glacier Now the glacier has all the ingredients needed to evolve. Let's first progress the glacier to year 1. And let's take a look at the glacier. As the bed, it has a in method for this. Here we can see that there is thin cover of ice from the top and 4 km down the glacier bed. So the glacier almost reaches the point where the bed intersects the ELA (~4 km). We can also take a look at some of statistics of the glacier again to get some more details: From the statistics we can read that the glacier has a length of 4 km and covers an area of 1.2 km2. The glacier will grow considerably in the upcoming years, and the ice thickness should become apparent even in the altitude - distance plot. Let us progress the glacier to year 150 and take a look. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same statistics about the glacier as before: The glacier length and area has increased by ~20% while the volume has increased by more than 1000%. This is because the glacier has to build enough mass (i.e. ice thickness) before it can begin to flow downhill and increase its length. Note that the glacier is now 150 years old. If we try progressing the glacier to the same year again, nothing will happen. It evens gives us a warning. We can easily progress the glacier even longer: The glaciers has now grown considerably further down our made up mountain, well below the ELA. It is important to note that the model can not progress back in time. Once at year 500, we can not de-age the glacier. Let's do the same with one of the glaciers with a non-linear bed profile! Glacier history This brings us to the glacier history. This is just what it sounds like, a history of the length, volume and area of the glacier. We can access the data through the .history attribute And we can quickly visualise the history of the glacier with the .plot_history() method The glacier length and area has a step in the first year. This has to do with how OGGM internally deals with snow and ice, it does not differentiate between them. And since the mass balance is always positive above the ELA, any snowfall in the first year above the ELA will remain and be classified as part of the glacier, and contribute to the length and area. This is why after the first year, the glacier's length and area remains constant for a few years. In this initial stage, the ice is so thin that any flow bringing ice below the ELA will not be large enough to compensate for the high ablation rate, and any ice melts away. When the ice thickness has increased enough for the ice flow to surpass the ablation rate below the ELA, the glacier length can begin to increase. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume won't change anymore, as long as all physical parameters and the climate stay constant. The Glacier has a method which progress the glacier to equilibrium .progress_to_equilibrium(), more on this in later notebooks. A first experiment We have now seen how to setup a simple glacier and progress it to any year. Now we will move a little bit closer to reality and define a glacier with changing widths. Like many real glaciers the new glacier will be wider at the top (in the accumulation area) and have a constant width below the ELA. We can achieve this by creating a new Bed and instead of specifying the top and bottom altitudes along with the width, we specify altitudes and widths in pairs: Here the first and last values in altitudes and widths correspond to the top/bottom altitude/width. Any values in between will change the shape of the bed further. We use the new bed to create a new glacier We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. The GlacierCollection will be used extensively throughout these notebooks and its functionality will be explained further as we go along. We can get a quick look at the collection by simply calling it Before plotting the glaciers in the collection, we can progress them to the same year with the .progress_to_year() method. We can then plot the collection Similarly to the glacier the collection has a method for easily plotting the histories of the held glaciers.
2,736
2,766
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) bed bed.plot() bed_with_slope = GlacierBed(top=3400, bottom=1500, width=300, slopes=25) bed_with_slope.plot() bed_with_multiple_slopes = GlacierBed(top=3400, bottom=1500, width=300, slopes=[25, 10], # Slope sections are defined by altitude # pairs. Here we have two parirs. slope_sections=[3400, 2200, 1500]) bed_with_multiple_slopes.plot() mass_balance = MassBalance(ela=3000, gradient=4) mass_balance glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier glacier.progress_to_year(1) glacier.plot() glacier glacier.progress_to_year(150) glacier.plot() glacier glacier.progress_to_year(150) glacier.progress_to_year(500) glacier.plot() glacier glacier.progress_to_year(450) mass_balance_2 = MassBalance(ela=2500, gradient=4) glacier_multiple_slopes = Glacier(bed=bed_with_multiple_slopes, mass_balance=mass_balance_2) glacier_multiple_slopes.progress_to_year(400) glacier_multiple_slopes.plot() glacier.history glacier.plot_history() wide_narrow_bed = GlacierBed(altitudes=[3400, 2800, 1500], widths=[600, 300, 300]) wide_narrow_bed wide_narrow_bed.plot() wide_narrow_glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) wide_narrow_glacier collection = GlacierCollection() collection.add([glacier, wide_narrow_glacier]) collection collection.progress_to_year(600) collection.plot() collection.plot_history()
766
794
4
edu_intro-5
edu_intro-5
Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Let's plot the bed to make sure that it looks like we expect. The bed object has a built in method for this which provide us with a side and top-down view of the glacier domain. For finer control over the bed slope you can pass a single value to slopes during the creation You can also pass a sequence of slope angles in slopes - for this you also need to specify the altitude spans of the sections with the slope_sections argument. There should be one more entry in slope_sections compared to the entries in slopes. The first and last value in slope_sections should match the top and bottom of the glacier. Mass balance For the glacier to grow it needs a mass balance model. The mass balance is responsible for adding snow and removing ice through melt on the glacier. In our case it will be a simple linear mass balance, meaning that it decreases linearly with altitude. The mass balance is defined by the equilibrium line altitude (ELA) and the altitude gradient (in mm yr − 1 m−1). The ELA defines at what altitude the mass balance is zero and the altitude gradient how much the mass balance changes with altitude. More on this in upcoming notebooks! We set the ELA of our glacier to 3000 meters and the altitude gradient to 4 mm yr − 1m−1. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, we can get some statistics about the glacier by simply calling it. However since we just created the glacier, everything will be zero. Progressing the glacier Now the glacier has all the ingredients needed to evolve. Let's first progress the glacier to year 1. And let's take a look at the glacier. As the bed, it has a in method for this. Here we can see that there is thin cover of ice from the top and 4 km down the glacier bed. So the glacier almost reaches the point where the bed intersects the ELA (~4 km). We can also take a look at some of statistics of the glacier again to get some more details: From the statistics we can read that the glacier has a length of 4 km and covers an area of 1.2 km2. The glacier will grow considerably in the upcoming years, and the ice thickness should become apparent even in the altitude - distance plot. Let us progress the glacier to year 150 and take a look. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same statistics about the glacier as before: The glacier length and area has increased by ~20% while the volume has increased by more than 1000%. This is because the glacier has to build enough mass (i.e. ice thickness) before it can begin to flow downhill and increase its length. Note that the glacier is now 150 years old. If we try progressing the glacier to the same year again, nothing will happen. It evens gives us a warning. We can easily progress the glacier even longer: The glaciers has now grown considerably further down our made up mountain, well below the ELA. It is important to note that the model can not progress back in time. Once at year 500, we can not de-age the glacier. Let's do the same with one of the glaciers with a non-linear bed profile! Glacier history This brings us to the glacier history. This is just what it sounds like, a history of the length, volume and area of the glacier. We can access the data through the .history attribute And we can quickly visualise the history of the glacier with the .plot_history() method The glacier length and area has a step in the first year. This has to do with how OGGM internally deals with snow and ice, it does not differentiate between them. And since the mass balance is always positive above the ELA, any snowfall in the first year above the ELA will remain and be classified as part of the glacier, and contribute to the length and area. This is why after the first year, the glacier's length and area remains constant for a few years. In this initial stage, the ice is so thin that any flow bringing ice below the ELA will not be large enough to compensate for the high ablation rate, and any ice melts away. When the ice thickness has increased enough for the ice flow to surpass the ablation rate below the ELA, the glacier length can begin to increase. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume won't change anymore, as long as all physical parameters and the climate stay constant. The Glacier has a method which progress the glacier to equilibrium .progress_to_equilibrium(), more on this in later notebooks. A first experiment We have now seen how to setup a simple glacier and progress it to any year. Now we will move a little bit closer to reality and define a glacier with changing widths. Like many real glaciers the new glacier will be wider at the top (in the accumulation area) and have a constant width below the ELA. We can achieve this by creating a new Bed and instead of specifying the top and bottom altitudes along with the width, we specify altitudes and widths in pairs: Here the first and last values in altitudes and widths correspond to the top/bottom altitude/width. Any values in between will change the shape of the bed further. We use the new bed to create a new glacier We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. The GlacierCollection will be used extensively throughout these notebooks and its functionality will be explained further as we go along. We can get a quick look at the collection by simply calling it Before plotting the glaciers in the collection, we can progress them to the same year with the .progress_to_year() method. We can then plot the collection Similarly to the glacier the collection has a method for easily plotting the histories of the held glaciers.
6,369
6,411
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) bed bed.plot() bed_with_slope = GlacierBed(top=3400, bottom=1500, width=300, slopes=25) bed_with_slope.plot() bed_with_multiple_slopes = GlacierBed(top=3400, bottom=1500, width=300, slopes=[25, 10], # Slope sections are defined by altitude # pairs. Here we have two parirs. slope_sections=[3400, 2200, 1500]) bed_with_multiple_slopes.plot() mass_balance = MassBalance(ela=3000, gradient=4) mass_balance glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier glacier.progress_to_year(1) glacier.plot() glacier glacier.progress_to_year(150) glacier.plot() glacier glacier.progress_to_year(150) glacier.progress_to_year(500) glacier.plot() glacier glacier.progress_to_year(450) mass_balance_2 = MassBalance(ela=2500, gradient=4) glacier_multiple_slopes = Glacier(bed=bed_with_multiple_slopes, mass_balance=mass_balance_2) glacier_multiple_slopes.progress_to_year(400) glacier_multiple_slopes.plot() glacier.history glacier.plot_history() wide_narrow_bed = GlacierBed(altitudes=[3400, 2800, 1500], widths=[600, 300, 300]) wide_narrow_bed wide_narrow_bed.plot() wide_narrow_glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) wide_narrow_glacier collection = GlacierCollection() collection.add([glacier, wide_narrow_glacier]) collection collection.progress_to_year(600) collection.plot() collection.plot_history()
1,462
1,570
5
edu_intro-6
edu_intro-6
Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Let's plot the bed to make sure that it looks like we expect. The bed object has a built in method for this which provide us with a side and top-down view of the glacier domain. For finer control over the bed slope you can pass a single value to slopes during the creation You can also pass a sequence of slope angles in slopes - for this you also need to specify the altitude spans of the sections with the slope_sections argument. There should be one more entry in slope_sections compared to the entries in slopes. The first and last value in slope_sections should match the top and bottom of the glacier. Mass balance For the glacier to grow it needs a mass balance model. The mass balance is responsible for adding snow and removing ice through melt on the glacier. In our case it will be a simple linear mass balance, meaning that it decreases linearly with altitude. The mass balance is defined by the equilibrium line altitude (ELA) and the altitude gradient (in mm yr − 1 m−1). The ELA defines at what altitude the mass balance is zero and the altitude gradient how much the mass balance changes with altitude. More on this in upcoming notebooks! We set the ELA of our glacier to 3000 meters and the altitude gradient to 4 mm yr − 1m−1. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, we can get some statistics about the glacier by simply calling it. However since we just created the glacier, everything will be zero. Progressing the glacier Now the glacier has all the ingredients needed to evolve. Let's first progress the glacier to year 1. And let's take a look at the glacier. As the bed, it has a in method for this. Here we can see that there is thin cover of ice from the top and 4 km down the glacier bed. So the glacier almost reaches the point where the bed intersects the ELA (~4 km). We can also take a look at some of statistics of the glacier again to get some more details: From the statistics we can read that the glacier has a length of 4 km and covers an area of 1.2 km2. The glacier will grow considerably in the upcoming years, and the ice thickness should become apparent even in the altitude - distance plot. Let us progress the glacier to year 150 and take a look. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same statistics about the glacier as before: The glacier length and area has increased by ~20% while the volume has increased by more than 1000%. This is because the glacier has to build enough mass (i.e. ice thickness) before it can begin to flow downhill and increase its length. Note that the glacier is now 150 years old. If we try progressing the glacier to the same year again, nothing will happen. It evens gives us a warning. We can easily progress the glacier even longer: The glaciers has now grown considerably further down our made up mountain, well below the ELA. It is important to note that the model can not progress back in time. Once at year 500, we can not de-age the glacier. Let's do the same with one of the glaciers with a non-linear bed profile! Glacier history This brings us to the glacier history. This is just what it sounds like, a history of the length, volume and area of the glacier. We can access the data through the .history attribute And we can quickly visualise the history of the glacier with the .plot_history() method The glacier length and area has a step in the first year. This has to do with how OGGM internally deals with snow and ice, it does not differentiate between them. And since the mass balance is always positive above the ELA, any snowfall in the first year above the ELA will remain and be classified as part of the glacier, and contribute to the length and area. This is why after the first year, the glacier's length and area remains constant for a few years. In this initial stage, the ice is so thin that any flow bringing ice below the ELA will not be large enough to compensate for the high ablation rate, and any ice melts away. When the ice thickness has increased enough for the ice flow to surpass the ablation rate below the ELA, the glacier length can begin to increase. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume won't change anymore, as long as all physical parameters and the climate stay constant. The Glacier has a method which progress the glacier to equilibrium .progress_to_equilibrium(), more on this in later notebooks. A first experiment We have now seen how to setup a simple glacier and progress it to any year. Now we will move a little bit closer to reality and define a glacier with changing widths. Like many real glaciers the new glacier will be wider at the top (in the accumulation area) and have a constant width below the ELA. We can achieve this by creating a new Bed and instead of specifying the top and bottom altitudes along with the width, we specify altitudes and widths in pairs: Here the first and last values in altitudes and widths correspond to the top/bottom altitude/width. Any values in between will change the shape of the bed further. We use the new bed to create a new glacier We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. The GlacierCollection will be used extensively throughout these notebooks and its functionality will be explained further as we go along. We can get a quick look at the collection by simply calling it Before plotting the glaciers in the collection, we can progress them to the same year with the .progress_to_year() method. We can then plot the collection Similarly to the glacier the collection has a method for easily plotting the histories of the held glaciers.
1,096
1,157
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) bed bed.plot() bed_with_slope = GlacierBed(top=3400, bottom=1500, width=300, slopes=25) bed_with_slope.plot() bed_with_multiple_slopes = GlacierBed(top=3400, bottom=1500, width=300, slopes=[25, 10], # Slope sections are defined by altitude # pairs. Here we have two parirs. slope_sections=[3400, 2200, 1500]) bed_with_multiple_slopes.plot() mass_balance = MassBalance(ela=3000, gradient=4) mass_balance glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier glacier.progress_to_year(1) glacier.plot() glacier glacier.progress_to_year(150) glacier.plot() glacier glacier.progress_to_year(150) glacier.progress_to_year(500) glacier.plot() glacier glacier.progress_to_year(450) mass_balance_2 = MassBalance(ela=2500, gradient=4) glacier_multiple_slopes = Glacier(bed=bed_with_multiple_slopes, mass_balance=mass_balance_2) glacier_multiple_slopes.progress_to_year(400) glacier_multiple_slopes.plot() glacier.history glacier.plot_history() wide_narrow_bed = GlacierBed(altitudes=[3400, 2800, 1500], widths=[600, 300, 300]) wide_narrow_bed wide_narrow_bed.plot() wide_narrow_glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) wide_narrow_glacier collection = GlacierCollection() collection.add([glacier, wide_narrow_glacier]) collection collection.progress_to_year(600) collection.plot() collection.plot_history()
138
149
6
edu_intro-7
edu_intro-7
Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Let's plot the bed to make sure that it looks like we expect. The bed object has a built in method for this which provide us with a side and top-down view of the glacier domain. For finer control over the bed slope you can pass a single value to slopes during the creation You can also pass a sequence of slope angles in slopes - for this you also need to specify the altitude spans of the sections with the slope_sections argument. There should be one more entry in slope_sections compared to the entries in slopes. The first and last value in slope_sections should match the top and bottom of the glacier. Mass balance For the glacier to grow it needs a mass balance model. The mass balance is responsible for adding snow and removing ice through melt on the glacier. In our case it will be a simple linear mass balance, meaning that it decreases linearly with altitude. The mass balance is defined by the equilibrium line altitude (ELA) and the altitude gradient (in mm yr − 1 m−1). The ELA defines at what altitude the mass balance is zero and the altitude gradient how much the mass balance changes with altitude. More on this in upcoming notebooks! We set the ELA of our glacier to 3000 meters and the altitude gradient to 4 mm yr − 1m−1. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, we can get some statistics about the glacier by simply calling it. However since we just created the glacier, everything will be zero. Progressing the glacier Now the glacier has all the ingredients needed to evolve. Let's first progress the glacier to year 1. And let's take a look at the glacier. As the bed, it has a in method for this. Here we can see that there is thin cover of ice from the top and 4 km down the glacier bed. So the glacier almost reaches the point where the bed intersects the ELA (~4 km). We can also take a look at some of statistics of the glacier again to get some more details: From the statistics we can read that the glacier has a length of 4 km and covers an area of 1.2 km2. The glacier will grow considerably in the upcoming years, and the ice thickness should become apparent even in the altitude - distance plot. Let us progress the glacier to year 150 and take a look. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same statistics about the glacier as before: The glacier length and area has increased by ~20% while the volume has increased by more than 1000%. This is because the glacier has to build enough mass (i.e. ice thickness) before it can begin to flow downhill and increase its length. Note that the glacier is now 150 years old. If we try progressing the glacier to the same year again, nothing will happen. It evens gives us a warning. We can easily progress the glacier even longer: The glaciers has now grown considerably further down our made up mountain, well below the ELA. It is important to note that the model can not progress back in time. Once at year 500, we can not de-age the glacier. Let's do the same with one of the glaciers with a non-linear bed profile! Glacier history This brings us to the glacier history. This is just what it sounds like, a history of the length, volume and area of the glacier. We can access the data through the .history attribute And we can quickly visualise the history of the glacier with the .plot_history() method The glacier length and area has a step in the first year. This has to do with how OGGM internally deals with snow and ice, it does not differentiate between them. And since the mass balance is always positive above the ELA, any snowfall in the first year above the ELA will remain and be classified as part of the glacier, and contribute to the length and area. This is why after the first year, the glacier's length and area remains constant for a few years. In this initial stage, the ice is so thin that any flow bringing ice below the ELA will not be large enough to compensate for the high ablation rate, and any ice melts away. When the ice thickness has increased enough for the ice flow to surpass the ablation rate below the ELA, the glacier length can begin to increase. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume won't change anymore, as long as all physical parameters and the climate stay constant. The Glacier has a method which progress the glacier to equilibrium .progress_to_equilibrium(), more on this in later notebooks. A first experiment We have now seen how to setup a simple glacier and progress it to any year. Now we will move a little bit closer to reality and define a glacier with changing widths. Like many real glaciers the new glacier will be wider at the top (in the accumulation area) and have a constant width below the ELA. We can achieve this by creating a new Bed and instead of specifying the top and bottom altitudes along with the width, we specify altitudes and widths in pairs: Here the first and last values in altitudes and widths correspond to the top/bottom altitude/width. Any values in between will change the shape of the bed further. We use the new bed to create a new glacier We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. The GlacierCollection will be used extensively throughout these notebooks and its functionality will be explained further as we go along. We can get a quick look at the collection by simply calling it Before plotting the glaciers in the collection, we can progress them to the same year with the .progress_to_year() method. We can then plot the collection Similarly to the glacier the collection has a method for easily plotting the histories of the held glaciers.
3,366
3,414
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) bed bed.plot() bed_with_slope = GlacierBed(top=3400, bottom=1500, width=300, slopes=25) bed_with_slope.plot() bed_with_multiple_slopes = GlacierBed(top=3400, bottom=1500, width=300, slopes=[25, 10], # Slope sections are defined by altitude # pairs. Here we have two parirs. slope_sections=[3400, 2200, 1500]) bed_with_multiple_slopes.plot() mass_balance = MassBalance(ela=3000, gradient=4) mass_balance glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier glacier.progress_to_year(1) glacier.plot() glacier glacier.progress_to_year(150) glacier.plot() glacier glacier.progress_to_year(150) glacier.progress_to_year(500) glacier.plot() glacier glacier.progress_to_year(450) mass_balance_2 = MassBalance(ela=2500, gradient=4) glacier_multiple_slopes = Glacier(bed=bed_with_multiple_slopes, mass_balance=mass_balance_2) glacier_multiple_slopes.progress_to_year(400) glacier_multiple_slopes.plot() glacier.history glacier.plot_history() wide_narrow_bed = GlacierBed(altitudes=[3400, 2800, 1500], widths=[600, 300, 300]) wide_narrow_bed wide_narrow_bed.plot() wide_narrow_glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) wide_narrow_glacier collection = GlacierCollection() collection.add([glacier, wide_narrow_glacier]) collection collection.progress_to_year(600) collection.plot() collection.plot_history()
823
869
7
edu_intro-8
edu_intro-8
Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Let's plot the bed to make sure that it looks like we expect. The bed object has a built in method for this which provide us with a side and top-down view of the glacier domain. For finer control over the bed slope you can pass a single value to slopes during the creation You can also pass a sequence of slope angles in slopes - for this you also need to specify the altitude spans of the sections with the slope_sections argument. There should be one more entry in slope_sections compared to the entries in slopes. The first and last value in slope_sections should match the top and bottom of the glacier. Mass balance For the glacier to grow it needs a mass balance model. The mass balance is responsible for adding snow and removing ice through melt on the glacier. In our case it will be a simple linear mass balance, meaning that it decreases linearly with altitude. The mass balance is defined by the equilibrium line altitude (ELA) and the altitude gradient (in mm yr − 1 m−1). The ELA defines at what altitude the mass balance is zero and the altitude gradient how much the mass balance changes with altitude. More on this in upcoming notebooks! We set the ELA of our glacier to 3000 meters and the altitude gradient to 4 mm yr − 1m−1. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, we can get some statistics about the glacier by simply calling it. However since we just created the glacier, everything will be zero. Progressing the glacier Now the glacier has all the ingredients needed to evolve. Let's first progress the glacier to year 1. And let's take a look at the glacier. As the bed, it has a in method for this. Here we can see that there is thin cover of ice from the top and 4 km down the glacier bed. So the glacier almost reaches the point where the bed intersects the ELA (~4 km). We can also take a look at some of statistics of the glacier again to get some more details: From the statistics we can read that the glacier has a length of 4 km and covers an area of 1.2 km2. The glacier will grow considerably in the upcoming years, and the ice thickness should become apparent even in the altitude - distance plot. Let us progress the glacier to year 150 and take a look. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same statistics about the glacier as before: The glacier length and area has increased by ~20% while the volume has increased by more than 1000%. This is because the glacier has to build enough mass (i.e. ice thickness) before it can begin to flow downhill and increase its length. Note that the glacier is now 150 years old. If we try progressing the glacier to the same year again, nothing will happen. It evens gives us a warning. We can easily progress the glacier even longer: The glaciers has now grown considerably further down our made up mountain, well below the ELA. It is important to note that the model can not progress back in time. Once at year 500, we can not de-age the glacier. Let's do the same with one of the glaciers with a non-linear bed profile! Glacier history This brings us to the glacier history. This is just what it sounds like, a history of the length, volume and area of the glacier. We can access the data through the .history attribute And we can quickly visualise the history of the glacier with the .plot_history() method The glacier length and area has a step in the first year. This has to do with how OGGM internally deals with snow and ice, it does not differentiate between them. And since the mass balance is always positive above the ELA, any snowfall in the first year above the ELA will remain and be classified as part of the glacier, and contribute to the length and area. This is why after the first year, the glacier's length and area remains constant for a few years. In this initial stage, the ice is so thin that any flow bringing ice below the ELA will not be large enough to compensate for the high ablation rate, and any ice melts away. When the ice thickness has increased enough for the ice flow to surpass the ablation rate below the ELA, the glacier length can begin to increase. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume won't change anymore, as long as all physical parameters and the climate stay constant. The Glacier has a method which progress the glacier to equilibrium .progress_to_equilibrium(), more on this in later notebooks. A first experiment We have now seen how to setup a simple glacier and progress it to any year. Now we will move a little bit closer to reality and define a glacier with changing widths. Like many real glaciers the new glacier will be wider at the top (in the accumulation area) and have a constant width below the ELA. We can achieve this by creating a new Bed and instead of specifying the top and bottom altitudes along with the width, we specify altitudes and widths in pairs: Here the first and last values in altitudes and widths correspond to the top/bottom altitude/width. Any values in between will change the shape of the bed further. We use the new bed to create a new glacier We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. The GlacierCollection will be used extensively throughout these notebooks and its functionality will be explained further as we go along. We can get a quick look at the collection by simply calling it Before plotting the glaciers in the collection, we can progress them to the same year with the .progress_to_year() method. We can then plot the collection Similarly to the glacier the collection has a method for easily plotting the histories of the held glaciers.
1,275
1,369
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) bed bed.plot() bed_with_slope = GlacierBed(top=3400, bottom=1500, width=300, slopes=25) bed_with_slope.plot() bed_with_multiple_slopes = GlacierBed(top=3400, bottom=1500, width=300, slopes=[25, 10], # Slope sections are defined by altitude # pairs. Here we have two parirs. slope_sections=[3400, 2200, 1500]) bed_with_multiple_slopes.plot() mass_balance = MassBalance(ela=3000, gradient=4) mass_balance glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier glacier.progress_to_year(1) glacier.plot() glacier glacier.progress_to_year(150) glacier.plot() glacier glacier.progress_to_year(150) glacier.progress_to_year(500) glacier.plot() glacier glacier.progress_to_year(450) mass_balance_2 = MassBalance(ela=2500, gradient=4) glacier_multiple_slopes = Glacier(bed=bed_with_multiple_slopes, mass_balance=mass_balance_2) glacier_multiple_slopes.progress_to_year(400) glacier_multiple_slopes.plot() glacier.history glacier.plot_history() wide_narrow_bed = GlacierBed(altitudes=[3400, 2800, 1500], widths=[600, 300, 300]) wide_narrow_bed wide_narrow_bed.plot() wide_narrow_glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) wide_narrow_glacier collection = GlacierCollection() collection.add([glacier, wide_narrow_glacier]) collection collection.progress_to_year(600) collection.plot() collection.plot_history()
152
225
8
edu_intro-9
edu_intro-9
Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Let's plot the bed to make sure that it looks like we expect. The bed object has a built in method for this which provide us with a side and top-down view of the glacier domain. For finer control over the bed slope you can pass a single value to slopes during the creation You can also pass a sequence of slope angles in slopes - for this you also need to specify the altitude spans of the sections with the slope_sections argument. There should be one more entry in slope_sections compared to the entries in slopes. The first and last value in slope_sections should match the top and bottom of the glacier. Mass balance For the glacier to grow it needs a mass balance model. The mass balance is responsible for adding snow and removing ice through melt on the glacier. In our case it will be a simple linear mass balance, meaning that it decreases linearly with altitude. The mass balance is defined by the equilibrium line altitude (ELA) and the altitude gradient (in mm yr − 1 m−1). The ELA defines at what altitude the mass balance is zero and the altitude gradient how much the mass balance changes with altitude. More on this in upcoming notebooks! We set the ELA of our glacier to 3000 meters and the altitude gradient to 4 mm yr − 1m−1. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, we can get some statistics about the glacier by simply calling it. However since we just created the glacier, everything will be zero. Progressing the glacier Now the glacier has all the ingredients needed to evolve. Let's first progress the glacier to year 1. And let's take a look at the glacier. As the bed, it has a in method for this. Here we can see that there is thin cover of ice from the top and 4 km down the glacier bed. So the glacier almost reaches the point where the bed intersects the ELA (~4 km). We can also take a look at some of statistics of the glacier again to get some more details: From the statistics we can read that the glacier has a length of 4 km and covers an area of 1.2 km2. The glacier will grow considerably in the upcoming years, and the ice thickness should become apparent even in the altitude - distance plot. Let us progress the glacier to year 150 and take a look. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same statistics about the glacier as before: The glacier length and area has increased by ~20% while the volume has increased by more than 1000%. This is because the glacier has to build enough mass (i.e. ice thickness) before it can begin to flow downhill and increase its length. Note that the glacier is now 150 years old. If we try progressing the glacier to the same year again, nothing will happen. It evens gives us a warning. We can easily progress the glacier even longer: The glaciers has now grown considerably further down our made up mountain, well below the ELA. It is important to note that the model can not progress back in time. Once at year 500, we can not de-age the glacier. Let's do the same with one of the glaciers with a non-linear bed profile! Glacier history This brings us to the glacier history. This is just what it sounds like, a history of the length, volume and area of the glacier. We can access the data through the .history attribute And we can quickly visualise the history of the glacier with the .plot_history() method The glacier length and area has a step in the first year. This has to do with how OGGM internally deals with snow and ice, it does not differentiate between them. And since the mass balance is always positive above the ELA, any snowfall in the first year above the ELA will remain and be classified as part of the glacier, and contribute to the length and area. This is why after the first year, the glacier's length and area remains constant for a few years. In this initial stage, the ice is so thin that any flow bringing ice below the ELA will not be large enough to compensate for the high ablation rate, and any ice melts away. When the ice thickness has increased enough for the ice flow to surpass the ablation rate below the ELA, the glacier length can begin to increase. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume won't change anymore, as long as all physical parameters and the climate stay constant. The Glacier has a method which progress the glacier to equilibrium .progress_to_equilibrium(), more on this in later notebooks. A first experiment We have now seen how to setup a simple glacier and progress it to any year. Now we will move a little bit closer to reality and define a glacier with changing widths. Like many real glaciers the new glacier will be wider at the top (in the accumulation area) and have a constant width below the ELA. We can achieve this by creating a new Bed and instead of specifying the top and bottom altitudes along with the width, we specify altitudes and widths in pairs: Here the first and last values in altitudes and widths correspond to the top/bottom altitude/width. Any values in between will change the shape of the bed further. We use the new bed to create a new glacier We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. The GlacierCollection will be used extensively throughout these notebooks and its functionality will be explained further as we go along. We can get a quick look at the collection by simply calling it Before plotting the glaciers in the collection, we can progress them to the same year with the .progress_to_year() method. We can then plot the collection Similarly to the glacier the collection has a method for easily plotting the histories of the held glaciers.
3,974
4,006
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) bed bed.plot() bed_with_slope = GlacierBed(top=3400, bottom=1500, width=300, slopes=25) bed_with_slope.plot() bed_with_multiple_slopes = GlacierBed(top=3400, bottom=1500, width=300, slopes=[25, 10], # Slope sections are defined by altitude # pairs. Here we have two parirs. slope_sections=[3400, 2200, 1500]) bed_with_multiple_slopes.plot() mass_balance = MassBalance(ela=3000, gradient=4) mass_balance glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier glacier.progress_to_year(1) glacier.plot() glacier glacier.progress_to_year(150) glacier.plot() glacier glacier.progress_to_year(150) glacier.progress_to_year(500) glacier.plot() glacier glacier.progress_to_year(450) mass_balance_2 = MassBalance(ela=2500, gradient=4) glacier_multiple_slopes = Glacier(bed=bed_with_multiple_slopes, mass_balance=mass_balance_2) glacier_multiple_slopes.progress_to_year(400) glacier_multiple_slopes.plot() glacier.history glacier.plot_history() wide_narrow_bed = GlacierBed(altitudes=[3400, 2800, 1500], widths=[600, 300, 300]) wide_narrow_bed wide_narrow_bed.plot() wide_narrow_glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) wide_narrow_glacier collection = GlacierCollection() collection.add([glacier, wide_narrow_glacier]) collection collection.progress_to_year(600) collection.plot() collection.plot_history()
913
943
9
edu_intro-10
edu_intro-10
Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Let's plot the bed to make sure that it looks like we expect. The bed object has a built in method for this which provide us with a side and top-down view of the glacier domain. For finer control over the bed slope you can pass a single value to slopes during the creation You can also pass a sequence of slope angles in slopes - for this you also need to specify the altitude spans of the sections with the slope_sections argument. There should be one more entry in slope_sections compared to the entries in slopes. The first and last value in slope_sections should match the top and bottom of the glacier. Mass balance For the glacier to grow it needs a mass balance model. The mass balance is responsible for adding snow and removing ice through melt on the glacier. In our case it will be a simple linear mass balance, meaning that it decreases linearly with altitude. The mass balance is defined by the equilibrium line altitude (ELA) and the altitude gradient (in mm yr − 1 m−1). The ELA defines at what altitude the mass balance is zero and the altitude gradient how much the mass balance changes with altitude. More on this in upcoming notebooks! We set the ELA of our glacier to 3000 meters and the altitude gradient to 4 mm yr − 1m−1. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, we can get some statistics about the glacier by simply calling it. However since we just created the glacier, everything will be zero. Progressing the glacier Now the glacier has all the ingredients needed to evolve. Let's first progress the glacier to year 1. And let's take a look at the glacier. As the bed, it has a in method for this. Here we can see that there is thin cover of ice from the top and 4 km down the glacier bed. So the glacier almost reaches the point where the bed intersects the ELA (~4 km). We can also take a look at some of statistics of the glacier again to get some more details: From the statistics we can read that the glacier has a length of 4 km and covers an area of 1.2 km2. The glacier will grow considerably in the upcoming years, and the ice thickness should become apparent even in the altitude - distance plot. Let us progress the glacier to year 150 and take a look. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same statistics about the glacier as before: The glacier length and area has increased by ~20% while the volume has increased by more than 1000%. This is because the glacier has to build enough mass (i.e. ice thickness) before it can begin to flow downhill and increase its length. Note that the glacier is now 150 years old. If we try progressing the glacier to the same year again, nothing will happen. It evens gives us a warning. We can easily progress the glacier even longer: The glaciers has now grown considerably further down our made up mountain, well below the ELA. It is important to note that the model can not progress back in time. Once at year 500, we can not de-age the glacier. Let's do the same with one of the glaciers with a non-linear bed profile! Glacier history This brings us to the glacier history. This is just what it sounds like, a history of the length, volume and area of the glacier. We can access the data through the .history attribute And we can quickly visualise the history of the glacier with the .plot_history() method The glacier length and area has a step in the first year. This has to do with how OGGM internally deals with snow and ice, it does not differentiate between them. And since the mass balance is always positive above the ELA, any snowfall in the first year above the ELA will remain and be classified as part of the glacier, and contribute to the length and area. This is why after the first year, the glacier's length and area remains constant for a few years. In this initial stage, the ice is so thin that any flow bringing ice below the ELA will not be large enough to compensate for the high ablation rate, and any ice melts away. When the ice thickness has increased enough for the ice flow to surpass the ablation rate below the ELA, the glacier length can begin to increase. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume won't change anymore, as long as all physical parameters and the climate stay constant. The Glacier has a method which progress the glacier to equilibrium .progress_to_equilibrium(), more on this in later notebooks. A first experiment We have now seen how to setup a simple glacier and progress it to any year. Now we will move a little bit closer to reality and define a glacier with changing widths. Like many real glaciers the new glacier will be wider at the top (in the accumulation area) and have a constant width below the ELA. We can achieve this by creating a new Bed and instead of specifying the top and bottom altitudes along with the width, we specify altitudes and widths in pairs: Here the first and last values in altitudes and widths correspond to the top/bottom altitude/width. Any values in between will change the shape of the bed further. We use the new bed to create a new glacier We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. The GlacierCollection will be used extensively throughout these notebooks and its functionality will be explained further as we go along. We can get a quick look at the collection by simply calling it Before plotting the glaciers in the collection, we can progress them to the same year with the .progress_to_year() method. We can then plot the collection Similarly to the glacier the collection has a method for easily plotting the histories of the held glaciers.
6,724
6,786
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) bed bed.plot() bed_with_slope = GlacierBed(top=3400, bottom=1500, width=300, slopes=25) bed_with_slope.plot() bed_with_multiple_slopes = GlacierBed(top=3400, bottom=1500, width=300, slopes=[25, 10], # Slope sections are defined by altitude # pairs. Here we have two parirs. slope_sections=[3400, 2200, 1500]) bed_with_multiple_slopes.plot() mass_balance = MassBalance(ela=3000, gradient=4) mass_balance glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier glacier.progress_to_year(1) glacier.plot() glacier glacier.progress_to_year(150) glacier.plot() glacier glacier.progress_to_year(150) glacier.progress_to_year(500) glacier.plot() glacier glacier.progress_to_year(450) mass_balance_2 = MassBalance(ela=2500, gradient=4) glacier_multiple_slopes = Glacier(bed=bed_with_multiple_slopes, mass_balance=mass_balance_2) glacier_multiple_slopes.progress_to_year(400) glacier_multiple_slopes.plot() glacier.history glacier.plot_history() wide_narrow_bed = GlacierBed(altitudes=[3400, 2800, 1500], widths=[600, 300, 300]) wide_narrow_bed wide_narrow_bed.plot() wide_narrow_glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) wide_narrow_glacier collection = GlacierCollection() collection.add([glacier, wide_narrow_glacier]) collection collection.progress_to_year(600) collection.plot() collection.plot_history()
1,675
1,686
10
edu_intro-11
edu_intro-11
Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Let's plot the bed to make sure that it looks like we expect. The bed object has a built in method for this which provide us with a side and top-down view of the glacier domain. For finer control over the bed slope you can pass a single value to slopes during the creation You can also pass a sequence of slope angles in slopes - for this you also need to specify the altitude spans of the sections with the slope_sections argument. There should be one more entry in slope_sections compared to the entries in slopes. The first and last value in slope_sections should match the top and bottom of the glacier. Mass balance For the glacier to grow it needs a mass balance model. The mass balance is responsible for adding snow and removing ice through melt on the glacier. In our case it will be a simple linear mass balance, meaning that it decreases linearly with altitude. The mass balance is defined by the equilibrium line altitude (ELA) and the altitude gradient (in mm yr − 1 m−1). The ELA defines at what altitude the mass balance is zero and the altitude gradient how much the mass balance changes with altitude. More on this in upcoming notebooks! We set the ELA of our glacier to 3000 meters and the altitude gradient to 4 mm yr − 1m−1. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, we can get some statistics about the glacier by simply calling it. However since we just created the glacier, everything will be zero. Progressing the glacier Now the glacier has all the ingredients needed to evolve. Let's first progress the glacier to year 1. And let's take a look at the glacier. As the bed, it has a in method for this. Here we can see that there is thin cover of ice from the top and 4 km down the glacier bed. So the glacier almost reaches the point where the bed intersects the ELA (~4 km). We can also take a look at some of statistics of the glacier again to get some more details: From the statistics we can read that the glacier has a length of 4 km and covers an area of 1.2 km2. The glacier will grow considerably in the upcoming years, and the ice thickness should become apparent even in the altitude - distance plot. Let us progress the glacier to year 150 and take a look. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same statistics about the glacier as before: The glacier length and area has increased by ~20% while the volume has increased by more than 1000%. This is because the glacier has to build enough mass (i.e. ice thickness) before it can begin to flow downhill and increase its length. Note that the glacier is now 150 years old. If we try progressing the glacier to the same year again, nothing will happen. It evens gives us a warning. We can easily progress the glacier even longer: The glaciers has now grown considerably further down our made up mountain, well below the ELA. It is important to note that the model can not progress back in time. Once at year 500, we can not de-age the glacier. Let's do the same with one of the glaciers with a non-linear bed profile! Glacier history This brings us to the glacier history. This is just what it sounds like, a history of the length, volume and area of the glacier. We can access the data through the .history attribute And we can quickly visualise the history of the glacier with the .plot_history() method The glacier length and area has a step in the first year. This has to do with how OGGM internally deals with snow and ice, it does not differentiate between them. And since the mass balance is always positive above the ELA, any snowfall in the first year above the ELA will remain and be classified as part of the glacier, and contribute to the length and area. This is why after the first year, the glacier's length and area remains constant for a few years. In this initial stage, the ice is so thin that any flow bringing ice below the ELA will not be large enough to compensate for the high ablation rate, and any ice melts away. When the ice thickness has increased enough for the ice flow to surpass the ablation rate below the ELA, the glacier length can begin to increase. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume won't change anymore, as long as all physical parameters and the climate stay constant. The Glacier has a method which progress the glacier to equilibrium .progress_to_equilibrium(), more on this in later notebooks. A first experiment We have now seen how to setup a simple glacier and progress it to any year. Now we will move a little bit closer to reality and define a glacier with changing widths. Like many real glaciers the new glacier will be wider at the top (in the accumulation area) and have a constant width below the ELA. We can achieve this by creating a new Bed and instead of specifying the top and bottom altitudes along with the width, we specify altitudes and widths in pairs: Here the first and last values in altitudes and widths correspond to the top/bottom altitude/width. Any values in between will change the shape of the bed further. We use the new bed to create a new glacier We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. The GlacierCollection will be used extensively throughout these notebooks and its functionality will be explained further as we go along. We can get a quick look at the collection by simply calling it Before plotting the glaciers in the collection, we can progress them to the same year with the .progress_to_year() method. We can then plot the collection Similarly to the glacier the collection has a method for easily plotting the histories of the held glaciers.
6,788
6,909
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) bed bed.plot() bed_with_slope = GlacierBed(top=3400, bottom=1500, width=300, slopes=25) bed_with_slope.plot() bed_with_multiple_slopes = GlacierBed(top=3400, bottom=1500, width=300, slopes=[25, 10], # Slope sections are defined by altitude # pairs. Here we have two parirs. slope_sections=[3400, 2200, 1500]) bed_with_multiple_slopes.plot() mass_balance = MassBalance(ela=3000, gradient=4) mass_balance glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier glacier.progress_to_year(1) glacier.plot() glacier glacier.progress_to_year(150) glacier.plot() glacier glacier.progress_to_year(150) glacier.progress_to_year(500) glacier.plot() glacier glacier.progress_to_year(450) mass_balance_2 = MassBalance(ela=2500, gradient=4) glacier_multiple_slopes = Glacier(bed=bed_with_multiple_slopes, mass_balance=mass_balance_2) glacier_multiple_slopes.progress_to_year(400) glacier_multiple_slopes.plot() glacier.history glacier.plot_history() wide_narrow_bed = GlacierBed(altitudes=[3400, 2800, 1500], widths=[600, 300, 300]) wide_narrow_bed wide_narrow_bed.plot() wide_narrow_glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) wide_narrow_glacier collection = GlacierCollection() collection.add([glacier, wide_narrow_glacier]) collection collection.progress_to_year(600) collection.plot() collection.plot_history()
1,688
1,721
11
edu_intro-12
edu_intro-12
Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Let's plot the bed to make sure that it looks like we expect. The bed object has a built in method for this which provide us with a side and top-down view of the glacier domain. For finer control over the bed slope you can pass a single value to slopes during the creation You can also pass a sequence of slope angles in slopes - for this you also need to specify the altitude spans of the sections with the slope_sections argument. There should be one more entry in slope_sections compared to the entries in slopes. The first and last value in slope_sections should match the top and bottom of the glacier. Mass balance For the glacier to grow it needs a mass balance model. The mass balance is responsible for adding snow and removing ice through melt on the glacier. In our case it will be a simple linear mass balance, meaning that it decreases linearly with altitude. The mass balance is defined by the equilibrium line altitude (ELA) and the altitude gradient (in mm yr − 1 m−1). The ELA defines at what altitude the mass balance is zero and the altitude gradient how much the mass balance changes with altitude. More on this in upcoming notebooks! We set the ELA of our glacier to 3000 meters and the altitude gradient to 4 mm yr − 1m−1. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, we can get some statistics about the glacier by simply calling it. However since we just created the glacier, everything will be zero. Progressing the glacier Now the glacier has all the ingredients needed to evolve. Let's first progress the glacier to year 1. And let's take a look at the glacier. As the bed, it has a in method for this. Here we can see that there is thin cover of ice from the top and 4 km down the glacier bed. So the glacier almost reaches the point where the bed intersects the ELA (~4 km). We can also take a look at some of statistics of the glacier again to get some more details: From the statistics we can read that the glacier has a length of 4 km and covers an area of 1.2 km2. The glacier will grow considerably in the upcoming years, and the ice thickness should become apparent even in the altitude - distance plot. Let us progress the glacier to year 150 and take a look. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same statistics about the glacier as before: The glacier length and area has increased by ~20% while the volume has increased by more than 1000%. This is because the glacier has to build enough mass (i.e. ice thickness) before it can begin to flow downhill and increase its length. Note that the glacier is now 150 years old. If we try progressing the glacier to the same year again, nothing will happen. It evens gives us a warning. We can easily progress the glacier even longer: The glaciers has now grown considerably further down our made up mountain, well below the ELA. It is important to note that the model can not progress back in time. Once at year 500, we can not de-age the glacier. Let's do the same with one of the glaciers with a non-linear bed profile! Glacier history This brings us to the glacier history. This is just what it sounds like, a history of the length, volume and area of the glacier. We can access the data through the .history attribute And we can quickly visualise the history of the glacier with the .plot_history() method The glacier length and area has a step in the first year. This has to do with how OGGM internally deals with snow and ice, it does not differentiate between them. And since the mass balance is always positive above the ELA, any snowfall in the first year above the ELA will remain and be classified as part of the glacier, and contribute to the length and area. This is why after the first year, the glacier's length and area remains constant for a few years. In this initial stage, the ice is so thin that any flow bringing ice below the ELA will not be large enough to compensate for the high ablation rate, and any ice melts away. When the ice thickness has increased enough for the ice flow to surpass the ablation rate below the ELA, the glacier length can begin to increase. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume won't change anymore, as long as all physical parameters and the climate stay constant. The Glacier has a method which progress the glacier to equilibrium .progress_to_equilibrium(), more on this in later notebooks. A first experiment We have now seen how to setup a simple glacier and progress it to any year. Now we will move a little bit closer to reality and define a glacier with changing widths. Like many real glaciers the new glacier will be wider at the top (in the accumulation area) and have a constant width below the ELA. We can achieve this by creating a new Bed and instead of specifying the top and bottom altitudes along with the width, we specify altitudes and widths in pairs: Here the first and last values in altitudes and widths correspond to the top/bottom altitude/width. Any values in between will change the shape of the bed further. We use the new bed to create a new glacier We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. The GlacierCollection will be used extensively throughout these notebooks and its functionality will be explained further as we go along. We can get a quick look at the collection by simply calling it Before plotting the glaciers in the collection, we can progress them to the same year with the .progress_to_year() method. We can then plot the collection Similarly to the glacier the collection has a method for easily plotting the histories of the held glaciers.
6,065
6,201
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) bed bed.plot() bed_with_slope = GlacierBed(top=3400, bottom=1500, width=300, slopes=25) bed_with_slope.plot() bed_with_multiple_slopes = GlacierBed(top=3400, bottom=1500, width=300, slopes=[25, 10], # Slope sections are defined by altitude # pairs. Here we have two parirs. slope_sections=[3400, 2200, 1500]) bed_with_multiple_slopes.plot() mass_balance = MassBalance(ela=3000, gradient=4) mass_balance glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier glacier.progress_to_year(1) glacier.plot() glacier glacier.progress_to_year(150) glacier.plot() glacier glacier.progress_to_year(150) glacier.progress_to_year(500) glacier.plot() glacier glacier.progress_to_year(450) mass_balance_2 = MassBalance(ela=2500, gradient=4) glacier_multiple_slopes = Glacier(bed=bed_with_multiple_slopes, mass_balance=mass_balance_2) glacier_multiple_slopes.progress_to_year(400) glacier_multiple_slopes.plot() glacier.history glacier.plot_history() wide_narrow_bed = GlacierBed(altitudes=[3400, 2800, 1500], widths=[600, 300, 300]) wide_narrow_bed wide_narrow_bed.plot() wide_narrow_glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) wide_narrow_glacier collection = GlacierCollection() collection.add([glacier, wide_narrow_glacier]) collection collection.progress_to_year(600) collection.plot() collection.plot_history()
1,306
1,418
12
edu_intro-13
edu_intro-13
Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Let's plot the bed to make sure that it looks like we expect. The bed object has a built in method for this which provide us with a side and top-down view of the glacier domain. For finer control over the bed slope you can pass a single value to slopes during the creation You can also pass a sequence of slope angles in slopes - for this you also need to specify the altitude spans of the sections with the slope_sections argument. There should be one more entry in slope_sections compared to the entries in slopes. The first and last value in slope_sections should match the top and bottom of the glacier. Mass balance For the glacier to grow it needs a mass balance model. The mass balance is responsible for adding snow and removing ice through melt on the glacier. In our case it will be a simple linear mass balance, meaning that it decreases linearly with altitude. The mass balance is defined by the equilibrium line altitude (ELA) and the altitude gradient (in mm yr − 1 m−1). The ELA defines at what altitude the mass balance is zero and the altitude gradient how much the mass balance changes with altitude. More on this in upcoming notebooks! We set the ELA of our glacier to 3000 meters and the altitude gradient to 4 mm yr − 1m−1. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, we can get some statistics about the glacier by simply calling it. However since we just created the glacier, everything will be zero. Progressing the glacier Now the glacier has all the ingredients needed to evolve. Let's first progress the glacier to year 1. And let's take a look at the glacier. As the bed, it has a in method for this. Here we can see that there is thin cover of ice from the top and 4 km down the glacier bed. So the glacier almost reaches the point where the bed intersects the ELA (~4 km). We can also take a look at some of statistics of the glacier again to get some more details: From the statistics we can read that the glacier has a length of 4 km and covers an area of 1.2 km2. The glacier will grow considerably in the upcoming years, and the ice thickness should become apparent even in the altitude - distance plot. Let us progress the glacier to year 150 and take a look. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same statistics about the glacier as before: The glacier length and area has increased by ~20% while the volume has increased by more than 1000%. This is because the glacier has to build enough mass (i.e. ice thickness) before it can begin to flow downhill and increase its length. Note that the glacier is now 150 years old. If we try progressing the glacier to the same year again, nothing will happen. It evens gives us a warning. We can easily progress the glacier even longer: The glaciers has now grown considerably further down our made up mountain, well below the ELA. It is important to note that the model can not progress back in time. Once at year 500, we can not de-age the glacier. Let's do the same with one of the glaciers with a non-linear bed profile! Glacier history This brings us to the glacier history. This is just what it sounds like, a history of the length, volume and area of the glacier. We can access the data through the .history attribute And we can quickly visualise the history of the glacier with the .plot_history() method The glacier length and area has a step in the first year. This has to do with how OGGM internally deals with snow and ice, it does not differentiate between them. And since the mass balance is always positive above the ELA, any snowfall in the first year above the ELA will remain and be classified as part of the glacier, and contribute to the length and area. This is why after the first year, the glacier's length and area remains constant for a few years. In this initial stage, the ice is so thin that any flow bringing ice below the ELA will not be large enough to compensate for the high ablation rate, and any ice melts away. When the ice thickness has increased enough for the ice flow to surpass the ablation rate below the ELA, the glacier length can begin to increase. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume won't change anymore, as long as all physical parameters and the climate stay constant. The Glacier has a method which progress the glacier to equilibrium .progress_to_equilibrium(), more on this in later notebooks. A first experiment We have now seen how to setup a simple glacier and progress it to any year. Now we will move a little bit closer to reality and define a glacier with changing widths. Like many real glaciers the new glacier will be wider at the top (in the accumulation area) and have a constant width below the ELA. We can achieve this by creating a new Bed and instead of specifying the top and bottom altitudes along with the width, we specify altitudes and widths in pairs: Here the first and last values in altitudes and widths correspond to the top/bottom altitude/width. Any values in between will change the shape of the bed further. We use the new bed to create a new glacier We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. The GlacierCollection will be used extensively throughout these notebooks and its functionality will be explained further as we go along. We can get a quick look at the collection by simply calling it Before plotting the glaciers in the collection, we can progress them to the same year with the .progress_to_year() method. We can then plot the collection Similarly to the glacier the collection has a method for easily plotting the histories of the held glaciers.
4,506
4,589
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) bed bed.plot() bed_with_slope = GlacierBed(top=3400, bottom=1500, width=300, slopes=25) bed_with_slope.plot() bed_with_multiple_slopes = GlacierBed(top=3400, bottom=1500, width=300, slopes=[25, 10], # Slope sections are defined by altitude # pairs. Here we have two parirs. slope_sections=[3400, 2200, 1500]) bed_with_multiple_slopes.plot() mass_balance = MassBalance(ela=3000, gradient=4) mass_balance glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier glacier.progress_to_year(1) glacier.plot() glacier glacier.progress_to_year(150) glacier.plot() glacier glacier.progress_to_year(150) glacier.progress_to_year(500) glacier.plot() glacier glacier.progress_to_year(450) mass_balance_2 = MassBalance(ela=2500, gradient=4) glacier_multiple_slopes = Glacier(bed=bed_with_multiple_slopes, mass_balance=mass_balance_2) glacier_multiple_slopes.progress_to_year(400) glacier_multiple_slopes.plot() glacier.history glacier.plot_history() wide_narrow_bed = GlacierBed(altitudes=[3400, 2800, 1500], widths=[600, 300, 300]) wide_narrow_bed wide_narrow_bed.plot() wide_narrow_glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) wide_narrow_glacier collection = GlacierCollection() collection.add([glacier, wide_narrow_glacier]) collection collection.progress_to_year(600) collection.plot() collection.plot_history()
1,260
1,276
13
edu_intro-14
edu_intro-14
Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Let's plot the bed to make sure that it looks like we expect. The bed object has a built in method for this which provide us with a side and top-down view of the glacier domain. For finer control over the bed slope you can pass a single value to slopes during the creation You can also pass a sequence of slope angles in slopes - for this you also need to specify the altitude spans of the sections with the slope_sections argument. There should be one more entry in slope_sections compared to the entries in slopes. The first and last value in slope_sections should match the top and bottom of the glacier. Mass balance For the glacier to grow it needs a mass balance model. The mass balance is responsible for adding snow and removing ice through melt on the glacier. In our case it will be a simple linear mass balance, meaning that it decreases linearly with altitude. The mass balance is defined by the equilibrium line altitude (ELA) and the altitude gradient (in mm yr − 1 m−1). The ELA defines at what altitude the mass balance is zero and the altitude gradient how much the mass balance changes with altitude. More on this in upcoming notebooks! We set the ELA of our glacier to 3000 meters and the altitude gradient to 4 mm yr − 1m−1. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, we can get some statistics about the glacier by simply calling it. However since we just created the glacier, everything will be zero. Progressing the glacier Now the glacier has all the ingredients needed to evolve. Let's first progress the glacier to year 1. And let's take a look at the glacier. As the bed, it has a in method for this. Here we can see that there is thin cover of ice from the top and 4 km down the glacier bed. So the glacier almost reaches the point where the bed intersects the ELA (~4 km). We can also take a look at some of statistics of the glacier again to get some more details: From the statistics we can read that the glacier has a length of 4 km and covers an area of 1.2 km2. The glacier will grow considerably in the upcoming years, and the ice thickness should become apparent even in the altitude - distance plot. Let us progress the glacier to year 150 and take a look. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same statistics about the glacier as before: The glacier length and area has increased by ~20% while the volume has increased by more than 1000%. This is because the glacier has to build enough mass (i.e. ice thickness) before it can begin to flow downhill and increase its length. Note that the glacier is now 150 years old. If we try progressing the glacier to the same year again, nothing will happen. It evens gives us a warning. We can easily progress the glacier even longer: The glaciers has now grown considerably further down our made up mountain, well below the ELA. It is important to note that the model can not progress back in time. Once at year 500, we can not de-age the glacier. Let's do the same with one of the glaciers with a non-linear bed profile! Glacier history This brings us to the glacier history. This is just what it sounds like, a history of the length, volume and area of the glacier. We can access the data through the .history attribute And we can quickly visualise the history of the glacier with the .plot_history() method The glacier length and area has a step in the first year. This has to do with how OGGM internally deals with snow and ice, it does not differentiate between them. And since the mass balance is always positive above the ELA, any snowfall in the first year above the ELA will remain and be classified as part of the glacier, and contribute to the length and area. This is why after the first year, the glacier's length and area remains constant for a few years. In this initial stage, the ice is so thin that any flow bringing ice below the ELA will not be large enough to compensate for the high ablation rate, and any ice melts away. When the ice thickness has increased enough for the ice flow to surpass the ablation rate below the ELA, the glacier length can begin to increase. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume won't change anymore, as long as all physical parameters and the climate stay constant. The Glacier has a method which progress the glacier to equilibrium .progress_to_equilibrium(), more on this in later notebooks. A first experiment We have now seen how to setup a simple glacier and progress it to any year. Now we will move a little bit closer to reality and define a glacier with changing widths. Like many real glaciers the new glacier will be wider at the top (in the accumulation area) and have a constant width below the ELA. We can achieve this by creating a new Bed and instead of specifying the top and bottom altitudes along with the width, we specify altitudes and widths in pairs: Here the first and last values in altitudes and widths correspond to the top/bottom altitude/width. Any values in between will change the shape of the bed further. We use the new bed to create a new glacier We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. The GlacierCollection will be used extensively throughout these notebooks and its functionality will be explained further as we go along. We can get a quick look at the collection by simply calling it Before plotting the glaciers in the collection, we can progress them to the same year with the .progress_to_year() method. We can then plot the collection Similarly to the glacier the collection has a method for easily plotting the histories of the held glaciers.
2,373
2,479
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) bed bed.plot() bed_with_slope = GlacierBed(top=3400, bottom=1500, width=300, slopes=25) bed_with_slope.plot() bed_with_multiple_slopes = GlacierBed(top=3400, bottom=1500, width=300, slopes=[25, 10], # Slope sections are defined by altitude # pairs. Here we have two parirs. slope_sections=[3400, 2200, 1500]) bed_with_multiple_slopes.plot() mass_balance = MassBalance(ela=3000, gradient=4) mass_balance glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier glacier.progress_to_year(1) glacier.plot() glacier glacier.progress_to_year(150) glacier.plot() glacier glacier.progress_to_year(150) glacier.progress_to_year(500) glacier.plot() glacier glacier.progress_to_year(450) mass_balance_2 = MassBalance(ela=2500, gradient=4) glacier_multiple_slopes = Glacier(bed=bed_with_multiple_slopes, mass_balance=mass_balance_2) glacier_multiple_slopes.progress_to_year(400) glacier_multiple_slopes.plot() glacier.history glacier.plot_history() wide_narrow_bed = GlacierBed(altitudes=[3400, 2800, 1500], widths=[600, 300, 300]) wide_narrow_bed wide_narrow_bed.plot() wide_narrow_glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) wide_narrow_glacier collection = GlacierCollection() collection.add([glacier, wide_narrow_glacier]) collection collection.progress_to_year(600) collection.plot() collection.plot_history()
699
753
14
edu_intro-15
edu_intro-15
Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Let's plot the bed to make sure that it looks like we expect. The bed object has a built in method for this which provide us with a side and top-down view of the glacier domain. For finer control over the bed slope you can pass a single value to slopes during the creation You can also pass a sequence of slope angles in slopes - for this you also need to specify the altitude spans of the sections with the slope_sections argument. There should be one more entry in slope_sections compared to the entries in slopes. The first and last value in slope_sections should match the top and bottom of the glacier. Mass balance For the glacier to grow it needs a mass balance model. The mass balance is responsible for adding snow and removing ice through melt on the glacier. In our case it will be a simple linear mass balance, meaning that it decreases linearly with altitude. The mass balance is defined by the equilibrium line altitude (ELA) and the altitude gradient (in mm yr − 1 m−1). The ELA defines at what altitude the mass balance is zero and the altitude gradient how much the mass balance changes with altitude. More on this in upcoming notebooks! We set the ELA of our glacier to 3000 meters and the altitude gradient to 4 mm yr − 1m−1. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, we can get some statistics about the glacier by simply calling it. However since we just created the glacier, everything will be zero. Progressing the glacier Now the glacier has all the ingredients needed to evolve. Let's first progress the glacier to year 1. And let's take a look at the glacier. As the bed, it has a in method for this. Here we can see that there is thin cover of ice from the top and 4 km down the glacier bed. So the glacier almost reaches the point where the bed intersects the ELA (~4 km). We can also take a look at some of statistics of the glacier again to get some more details: From the statistics we can read that the glacier has a length of 4 km and covers an area of 1.2 km2. The glacier will grow considerably in the upcoming years, and the ice thickness should become apparent even in the altitude - distance plot. Let us progress the glacier to year 150 and take a look. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same statistics about the glacier as before: The glacier length and area has increased by ~20% while the volume has increased by more than 1000%. This is because the glacier has to build enough mass (i.e. ice thickness) before it can begin to flow downhill and increase its length. Note that the glacier is now 150 years old. If we try progressing the glacier to the same year again, nothing will happen. It evens gives us a warning. We can easily progress the glacier even longer: The glaciers has now grown considerably further down our made up mountain, well below the ELA. It is important to note that the model can not progress back in time. Once at year 500, we can not de-age the glacier. Let's do the same with one of the glaciers with a non-linear bed profile! Glacier history This brings us to the glacier history. This is just what it sounds like, a history of the length, volume and area of the glacier. We can access the data through the .history attribute And we can quickly visualise the history of the glacier with the .plot_history() method The glacier length and area has a step in the first year. This has to do with how OGGM internally deals with snow and ice, it does not differentiate between them. And since the mass balance is always positive above the ELA, any snowfall in the first year above the ELA will remain and be classified as part of the glacier, and contribute to the length and area. This is why after the first year, the glacier's length and area remains constant for a few years. In this initial stage, the ice is so thin that any flow bringing ice below the ELA will not be large enough to compensate for the high ablation rate, and any ice melts away. When the ice thickness has increased enough for the ice flow to surpass the ablation rate below the ELA, the glacier length can begin to increase. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume won't change anymore, as long as all physical parameters and the climate stay constant. The Glacier has a method which progress the glacier to equilibrium .progress_to_equilibrium(), more on this in later notebooks. A first experiment We have now seen how to setup a simple glacier and progress it to any year. Now we will move a little bit closer to reality and define a glacier with changing widths. Like many real glaciers the new glacier will be wider at the top (in the accumulation area) and have a constant width below the ELA. We can achieve this by creating a new Bed and instead of specifying the top and bottom altitudes along with the width, we specify altitudes and widths in pairs: Here the first and last values in altitudes and widths correspond to the top/bottom altitude/width. Any values in between will change the shape of the bed further. We use the new bed to create a new glacier We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. The GlacierCollection will be used extensively throughout these notebooks and its functionality will be explained further as we go along. We can get a quick look at the collection by simply calling it Before plotting the glaciers in the collection, we can progress them to the same year with the .progress_to_year() method. We can then plot the collection Similarly to the glacier the collection has a method for easily plotting the histories of the held glaciers.
2,779
2,805
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) bed bed.plot() bed_with_slope = GlacierBed(top=3400, bottom=1500, width=300, slopes=25) bed_with_slope.plot() bed_with_multiple_slopes = GlacierBed(top=3400, bottom=1500, width=300, slopes=[25, 10], # Slope sections are defined by altitude # pairs. Here we have two parirs. slope_sections=[3400, 2200, 1500]) bed_with_multiple_slopes.plot() mass_balance = MassBalance(ela=3000, gradient=4) mass_balance glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier glacier.progress_to_year(1) glacier.plot() glacier glacier.progress_to_year(150) glacier.plot() glacier glacier.progress_to_year(150) glacier.progress_to_year(500) glacier.plot() glacier glacier.progress_to_year(450) mass_balance_2 = MassBalance(ela=2500, gradient=4) glacier_multiple_slopes = Glacier(bed=bed_with_multiple_slopes, mass_balance=mass_balance_2) glacier_multiple_slopes.progress_to_year(400) glacier_multiple_slopes.plot() glacier.history glacier.plot_history() wide_narrow_bed = GlacierBed(altitudes=[3400, 2800, 1500], widths=[600, 300, 300]) wide_narrow_bed wide_narrow_bed.plot() wide_narrow_glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) wide_narrow_glacier collection = GlacierCollection() collection.add([glacier, wide_narrow_glacier]) collection collection.progress_to_year(600) collection.plot() collection.plot_history()
796
811
15
edu_intro-16
edu_intro-16
Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Let's plot the bed to make sure that it looks like we expect. The bed object has a built in method for this which provide us with a side and top-down view of the glacier domain. For finer control over the bed slope you can pass a single value to slopes during the creation You can also pass a sequence of slope angles in slopes - for this you also need to specify the altitude spans of the sections with the slope_sections argument. There should be one more entry in slope_sections compared to the entries in slopes. The first and last value in slope_sections should match the top and bottom of the glacier. Mass balance For the glacier to grow it needs a mass balance model. The mass balance is responsible for adding snow and removing ice through melt on the glacier. In our case it will be a simple linear mass balance, meaning that it decreases linearly with altitude. The mass balance is defined by the equilibrium line altitude (ELA) and the altitude gradient (in mm yr − 1 m−1). The ELA defines at what altitude the mass balance is zero and the altitude gradient how much the mass balance changes with altitude. More on this in upcoming notebooks! We set the ELA of our glacier to 3000 meters and the altitude gradient to 4 mm yr − 1m−1. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, we can get some statistics about the glacier by simply calling it. However since we just created the glacier, everything will be zero. Progressing the glacier Now the glacier has all the ingredients needed to evolve. Let's first progress the glacier to year 1. And let's take a look at the glacier. As the bed, it has a in method for this. Here we can see that there is thin cover of ice from the top and 4 km down the glacier bed. So the glacier almost reaches the point where the bed intersects the ELA (~4 km). We can also take a look at some of statistics of the glacier again to get some more details: From the statistics we can read that the glacier has a length of 4 km and covers an area of 1.2 km2. The glacier will grow considerably in the upcoming years, and the ice thickness should become apparent even in the altitude - distance plot. Let us progress the glacier to year 150 and take a look. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same statistics about the glacier as before: The glacier length and area has increased by ~20% while the volume has increased by more than 1000%. This is because the glacier has to build enough mass (i.e. ice thickness) before it can begin to flow downhill and increase its length. Note that the glacier is now 150 years old. If we try progressing the glacier to the same year again, nothing will happen. It evens gives us a warning. We can easily progress the glacier even longer: The glaciers has now grown considerably further down our made up mountain, well below the ELA. It is important to note that the model can not progress back in time. Once at year 500, we can not de-age the glacier. Let's do the same with one of the glaciers with a non-linear bed profile! Glacier history This brings us to the glacier history. This is just what it sounds like, a history of the length, volume and area of the glacier. We can access the data through the .history attribute And we can quickly visualise the history of the glacier with the .plot_history() method The glacier length and area has a step in the first year. This has to do with how OGGM internally deals with snow and ice, it does not differentiate between them. And since the mass balance is always positive above the ELA, any snowfall in the first year above the ELA will remain and be classified as part of the glacier, and contribute to the length and area. This is why after the first year, the glacier's length and area remains constant for a few years. In this initial stage, the ice is so thin that any flow bringing ice below the ELA will not be large enough to compensate for the high ablation rate, and any ice melts away. When the ice thickness has increased enough for the ice flow to surpass the ablation rate below the ELA, the glacier length can begin to increase. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume won't change anymore, as long as all physical parameters and the climate stay constant. The Glacier has a method which progress the glacier to equilibrium .progress_to_equilibrium(), more on this in later notebooks. A first experiment We have now seen how to setup a simple glacier and progress it to any year. Now we will move a little bit closer to reality and define a glacier with changing widths. Like many real glaciers the new glacier will be wider at the top (in the accumulation area) and have a constant width below the ELA. We can achieve this by creating a new Bed and instead of specifying the top and bottom altitudes along with the width, we specify altitudes and widths in pairs: Here the first and last values in altitudes and widths correspond to the top/bottom altitude/width. Any values in between will change the shape of the bed further. We use the new bed to create a new glacier We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. The GlacierCollection will be used extensively throughout these notebooks and its functionality will be explained further as we go along. We can get a quick look at the collection by simply calling it Before plotting the glaciers in the collection, we can progress them to the same year with the .progress_to_year() method. We can then plot the collection Similarly to the glacier the collection has a method for easily plotting the histories of the held glaciers.
3,851
3,907
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) bed bed.plot() bed_with_slope = GlacierBed(top=3400, bottom=1500, width=300, slopes=25) bed_with_slope.plot() bed_with_multiple_slopes = GlacierBed(top=3400, bottom=1500, width=300, slopes=[25, 10], # Slope sections are defined by altitude # pairs. Here we have two parirs. slope_sections=[3400, 2200, 1500]) bed_with_multiple_slopes.plot() mass_balance = MassBalance(ela=3000, gradient=4) mass_balance glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier glacier.progress_to_year(1) glacier.plot() glacier glacier.progress_to_year(150) glacier.plot() glacier glacier.progress_to_year(150) glacier.progress_to_year(500) glacier.plot() glacier glacier.progress_to_year(450) mass_balance_2 = MassBalance(ela=2500, gradient=4) glacier_multiple_slopes = Glacier(bed=bed_with_multiple_slopes, mass_balance=mass_balance_2) glacier_multiple_slopes.progress_to_year(400) glacier_multiple_slopes.plot() glacier.history glacier.plot_history() wide_narrow_bed = GlacierBed(altitudes=[3400, 2800, 1500], widths=[600, 300, 300]) wide_narrow_bed wide_narrow_bed.plot() wide_narrow_glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) wide_narrow_glacier collection = GlacierCollection() collection.add([glacier, wide_narrow_glacier]) collection collection.progress_to_year(600) collection.plot() collection.plot_history()
881
911
16
edu_intro-17
edu_intro-17
Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Getting started with OGGM Edu: idealised glaciers OGGM Edu provides a simple way to experiment with glaciers on your computer. This is achieved by a high level interface to the different parts of the complex glacier model that is OGGM. You as a user will interact with a few objects that provide you with methods and attributes fitting for a glacier and the parts that make it up. The goal of this notebook is to introduce you to OGGM Edu and how it can be used to simulate two idealised glaciers. We begin by importing the classes that we need Let's plot the bed to make sure that it looks like we expect. The bed object has a built in method for this which provide us with a side and top-down view of the glacier domain. For finer control over the bed slope you can pass a single value to slopes during the creation You can also pass a sequence of slope angles in slopes - for this you also need to specify the altitude spans of the sections with the slope_sections argument. There should be one more entry in slope_sections compared to the entries in slopes. The first and last value in slope_sections should match the top and bottom of the glacier. Mass balance For the glacier to grow it needs a mass balance model. The mass balance is responsible for adding snow and removing ice through melt on the glacier. In our case it will be a simple linear mass balance, meaning that it decreases linearly with altitude. The mass balance is defined by the equilibrium line altitude (ELA) and the altitude gradient (in mm yr − 1 m−1). The ELA defines at what altitude the mass balance is zero and the altitude gradient how much the mass balance changes with altitude. More on this in upcoming notebooks! We set the ELA of our glacier to 3000 meters and the altitude gradient to 4 mm yr − 1m−1. Glacier initialisation We can now take our bed and the mass balance and create a glacier which we can then perform experiments on. Similarly to the bed, we can get some statistics about the glacier by simply calling it. However since we just created the glacier, everything will be zero. Progressing the glacier Now the glacier has all the ingredients needed to evolve. Let's first progress the glacier to year 1. And let's take a look at the glacier. As the bed, it has a in method for this. Here we can see that there is thin cover of ice from the top and 4 km down the glacier bed. So the glacier almost reaches the point where the bed intersects the ELA (~4 km). We can also take a look at some of statistics of the glacier again to get some more details: From the statistics we can read that the glacier has a length of 4 km and covers an area of 1.2 km2. The glacier will grow considerably in the upcoming years, and the ice thickness should become apparent even in the altitude - distance plot. Let us progress the glacier to year 150 and take a look. Now we can clearly see the difference between the surface of the glacier and the bedrock. Let's print the same statistics about the glacier as before: The glacier length and area has increased by ~20% while the volume has increased by more than 1000%. This is because the glacier has to build enough mass (i.e. ice thickness) before it can begin to flow downhill and increase its length. Note that the glacier is now 150 years old. If we try progressing the glacier to the same year again, nothing will happen. It evens gives us a warning. We can easily progress the glacier even longer: The glaciers has now grown considerably further down our made up mountain, well below the ELA. It is important to note that the model can not progress back in time. Once at year 500, we can not de-age the glacier. Let's do the same with one of the glaciers with a non-linear bed profile! Glacier history This brings us to the glacier history. This is just what it sounds like, a history of the length, volume and area of the glacier. We can access the data through the .history attribute And we can quickly visualise the history of the glacier with the .plot_history() method The glacier length and area has a step in the first year. This has to do with how OGGM internally deals with snow and ice, it does not differentiate between them. And since the mass balance is always positive above the ELA, any snowfall in the first year above the ELA will remain and be classified as part of the glacier, and contribute to the length and area. This is why after the first year, the glacier's length and area remains constant for a few years. In this initial stage, the ice is so thin that any flow bringing ice below the ELA will not be large enough to compensate for the high ablation rate, and any ice melts away. When the ice thickness has increased enough for the ice flow to surpass the ablation rate below the ELA, the glacier length can begin to increase. Equilibrium state After several centuries, the glacier reaches a balance with its climate. This means that its length and volume won't change anymore, as long as all physical parameters and the climate stay constant. The Glacier has a method which progress the glacier to equilibrium .progress_to_equilibrium(), more on this in later notebooks. A first experiment We have now seen how to setup a simple glacier and progress it to any year. Now we will move a little bit closer to reality and define a glacier with changing widths. Like many real glaciers the new glacier will be wider at the top (in the accumulation area) and have a constant width below the ELA. We can achieve this by creating a new Bed and instead of specifying the top and bottom altitudes along with the width, we specify altitudes and widths in pairs: Here the first and last values in altitudes and widths correspond to the top/bottom altitude/width. Any values in between will change the shape of the bed further. We use the new bed to create a new glacier We can now introduce the GlacierCollection. This is a utility which can store multiple glaciers and can be used to easily compare and run experiments on multiple glaciers. The GlacierCollection will be used extensively throughout these notebooks and its functionality will be explained further as we go along. We can get a quick look at the collection by simply calling it Before plotting the glaciers in the collection, we can progress them to the same year with the .progress_to_year() method. We can then plot the collection Similarly to the glacier the collection has a method for easily plotting the histories of the held glaciers.
500
546
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=300) bed bed.plot() bed_with_slope = GlacierBed(top=3400, bottom=1500, width=300, slopes=25) bed_with_slope.plot() bed_with_multiple_slopes = GlacierBed(top=3400, bottom=1500, width=300, slopes=[25, 10], # Slope sections are defined by altitude # pairs. Here we have two parirs. slope_sections=[3400, 2200, 1500]) bed_with_multiple_slopes.plot() mass_balance = MassBalance(ela=3000, gradient=4) mass_balance glacier = Glacier(bed=bed, mass_balance=mass_balance) glacier glacier.progress_to_year(1) glacier.plot() glacier glacier.progress_to_year(150) glacier.plot() glacier glacier.progress_to_year(150) glacier.progress_to_year(500) glacier.plot() glacier glacier.progress_to_year(450) mass_balance_2 = MassBalance(ela=2500, gradient=4) glacier_multiple_slopes = Glacier(bed=bed_with_multiple_slopes, mass_balance=mass_balance_2) glacier_multiple_slopes.progress_to_year(400) glacier_multiple_slopes.plot() glacier.history glacier.plot_history() wide_narrow_bed = GlacierBed(altitudes=[3400, 2800, 1500], widths=[600, 300, 300]) wide_narrow_bed wide_narrow_bed.plot() wide_narrow_glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) wide_narrow_glacier collection = GlacierCollection() collection.add([glacier, wide_narrow_glacier]) collection collection.progress_to_year(600) collection.plot() collection.plot_history()
2
75
17
accumulation_and_ablation-0
accumulation_and_ablation-0
Accumulation, ablation, mass Balance and the resulting ice flow Goals of this notebook: Gain a basic understanding of accumulation, ablation and glacier mass balance Understand the link between mass balance and ice flow Implement a simple experiment to calculate ice flow on a glacier in equilibrium Copyright notice: the following sections are heavily based on the book "The Physics of Glaciers" by Cuffey and Paterson, (2010). The glacier images are taken from the open glacier graphics on OGGM-Edu, made by Anne Maussion, Atelier les Gros yeux. The mass balance is the result of several processes that either add mass to the glacier (accumulation) or remove mass from the glacier (ablation). Accumulation processes Accumulation processes are all processes that add snow or ice to a glacier (surface). The most important accumulation processes are listed below in order of their relative importance: Solid precipitation (snowfall) Snowfall varies substantially with latitude and altitude, where the primary factors determining snowfall rates are: Water vapor content governed by the Clausius-Clapeyron-relationship: the warmer the air, the more water it can hold and hence the more precipitation can form Stratification of the atmosphere: a subfreezing layer in the lower atmosphere is required for precipitation to reach the ground in solid form Cooling rate: high snowfall rates occur where snow is rapidly cooled, e.g. in frontal systems or via orographic lifting Redistribution by wind and avalanching Accumulation may differ from snowfall due to winds advecting snow over a glacier surface - the interaction between wind and the topography creates regions of snow assimilation and deposition. Furthermore, avalanches may accumulate unusually large amounts of snow in favorable zones. Avalanching is particularly important for mountain glaciers in steep valleys. Refreezing of meltwater Refreezing of meltwater can either occur at the glacier surface or inside the glacier body, where it is commonly called englacial or internal accumulation. Refreezing meltwater does not explicitly contribute to glacier mass balance, but it has to be subtracted from the total melt to assess the net runoff. Deposition Deposition refers to processes directly accumulating water or water vapor to the glacier surface, i.e. freezing rain and resublimation. Ablation processes Ablation processes are all processes that remove snow or ice from a glacier. The most important ablation processes are listed below in order of their relative importance: Melt and runoff Melt and runoff account for most glacier mass loss and are driven by the net energy imbalance between the atmosphere and the glacier surface. The most important contributors are the net radiation and the turbulent fluxes of sensible and latent heat. Once the temperature of the glacier surface is at the melting point, i.e. the glacier surface was sufficiently heated, melts rates increase in proportion to the net energy flux. Sublimation Sublimation refers to the phase change from solid state to gaseous state, e.g. the direct transition of snow and ice to water vapor. It is the dominant source of mass loss in environments where surface temperatures hardly reach the melting point. Sublimation increases with increasing surface temperature and wind speed and with decreasing humidity, hence, it is strongest in dry and warm environments. Melt and sublimation can counteract each other: as sublimation consumes energy and transforms it to latent heat, the energy available for melt decreases. Calving Calving is the separation of ice blocks from a glacier’s margin. Most calving occurs at margins of glaciers that stand or float in water. Calving of glaciers terminating in the ocean, so called tidewater glaciers, accounts for much of the mass loss, e.g. for more than 90% of the ablation from Antarctica and about half of the ablation from Greenland. The process is also significant for mountain glaciers that terminate in deep lakes or the ocean. This nice graphic from antarcticglaciers.org summarizes the different accumulation and ablation processes: Mass balance The rates of accumulation and ablation processes, summed over the glacier and over time, determine the glacier mass balance: ˙m, the change in total mass of snow and ice, ˙m = accumulation + ablation. Mass is continuously redistributed in a glacier: accumulated mass at the top of the glacier is transported downglacier, which is indicated by the black arrow in the figure above. The driving force of this ice flow is gravity. Thus, the mass balance of a region on a glacier depends not only on the mass exchanges induced by accumulation and ablation, but also on the gravity driven transport of ice from the acccumulation area to the ablation area. Generally, mass balance and ice flux are linked via the continuity equation, which implies mass conservation, ∂H∂t = ˙m − ∇ ⋅→ q, where H is the ice thickness, ˙m the mass balance and →q the ice flux. Accumulation, ablation and ice flow with OGGM In this example, we will essentially illustrate the OGGM-Edu glacier graphics series of images using OGGM. Set the scene In the introduction on the OGGM-Edu website, a cross section of a typical mountain glacier is shown: Such a glacier can be reconstructed in OGGM, as done in the intro notebook. First, we define a linear bedrock profile with a wider accumulation area, typical for mountain glaciers. The accumulation area is determined by the width at the top of the glacier, the width at the equilibrium line altitude and the vertical extent downglacier. We want to create a glacier bed that is 1500 meters wide at the top and 500 meters wide from the ELA and down. We also want the accumulation area to make up 1/3 of the total vertial extent of the glacier. Let's plot the geometry of the glacier Then we will need a mass balance. In our case this will be a simple linear mass balance, defined by the equilibrium line altitude (ELA) and a linear mass balance gradient with respect to elevation (in [mm m−1]). The equilibrium line altitude is located at the transition between the accumulation and ablation zone. We can use the same expression as we used to create the transition for the bed: Now that we have all the ingredients to initialise the glacier. Let's progress the glacier to equilibrium And lets plot it Mass balance of a glacier in equilibrium For a glacier to be in equilibrium, we require the specific mass balance (accumulation + ablation) to be zero averaged over a year on the glacier. To check this requirement, we can use the mass balance model to compute the annual mass balance and compute a width weighted average over all altitudes: At the end of the year the total specific mass-balance is zero, but this doesn't mean that the mass-balance is zero everywhere! A very classic situation looks like the image below: positive mass-balance at the top (more accumulation, less ablation) and negative at the tongue (less accumulation, more ablation). In equilibrium, the ice thickness H does not change with time and the continuity equation reduces to, m = ∇ → q. This means that glacier mass balance solely determines ice flux if the glacier is in steady-state. Hence, the ice flux can be computed by vertically integrating the mass balance - in the one-dimensional case, the ice flux is the sum of the mass balance above a certain reference height z. The ice flux can then by computed by discrete integration of the mass balance. For this example we are going to go outside the built in capabilities of oggm_edu.Glacier. This also shows how you can access properties of the Glacier and create your own plots. By construction, the ice flux is maximal at the equilibrium line altitude and zero at the glacier terminus. Take home points Accumulation processes include all the processes that add snow or ice to a glacier, e.g. Solid precipitation Redistribution of snow by wind and avalanching Refreezing of meltwater Resublimation and freezing rain Ablation processes are all processes that remove snow or ice from a glacier, e.g. Melt and runoff Sublimation Calving Accumulation and ablation rates determine the glacier mass balance, i.e. the change in total mass of snow and ice. Glaciers flow due to gravity Mass conservation implies a link between ice thickness, mass balance and ice flow References K.M. Cuffey and W.S.B. Paterson, (2010), The Physics of Glaciers AntarcticGlaciers.org, glacier mass-balance
6,296
6,318
from oggm_edu import Glacier, MassBalance, GlacierBed top = 3400 bottom = 0 wide_narrow_bed = GlacierBed(altitudes=[top, (top-bottom) * 2/3, bottom], widths=[1500, 500, 500]) wide_narrow_bed.plot() mass_balance = MassBalance(ela=(top-bottom)*2/3, gradient=3) glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) glacier.plot() glacier.progress_to_equilibrium() glacier.plot() glacier.specific_mass_balance from matplotlib import pyplot as plt import numpy as np mb = glacier.mass_balance.get_annual_mb(glacier.current_state.surface_h) mb = mb * glacier.bed.widths * glacier.bed.map_dx *\ glacier.current_state.dx_meter q = (mb).cumsum() fig, ax = plt.subplots() ax.plot(glacier.bed.distance_along_glacier[q>0], q[q>0]) idx = np.argmin(np.abs(mb)) ax.axvline(glacier.bed.distance_along_glacier[idx], c='k') ax.text(glacier.bed.distance_along_glacier[idx]-0.1, 0, 'ELA', ha='right') ax.set_xlabel('Distance along glacier [km]') ax.set_ylabel('Ice flux $q$ (m$^3$ s$^{-1}$)')
290
356
0
accumulation_and_ablation-1
accumulation_and_ablation-1
Accumulation, ablation, mass Balance and the resulting ice flow Goals of this notebook: Gain a basic understanding of accumulation, ablation and glacier mass balance Understand the link between mass balance and ice flow Implement a simple experiment to calculate ice flow on a glacier in equilibrium Copyright notice: the following sections are heavily based on the book "The Physics of Glaciers" by Cuffey and Paterson, (2010). The glacier images are taken from the open glacier graphics on OGGM-Edu, made by Anne Maussion, Atelier les Gros yeux. The mass balance is the result of several processes that either add mass to the glacier (accumulation) or remove mass from the glacier (ablation). Accumulation processes Accumulation processes are all processes that add snow or ice to a glacier (surface). The most important accumulation processes are listed below in order of their relative importance: Solid precipitation (snowfall) Snowfall varies substantially with latitude and altitude, where the primary factors determining snowfall rates are: Water vapor content governed by the Clausius-Clapeyron-relationship: the warmer the air, the more water it can hold and hence the more precipitation can form Stratification of the atmosphere: a subfreezing layer in the lower atmosphere is required for precipitation to reach the ground in solid form Cooling rate: high snowfall rates occur where snow is rapidly cooled, e.g. in frontal systems or via orographic lifting Redistribution by wind and avalanching Accumulation may differ from snowfall due to winds advecting snow over a glacier surface - the interaction between wind and the topography creates regions of snow assimilation and deposition. Furthermore, avalanches may accumulate unusually large amounts of snow in favorable zones. Avalanching is particularly important for mountain glaciers in steep valleys. Refreezing of meltwater Refreezing of meltwater can either occur at the glacier surface or inside the glacier body, where it is commonly called englacial or internal accumulation. Refreezing meltwater does not explicitly contribute to glacier mass balance, but it has to be subtracted from the total melt to assess the net runoff. Deposition Deposition refers to processes directly accumulating water or water vapor to the glacier surface, i.e. freezing rain and resublimation. Ablation processes Ablation processes are all processes that remove snow or ice from a glacier. The most important ablation processes are listed below in order of their relative importance: Melt and runoff Melt and runoff account for most glacier mass loss and are driven by the net energy imbalance between the atmosphere and the glacier surface. The most important contributors are the net radiation and the turbulent fluxes of sensible and latent heat. Once the temperature of the glacier surface is at the melting point, i.e. the glacier surface was sufficiently heated, melts rates increase in proportion to the net energy flux. Sublimation Sublimation refers to the phase change from solid state to gaseous state, e.g. the direct transition of snow and ice to water vapor. It is the dominant source of mass loss in environments where surface temperatures hardly reach the melting point. Sublimation increases with increasing surface temperature and wind speed and with decreasing humidity, hence, it is strongest in dry and warm environments. Melt and sublimation can counteract each other: as sublimation consumes energy and transforms it to latent heat, the energy available for melt decreases. Calving Calving is the separation of ice blocks from a glacier’s margin. Most calving occurs at margins of glaciers that stand or float in water. Calving of glaciers terminating in the ocean, so called tidewater glaciers, accounts for much of the mass loss, e.g. for more than 90% of the ablation from Antarctica and about half of the ablation from Greenland. The process is also significant for mountain glaciers that terminate in deep lakes or the ocean. This nice graphic from antarcticglaciers.org summarizes the different accumulation and ablation processes: Mass balance The rates of accumulation and ablation processes, summed over the glacier and over time, determine the glacier mass balance: ˙m, the change in total mass of snow and ice, ˙m = accumulation + ablation. Mass is continuously redistributed in a glacier: accumulated mass at the top of the glacier is transported downglacier, which is indicated by the black arrow in the figure above. The driving force of this ice flow is gravity. Thus, the mass balance of a region on a glacier depends not only on the mass exchanges induced by accumulation and ablation, but also on the gravity driven transport of ice from the acccumulation area to the ablation area. Generally, mass balance and ice flux are linked via the continuity equation, which implies mass conservation, ∂H∂t = ˙m − ∇ ⋅→ q, where H is the ice thickness, ˙m the mass balance and →q the ice flux. Accumulation, ablation and ice flow with OGGM In this example, we will essentially illustrate the OGGM-Edu glacier graphics series of images using OGGM. Set the scene In the introduction on the OGGM-Edu website, a cross section of a typical mountain glacier is shown: Such a glacier can be reconstructed in OGGM, as done in the intro notebook. First, we define a linear bedrock profile with a wider accumulation area, typical for mountain glaciers. The accumulation area is determined by the width at the top of the glacier, the width at the equilibrium line altitude and the vertical extent downglacier. We want to create a glacier bed that is 1500 meters wide at the top and 500 meters wide from the ELA and down. We also want the accumulation area to make up 1/3 of the total vertial extent of the glacier. Let's plot the geometry of the glacier Then we will need a mass balance. In our case this will be a simple linear mass balance, defined by the equilibrium line altitude (ELA) and a linear mass balance gradient with respect to elevation (in [mm m−1]). The equilibrium line altitude is located at the transition between the accumulation and ablation zone. We can use the same expression as we used to create the transition for the bed: Now that we have all the ingredients to initialise the glacier. Let's progress the glacier to equilibrium And lets plot it Mass balance of a glacier in equilibrium For a glacier to be in equilibrium, we require the specific mass balance (accumulation + ablation) to be zero averaged over a year on the glacier. To check this requirement, we can use the mass balance model to compute the annual mass balance and compute a width weighted average over all altitudes: At the end of the year the total specific mass-balance is zero, but this doesn't mean that the mass-balance is zero everywhere! A very classic situation looks like the image below: positive mass-balance at the top (more accumulation, less ablation) and negative at the tongue (less accumulation, more ablation). In equilibrium, the ice thickness H does not change with time and the continuity equation reduces to, m = ∇ → q. This means that glacier mass balance solely determines ice flux if the glacier is in steady-state. Hence, the ice flux can be computed by vertically integrating the mass balance - in the one-dimensional case, the ice flux is the sum of the mass balance above a certain reference height z. The ice flux can then by computed by discrete integration of the mass balance. For this example we are going to go outside the built in capabilities of oggm_edu.Glacier. This also shows how you can access properties of the Glacier and create your own plots. By construction, the ice flux is maximal at the equilibrium line altitude and zero at the glacier terminus. Take home points Accumulation processes include all the processes that add snow or ice to a glacier, e.g. Solid precipitation Redistribution of snow by wind and avalanching Refreezing of meltwater Resublimation and freezing rain Ablation processes are all processes that remove snow or ice from a glacier, e.g. Melt and runoff Sublimation Calving Accumulation and ablation rates determine the glacier mass balance, i.e. the change in total mass of snow and ice. Glaciers flow due to gravity Mass conservation implies a link between ice thickness, mass balance and ice flow References K.M. Cuffey and W.S.B. Paterson, (2010), The Physics of Glaciers AntarcticGlaciers.org, glacier mass-balance
6,321
6,362
from oggm_edu import Glacier, MassBalance, GlacierBed top = 3400 bottom = 0 wide_narrow_bed = GlacierBed(altitudes=[top, (top-bottom) * 2/3, bottom], widths=[1500, 500, 500]) wide_narrow_bed.plot() mass_balance = MassBalance(ela=(top-bottom)*2/3, gradient=3) glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) glacier.plot() glacier.progress_to_equilibrium() glacier.plot() glacier.specific_mass_balance from matplotlib import pyplot as plt import numpy as np mb = glacier.mass_balance.get_annual_mb(glacier.current_state.surface_h) mb = mb * glacier.bed.widths * glacier.bed.map_dx *\ glacier.current_state.dx_meter q = (mb).cumsum() fig, ax = plt.subplots() ax.plot(glacier.bed.distance_along_glacier[q>0], q[q>0]) idx = np.argmin(np.abs(mb)) ax.axvline(glacier.bed.distance_along_glacier[idx], c='k') ax.text(glacier.bed.distance_along_glacier[idx]-0.1, 0, 'ELA', ha='right') ax.set_xlabel('Distance along glacier [km]') ax.set_ylabel('Ice flux $q$ (m$^3$ s$^{-1}$)')
372
406
1
accumulation_and_ablation-2
accumulation_and_ablation-2
Accumulation, ablation, mass Balance and the resulting ice flow Goals of this notebook: Gain a basic understanding of accumulation, ablation and glacier mass balance Understand the link between mass balance and ice flow Implement a simple experiment to calculate ice flow on a glacier in equilibrium Copyright notice: the following sections are heavily based on the book "The Physics of Glaciers" by Cuffey and Paterson, (2010). The glacier images are taken from the open glacier graphics on OGGM-Edu, made by Anne Maussion, Atelier les Gros yeux. The mass balance is the result of several processes that either add mass to the glacier (accumulation) or remove mass from the glacier (ablation). Accumulation processes Accumulation processes are all processes that add snow or ice to a glacier (surface). The most important accumulation processes are listed below in order of their relative importance: Solid precipitation (snowfall) Snowfall varies substantially with latitude and altitude, where the primary factors determining snowfall rates are: Water vapor content governed by the Clausius-Clapeyron-relationship: the warmer the air, the more water it can hold and hence the more precipitation can form Stratification of the atmosphere: a subfreezing layer in the lower atmosphere is required for precipitation to reach the ground in solid form Cooling rate: high snowfall rates occur where snow is rapidly cooled, e.g. in frontal systems or via orographic lifting Redistribution by wind and avalanching Accumulation may differ from snowfall due to winds advecting snow over a glacier surface - the interaction between wind and the topography creates regions of snow assimilation and deposition. Furthermore, avalanches may accumulate unusually large amounts of snow in favorable zones. Avalanching is particularly important for mountain glaciers in steep valleys. Refreezing of meltwater Refreezing of meltwater can either occur at the glacier surface or inside the glacier body, where it is commonly called englacial or internal accumulation. Refreezing meltwater does not explicitly contribute to glacier mass balance, but it has to be subtracted from the total melt to assess the net runoff. Deposition Deposition refers to processes directly accumulating water or water vapor to the glacier surface, i.e. freezing rain and resublimation. Ablation processes Ablation processes are all processes that remove snow or ice from a glacier. The most important ablation processes are listed below in order of their relative importance: Melt and runoff Melt and runoff account for most glacier mass loss and are driven by the net energy imbalance between the atmosphere and the glacier surface. The most important contributors are the net radiation and the turbulent fluxes of sensible and latent heat. Once the temperature of the glacier surface is at the melting point, i.e. the glacier surface was sufficiently heated, melts rates increase in proportion to the net energy flux. Sublimation Sublimation refers to the phase change from solid state to gaseous state, e.g. the direct transition of snow and ice to water vapor. It is the dominant source of mass loss in environments where surface temperatures hardly reach the melting point. Sublimation increases with increasing surface temperature and wind speed and with decreasing humidity, hence, it is strongest in dry and warm environments. Melt and sublimation can counteract each other: as sublimation consumes energy and transforms it to latent heat, the energy available for melt decreases. Calving Calving is the separation of ice blocks from a glacier’s margin. Most calving occurs at margins of glaciers that stand or float in water. Calving of glaciers terminating in the ocean, so called tidewater glaciers, accounts for much of the mass loss, e.g. for more than 90% of the ablation from Antarctica and about half of the ablation from Greenland. The process is also significant for mountain glaciers that terminate in deep lakes or the ocean. This nice graphic from antarcticglaciers.org summarizes the different accumulation and ablation processes: Mass balance The rates of accumulation and ablation processes, summed over the glacier and over time, determine the glacier mass balance: ˙m, the change in total mass of snow and ice, ˙m = accumulation + ablation. Mass is continuously redistributed in a glacier: accumulated mass at the top of the glacier is transported downglacier, which is indicated by the black arrow in the figure above. The driving force of this ice flow is gravity. Thus, the mass balance of a region on a glacier depends not only on the mass exchanges induced by accumulation and ablation, but also on the gravity driven transport of ice from the acccumulation area to the ablation area. Generally, mass balance and ice flux are linked via the continuity equation, which implies mass conservation, ∂H∂t = ˙m − ∇ ⋅→ q, where H is the ice thickness, ˙m the mass balance and →q the ice flux. Accumulation, ablation and ice flow with OGGM In this example, we will essentially illustrate the OGGM-Edu glacier graphics series of images using OGGM. Set the scene In the introduction on the OGGM-Edu website, a cross section of a typical mountain glacier is shown: Such a glacier can be reconstructed in OGGM, as done in the intro notebook. First, we define a linear bedrock profile with a wider accumulation area, typical for mountain glaciers. The accumulation area is determined by the width at the top of the glacier, the width at the equilibrium line altitude and the vertical extent downglacier. We want to create a glacier bed that is 1500 meters wide at the top and 500 meters wide from the ELA and down. We also want the accumulation area to make up 1/3 of the total vertial extent of the glacier. Let's plot the geometry of the glacier Then we will need a mass balance. In our case this will be a simple linear mass balance, defined by the equilibrium line altitude (ELA) and a linear mass balance gradient with respect to elevation (in [mm m−1]). The equilibrium line altitude is located at the transition between the accumulation and ablation zone. We can use the same expression as we used to create the transition for the bed: Now that we have all the ingredients to initialise the glacier. Let's progress the glacier to equilibrium And lets plot it Mass balance of a glacier in equilibrium For a glacier to be in equilibrium, we require the specific mass balance (accumulation + ablation) to be zero averaged over a year on the glacier. To check this requirement, we can use the mass balance model to compute the annual mass balance and compute a width weighted average over all altitudes: At the end of the year the total specific mass-balance is zero, but this doesn't mean that the mass-balance is zero everywhere! A very classic situation looks like the image below: positive mass-balance at the top (more accumulation, less ablation) and negative at the tongue (less accumulation, more ablation). In equilibrium, the ice thickness H does not change with time and the continuity equation reduces to, m = ∇ → q. This means that glacier mass balance solely determines ice flux if the glacier is in steady-state. Hence, the ice flux can be computed by vertically integrating the mass balance - in the one-dimensional case, the ice flux is the sum of the mass balance above a certain reference height z. The ice flux can then by computed by discrete integration of the mass balance. For this example we are going to go outside the built in capabilities of oggm_edu.Glacier. This also shows how you can access properties of the Glacier and create your own plots. By construction, the ice flux is maximal at the equilibrium line altitude and zero at the glacier terminus. Take home points Accumulation processes include all the processes that add snow or ice to a glacier, e.g. Solid precipitation Redistribution of snow by wind and avalanching Refreezing of meltwater Resublimation and freezing rain Ablation processes are all processes that remove snow or ice from a glacier, e.g. Melt and runoff Sublimation Calving Accumulation and ablation rates determine the glacier mass balance, i.e. the change in total mass of snow and ice. Glaciers flow due to gravity Mass conservation implies a link between ice thickness, mass balance and ice flow References K.M. Cuffey and W.S.B. Paterson, (2010), The Physics of Glaciers AntarcticGlaciers.org, glacier mass-balance
7,643
7,701
from oggm_edu import Glacier, MassBalance, GlacierBed top = 3400 bottom = 0 wide_narrow_bed = GlacierBed(altitudes=[top, (top-bottom) * 2/3, bottom], widths=[1500, 500, 500]) wide_narrow_bed.plot() mass_balance = MassBalance(ela=(top-bottom)*2/3, gradient=3) glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) glacier.plot() glacier.progress_to_equilibrium() glacier.plot() glacier.specific_mass_balance from matplotlib import pyplot as plt import numpy as np mb = glacier.mass_balance.get_annual_mb(glacier.current_state.surface_h) mb = mb * glacier.bed.widths * glacier.bed.map_dx *\ glacier.current_state.dx_meter q = (mb).cumsum() fig, ax = plt.subplots() ax.plot(glacier.bed.distance_along_glacier[q>0], q[q>0]) idx = np.argmin(np.abs(mb)) ax.axvline(glacier.bed.distance_along_glacier[idx], c='k') ax.text(glacier.bed.distance_along_glacier[idx]-0.1, 0, 'ELA', ha='right') ax.set_xlabel('Distance along glacier [km]') ax.set_ylabel('Ice flux $q$ (m$^3$ s$^{-1}$)')
694
1,042
2
accumulation_and_ablation-3
accumulation_and_ablation-3
Accumulation, ablation, mass Balance and the resulting ice flow Goals of this notebook: Gain a basic understanding of accumulation, ablation and glacier mass balance Understand the link between mass balance and ice flow Implement a simple experiment to calculate ice flow on a glacier in equilibrium Copyright notice: the following sections are heavily based on the book "The Physics of Glaciers" by Cuffey and Paterson, (2010). The glacier images are taken from the open glacier graphics on OGGM-Edu, made by Anne Maussion, Atelier les Gros yeux. The mass balance is the result of several processes that either add mass to the glacier (accumulation) or remove mass from the glacier (ablation). Accumulation processes Accumulation processes are all processes that add snow or ice to a glacier (surface). The most important accumulation processes are listed below in order of their relative importance: Solid precipitation (snowfall) Snowfall varies substantially with latitude and altitude, where the primary factors determining snowfall rates are: Water vapor content governed by the Clausius-Clapeyron-relationship: the warmer the air, the more water it can hold and hence the more precipitation can form Stratification of the atmosphere: a subfreezing layer in the lower atmosphere is required for precipitation to reach the ground in solid form Cooling rate: high snowfall rates occur where snow is rapidly cooled, e.g. in frontal systems or via orographic lifting Redistribution by wind and avalanching Accumulation may differ from snowfall due to winds advecting snow over a glacier surface - the interaction between wind and the topography creates regions of snow assimilation and deposition. Furthermore, avalanches may accumulate unusually large amounts of snow in favorable zones. Avalanching is particularly important for mountain glaciers in steep valleys. Refreezing of meltwater Refreezing of meltwater can either occur at the glacier surface or inside the glacier body, where it is commonly called englacial or internal accumulation. Refreezing meltwater does not explicitly contribute to glacier mass balance, but it has to be subtracted from the total melt to assess the net runoff. Deposition Deposition refers to processes directly accumulating water or water vapor to the glacier surface, i.e. freezing rain and resublimation. Ablation processes Ablation processes are all processes that remove snow or ice from a glacier. The most important ablation processes are listed below in order of their relative importance: Melt and runoff Melt and runoff account for most glacier mass loss and are driven by the net energy imbalance between the atmosphere and the glacier surface. The most important contributors are the net radiation and the turbulent fluxes of sensible and latent heat. Once the temperature of the glacier surface is at the melting point, i.e. the glacier surface was sufficiently heated, melts rates increase in proportion to the net energy flux. Sublimation Sublimation refers to the phase change from solid state to gaseous state, e.g. the direct transition of snow and ice to water vapor. It is the dominant source of mass loss in environments where surface temperatures hardly reach the melting point. Sublimation increases with increasing surface temperature and wind speed and with decreasing humidity, hence, it is strongest in dry and warm environments. Melt and sublimation can counteract each other: as sublimation consumes energy and transforms it to latent heat, the energy available for melt decreases. Calving Calving is the separation of ice blocks from a glacier’s margin. Most calving occurs at margins of glaciers that stand or float in water. Calving of glaciers terminating in the ocean, so called tidewater glaciers, accounts for much of the mass loss, e.g. for more than 90% of the ablation from Antarctica and about half of the ablation from Greenland. The process is also significant for mountain glaciers that terminate in deep lakes or the ocean. This nice graphic from antarcticglaciers.org summarizes the different accumulation and ablation processes: Mass balance The rates of accumulation and ablation processes, summed over the glacier and over time, determine the glacier mass balance: ˙m, the change in total mass of snow and ice, ˙m = accumulation + ablation. Mass is continuously redistributed in a glacier: accumulated mass at the top of the glacier is transported downglacier, which is indicated by the black arrow in the figure above. The driving force of this ice flow is gravity. Thus, the mass balance of a region on a glacier depends not only on the mass exchanges induced by accumulation and ablation, but also on the gravity driven transport of ice from the acccumulation area to the ablation area. Generally, mass balance and ice flux are linked via the continuity equation, which implies mass conservation, ∂H∂t = ˙m − ∇ ⋅→ q, where H is the ice thickness, ˙m the mass balance and →q the ice flux. Accumulation, ablation and ice flow with OGGM In this example, we will essentially illustrate the OGGM-Edu glacier graphics series of images using OGGM. Set the scene In the introduction on the OGGM-Edu website, a cross section of a typical mountain glacier is shown: Such a glacier can be reconstructed in OGGM, as done in the intro notebook. First, we define a linear bedrock profile with a wider accumulation area, typical for mountain glaciers. The accumulation area is determined by the width at the top of the glacier, the width at the equilibrium line altitude and the vertical extent downglacier. We want to create a glacier bed that is 1500 meters wide at the top and 500 meters wide from the ELA and down. We also want the accumulation area to make up 1/3 of the total vertial extent of the glacier. Let's plot the geometry of the glacier Then we will need a mass balance. In our case this will be a simple linear mass balance, defined by the equilibrium line altitude (ELA) and a linear mass balance gradient with respect to elevation (in [mm m−1]). The equilibrium line altitude is located at the transition between the accumulation and ablation zone. We can use the same expression as we used to create the transition for the bed: Now that we have all the ingredients to initialise the glacier. Let's progress the glacier to equilibrium And lets plot it Mass balance of a glacier in equilibrium For a glacier to be in equilibrium, we require the specific mass balance (accumulation + ablation) to be zero averaged over a year on the glacier. To check this requirement, we can use the mass balance model to compute the annual mass balance and compute a width weighted average over all altitudes: At the end of the year the total specific mass-balance is zero, but this doesn't mean that the mass-balance is zero everywhere! A very classic situation looks like the image below: positive mass-balance at the top (more accumulation, less ablation) and negative at the tongue (less accumulation, more ablation). In equilibrium, the ice thickness H does not change with time and the continuity equation reduces to, m = ∇ → q. This means that glacier mass balance solely determines ice flux if the glacier is in steady-state. Hence, the ice flux can be computed by vertically integrating the mass balance - in the one-dimensional case, the ice flux is the sum of the mass balance above a certain reference height z. The ice flux can then by computed by discrete integration of the mass balance. For this example we are going to go outside the built in capabilities of oggm_edu.Glacier. This also shows how you can access properties of the Glacier and create your own plots. By construction, the ice flux is maximal at the equilibrium line altitude and zero at the glacier terminus. Take home points Accumulation processes include all the processes that add snow or ice to a glacier, e.g. Solid precipitation Redistribution of snow by wind and avalanching Refreezing of meltwater Resublimation and freezing rain Ablation processes are all processes that remove snow or ice from a glacier, e.g. Melt and runoff Sublimation Calving Accumulation and ablation rates determine the glacier mass balance, i.e. the change in total mass of snow and ice. Glaciers flow due to gravity Mass conservation implies a link between ice thickness, mass balance and ice flow References K.M. Cuffey and W.S.B. Paterson, (2010), The Physics of Glaciers AntarcticGlaciers.org, glacier mass-balance
5,820
5,858
from oggm_edu import Glacier, MassBalance, GlacierBed top = 3400 bottom = 0 wide_narrow_bed = GlacierBed(altitudes=[top, (top-bottom) * 2/3, bottom], widths=[1500, 500, 500]) wide_narrow_bed.plot() mass_balance = MassBalance(ela=(top-bottom)*2/3, gradient=3) glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) glacier.plot() glacier.progress_to_equilibrium() glacier.plot() glacier.specific_mass_balance from matplotlib import pyplot as plt import numpy as np mb = glacier.mass_balance.get_annual_mb(glacier.current_state.surface_h) mb = mb * glacier.bed.widths * glacier.bed.map_dx *\ glacier.current_state.dx_meter q = (mb).cumsum() fig, ax = plt.subplots() ax.plot(glacier.bed.distance_along_glacier[q>0], q[q>0]) idx = np.argmin(np.abs(mb)) ax.axvline(glacier.bed.distance_along_glacier[idx], c='k') ax.text(glacier.bed.distance_along_glacier[idx]-0.1, 0, 'ELA', ha='right') ax.set_xlabel('Distance along glacier [km]') ax.set_ylabel('Ice flux $q$ (m$^3$ s$^{-1}$)')
206
229
3
accumulation_and_ablation-4
accumulation_and_ablation-4
Accumulation, ablation, mass Balance and the resulting ice flow Goals of this notebook: Gain a basic understanding of accumulation, ablation and glacier mass balance Understand the link between mass balance and ice flow Implement a simple experiment to calculate ice flow on a glacier in equilibrium Copyright notice: the following sections are heavily based on the book "The Physics of Glaciers" by Cuffey and Paterson, (2010). The glacier images are taken from the open glacier graphics on OGGM-Edu, made by Anne Maussion, Atelier les Gros yeux. The mass balance is the result of several processes that either add mass to the glacier (accumulation) or remove mass from the glacier (ablation). Accumulation processes Accumulation processes are all processes that add snow or ice to a glacier (surface). The most important accumulation processes are listed below in order of their relative importance: Solid precipitation (snowfall) Snowfall varies substantially with latitude and altitude, where the primary factors determining snowfall rates are: Water vapor content governed by the Clausius-Clapeyron-relationship: the warmer the air, the more water it can hold and hence the more precipitation can form Stratification of the atmosphere: a subfreezing layer in the lower atmosphere is required for precipitation to reach the ground in solid form Cooling rate: high snowfall rates occur where snow is rapidly cooled, e.g. in frontal systems or via orographic lifting Redistribution by wind and avalanching Accumulation may differ from snowfall due to winds advecting snow over a glacier surface - the interaction between wind and the topography creates regions of snow assimilation and deposition. Furthermore, avalanches may accumulate unusually large amounts of snow in favorable zones. Avalanching is particularly important for mountain glaciers in steep valleys. Refreezing of meltwater Refreezing of meltwater can either occur at the glacier surface or inside the glacier body, where it is commonly called englacial or internal accumulation. Refreezing meltwater does not explicitly contribute to glacier mass balance, but it has to be subtracted from the total melt to assess the net runoff. Deposition Deposition refers to processes directly accumulating water or water vapor to the glacier surface, i.e. freezing rain and resublimation. Ablation processes Ablation processes are all processes that remove snow or ice from a glacier. The most important ablation processes are listed below in order of their relative importance: Melt and runoff Melt and runoff account for most glacier mass loss and are driven by the net energy imbalance between the atmosphere and the glacier surface. The most important contributors are the net radiation and the turbulent fluxes of sensible and latent heat. Once the temperature of the glacier surface is at the melting point, i.e. the glacier surface was sufficiently heated, melts rates increase in proportion to the net energy flux. Sublimation Sublimation refers to the phase change from solid state to gaseous state, e.g. the direct transition of snow and ice to water vapor. It is the dominant source of mass loss in environments where surface temperatures hardly reach the melting point. Sublimation increases with increasing surface temperature and wind speed and with decreasing humidity, hence, it is strongest in dry and warm environments. Melt and sublimation can counteract each other: as sublimation consumes energy and transforms it to latent heat, the energy available for melt decreases. Calving Calving is the separation of ice blocks from a glacier’s margin. Most calving occurs at margins of glaciers that stand or float in water. Calving of glaciers terminating in the ocean, so called tidewater glaciers, accounts for much of the mass loss, e.g. for more than 90% of the ablation from Antarctica and about half of the ablation from Greenland. The process is also significant for mountain glaciers that terminate in deep lakes or the ocean. This nice graphic from antarcticglaciers.org summarizes the different accumulation and ablation processes: Mass balance The rates of accumulation and ablation processes, summed over the glacier and over time, determine the glacier mass balance: ˙m, the change in total mass of snow and ice, ˙m = accumulation + ablation. Mass is continuously redistributed in a glacier: accumulated mass at the top of the glacier is transported downglacier, which is indicated by the black arrow in the figure above. The driving force of this ice flow is gravity. Thus, the mass balance of a region on a glacier depends not only on the mass exchanges induced by accumulation and ablation, but also on the gravity driven transport of ice from the acccumulation area to the ablation area. Generally, mass balance and ice flux are linked via the continuity equation, which implies mass conservation, ∂H∂t = ˙m − ∇ ⋅→ q, where H is the ice thickness, ˙m the mass balance and →q the ice flux. Accumulation, ablation and ice flow with OGGM In this example, we will essentially illustrate the OGGM-Edu glacier graphics series of images using OGGM. Set the scene In the introduction on the OGGM-Edu website, a cross section of a typical mountain glacier is shown: Such a glacier can be reconstructed in OGGM, as done in the intro notebook. First, we define a linear bedrock profile with a wider accumulation area, typical for mountain glaciers. The accumulation area is determined by the width at the top of the glacier, the width at the equilibrium line altitude and the vertical extent downglacier. We want to create a glacier bed that is 1500 meters wide at the top and 500 meters wide from the ELA and down. We also want the accumulation area to make up 1/3 of the total vertial extent of the glacier. Let's plot the geometry of the glacier Then we will need a mass balance. In our case this will be a simple linear mass balance, defined by the equilibrium line altitude (ELA) and a linear mass balance gradient with respect to elevation (in [mm m−1]). The equilibrium line altitude is located at the transition between the accumulation and ablation zone. We can use the same expression as we used to create the transition for the bed: Now that we have all the ingredients to initialise the glacier. Let's progress the glacier to equilibrium And lets plot it Mass balance of a glacier in equilibrium For a glacier to be in equilibrium, we require the specific mass balance (accumulation + ablation) to be zero averaged over a year on the glacier. To check this requirement, we can use the mass balance model to compute the annual mass balance and compute a width weighted average over all altitudes: At the end of the year the total specific mass-balance is zero, but this doesn't mean that the mass-balance is zero everywhere! A very classic situation looks like the image below: positive mass-balance at the top (more accumulation, less ablation) and negative at the tongue (less accumulation, more ablation). In equilibrium, the ice thickness H does not change with time and the continuity equation reduces to, m = ∇ → q. This means that glacier mass balance solely determines ice flux if the glacier is in steady-state. Hence, the ice flux can be computed by vertically integrating the mass balance - in the one-dimensional case, the ice flux is the sum of the mass balance above a certain reference height z. The ice flux can then by computed by discrete integration of the mass balance. For this example we are going to go outside the built in capabilities of oggm_edu.Glacier. This also shows how you can access properties of the Glacier and create your own plots. By construction, the ice flux is maximal at the equilibrium line altitude and zero at the glacier terminus. Take home points Accumulation processes include all the processes that add snow or ice to a glacier, e.g. Solid precipitation Redistribution of snow by wind and avalanching Refreezing of meltwater Resublimation and freezing rain Ablation processes are all processes that remove snow or ice from a glacier, e.g. Melt and runoff Sublimation Calving Accumulation and ablation rates determine the glacier mass balance, i.e. the change in total mass of snow and ice. Glaciers flow due to gravity Mass conservation implies a link between ice thickness, mass balance and ice flow References K.M. Cuffey and W.S.B. Paterson, (2010), The Physics of Glaciers AntarcticGlaciers.org, glacier mass-balance
5,860
5,893
from oggm_edu import Glacier, MassBalance, GlacierBed top = 3400 bottom = 0 wide_narrow_bed = GlacierBed(altitudes=[top, (top-bottom) * 2/3, bottom], widths=[1500, 500, 500]) wide_narrow_bed.plot() mass_balance = MassBalance(ela=(top-bottom)*2/3, gradient=3) glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) glacier.plot() glacier.progress_to_equilibrium() glacier.plot() glacier.specific_mass_balance from matplotlib import pyplot as plt import numpy as np mb = glacier.mass_balance.get_annual_mb(glacier.current_state.surface_h) mb = mb * glacier.bed.widths * glacier.bed.map_dx *\ glacier.current_state.dx_meter q = (mb).cumsum() fig, ax = plt.subplots() ax.plot(glacier.bed.distance_along_glacier[q>0], q[q>0]) idx = np.argmin(np.abs(mb)) ax.axvline(glacier.bed.distance_along_glacier[idx], c='k') ax.text(glacier.bed.distance_along_glacier[idx]-0.1, 0, 'ELA', ha='right') ax.set_xlabel('Distance along glacier [km]') ax.set_ylabel('Ice flux $q$ (m$^3$ s$^{-1}$)')
229
290
4
accumulation_and_ablation-5
accumulation_and_ablation-5
Accumulation, ablation, mass Balance and the resulting ice flow Goals of this notebook: Gain a basic understanding of accumulation, ablation and glacier mass balance Understand the link between mass balance and ice flow Implement a simple experiment to calculate ice flow on a glacier in equilibrium Copyright notice: the following sections are heavily based on the book "The Physics of Glaciers" by Cuffey and Paterson, (2010). The glacier images are taken from the open glacier graphics on OGGM-Edu, made by Anne Maussion, Atelier les Gros yeux. The mass balance is the result of several processes that either add mass to the glacier (accumulation) or remove mass from the glacier (ablation). Accumulation processes Accumulation processes are all processes that add snow or ice to a glacier (surface). The most important accumulation processes are listed below in order of their relative importance: Solid precipitation (snowfall) Snowfall varies substantially with latitude and altitude, where the primary factors determining snowfall rates are: Water vapor content governed by the Clausius-Clapeyron-relationship: the warmer the air, the more water it can hold and hence the more precipitation can form Stratification of the atmosphere: a subfreezing layer in the lower atmosphere is required for precipitation to reach the ground in solid form Cooling rate: high snowfall rates occur where snow is rapidly cooled, e.g. in frontal systems or via orographic lifting Redistribution by wind and avalanching Accumulation may differ from snowfall due to winds advecting snow over a glacier surface - the interaction between wind and the topography creates regions of snow assimilation and deposition. Furthermore, avalanches may accumulate unusually large amounts of snow in favorable zones. Avalanching is particularly important for mountain glaciers in steep valleys. Refreezing of meltwater Refreezing of meltwater can either occur at the glacier surface or inside the glacier body, where it is commonly called englacial or internal accumulation. Refreezing meltwater does not explicitly contribute to glacier mass balance, but it has to be subtracted from the total melt to assess the net runoff. Deposition Deposition refers to processes directly accumulating water or water vapor to the glacier surface, i.e. freezing rain and resublimation. Ablation processes Ablation processes are all processes that remove snow or ice from a glacier. The most important ablation processes are listed below in order of their relative importance: Melt and runoff Melt and runoff account for most glacier mass loss and are driven by the net energy imbalance between the atmosphere and the glacier surface. The most important contributors are the net radiation and the turbulent fluxes of sensible and latent heat. Once the temperature of the glacier surface is at the melting point, i.e. the glacier surface was sufficiently heated, melts rates increase in proportion to the net energy flux. Sublimation Sublimation refers to the phase change from solid state to gaseous state, e.g. the direct transition of snow and ice to water vapor. It is the dominant source of mass loss in environments where surface temperatures hardly reach the melting point. Sublimation increases with increasing surface temperature and wind speed and with decreasing humidity, hence, it is strongest in dry and warm environments. Melt and sublimation can counteract each other: as sublimation consumes energy and transforms it to latent heat, the energy available for melt decreases. Calving Calving is the separation of ice blocks from a glacier’s margin. Most calving occurs at margins of glaciers that stand or float in water. Calving of glaciers terminating in the ocean, so called tidewater glaciers, accounts for much of the mass loss, e.g. for more than 90% of the ablation from Antarctica and about half of the ablation from Greenland. The process is also significant for mountain glaciers that terminate in deep lakes or the ocean. This nice graphic from antarcticglaciers.org summarizes the different accumulation and ablation processes: Mass balance The rates of accumulation and ablation processes, summed over the glacier and over time, determine the glacier mass balance: ˙m, the change in total mass of snow and ice, ˙m = accumulation + ablation. Mass is continuously redistributed in a glacier: accumulated mass at the top of the glacier is transported downglacier, which is indicated by the black arrow in the figure above. The driving force of this ice flow is gravity. Thus, the mass balance of a region on a glacier depends not only on the mass exchanges induced by accumulation and ablation, but also on the gravity driven transport of ice from the acccumulation area to the ablation area. Generally, mass balance and ice flux are linked via the continuity equation, which implies mass conservation, ∂H∂t = ˙m − ∇ ⋅→ q, where H is the ice thickness, ˙m the mass balance and →q the ice flux. Accumulation, ablation and ice flow with OGGM In this example, we will essentially illustrate the OGGM-Edu glacier graphics series of images using OGGM. Set the scene In the introduction on the OGGM-Edu website, a cross section of a typical mountain glacier is shown: Such a glacier can be reconstructed in OGGM, as done in the intro notebook. First, we define a linear bedrock profile with a wider accumulation area, typical for mountain glaciers. The accumulation area is determined by the width at the top of the glacier, the width at the equilibrium line altitude and the vertical extent downglacier. We want to create a glacier bed that is 1500 meters wide at the top and 500 meters wide from the ELA and down. We also want the accumulation area to make up 1/3 of the total vertial extent of the glacier. Let's plot the geometry of the glacier Then we will need a mass balance. In our case this will be a simple linear mass balance, defined by the equilibrium line altitude (ELA) and a linear mass balance gradient with respect to elevation (in [mm m−1]). The equilibrium line altitude is located at the transition between the accumulation and ablation zone. We can use the same expression as we used to create the transition for the bed: Now that we have all the ingredients to initialise the glacier. Let's progress the glacier to equilibrium And lets plot it Mass balance of a glacier in equilibrium For a glacier to be in equilibrium, we require the specific mass balance (accumulation + ablation) to be zero averaged over a year on the glacier. To check this requirement, we can use the mass balance model to compute the annual mass balance and compute a width weighted average over all altitudes: At the end of the year the total specific mass-balance is zero, but this doesn't mean that the mass-balance is zero everywhere! A very classic situation looks like the image below: positive mass-balance at the top (more accumulation, less ablation) and negative at the tongue (less accumulation, more ablation). In equilibrium, the ice thickness H does not change with time and the continuity equation reduces to, m = ∇ → q. This means that glacier mass balance solely determines ice flux if the glacier is in steady-state. Hence, the ice flux can be computed by vertically integrating the mass balance - in the one-dimensional case, the ice flux is the sum of the mass balance above a certain reference height z. The ice flux can then by computed by discrete integration of the mass balance. For this example we are going to go outside the built in capabilities of oggm_edu.Glacier. This also shows how you can access properties of the Glacier and create your own plots. By construction, the ice flux is maximal at the equilibrium line altitude and zero at the glacier terminus. Take home points Accumulation processes include all the processes that add snow or ice to a glacier, e.g. Solid precipitation Redistribution of snow by wind and avalanching Refreezing of meltwater Resublimation and freezing rain Ablation processes are all processes that remove snow or ice from a glacier, e.g. Melt and runoff Sublimation Calving Accumulation and ablation rates determine the glacier mass balance, i.e. the change in total mass of snow and ice. Glaciers flow due to gravity Mass conservation implies a link between ice thickness, mass balance and ice flow References K.M. Cuffey and W.S.B. Paterson, (2010), The Physics of Glaciers AntarcticGlaciers.org, glacier mass-balance
6,597
6,630
from oggm_edu import Glacier, MassBalance, GlacierBed top = 3400 bottom = 0 wide_narrow_bed = GlacierBed(altitudes=[top, (top-bottom) * 2/3, bottom], widths=[1500, 500, 500]) wide_narrow_bed.plot() mass_balance = MassBalance(ela=(top-bottom)*2/3, gradient=3) glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) glacier.plot() glacier.progress_to_equilibrium() glacier.plot() glacier.specific_mass_balance from matplotlib import pyplot as plt import numpy as np mb = glacier.mass_balance.get_annual_mb(glacier.current_state.surface_h) mb = mb * glacier.bed.widths * glacier.bed.map_dx *\ glacier.current_state.dx_meter q = (mb).cumsum() fig, ax = plt.subplots() ax.plot(glacier.bed.distance_along_glacier[q>0], q[q>0]) idx = np.argmin(np.abs(mb)) ax.axvline(glacier.bed.distance_along_glacier[idx], c='k') ax.text(glacier.bed.distance_along_glacier[idx]-0.1, 0, 'ELA', ha='right') ax.set_xlabel('Distance along glacier [km]') ax.set_ylabel('Ice flux $q$ (m$^3$ s$^{-1}$)')
422
452
5
accumulation_and_ablation-6
accumulation_and_ablation-6
Accumulation, ablation, mass Balance and the resulting ice flow Goals of this notebook: Gain a basic understanding of accumulation, ablation and glacier mass balance Understand the link between mass balance and ice flow Implement a simple experiment to calculate ice flow on a glacier in equilibrium Copyright notice: the following sections are heavily based on the book "The Physics of Glaciers" by Cuffey and Paterson, (2010). The glacier images are taken from the open glacier graphics on OGGM-Edu, made by Anne Maussion, Atelier les Gros yeux. The mass balance is the result of several processes that either add mass to the glacier (accumulation) or remove mass from the glacier (ablation). Accumulation processes Accumulation processes are all processes that add snow or ice to a glacier (surface). The most important accumulation processes are listed below in order of their relative importance: Solid precipitation (snowfall) Snowfall varies substantially with latitude and altitude, where the primary factors determining snowfall rates are: Water vapor content governed by the Clausius-Clapeyron-relationship: the warmer the air, the more water it can hold and hence the more precipitation can form Stratification of the atmosphere: a subfreezing layer in the lower atmosphere is required for precipitation to reach the ground in solid form Cooling rate: high snowfall rates occur where snow is rapidly cooled, e.g. in frontal systems or via orographic lifting Redistribution by wind and avalanching Accumulation may differ from snowfall due to winds advecting snow over a glacier surface - the interaction between wind and the topography creates regions of snow assimilation and deposition. Furthermore, avalanches may accumulate unusually large amounts of snow in favorable zones. Avalanching is particularly important for mountain glaciers in steep valleys. Refreezing of meltwater Refreezing of meltwater can either occur at the glacier surface or inside the glacier body, where it is commonly called englacial or internal accumulation. Refreezing meltwater does not explicitly contribute to glacier mass balance, but it has to be subtracted from the total melt to assess the net runoff. Deposition Deposition refers to processes directly accumulating water or water vapor to the glacier surface, i.e. freezing rain and resublimation. Ablation processes Ablation processes are all processes that remove snow or ice from a glacier. The most important ablation processes are listed below in order of their relative importance: Melt and runoff Melt and runoff account for most glacier mass loss and are driven by the net energy imbalance between the atmosphere and the glacier surface. The most important contributors are the net radiation and the turbulent fluxes of sensible and latent heat. Once the temperature of the glacier surface is at the melting point, i.e. the glacier surface was sufficiently heated, melts rates increase in proportion to the net energy flux. Sublimation Sublimation refers to the phase change from solid state to gaseous state, e.g. the direct transition of snow and ice to water vapor. It is the dominant source of mass loss in environments where surface temperatures hardly reach the melting point. Sublimation increases with increasing surface temperature and wind speed and with decreasing humidity, hence, it is strongest in dry and warm environments. Melt and sublimation can counteract each other: as sublimation consumes energy and transforms it to latent heat, the energy available for melt decreases. Calving Calving is the separation of ice blocks from a glacier’s margin. Most calving occurs at margins of glaciers that stand or float in water. Calving of glaciers terminating in the ocean, so called tidewater glaciers, accounts for much of the mass loss, e.g. for more than 90% of the ablation from Antarctica and about half of the ablation from Greenland. The process is also significant for mountain glaciers that terminate in deep lakes or the ocean. This nice graphic from antarcticglaciers.org summarizes the different accumulation and ablation processes: Mass balance The rates of accumulation and ablation processes, summed over the glacier and over time, determine the glacier mass balance: ˙m, the change in total mass of snow and ice, ˙m = accumulation + ablation. Mass is continuously redistributed in a glacier: accumulated mass at the top of the glacier is transported downglacier, which is indicated by the black arrow in the figure above. The driving force of this ice flow is gravity. Thus, the mass balance of a region on a glacier depends not only on the mass exchanges induced by accumulation and ablation, but also on the gravity driven transport of ice from the acccumulation area to the ablation area. Generally, mass balance and ice flux are linked via the continuity equation, which implies mass conservation, ∂H∂t = ˙m − ∇ ⋅→ q, where H is the ice thickness, ˙m the mass balance and →q the ice flux. Accumulation, ablation and ice flow with OGGM In this example, we will essentially illustrate the OGGM-Edu glacier graphics series of images using OGGM. Set the scene In the introduction on the OGGM-Edu website, a cross section of a typical mountain glacier is shown: Such a glacier can be reconstructed in OGGM, as done in the intro notebook. First, we define a linear bedrock profile with a wider accumulation area, typical for mountain glaciers. The accumulation area is determined by the width at the top of the glacier, the width at the equilibrium line altitude and the vertical extent downglacier. We want to create a glacier bed that is 1500 meters wide at the top and 500 meters wide from the ELA and down. We also want the accumulation area to make up 1/3 of the total vertial extent of the glacier. Let's plot the geometry of the glacier Then we will need a mass balance. In our case this will be a simple linear mass balance, defined by the equilibrium line altitude (ELA) and a linear mass balance gradient with respect to elevation (in [mm m−1]). The equilibrium line altitude is located at the transition between the accumulation and ablation zone. We can use the same expression as we used to create the transition for the bed: Now that we have all the ingredients to initialise the glacier. Let's progress the glacier to equilibrium And lets plot it Mass balance of a glacier in equilibrium For a glacier to be in equilibrium, we require the specific mass balance (accumulation + ablation) to be zero averaged over a year on the glacier. To check this requirement, we can use the mass balance model to compute the annual mass balance and compute a width weighted average over all altitudes: At the end of the year the total specific mass-balance is zero, but this doesn't mean that the mass-balance is zero everywhere! A very classic situation looks like the image below: positive mass-balance at the top (more accumulation, less ablation) and negative at the tongue (less accumulation, more ablation). In equilibrium, the ice thickness H does not change with time and the continuity equation reduces to, m = ∇ → q. This means that glacier mass balance solely determines ice flux if the glacier is in steady-state. Hence, the ice flux can be computed by vertically integrating the mass balance - in the one-dimensional case, the ice flux is the sum of the mass balance above a certain reference height z. The ice flux can then by computed by discrete integration of the mass balance. For this example we are going to go outside the built in capabilities of oggm_edu.Glacier. This also shows how you can access properties of the Glacier and create your own plots. By construction, the ice flux is maximal at the equilibrium line altitude and zero at the glacier terminus. Take home points Accumulation processes include all the processes that add snow or ice to a glacier, e.g. Solid precipitation Redistribution of snow by wind and avalanching Refreezing of meltwater Resublimation and freezing rain Ablation processes are all processes that remove snow or ice from a glacier, e.g. Melt and runoff Sublimation Calving Accumulation and ablation rates determine the glacier mass balance, i.e. the change in total mass of snow and ice. Glaciers flow due to gravity Mass conservation implies a link between ice thickness, mass balance and ice flow References K.M. Cuffey and W.S.B. Paterson, (2010), The Physics of Glaciers AntarcticGlaciers.org, glacier mass-balance
5,614
5,818
from oggm_edu import Glacier, MassBalance, GlacierBed top = 3400 bottom = 0 wide_narrow_bed = GlacierBed(altitudes=[top, (top-bottom) * 2/3, bottom], widths=[1500, 500, 500]) wide_narrow_bed.plot() mass_balance = MassBalance(ela=(top-bottom)*2/3, gradient=3) glacier = Glacier(bed=wide_narrow_bed, mass_balance=mass_balance) glacier.plot() glacier.progress_to_equilibrium() glacier.plot() glacier.specific_mass_balance from matplotlib import pyplot as plt import numpy as np mb = glacier.mass_balance.get_annual_mb(glacier.current_state.surface_h) mb = mb * glacier.bed.widths * glacier.bed.map_dx *\ glacier.current_state.dx_meter q = (mb).cumsum() fig, ax = plt.subplots() ax.plot(glacier.bed.distance_along_glacier[q>0], q[q>0]) idx = np.argmin(np.abs(mb)) ax.axvline(glacier.bed.distance_along_glacier[idx], c='k') ax.text(glacier.bed.distance_along_glacier[idx]-0.1, 0, 'ELA', ha='right') ax.set_xlabel('Distance along glacier [km]') ax.set_ylabel('Ice flux $q$ (m$^3$ s$^{-1}$)')
55
205
6
weather_forecast-0
weather_forecast-0
Weather Forecast with PixieDust This notebook shows how to: use the Weather Company Data API to get weather forecast json data based on latitude and longitude convert this json data into a pandas DataFrame create a weather chart and map with matplotlib create a weather chart and map with PixieDust Before running the notebook: Sign up for a free 30-day trial Bluemix account Launch the Weather Data service in Bluemix and fill in the credentials below. Learn more here Run this notebook locally or in the Cloud using the IBM Data Science Experience 1. Load and install packages First, uncomment the lines in the below cell and upgrade the pixiedust and bokeh packages. When this is done restart the kernel. You have to do this only once, or when there is an update available. Then import the package needed to run this notebook. 2. Get weather data Find the latitude and longitude of your current location by running this magic javascript cell. Then fill in your Weather Company API credentials to load the weather forecast for where you are. Wait a few seconds to run the second cell to allow the above geolocation function to run. Or provide the lat and lon of the location you want to get a weather forecast for. Uncomment and run the next cell to have a look what the json data file looks like. Convert the data into a DataFrame with each timestep on a new row. Convert the timestamp into a datetime format and drop the columns that are not needed. See this Cheat sheet for date format conversions. Finally, convert the data type into numeric. You may have to change to format of the time to your time zone '%Y-%m-%dT%H:%M:%S+0200' for Europe or '%Y-%m-%dT%H:%M:%S+0100' for the UK during summer time for example. As there seems to be an issue with the pop column (percentage of precipitation), create a new column rain. 4. Plot data with matplotlib 5. Create a temperature map for the UK 6. Plot data with PixieDust https://ibm-cds-labs.github.io/pixiedust/
1,377
1,421
import requests import json import pandas as pd import numpy as np from datetime import datetime import time import pixiedust lat = str(41.3850639) lon = str(2.1734035) print(lat, lon) username='xxxx' password='xxxx' line='https://'+username+':'+password+\ '@twcservice.mybluemix.net/api/weather/v1/geocode/'+\ lat+'/'+lon+'/forecast/intraday/10day.json?&units=m' r=requests.get(line) weather = json.loads(r.text) df = pd.DataFrame.from_dict(weather['forecasts'][0],orient='index').transpose() for forecast in weather['forecasts'][1:]: df = pd.concat([df, pd.DataFrame.from_dict(forecast,orient='index').transpose()]) df['date'] = df['fcst_valid_local'].apply(lambda x: datetime.strptime(x, '%Y-%m-%dT%H:%M:%S+0200')) df = df.drop(['expire_time_gmt','num','qualifier','qualifier_code'],1) df = df.drop(['fcst_valid','fcst_valid_local','icon_extd','wdir_cardinal'],1) df = df.drop(['subphrase_pt1','subphrase_pt2','subphrase_pt3','class'],1) df = df.drop(['daypart_name','phrase_12char','phrase_22char','phrase_32char'],1) df.dtypes df[['pop','wspd','rh','clds','wdir','temp']] = df[['pop','wspd','rh','clds','wdir','temp']].apply(pd.to_numeric) df.dtypes df['rain'] = df['pop'].as_matrix() df=df.drop('pop',1) df.head() df = df.set_index('date',drop=False) df.head() import matplotlib.pyplot as plt import matplotlib fig, axes = plt.subplots(nrows=2, ncols=1, figsize=(14, 8)) df['temp'].plot(ax=axes[1], color='#6EEDD8',lw=3.0,sharex=True) axes[1].set_title('Temperature',loc='left',fontsize=20) df['rain'].plot(ax=axes[0], kind='bar', color='#C93D79',lw=2.0,sharex=True) axes[0].set_title('Chance of rain',loc='left',fontsize=20) cities = [ ('Exeter',50.7184,-3.5339), ('Truro',50.2632,-5.051), ('Carmarthen',51.8576,-4.3121), ('Norwich',52.6309,1.2974), ('Brighton And Hove',50.8225,-0.1372), ('Bristol',51.44999778,-2.583315472), ('Durham',54.7753,-1.5849), ('Llanidloes',52.4135,-3.5883), ('Penrith',54.6641,-2.7527), ('Jedburgh',55.4777,-2.5549), ('Coventry',52.42040367,-1.499996583), ('Edinburgh',55.94832786,-3.219090618), ('Cambridge',52.2053,0.1218), ('Glasgow',55.87440472,-4.250707236), ('Kingston upon Hull',53.7457,-0.3367), ('Leeds',53.83000755,-1.580017539), ('London',51.49999473,-0.116721844), ('Manchester',53.50041526,-2.247987103), ('Nottingham',52.97034426,-1.170016725), ('Aberdeen',57.1497,-2.0943), ('Fort Augustus',57.1448,-4.6805), ('Lairg',58.197,-4.6173), ('Oxford',51.7517,-1.2553), ('Inverey',56.9855,-3.5055), ('Shrewsbury',52.7069,-2.7527), ('Colwyn Bay',53.2932,-3.7276), ('Newton Stewart',54.9186,-4.5918), ('Portsmouth',50.80034751,-1.080022218)] icons=[] temps=[] for city in cities: lat = city[1] lon = city[2] line='https://'+username+':'+password+'@twcservice.mybluemix.net/api/weather/v1/geocode/'+str(lat)+'/'+str(lon)+'/observations.json?&units=m' r=requests.get(line) weather = json.loads(r.text) icons=np.append(icons,weather['observation']['wx_icon']) temps=np.append(temps,weather['observation']['temp']) dfmap = pd.DataFrame(cities, columns=['city','lat','lon']) dfmap['temp']=temps dfmap['icon']=icons dfmap.head(25) from mpl_toolkits.basemap import Basemap from matplotlib.offsetbox import AnnotationBbox, OffsetImage from matplotlib._png import read_png from itertools import izip import urllib matplotlib.style.use('bmh') fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(10, 12)) m1 = Basemap(projection='mill',resolution=None,llcrnrlon=-7.5,llcrnrlat=49.84,urcrnrlon=2.5,urcrnrlat=59,ax=axes[0]) m1.drawlsmask(land_color='dimgrey',ocean_color='dodgerBlue',lakes=True) m2 = Basemap(projection='mill',resolution=None,llcrnrlon=-7.5,llcrnrlat=49.84,urcrnrlon=2.5,urcrnrlat=59,ax=axes[1]) m2.drawlsmask(land_color='dimgrey',ocean_color='dodgerBlue',lakes=True) for [icon,city] in izip(icons,cities): lat = city[1] lon = city[2] try: pngfile=urllib.urlopen('https://github.com/ibm-cds-labs/python-notebooks/blob/master/weathericons/icon'+str(int(icon))+'.png?raw=true') icon_hand = read_png(pngfile) imagebox = OffsetImage(icon_hand, zoom=.15) ab = AnnotationBbox(imagebox,m1(lon,lat),frameon=False) axes[0].add_artist(ab) except: pass for [temp,city] in izip(temps,cities): lat = city[1] lon = city[2] if temp>16: col='indigo' elif temp>14: col='darkmagenta' elif temp>12: col='red' elif temp>10: col='tomato' elif temp>0: col='turquoise' x1, y1 = m2(lon,lat) bbox_props = dict(boxstyle="round,pad=0.3", fc=col, ec=col, lw=2) axes[1].text(x1, y1, temp, ha="center", va="center", size=11,bbox=bbox_props) plt.tight_layout() display(df)
642
742
0
weather_forecast-1
weather_forecast-1
Weather Forecast with PixieDust This notebook shows how to: use the Weather Company Data API to get weather forecast json data based on latitude and longitude convert this json data into a pandas DataFrame create a weather chart and map with matplotlib create a weather chart and map with PixieDust Before running the notebook: Sign up for a free 30-day trial Bluemix account Launch the Weather Data service in Bluemix and fill in the credentials below. Learn more here Run this notebook locally or in the Cloud using the IBM Data Science Experience 1. Load and install packages First, uncomment the lines in the below cell and upgrade the pixiedust and bokeh packages. When this is done restart the kernel. You have to do this only once, or when there is an update available. Then import the package needed to run this notebook. 2. Get weather data Find the latitude and longitude of your current location by running this magic javascript cell. Then fill in your Weather Company API credentials to load the weather forecast for where you are. Wait a few seconds to run the second cell to allow the above geolocation function to run. Or provide the lat and lon of the location you want to get a weather forecast for. Uncomment and run the next cell to have a look what the json data file looks like. Convert the data into a DataFrame with each timestep on a new row. Convert the timestamp into a datetime format and drop the columns that are not needed. See this Cheat sheet for date format conversions. Finally, convert the data type into numeric. You may have to change to format of the time to your time zone '%Y-%m-%dT%H:%M:%S+0200' for Europe or '%Y-%m-%dT%H:%M:%S+0100' for the UK during summer time for example. As there seems to be an issue with the pop column (percentage of precipitation), create a new column rain. 4. Plot data with matplotlib 5. Create a temperature map for the UK 6. Plot data with PixieDust https://ibm-cds-labs.github.io/pixiedust/
1,426
1,462
import requests import json import pandas as pd import numpy as np from datetime import datetime import time import pixiedust lat = str(41.3850639) lon = str(2.1734035) print(lat, lon) username='xxxx' password='xxxx' line='https://'+username+':'+password+\ '@twcservice.mybluemix.net/api/weather/v1/geocode/'+\ lat+'/'+lon+'/forecast/intraday/10day.json?&units=m' r=requests.get(line) weather = json.loads(r.text) df = pd.DataFrame.from_dict(weather['forecasts'][0],orient='index').transpose() for forecast in weather['forecasts'][1:]: df = pd.concat([df, pd.DataFrame.from_dict(forecast,orient='index').transpose()]) df['date'] = df['fcst_valid_local'].apply(lambda x: datetime.strptime(x, '%Y-%m-%dT%H:%M:%S+0200')) df = df.drop(['expire_time_gmt','num','qualifier','qualifier_code'],1) df = df.drop(['fcst_valid','fcst_valid_local','icon_extd','wdir_cardinal'],1) df = df.drop(['subphrase_pt1','subphrase_pt2','subphrase_pt3','class'],1) df = df.drop(['daypart_name','phrase_12char','phrase_22char','phrase_32char'],1) df.dtypes df[['pop','wspd','rh','clds','wdir','temp']] = df[['pop','wspd','rh','clds','wdir','temp']].apply(pd.to_numeric) df.dtypes df['rain'] = df['pop'].as_matrix() df=df.drop('pop',1) df.head() df = df.set_index('date',drop=False) df.head() import matplotlib.pyplot as plt import matplotlib fig, axes = plt.subplots(nrows=2, ncols=1, figsize=(14, 8)) df['temp'].plot(ax=axes[1], color='#6EEDD8',lw=3.0,sharex=True) axes[1].set_title('Temperature',loc='left',fontsize=20) df['rain'].plot(ax=axes[0], kind='bar', color='#C93D79',lw=2.0,sharex=True) axes[0].set_title('Chance of rain',loc='left',fontsize=20) cities = [ ('Exeter',50.7184,-3.5339), ('Truro',50.2632,-5.051), ('Carmarthen',51.8576,-4.3121), ('Norwich',52.6309,1.2974), ('Brighton And Hove',50.8225,-0.1372), ('Bristol',51.44999778,-2.583315472), ('Durham',54.7753,-1.5849), ('Llanidloes',52.4135,-3.5883), ('Penrith',54.6641,-2.7527), ('Jedburgh',55.4777,-2.5549), ('Coventry',52.42040367,-1.499996583), ('Edinburgh',55.94832786,-3.219090618), ('Cambridge',52.2053,0.1218), ('Glasgow',55.87440472,-4.250707236), ('Kingston upon Hull',53.7457,-0.3367), ('Leeds',53.83000755,-1.580017539), ('London',51.49999473,-0.116721844), ('Manchester',53.50041526,-2.247987103), ('Nottingham',52.97034426,-1.170016725), ('Aberdeen',57.1497,-2.0943), ('Fort Augustus',57.1448,-4.6805), ('Lairg',58.197,-4.6173), ('Oxford',51.7517,-1.2553), ('Inverey',56.9855,-3.5055), ('Shrewsbury',52.7069,-2.7527), ('Colwyn Bay',53.2932,-3.7276), ('Newton Stewart',54.9186,-4.5918), ('Portsmouth',50.80034751,-1.080022218)] icons=[] temps=[] for city in cities: lat = city[1] lon = city[2] line='https://'+username+':'+password+'@twcservice.mybluemix.net/api/weather/v1/geocode/'+str(lat)+'/'+str(lon)+'/observations.json?&units=m' r=requests.get(line) weather = json.loads(r.text) icons=np.append(icons,weather['observation']['wx_icon']) temps=np.append(temps,weather['observation']['temp']) dfmap = pd.DataFrame(cities, columns=['city','lat','lon']) dfmap['temp']=temps dfmap['icon']=icons dfmap.head(25) from mpl_toolkits.basemap import Basemap from matplotlib.offsetbox import AnnotationBbox, OffsetImage from matplotlib._png import read_png from itertools import izip import urllib matplotlib.style.use('bmh') fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(10, 12)) m1 = Basemap(projection='mill',resolution=None,llcrnrlon=-7.5,llcrnrlat=49.84,urcrnrlon=2.5,urcrnrlat=59,ax=axes[0]) m1.drawlsmask(land_color='dimgrey',ocean_color='dodgerBlue',lakes=True) m2 = Basemap(projection='mill',resolution=None,llcrnrlon=-7.5,llcrnrlat=49.84,urcrnrlon=2.5,urcrnrlat=59,ax=axes[1]) m2.drawlsmask(land_color='dimgrey',ocean_color='dodgerBlue',lakes=True) for [icon,city] in izip(icons,cities): lat = city[1] lon = city[2] try: pngfile=urllib.urlopen('https://github.com/ibm-cds-labs/python-notebooks/blob/master/weathericons/icon'+str(int(icon))+'.png?raw=true') icon_hand = read_png(pngfile) imagebox = OffsetImage(icon_hand, zoom=.15) ab = AnnotationBbox(imagebox,m1(lon,lat),frameon=False) axes[0].add_artist(ab) except: pass for [temp,city] in izip(temps,cities): lat = city[1] lon = city[2] if temp>16: col='indigo' elif temp>14: col='darkmagenta' elif temp>12: col='red' elif temp>10: col='tomato' elif temp>0: col='turquoise' x1, y1 = m2(lon,lat) bbox_props = dict(boxstyle="round,pad=0.3", fc=col, ec=col, lw=2) axes[1].text(x1, y1, temp, ha="center", va="center", size=11,bbox=bbox_props) plt.tight_layout() display(df)
743
1,059
1
weather_forecast-2
weather_forecast-2
Weather Forecast with PixieDust This notebook shows how to: use the Weather Company Data API to get weather forecast json data based on latitude and longitude convert this json data into a pandas DataFrame create a weather chart and map with matplotlib create a weather chart and map with PixieDust Before running the notebook: Sign up for a free 30-day trial Bluemix account Launch the Weather Data service in Bluemix and fill in the credentials below. Learn more here Run this notebook locally or in the Cloud using the IBM Data Science Experience 1. Load and install packages First, uncomment the lines in the below cell and upgrade the pixiedust and bokeh packages. When this is done restart the kernel. You have to do this only once, or when there is an update available. Then import the package needed to run this notebook. 2. Get weather data Find the latitude and longitude of your current location by running this magic javascript cell. Then fill in your Weather Company API credentials to load the weather forecast for where you are. Wait a few seconds to run the second cell to allow the above geolocation function to run. Or provide the lat and lon of the location you want to get a weather forecast for. Uncomment and run the next cell to have a look what the json data file looks like. Convert the data into a DataFrame with each timestep on a new row. Convert the timestamp into a datetime format and drop the columns that are not needed. See this Cheat sheet for date format conversions. Finally, convert the data type into numeric. You may have to change to format of the time to your time zone '%Y-%m-%dT%H:%M:%S+0200' for Europe or '%Y-%m-%dT%H:%M:%S+0100' for the UK during summer time for example. As there seems to be an issue with the pop column (percentage of precipitation), create a new column rain. 4. Plot data with matplotlib 5. Create a temperature map for the UK 6. Plot data with PixieDust https://ibm-cds-labs.github.io/pixiedust/
1,731
1,837
import requests import json import pandas as pd import numpy as np from datetime import datetime import time import pixiedust lat = str(41.3850639) lon = str(2.1734035) print(lat, lon) username='xxxx' password='xxxx' line='https://'+username+':'+password+\ '@twcservice.mybluemix.net/api/weather/v1/geocode/'+\ lat+'/'+lon+'/forecast/intraday/10day.json?&units=m' r=requests.get(line) weather = json.loads(r.text) df = pd.DataFrame.from_dict(weather['forecasts'][0],orient='index').transpose() for forecast in weather['forecasts'][1:]: df = pd.concat([df, pd.DataFrame.from_dict(forecast,orient='index').transpose()]) df['date'] = df['fcst_valid_local'].apply(lambda x: datetime.strptime(x, '%Y-%m-%dT%H:%M:%S+0200')) df = df.drop(['expire_time_gmt','num','qualifier','qualifier_code'],1) df = df.drop(['fcst_valid','fcst_valid_local','icon_extd','wdir_cardinal'],1) df = df.drop(['subphrase_pt1','subphrase_pt2','subphrase_pt3','class'],1) df = df.drop(['daypart_name','phrase_12char','phrase_22char','phrase_32char'],1) df.dtypes df[['pop','wspd','rh','clds','wdir','temp']] = df[['pop','wspd','rh','clds','wdir','temp']].apply(pd.to_numeric) df.dtypes df['rain'] = df['pop'].as_matrix() df=df.drop('pop',1) df.head() df = df.set_index('date',drop=False) df.head() import matplotlib.pyplot as plt import matplotlib fig, axes = plt.subplots(nrows=2, ncols=1, figsize=(14, 8)) df['temp'].plot(ax=axes[1], color='#6EEDD8',lw=3.0,sharex=True) axes[1].set_title('Temperature',loc='left',fontsize=20) df['rain'].plot(ax=axes[0], kind='bar', color='#C93D79',lw=2.0,sharex=True) axes[0].set_title('Chance of rain',loc='left',fontsize=20) cities = [ ('Exeter',50.7184,-3.5339), ('Truro',50.2632,-5.051), ('Carmarthen',51.8576,-4.3121), ('Norwich',52.6309,1.2974), ('Brighton And Hove',50.8225,-0.1372), ('Bristol',51.44999778,-2.583315472), ('Durham',54.7753,-1.5849), ('Llanidloes',52.4135,-3.5883), ('Penrith',54.6641,-2.7527), ('Jedburgh',55.4777,-2.5549), ('Coventry',52.42040367,-1.499996583), ('Edinburgh',55.94832786,-3.219090618), ('Cambridge',52.2053,0.1218), ('Glasgow',55.87440472,-4.250707236), ('Kingston upon Hull',53.7457,-0.3367), ('Leeds',53.83000755,-1.580017539), ('London',51.49999473,-0.116721844), ('Manchester',53.50041526,-2.247987103), ('Nottingham',52.97034426,-1.170016725), ('Aberdeen',57.1497,-2.0943), ('Fort Augustus',57.1448,-4.6805), ('Lairg',58.197,-4.6173), ('Oxford',51.7517,-1.2553), ('Inverey',56.9855,-3.5055), ('Shrewsbury',52.7069,-2.7527), ('Colwyn Bay',53.2932,-3.7276), ('Newton Stewart',54.9186,-4.5918), ('Portsmouth',50.80034751,-1.080022218)] icons=[] temps=[] for city in cities: lat = city[1] lon = city[2] line='https://'+username+':'+password+'@twcservice.mybluemix.net/api/weather/v1/geocode/'+str(lat)+'/'+str(lon)+'/observations.json?&units=m' r=requests.get(line) weather = json.loads(r.text) icons=np.append(icons,weather['observation']['wx_icon']) temps=np.append(temps,weather['observation']['temp']) dfmap = pd.DataFrame(cities, columns=['city','lat','lon']) dfmap['temp']=temps dfmap['icon']=icons dfmap.head(25) from mpl_toolkits.basemap import Basemap from matplotlib.offsetbox import AnnotationBbox, OffsetImage from matplotlib._png import read_png from itertools import izip import urllib matplotlib.style.use('bmh') fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(10, 12)) m1 = Basemap(projection='mill',resolution=None,llcrnrlon=-7.5,llcrnrlat=49.84,urcrnrlon=2.5,urcrnrlat=59,ax=axes[0]) m1.drawlsmask(land_color='dimgrey',ocean_color='dodgerBlue',lakes=True) m2 = Basemap(projection='mill',resolution=None,llcrnrlon=-7.5,llcrnrlat=49.84,urcrnrlon=2.5,urcrnrlat=59,ax=axes[1]) m2.drawlsmask(land_color='dimgrey',ocean_color='dodgerBlue',lakes=True) for [icon,city] in izip(icons,cities): lat = city[1] lon = city[2] try: pngfile=urllib.urlopen('https://github.com/ibm-cds-labs/python-notebooks/blob/master/weathericons/icon'+str(int(icon))+'.png?raw=true') icon_hand = read_png(pngfile) imagebox = OffsetImage(icon_hand, zoom=.15) ab = AnnotationBbox(imagebox,m1(lon,lat),frameon=False) axes[0].add_artist(ab) except: pass for [temp,city] in izip(temps,cities): lat = city[1] lon = city[2] if temp>16: col='indigo' elif temp>14: col='darkmagenta' elif temp>12: col='red' elif temp>10: col='tomato' elif temp>0: col='turquoise' x1, y1 = m2(lon,lat) bbox_props = dict(boxstyle="round,pad=0.3", fc=col, ec=col, lw=2) axes[1].text(x1, y1, temp, ha="center", va="center", size=11,bbox=bbox_props) plt.tight_layout() display(df)
1,196
1,231
2
weather_forecast-3
weather_forecast-3
Weather Forecast with PixieDust This notebook shows how to: use the Weather Company Data API to get weather forecast json data based on latitude and longitude convert this json data into a pandas DataFrame create a weather chart and map with matplotlib create a weather chart and map with PixieDust Before running the notebook: Sign up for a free 30-day trial Bluemix account Launch the Weather Data service in Bluemix and fill in the credentials below. Learn more here Run this notebook locally or in the Cloud using the IBM Data Science Experience 1. Load and install packages First, uncomment the lines in the below cell and upgrade the pixiedust and bokeh packages. When this is done restart the kernel. You have to do this only once, or when there is an update available. Then import the package needed to run this notebook. 2. Get weather data Find the latitude and longitude of your current location by running this magic javascript cell. Then fill in your Weather Company API credentials to load the weather forecast for where you are. Wait a few seconds to run the second cell to allow the above geolocation function to run. Or provide the lat and lon of the location you want to get a weather forecast for. Uncomment and run the next cell to have a look what the json data file looks like. Convert the data into a DataFrame with each timestep on a new row. Convert the timestamp into a datetime format and drop the columns that are not needed. See this Cheat sheet for date format conversions. Finally, convert the data type into numeric. You may have to change to format of the time to your time zone '%Y-%m-%dT%H:%M:%S+0200' for Europe or '%Y-%m-%dT%H:%M:%S+0100' for the UK during summer time for example. As there seems to be an issue with the pop column (percentage of precipitation), create a new column rain. 4. Plot data with matplotlib 5. Create a temperature map for the UK 6. Plot data with PixieDust https://ibm-cds-labs.github.io/pixiedust/
1,145
1,223
import requests import json import pandas as pd import numpy as np from datetime import datetime import time import pixiedust lat = str(41.3850639) lon = str(2.1734035) print(lat, lon) username='xxxx' password='xxxx' line='https://'+username+':'+password+\ '@twcservice.mybluemix.net/api/weather/v1/geocode/'+\ lat+'/'+lon+'/forecast/intraday/10day.json?&units=m' r=requests.get(line) weather = json.loads(r.text) df = pd.DataFrame.from_dict(weather['forecasts'][0],orient='index').transpose() for forecast in weather['forecasts'][1:]: df = pd.concat([df, pd.DataFrame.from_dict(forecast,orient='index').transpose()]) df['date'] = df['fcst_valid_local'].apply(lambda x: datetime.strptime(x, '%Y-%m-%dT%H:%M:%S+0200')) df = df.drop(['expire_time_gmt','num','qualifier','qualifier_code'],1) df = df.drop(['fcst_valid','fcst_valid_local','icon_extd','wdir_cardinal'],1) df = df.drop(['subphrase_pt1','subphrase_pt2','subphrase_pt3','class'],1) df = df.drop(['daypart_name','phrase_12char','phrase_22char','phrase_32char'],1) df.dtypes df[['pop','wspd','rh','clds','wdir','temp']] = df[['pop','wspd','rh','clds','wdir','temp']].apply(pd.to_numeric) df.dtypes df['rain'] = df['pop'].as_matrix() df=df.drop('pop',1) df.head() df = df.set_index('date',drop=False) df.head() import matplotlib.pyplot as plt import matplotlib fig, axes = plt.subplots(nrows=2, ncols=1, figsize=(14, 8)) df['temp'].plot(ax=axes[1], color='#6EEDD8',lw=3.0,sharex=True) axes[1].set_title('Temperature',loc='left',fontsize=20) df['rain'].plot(ax=axes[0], kind='bar', color='#C93D79',lw=2.0,sharex=True) axes[0].set_title('Chance of rain',loc='left',fontsize=20) cities = [ ('Exeter',50.7184,-3.5339), ('Truro',50.2632,-5.051), ('Carmarthen',51.8576,-4.3121), ('Norwich',52.6309,1.2974), ('Brighton And Hove',50.8225,-0.1372), ('Bristol',51.44999778,-2.583315472), ('Durham',54.7753,-1.5849), ('Llanidloes',52.4135,-3.5883), ('Penrith',54.6641,-2.7527), ('Jedburgh',55.4777,-2.5549), ('Coventry',52.42040367,-1.499996583), ('Edinburgh',55.94832786,-3.219090618), ('Cambridge',52.2053,0.1218), ('Glasgow',55.87440472,-4.250707236), ('Kingston upon Hull',53.7457,-0.3367), ('Leeds',53.83000755,-1.580017539), ('London',51.49999473,-0.116721844), ('Manchester',53.50041526,-2.247987103), ('Nottingham',52.97034426,-1.170016725), ('Aberdeen',57.1497,-2.0943), ('Fort Augustus',57.1448,-4.6805), ('Lairg',58.197,-4.6173), ('Oxford',51.7517,-1.2553), ('Inverey',56.9855,-3.5055), ('Shrewsbury',52.7069,-2.7527), ('Colwyn Bay',53.2932,-3.7276), ('Newton Stewart',54.9186,-4.5918), ('Portsmouth',50.80034751,-1.080022218)] icons=[] temps=[] for city in cities: lat = city[1] lon = city[2] line='https://'+username+':'+password+'@twcservice.mybluemix.net/api/weather/v1/geocode/'+str(lat)+'/'+str(lon)+'/observations.json?&units=m' r=requests.get(line) weather = json.loads(r.text) icons=np.append(icons,weather['observation']['wx_icon']) temps=np.append(temps,weather['observation']['temp']) dfmap = pd.DataFrame(cities, columns=['city','lat','lon']) dfmap['temp']=temps dfmap['icon']=icons dfmap.head(25) from mpl_toolkits.basemap import Basemap from matplotlib.offsetbox import AnnotationBbox, OffsetImage from matplotlib._png import read_png from itertools import izip import urllib matplotlib.style.use('bmh') fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(10, 12)) m1 = Basemap(projection='mill',resolution=None,llcrnrlon=-7.5,llcrnrlat=49.84,urcrnrlon=2.5,urcrnrlat=59,ax=axes[0]) m1.drawlsmask(land_color='dimgrey',ocean_color='dodgerBlue',lakes=True) m2 = Basemap(projection='mill',resolution=None,llcrnrlon=-7.5,llcrnrlat=49.84,urcrnrlon=2.5,urcrnrlat=59,ax=axes[1]) m2.drawlsmask(land_color='dimgrey',ocean_color='dodgerBlue',lakes=True) for [icon,city] in izip(icons,cities): lat = city[1] lon = city[2] try: pngfile=urllib.urlopen('https://github.com/ibm-cds-labs/python-notebooks/blob/master/weathericons/icon'+str(int(icon))+'.png?raw=true') icon_hand = read_png(pngfile) imagebox = OffsetImage(icon_hand, zoom=.15) ab = AnnotationBbox(imagebox,m1(lon,lat),frameon=False) axes[0].add_artist(ab) except: pass for [temp,city] in izip(temps,cities): lat = city[1] lon = city[2] if temp>16: col='indigo' elif temp>14: col='darkmagenta' elif temp>12: col='red' elif temp>10: col='tomato' elif temp>0: col='turquoise' x1, y1 = m2(lon,lat) bbox_props = dict(boxstyle="round,pad=0.3", fc=col, ec=col, lw=2) axes[1].text(x1, y1, temp, ha="center", va="center", size=11,bbox=bbox_props) plt.tight_layout() display(df)
128
171
3
weather_forecast-4
weather_forecast-4
Weather Forecast with PixieDust This notebook shows how to: use the Weather Company Data API to get weather forecast json data based on latitude and longitude convert this json data into a pandas DataFrame create a weather chart and map with matplotlib create a weather chart and map with PixieDust Before running the notebook: Sign up for a free 30-day trial Bluemix account Launch the Weather Data service in Bluemix and fill in the credentials below. Learn more here Run this notebook locally or in the Cloud using the IBM Data Science Experience 1. Load and install packages First, uncomment the lines in the below cell and upgrade the pixiedust and bokeh packages. When this is done restart the kernel. You have to do this only once, or when there is an update available. Then import the package needed to run this notebook. 2. Get weather data Find the latitude and longitude of your current location by running this magic javascript cell. Then fill in your Weather Company API credentials to load the weather forecast for where you are. Wait a few seconds to run the second cell to allow the above geolocation function to run. Or provide the lat and lon of the location you want to get a weather forecast for. Uncomment and run the next cell to have a look what the json data file looks like. Convert the data into a DataFrame with each timestep on a new row. Convert the timestamp into a datetime format and drop the columns that are not needed. See this Cheat sheet for date format conversions. Finally, convert the data type into numeric. You may have to change to format of the time to your time zone '%Y-%m-%dT%H:%M:%S+0200' for Europe or '%Y-%m-%dT%H:%M:%S+0100' for the UK during summer time for example. As there seems to be an issue with the pop column (percentage of precipitation), create a new column rain. 4. Plot data with matplotlib 5. Create a temperature map for the UK 6. Plot data with PixieDust https://ibm-cds-labs.github.io/pixiedust/
1,872
1,907
import requests import json import pandas as pd import numpy as np from datetime import datetime import time import pixiedust lat = str(41.3850639) lon = str(2.1734035) print(lat, lon) username='xxxx' password='xxxx' line='https://'+username+':'+password+\ '@twcservice.mybluemix.net/api/weather/v1/geocode/'+\ lat+'/'+lon+'/forecast/intraday/10day.json?&units=m' r=requests.get(line) weather = json.loads(r.text) df = pd.DataFrame.from_dict(weather['forecasts'][0],orient='index').transpose() for forecast in weather['forecasts'][1:]: df = pd.concat([df, pd.DataFrame.from_dict(forecast,orient='index').transpose()]) df['date'] = df['fcst_valid_local'].apply(lambda x: datetime.strptime(x, '%Y-%m-%dT%H:%M:%S+0200')) df = df.drop(['expire_time_gmt','num','qualifier','qualifier_code'],1) df = df.drop(['fcst_valid','fcst_valid_local','icon_extd','wdir_cardinal'],1) df = df.drop(['subphrase_pt1','subphrase_pt2','subphrase_pt3','class'],1) df = df.drop(['daypart_name','phrase_12char','phrase_22char','phrase_32char'],1) df.dtypes df[['pop','wspd','rh','clds','wdir','temp']] = df[['pop','wspd','rh','clds','wdir','temp']].apply(pd.to_numeric) df.dtypes df['rain'] = df['pop'].as_matrix() df=df.drop('pop',1) df.head() df = df.set_index('date',drop=False) df.head() import matplotlib.pyplot as plt import matplotlib fig, axes = plt.subplots(nrows=2, ncols=1, figsize=(14, 8)) df['temp'].plot(ax=axes[1], color='#6EEDD8',lw=3.0,sharex=True) axes[1].set_title('Temperature',loc='left',fontsize=20) df['rain'].plot(ax=axes[0], kind='bar', color='#C93D79',lw=2.0,sharex=True) axes[0].set_title('Chance of rain',loc='left',fontsize=20) cities = [ ('Exeter',50.7184,-3.5339), ('Truro',50.2632,-5.051), ('Carmarthen',51.8576,-4.3121), ('Norwich',52.6309,1.2974), ('Brighton And Hove',50.8225,-0.1372), ('Bristol',51.44999778,-2.583315472), ('Durham',54.7753,-1.5849), ('Llanidloes',52.4135,-3.5883), ('Penrith',54.6641,-2.7527), ('Jedburgh',55.4777,-2.5549), ('Coventry',52.42040367,-1.499996583), ('Edinburgh',55.94832786,-3.219090618), ('Cambridge',52.2053,0.1218), ('Glasgow',55.87440472,-4.250707236), ('Kingston upon Hull',53.7457,-0.3367), ('Leeds',53.83000755,-1.580017539), ('London',51.49999473,-0.116721844), ('Manchester',53.50041526,-2.247987103), ('Nottingham',52.97034426,-1.170016725), ('Aberdeen',57.1497,-2.0943), ('Fort Augustus',57.1448,-4.6805), ('Lairg',58.197,-4.6173), ('Oxford',51.7517,-1.2553), ('Inverey',56.9855,-3.5055), ('Shrewsbury',52.7069,-2.7527), ('Colwyn Bay',53.2932,-3.7276), ('Newton Stewart',54.9186,-4.5918), ('Portsmouth',50.80034751,-1.080022218)] icons=[] temps=[] for city in cities: lat = city[1] lon = city[2] line='https://'+username+':'+password+'@twcservice.mybluemix.net/api/weather/v1/geocode/'+str(lat)+'/'+str(lon)+'/observations.json?&units=m' r=requests.get(line) weather = json.loads(r.text) icons=np.append(icons,weather['observation']['wx_icon']) temps=np.append(temps,weather['observation']['temp']) dfmap = pd.DataFrame(cities, columns=['city','lat','lon']) dfmap['temp']=temps dfmap['icon']=icons dfmap.head(25) from mpl_toolkits.basemap import Basemap from matplotlib.offsetbox import AnnotationBbox, OffsetImage from matplotlib._png import read_png from itertools import izip import urllib matplotlib.style.use('bmh') fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(10, 12)) m1 = Basemap(projection='mill',resolution=None,llcrnrlon=-7.5,llcrnrlat=49.84,urcrnrlon=2.5,urcrnrlat=59,ax=axes[0]) m1.drawlsmask(land_color='dimgrey',ocean_color='dodgerBlue',lakes=True) m2 = Basemap(projection='mill',resolution=None,llcrnrlon=-7.5,llcrnrlat=49.84,urcrnrlon=2.5,urcrnrlat=59,ax=axes[1]) m2.drawlsmask(land_color='dimgrey',ocean_color='dodgerBlue',lakes=True) for [icon,city] in izip(icons,cities): lat = city[1] lon = city[2] try: pngfile=urllib.urlopen('https://github.com/ibm-cds-labs/python-notebooks/blob/master/weathericons/icon'+str(int(icon))+'.png?raw=true') icon_hand = read_png(pngfile) imagebox = OffsetImage(icon_hand, zoom=.15) ab = AnnotationBbox(imagebox,m1(lon,lat),frameon=False) axes[0].add_artist(ab) except: pass for [temp,city] in izip(temps,cities): lat = city[1] lon = city[2] if temp>16: col='indigo' elif temp>14: col='darkmagenta' elif temp>12: col='red' elif temp>10: col='tomato' elif temp>0: col='turquoise' x1, y1 = m2(lon,lat) bbox_props = dict(boxstyle="round,pad=0.3", fc=col, ec=col, lw=2) axes[1].text(x1, y1, temp, ha="center", va="center", size=11,bbox=bbox_props) plt.tight_layout() display(df)
4,379
4,858
4
weather_forecast-5
weather_forecast-5
Weather Forecast with PixieDust This notebook shows how to: use the Weather Company Data API to get weather forecast json data based on latitude and longitude convert this json data into a pandas DataFrame create a weather chart and map with matplotlib create a weather chart and map with PixieDust Before running the notebook: Sign up for a free 30-day trial Bluemix account Launch the Weather Data service in Bluemix and fill in the credentials below. Learn more here Run this notebook locally or in the Cloud using the IBM Data Science Experience 1. Load and install packages First, uncomment the lines in the below cell and upgrade the pixiedust and bokeh packages. When this is done restart the kernel. You have to do this only once, or when there is an update available. Then import the package needed to run this notebook. 2. Get weather data Find the latitude and longitude of your current location by running this magic javascript cell. Then fill in your Weather Company API credentials to load the weather forecast for where you are. Wait a few seconds to run the second cell to allow the above geolocation function to run. Or provide the lat and lon of the location you want to get a weather forecast for. Uncomment and run the next cell to have a look what the json data file looks like. Convert the data into a DataFrame with each timestep on a new row. Convert the timestamp into a datetime format and drop the columns that are not needed. See this Cheat sheet for date format conversions. Finally, convert the data type into numeric. You may have to change to format of the time to your time zone '%Y-%m-%dT%H:%M:%S+0200' for Europe or '%Y-%m-%dT%H:%M:%S+0100' for the UK during summer time for example. As there seems to be an issue with the pop column (percentage of precipitation), create a new column rain. 4. Plot data with matplotlib 5. Create a temperature map for the UK 6. Plot data with PixieDust https://ibm-cds-labs.github.io/pixiedust/
1,310
1,375
import requests import json import pandas as pd import numpy as np from datetime import datetime import time import pixiedust lat = str(41.3850639) lon = str(2.1734035) print(lat, lon) username='xxxx' password='xxxx' line='https://'+username+':'+password+\ '@twcservice.mybluemix.net/api/weather/v1/geocode/'+\ lat+'/'+lon+'/forecast/intraday/10day.json?&units=m' r=requests.get(line) weather = json.loads(r.text) df = pd.DataFrame.from_dict(weather['forecasts'][0],orient='index').transpose() for forecast in weather['forecasts'][1:]: df = pd.concat([df, pd.DataFrame.from_dict(forecast,orient='index').transpose()]) df['date'] = df['fcst_valid_local'].apply(lambda x: datetime.strptime(x, '%Y-%m-%dT%H:%M:%S+0200')) df = df.drop(['expire_time_gmt','num','qualifier','qualifier_code'],1) df = df.drop(['fcst_valid','fcst_valid_local','icon_extd','wdir_cardinal'],1) df = df.drop(['subphrase_pt1','subphrase_pt2','subphrase_pt3','class'],1) df = df.drop(['daypart_name','phrase_12char','phrase_22char','phrase_32char'],1) df.dtypes df[['pop','wspd','rh','clds','wdir','temp']] = df[['pop','wspd','rh','clds','wdir','temp']].apply(pd.to_numeric) df.dtypes df['rain'] = df['pop'].as_matrix() df=df.drop('pop',1) df.head() df = df.set_index('date',drop=False) df.head() import matplotlib.pyplot as plt import matplotlib fig, axes = plt.subplots(nrows=2, ncols=1, figsize=(14, 8)) df['temp'].plot(ax=axes[1], color='#6EEDD8',lw=3.0,sharex=True) axes[1].set_title('Temperature',loc='left',fontsize=20) df['rain'].plot(ax=axes[0], kind='bar', color='#C93D79',lw=2.0,sharex=True) axes[0].set_title('Chance of rain',loc='left',fontsize=20) cities = [ ('Exeter',50.7184,-3.5339), ('Truro',50.2632,-5.051), ('Carmarthen',51.8576,-4.3121), ('Norwich',52.6309,1.2974), ('Brighton And Hove',50.8225,-0.1372), ('Bristol',51.44999778,-2.583315472), ('Durham',54.7753,-1.5849), ('Llanidloes',52.4135,-3.5883), ('Penrith',54.6641,-2.7527), ('Jedburgh',55.4777,-2.5549), ('Coventry',52.42040367,-1.499996583), ('Edinburgh',55.94832786,-3.219090618), ('Cambridge',52.2053,0.1218), ('Glasgow',55.87440472,-4.250707236), ('Kingston upon Hull',53.7457,-0.3367), ('Leeds',53.83000755,-1.580017539), ('London',51.49999473,-0.116721844), ('Manchester',53.50041526,-2.247987103), ('Nottingham',52.97034426,-1.170016725), ('Aberdeen',57.1497,-2.0943), ('Fort Augustus',57.1448,-4.6805), ('Lairg',58.197,-4.6173), ('Oxford',51.7517,-1.2553), ('Inverey',56.9855,-3.5055), ('Shrewsbury',52.7069,-2.7527), ('Colwyn Bay',53.2932,-3.7276), ('Newton Stewart',54.9186,-4.5918), ('Portsmouth',50.80034751,-1.080022218)] icons=[] temps=[] for city in cities: lat = city[1] lon = city[2] line='https://'+username+':'+password+'@twcservice.mybluemix.net/api/weather/v1/geocode/'+str(lat)+'/'+str(lon)+'/observations.json?&units=m' r=requests.get(line) weather = json.loads(r.text) icons=np.append(icons,weather['observation']['wx_icon']) temps=np.append(temps,weather['observation']['temp']) dfmap = pd.DataFrame(cities, columns=['city','lat','lon']) dfmap['temp']=temps dfmap['icon']=icons dfmap.head(25) from mpl_toolkits.basemap import Basemap from matplotlib.offsetbox import AnnotationBbox, OffsetImage from matplotlib._png import read_png from itertools import izip import urllib matplotlib.style.use('bmh') fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(10, 12)) m1 = Basemap(projection='mill',resolution=None,llcrnrlon=-7.5,llcrnrlat=49.84,urcrnrlon=2.5,urcrnrlat=59,ax=axes[0]) m1.drawlsmask(land_color='dimgrey',ocean_color='dodgerBlue',lakes=True) m2 = Basemap(projection='mill',resolution=None,llcrnrlon=-7.5,llcrnrlat=49.84,urcrnrlon=2.5,urcrnrlat=59,ax=axes[1]) m2.drawlsmask(land_color='dimgrey',ocean_color='dodgerBlue',lakes=True) for [icon,city] in izip(icons,cities): lat = city[1] lon = city[2] try: pngfile=urllib.urlopen('https://github.com/ibm-cds-labs/python-notebooks/blob/master/weathericons/icon'+str(int(icon))+'.png?raw=true') icon_hand = read_png(pngfile) imagebox = OffsetImage(icon_hand, zoom=.15) ab = AnnotationBbox(imagebox,m1(lon,lat),frameon=False) axes[0].add_artist(ab) except: pass for [temp,city] in izip(temps,cities): lat = city[1] lon = city[2] if temp>16: col='indigo' elif temp>14: col='darkmagenta' elif temp>12: col='red' elif temp>10: col='tomato' elif temp>0: col='turquoise' x1, y1 = m2(lon,lat) bbox_props = dict(boxstyle="round,pad=0.3", fc=col, ec=col, lw=2) axes[1].text(x1, y1, temp, ha="center", va="center", size=11,bbox=bbox_props) plt.tight_layout() display(df)
433
641
5
weather_forecast-6
weather_forecast-6
Weather Forecast with PixieDust This notebook shows how to: use the Weather Company Data API to get weather forecast json data based on latitude and longitude convert this json data into a pandas DataFrame create a weather chart and map with matplotlib create a weather chart and map with PixieDust Before running the notebook: Sign up for a free 30-day trial Bluemix account Launch the Weather Data service in Bluemix and fill in the credentials below. Learn more here Run this notebook locally or in the Cloud using the IBM Data Science Experience 1. Load and install packages First, uncomment the lines in the below cell and upgrade the pixiedust and bokeh packages. When this is done restart the kernel. You have to do this only once, or when there is an update available. Then import the package needed to run this notebook. 2. Get weather data Find the latitude and longitude of your current location by running this magic javascript cell. Then fill in your Weather Company API credentials to load the weather forecast for where you are. Wait a few seconds to run the second cell to allow the above geolocation function to run. Or provide the lat and lon of the location you want to get a weather forecast for. Uncomment and run the next cell to have a look what the json data file looks like. Convert the data into a DataFrame with each timestep on a new row. Convert the timestamp into a datetime format and drop the columns that are not needed. See this Cheat sheet for date format conversions. Finally, convert the data type into numeric. You may have to change to format of the time to your time zone '%Y-%m-%dT%H:%M:%S+0200' for Europe or '%Y-%m-%dT%H:%M:%S+0100' for the UK during summer time for example. As there seems to be an issue with the pop column (percentage of precipitation), create a new column rain. 4. Plot data with matplotlib 5. Create a temperature map for the UK 6. Plot data with PixieDust https://ibm-cds-labs.github.io/pixiedust/
1,514
1,557
import requests import json import pandas as pd import numpy as np from datetime import datetime import time import pixiedust lat = str(41.3850639) lon = str(2.1734035) print(lat, lon) username='xxxx' password='xxxx' line='https://'+username+':'+password+\ '@twcservice.mybluemix.net/api/weather/v1/geocode/'+\ lat+'/'+lon+'/forecast/intraday/10day.json?&units=m' r=requests.get(line) weather = json.loads(r.text) df = pd.DataFrame.from_dict(weather['forecasts'][0],orient='index').transpose() for forecast in weather['forecasts'][1:]: df = pd.concat([df, pd.DataFrame.from_dict(forecast,orient='index').transpose()]) df['date'] = df['fcst_valid_local'].apply(lambda x: datetime.strptime(x, '%Y-%m-%dT%H:%M:%S+0200')) df = df.drop(['expire_time_gmt','num','qualifier','qualifier_code'],1) df = df.drop(['fcst_valid','fcst_valid_local','icon_extd','wdir_cardinal'],1) df = df.drop(['subphrase_pt1','subphrase_pt2','subphrase_pt3','class'],1) df = df.drop(['daypart_name','phrase_12char','phrase_22char','phrase_32char'],1) df.dtypes df[['pop','wspd','rh','clds','wdir','temp']] = df[['pop','wspd','rh','clds','wdir','temp']].apply(pd.to_numeric) df.dtypes df['rain'] = df['pop'].as_matrix() df=df.drop('pop',1) df.head() df = df.set_index('date',drop=False) df.head() import matplotlib.pyplot as plt import matplotlib fig, axes = plt.subplots(nrows=2, ncols=1, figsize=(14, 8)) df['temp'].plot(ax=axes[1], color='#6EEDD8',lw=3.0,sharex=True) axes[1].set_title('Temperature',loc='left',fontsize=20) df['rain'].plot(ax=axes[0], kind='bar', color='#C93D79',lw=2.0,sharex=True) axes[0].set_title('Chance of rain',loc='left',fontsize=20) cities = [ ('Exeter',50.7184,-3.5339), ('Truro',50.2632,-5.051), ('Carmarthen',51.8576,-4.3121), ('Norwich',52.6309,1.2974), ('Brighton And Hove',50.8225,-0.1372), ('Bristol',51.44999778,-2.583315472), ('Durham',54.7753,-1.5849), ('Llanidloes',52.4135,-3.5883), ('Penrith',54.6641,-2.7527), ('Jedburgh',55.4777,-2.5549), ('Coventry',52.42040367,-1.499996583), ('Edinburgh',55.94832786,-3.219090618), ('Cambridge',52.2053,0.1218), ('Glasgow',55.87440472,-4.250707236), ('Kingston upon Hull',53.7457,-0.3367), ('Leeds',53.83000755,-1.580017539), ('London',51.49999473,-0.116721844), ('Manchester',53.50041526,-2.247987103), ('Nottingham',52.97034426,-1.170016725), ('Aberdeen',57.1497,-2.0943), ('Fort Augustus',57.1448,-4.6805), ('Lairg',58.197,-4.6173), ('Oxford',51.7517,-1.2553), ('Inverey',56.9855,-3.5055), ('Shrewsbury',52.7069,-2.7527), ('Colwyn Bay',53.2932,-3.7276), ('Newton Stewart',54.9186,-4.5918), ('Portsmouth',50.80034751,-1.080022218)] icons=[] temps=[] for city in cities: lat = city[1] lon = city[2] line='https://'+username+':'+password+'@twcservice.mybluemix.net/api/weather/v1/geocode/'+str(lat)+'/'+str(lon)+'/observations.json?&units=m' r=requests.get(line) weather = json.loads(r.text) icons=np.append(icons,weather['observation']['wx_icon']) temps=np.append(temps,weather['observation']['temp']) dfmap = pd.DataFrame(cities, columns=['city','lat','lon']) dfmap['temp']=temps dfmap['icon']=icons dfmap.head(25) from mpl_toolkits.basemap import Basemap from matplotlib.offsetbox import AnnotationBbox, OffsetImage from matplotlib._png import read_png from itertools import izip import urllib matplotlib.style.use('bmh') fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(10, 12)) m1 = Basemap(projection='mill',resolution=None,llcrnrlon=-7.5,llcrnrlat=49.84,urcrnrlon=2.5,urcrnrlat=59,ax=axes[0]) m1.drawlsmask(land_color='dimgrey',ocean_color='dodgerBlue',lakes=True) m2 = Basemap(projection='mill',resolution=None,llcrnrlon=-7.5,llcrnrlat=49.84,urcrnrlon=2.5,urcrnrlat=59,ax=axes[1]) m2.drawlsmask(land_color='dimgrey',ocean_color='dodgerBlue',lakes=True) for [icon,city] in izip(icons,cities): lat = city[1] lon = city[2] try: pngfile=urllib.urlopen('https://github.com/ibm-cds-labs/python-notebooks/blob/master/weathericons/icon'+str(int(icon))+'.png?raw=true') icon_hand = read_png(pngfile) imagebox = OffsetImage(icon_hand, zoom=.15) ab = AnnotationBbox(imagebox,m1(lon,lat),frameon=False) axes[0].add_artist(ab) except: pass for [temp,city] in izip(temps,cities): lat = city[1] lon = city[2] if temp>16: col='indigo' elif temp>14: col='darkmagenta' elif temp>12: col='red' elif temp>10: col='tomato' elif temp>0: col='turquoise' x1, y1 = m2(lon,lat) bbox_props = dict(boxstyle="round,pad=0.3", fc=col, ec=col, lw=2) axes[1].text(x1, y1, temp, ha="center", va="center", size=11,bbox=bbox_props) plt.tight_layout() display(df)
1,071
1,184
6
weather_forecast-7
weather_forecast-7
Weather Forecast with PixieDust This notebook shows how to: use the Weather Company Data API to get weather forecast json data based on latitude and longitude convert this json data into a pandas DataFrame create a weather chart and map with matplotlib create a weather chart and map with PixieDust Before running the notebook: Sign up for a free 30-day trial Bluemix account Launch the Weather Data service in Bluemix and fill in the credentials below. Learn more here Run this notebook locally or in the Cloud using the IBM Data Science Experience 1. Load and install packages First, uncomment the lines in the below cell and upgrade the pixiedust and bokeh packages. When this is done restart the kernel. You have to do this only once, or when there is an update available. Then import the package needed to run this notebook. 2. Get weather data Find the latitude and longitude of your current location by running this magic javascript cell. Then fill in your Weather Company API credentials to load the weather forecast for where you are. Wait a few seconds to run the second cell to allow the above geolocation function to run. Or provide the lat and lon of the location you want to get a weather forecast for. Uncomment and run the next cell to have a look what the json data file looks like. Convert the data into a DataFrame with each timestep on a new row. Convert the timestamp into a datetime format and drop the columns that are not needed. See this Cheat sheet for date format conversions. Finally, convert the data type into numeric. You may have to change to format of the time to your time zone '%Y-%m-%dT%H:%M:%S+0200' for Europe or '%Y-%m-%dT%H:%M:%S+0100' for the UK during summer time for example. As there seems to be an issue with the pop column (percentage of precipitation), create a new column rain. 4. Plot data with matplotlib 5. Create a temperature map for the UK 6. Plot data with PixieDust https://ibm-cds-labs.github.io/pixiedust/
1,839
1,867
import requests import json import pandas as pd import numpy as np from datetime import datetime import time import pixiedust lat = str(41.3850639) lon = str(2.1734035) print(lat, lon) username='xxxx' password='xxxx' line='https://'+username+':'+password+\ '@twcservice.mybluemix.net/api/weather/v1/geocode/'+\ lat+'/'+lon+'/forecast/intraday/10day.json?&units=m' r=requests.get(line) weather = json.loads(r.text) df = pd.DataFrame.from_dict(weather['forecasts'][0],orient='index').transpose() for forecast in weather['forecasts'][1:]: df = pd.concat([df, pd.DataFrame.from_dict(forecast,orient='index').transpose()]) df['date'] = df['fcst_valid_local'].apply(lambda x: datetime.strptime(x, '%Y-%m-%dT%H:%M:%S+0200')) df = df.drop(['expire_time_gmt','num','qualifier','qualifier_code'],1) df = df.drop(['fcst_valid','fcst_valid_local','icon_extd','wdir_cardinal'],1) df = df.drop(['subphrase_pt1','subphrase_pt2','subphrase_pt3','class'],1) df = df.drop(['daypart_name','phrase_12char','phrase_22char','phrase_32char'],1) df.dtypes df[['pop','wspd','rh','clds','wdir','temp']] = df[['pop','wspd','rh','clds','wdir','temp']].apply(pd.to_numeric) df.dtypes df['rain'] = df['pop'].as_matrix() df=df.drop('pop',1) df.head() df = df.set_index('date',drop=False) df.head() import matplotlib.pyplot as plt import matplotlib fig, axes = plt.subplots(nrows=2, ncols=1, figsize=(14, 8)) df['temp'].plot(ax=axes[1], color='#6EEDD8',lw=3.0,sharex=True) axes[1].set_title('Temperature',loc='left',fontsize=20) df['rain'].plot(ax=axes[0], kind='bar', color='#C93D79',lw=2.0,sharex=True) axes[0].set_title('Chance of rain',loc='left',fontsize=20) cities = [ ('Exeter',50.7184,-3.5339), ('Truro',50.2632,-5.051), ('Carmarthen',51.8576,-4.3121), ('Norwich',52.6309,1.2974), ('Brighton And Hove',50.8225,-0.1372), ('Bristol',51.44999778,-2.583315472), ('Durham',54.7753,-1.5849), ('Llanidloes',52.4135,-3.5883), ('Penrith',54.6641,-2.7527), ('Jedburgh',55.4777,-2.5549), ('Coventry',52.42040367,-1.499996583), ('Edinburgh',55.94832786,-3.219090618), ('Cambridge',52.2053,0.1218), ('Glasgow',55.87440472,-4.250707236), ('Kingston upon Hull',53.7457,-0.3367), ('Leeds',53.83000755,-1.580017539), ('London',51.49999473,-0.116721844), ('Manchester',53.50041526,-2.247987103), ('Nottingham',52.97034426,-1.170016725), ('Aberdeen',57.1497,-2.0943), ('Fort Augustus',57.1448,-4.6805), ('Lairg',58.197,-4.6173), ('Oxford',51.7517,-1.2553), ('Inverey',56.9855,-3.5055), ('Shrewsbury',52.7069,-2.7527), ('Colwyn Bay',53.2932,-3.7276), ('Newton Stewart',54.9186,-4.5918), ('Portsmouth',50.80034751,-1.080022218)] icons=[] temps=[] for city in cities: lat = city[1] lon = city[2] line='https://'+username+':'+password+'@twcservice.mybluemix.net/api/weather/v1/geocode/'+str(lat)+'/'+str(lon)+'/observations.json?&units=m' r=requests.get(line) weather = json.loads(r.text) icons=np.append(icons,weather['observation']['wx_icon']) temps=np.append(temps,weather['observation']['temp']) dfmap = pd.DataFrame(cities, columns=['city','lat','lon']) dfmap['temp']=temps dfmap['icon']=icons dfmap.head(25) from mpl_toolkits.basemap import Basemap from matplotlib.offsetbox import AnnotationBbox, OffsetImage from matplotlib._png import read_png from itertools import izip import urllib matplotlib.style.use('bmh') fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(10, 12)) m1 = Basemap(projection='mill',resolution=None,llcrnrlon=-7.5,llcrnrlat=49.84,urcrnrlon=2.5,urcrnrlat=59,ax=axes[0]) m1.drawlsmask(land_color='dimgrey',ocean_color='dodgerBlue',lakes=True) m2 = Basemap(projection='mill',resolution=None,llcrnrlon=-7.5,llcrnrlat=49.84,urcrnrlon=2.5,urcrnrlat=59,ax=axes[1]) m2.drawlsmask(land_color='dimgrey',ocean_color='dodgerBlue',lakes=True) for [icon,city] in izip(icons,cities): lat = city[1] lon = city[2] try: pngfile=urllib.urlopen('https://github.com/ibm-cds-labs/python-notebooks/blob/master/weathericons/icon'+str(int(icon))+'.png?raw=true') icon_hand = read_png(pngfile) imagebox = OffsetImage(icon_hand, zoom=.15) ab = AnnotationBbox(imagebox,m1(lon,lat),frameon=False) axes[0].add_artist(ab) except: pass for [temp,city] in izip(temps,cities): lat = city[1] lon = city[2] if temp>16: col='indigo' elif temp>14: col='darkmagenta' elif temp>12: col='red' elif temp>10: col='tomato' elif temp>0: col='turquoise' x1, y1 = m2(lon,lat) bbox_props = dict(boxstyle="round,pad=0.3", fc=col, ec=col, lw=2) axes[1].text(x1, y1, temp, ha="center", va="center", size=11,bbox=bbox_props) plt.tight_layout() display(df)
1,312
1,680
7
weather_forecast-8
weather_forecast-8
Weather Forecast with PixieDust This notebook shows how to: use the Weather Company Data API to get weather forecast json data based on latitude and longitude convert this json data into a pandas DataFrame create a weather chart and map with matplotlib create a weather chart and map with PixieDust Before running the notebook: Sign up for a free 30-day trial Bluemix account Launch the Weather Data service in Bluemix and fill in the credentials below. Learn more here Run this notebook locally or in the Cloud using the IBM Data Science Experience 1. Load and install packages First, uncomment the lines in the below cell and upgrade the pixiedust and bokeh packages. When this is done restart the kernel. You have to do this only once, or when there is an update available. Then import the package needed to run this notebook. 2. Get weather data Find the latitude and longitude of your current location by running this magic javascript cell. Then fill in your Weather Company API credentials to load the weather forecast for where you are. Wait a few seconds to run the second cell to allow the above geolocation function to run. Or provide the lat and lon of the location you want to get a weather forecast for. Uncomment and run the next cell to have a look what the json data file looks like. Convert the data into a DataFrame with each timestep on a new row. Convert the timestamp into a datetime format and drop the columns that are not needed. See this Cheat sheet for date format conversions. Finally, convert the data type into numeric. You may have to change to format of the time to your time zone '%Y-%m-%dT%H:%M:%S+0200' for Europe or '%Y-%m-%dT%H:%M:%S+0100' for the UK during summer time for example. As there seems to be an issue with the pop column (percentage of precipitation), create a new column rain. 4. Plot data with matplotlib 5. Create a temperature map for the UK 6. Plot data with PixieDust https://ibm-cds-labs.github.io/pixiedust/
787
833
import requests import json import pandas as pd import numpy as np from datetime import datetime import time import pixiedust lat = str(41.3850639) lon = str(2.1734035) print(lat, lon) username='xxxx' password='xxxx' line='https://'+username+':'+password+\ '@twcservice.mybluemix.net/api/weather/v1/geocode/'+\ lat+'/'+lon+'/forecast/intraday/10day.json?&units=m' r=requests.get(line) weather = json.loads(r.text) df = pd.DataFrame.from_dict(weather['forecasts'][0],orient='index').transpose() for forecast in weather['forecasts'][1:]: df = pd.concat([df, pd.DataFrame.from_dict(forecast,orient='index').transpose()]) df['date'] = df['fcst_valid_local'].apply(lambda x: datetime.strptime(x, '%Y-%m-%dT%H:%M:%S+0200')) df = df.drop(['expire_time_gmt','num','qualifier','qualifier_code'],1) df = df.drop(['fcst_valid','fcst_valid_local','icon_extd','wdir_cardinal'],1) df = df.drop(['subphrase_pt1','subphrase_pt2','subphrase_pt3','class'],1) df = df.drop(['daypart_name','phrase_12char','phrase_22char','phrase_32char'],1) df.dtypes df[['pop','wspd','rh','clds','wdir','temp']] = df[['pop','wspd','rh','clds','wdir','temp']].apply(pd.to_numeric) df.dtypes df['rain'] = df['pop'].as_matrix() df=df.drop('pop',1) df.head() df = df.set_index('date',drop=False) df.head() import matplotlib.pyplot as plt import matplotlib fig, axes = plt.subplots(nrows=2, ncols=1, figsize=(14, 8)) df['temp'].plot(ax=axes[1], color='#6EEDD8',lw=3.0,sharex=True) axes[1].set_title('Temperature',loc='left',fontsize=20) df['rain'].plot(ax=axes[0], kind='bar', color='#C93D79',lw=2.0,sharex=True) axes[0].set_title('Chance of rain',loc='left',fontsize=20) cities = [ ('Exeter',50.7184,-3.5339), ('Truro',50.2632,-5.051), ('Carmarthen',51.8576,-4.3121), ('Norwich',52.6309,1.2974), ('Brighton And Hove',50.8225,-0.1372), ('Bristol',51.44999778,-2.583315472), ('Durham',54.7753,-1.5849), ('Llanidloes',52.4135,-3.5883), ('Penrith',54.6641,-2.7527), ('Jedburgh',55.4777,-2.5549), ('Coventry',52.42040367,-1.499996583), ('Edinburgh',55.94832786,-3.219090618), ('Cambridge',52.2053,0.1218), ('Glasgow',55.87440472,-4.250707236), ('Kingston upon Hull',53.7457,-0.3367), ('Leeds',53.83000755,-1.580017539), ('London',51.49999473,-0.116721844), ('Manchester',53.50041526,-2.247987103), ('Nottingham',52.97034426,-1.170016725), ('Aberdeen',57.1497,-2.0943), ('Fort Augustus',57.1448,-4.6805), ('Lairg',58.197,-4.6173), ('Oxford',51.7517,-1.2553), ('Inverey',56.9855,-3.5055), ('Shrewsbury',52.7069,-2.7527), ('Colwyn Bay',53.2932,-3.7276), ('Newton Stewart',54.9186,-4.5918), ('Portsmouth',50.80034751,-1.080022218)] icons=[] temps=[] for city in cities: lat = city[1] lon = city[2] line='https://'+username+':'+password+'@twcservice.mybluemix.net/api/weather/v1/geocode/'+str(lat)+'/'+str(lon)+'/observations.json?&units=m' r=requests.get(line) weather = json.loads(r.text) icons=np.append(icons,weather['observation']['wx_icon']) temps=np.append(temps,weather['observation']['temp']) dfmap = pd.DataFrame(cities, columns=['city','lat','lon']) dfmap['temp']=temps dfmap['icon']=icons dfmap.head(25) from mpl_toolkits.basemap import Basemap from matplotlib.offsetbox import AnnotationBbox, OffsetImage from matplotlib._png import read_png from itertools import izip import urllib matplotlib.style.use('bmh') fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(10, 12)) m1 = Basemap(projection='mill',resolution=None,llcrnrlon=-7.5,llcrnrlat=49.84,urcrnrlon=2.5,urcrnrlat=59,ax=axes[0]) m1.drawlsmask(land_color='dimgrey',ocean_color='dodgerBlue',lakes=True) m2 = Basemap(projection='mill',resolution=None,llcrnrlon=-7.5,llcrnrlat=49.84,urcrnrlon=2.5,urcrnrlat=59,ax=axes[1]) m2.drawlsmask(land_color='dimgrey',ocean_color='dodgerBlue',lakes=True) for [icon,city] in izip(icons,cities): lat = city[1] lon = city[2] try: pngfile=urllib.urlopen('https://github.com/ibm-cds-labs/python-notebooks/blob/master/weathericons/icon'+str(int(icon))+'.png?raw=true') icon_hand = read_png(pngfile) imagebox = OffsetImage(icon_hand, zoom=.15) ab = AnnotationBbox(imagebox,m1(lon,lat),frameon=False) axes[0].add_artist(ab) except: pass for [temp,city] in izip(temps,cities): lat = city[1] lon = city[2] if temp>16: col='indigo' elif temp>14: col='darkmagenta' elif temp>12: col='red' elif temp>10: col='tomato' elif temp>0: col='turquoise' x1, y1 = m2(lon,lat) bbox_props = dict(boxstyle="round,pad=0.3", fc=col, ec=col, lw=2) axes[1].text(x1, y1, temp, ha="center", va="center", size=11,bbox=bbox_props) plt.tight_layout() display(df)
0
126
8
mass_balance_gradients-0
mass_balance_gradients-0
Mass balance gradients (MBG) and their influence on glacier flow In the intro notebook we touched briefly on the mass balance gradient of a glacier. This is what we are going to take a closer look at now. If the concept of mass balance is completely new to you, have a short read about it here, up to the paragraph "So what is Glacier Mass Balance?". In this notebook we will set up a few simple glaciers to further explore what characteristics of glaciers change with different mass balance gradients. We will also take a look at the topics of volume and response time. Goals of this notebook: The student will be able to explain the terms: Mass balance gradient, Equilibrium state Response time. First, we have to import the relevant classes Initialising the glacier We start by setting up a simple glacier with a linear bedrock (see Getting started with OGGM Edu) to generate a starting point for our experiment. Changing the mass balance gradient (MBG) The MBG is defined as the change of the mass balance with altitude ¹. It depends strongly on the climate at the glacier ². Let's take a look at the effects of the MBG by creating a few glaciers with different gradients. In the intro notebook our glacier had a gradient of 4 mm/m so lets add a glacier with a weaker gradient and one with a stronger gradient. We will again make use of the GlacierCollection to quickly progress and visualise the glaciers. Creating a complex mass balance profile It is also possible to create a more complex mass balance profile. This is achieved by passing a list of gradients, and another list with the altitude of the breakpoints between them. A stronger mass balance gradient (flatter line in plot above) implies a larger change of the mass balance with altitude. We can see this in the plot above: The annual mass balance hardly changes with altitude for the glacier with the weakest mass balance gradient (blue) while there is a considerable difference between the top and bottom annual mass balance for the glacier with the strongest mass balance gradient (green). This in turn affects the growth of the glacier. A strong mass balance gradient implies that more ice is added to the accumulation zone while more ice is removed from the ablation zone each year compared to a glacier with a weaker gradient. This results in a greater ice flux and the glacier thus grows faster. This is why the glacier with the strongest gradient exhibits the largest growth during our experiments (Green glacier in Collection plot above). What do you think: where do we find glaciers with high MBGs? Click for details Equilibrium state Glaciers change their geometry as a way to adapt to the climate³. If the accumulation increases, the glacier will grow further down below the ELA to increase the ablation. Similarly, if the temperature rises and the ablation increases, the glacier length will decrease. If the climate remains constant for a long enough time, glaciers will reach an equilibrium state with its climate, where the accumulation = ablation ⁴. With this in mind, we will take a look at how fast our glaciers, with different gradients, reach this state and compare their shapes: The different glaciers reach their equilibrium state after a different number of years. What does the figure show us? Which glacier is the thickest and longest? Let's look at specific numbers: The glacier with the strongest gradient reaches the equilibrium state first. This is also the largest and longest glacier. Response time The glacier response time is the period of time a glacier needs to adjust its geometry to changes in mass balance caused by climate change and reach a new equilibrium state. There are a some different definitions for its calculation, OGGM-Edu use the definition from Oerlemans (see formula below) ⁵. A OGGM-Edu glacier has an attribute .response_time which is calculated based on difference between the last two equilibrium states in the glacier history. So far we've only showed you how to progress a glacier to equilibrium, but not how to leave it and reach a second one. This will be the first step to getting the response time of a glacier. We use the glacier from the start of the notebook. First we progress the glacier to equilibrium We can access the stored equilibrium states of a glacier Now we want to set up a climate change scenario for the glacier. This is easily done with the .add_temperature_bias method. This method takes a desired temperature bias (+/−) and a duration, which specifies how long it will take for the glacier to reach the climate state. For instance, if we set the bias to 1. and the duration to 50, it will take 50 years for the climate to become 1 degree warmer. When a glacier has a climate change scenario the progress_ methods will internally work a little bit differently, but this is not anything you will notice. Since we are purely interested in the response of the glacier, we create a climate change scenario with the duration of 1 year. The next step is to calculate the response times for our glaciers. One could think that it is as simple as looking at the years above and do a simple subtraction. However this is not the case! In reality the rate at which a glacier changes is ever decreasing and a complete equilibrium state is never really achieved. Because of this the response time is considered the time it has taken the glacier to complete most of the adjustment, more specifically all but a factor of 1/e. For numerical models like our glaciers it is common to use the volume response time, from Oerlemans: τ = t(V = V2 −V 2 − V1e) where V1 and V2 corresponds to the glacier volume at the initial and new equilibrium state respectively. Luckily this is done by our glacier object, so we can just take look at the .response_time attribute or just look at the representation Now that we have introduced the concept of response time we can apply it and see how the different mass balance gradients affect the response time. For this we need a new collection. We then have to set up a climate change scenario for the glaciers in the collection We can also look at the state history for one of the glaciers The glacier with weakest MBG need the longest time to adjust to a changed climate compared to the other glaciers. On the other hand, the glacier with the strongest gradient only needs a around two decades to adjust its shape to the new climate (A real world example: Franz Josef glacier in New Zealand⁶)⁷. The response time of glaciers with weak gradients is in reality much longer than 200 years, actually closer to 2000 years.
1,461
1,644
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) complex_mb = MassBalance(ela=3000, gradient=[3, 7, 10, 15], breakpoints=[2700, 2250, 1800]) glacier_complex_mb = Glacier(bed=bed, mass_balance=complex_mb) collection.add(glacier_complex_mb) collection.progress_to_year(300) collection.plot() collection.plot_mass_balance() collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) collection.progress_to_equilibrium() collection.plot() collection glacier glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.add_temperature_bias(bias=1., duration=1) glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.response_time glacier bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[1, 4, 15]} ) collection.progress_to_equilibrium() collection collection.glaciers[0].add_temperature_bias(bias=1., duration=1) collection.glaciers[1].add_temperature_bias(bias=1., duration=1) collection.glaciers[2].add_temperature_bias(bias=1., duration=1) collection.progress_to_equilibrium() collection collection.plot_history() collection.glaciers[0].plot_state_history(eq_states=True)
381
561
0
mass_balance_gradients-1
mass_balance_gradients-1
Mass balance gradients (MBG) and their influence on glacier flow In the intro notebook we touched briefly on the mass balance gradient of a glacier. This is what we are going to take a closer look at now. If the concept of mass balance is completely new to you, have a short read about it here, up to the paragraph "So what is Glacier Mass Balance?". In this notebook we will set up a few simple glaciers to further explore what characteristics of glaciers change with different mass balance gradients. We will also take a look at the topics of volume and response time. Goals of this notebook: The student will be able to explain the terms: Mass balance gradient, Equilibrium state Response time. First, we have to import the relevant classes Initialising the glacier We start by setting up a simple glacier with a linear bedrock (see Getting started with OGGM Edu) to generate a starting point for our experiment. Changing the mass balance gradient (MBG) The MBG is defined as the change of the mass balance with altitude ¹. It depends strongly on the climate at the glacier ². Let's take a look at the effects of the MBG by creating a few glaciers with different gradients. In the intro notebook our glacier had a gradient of 4 mm/m so lets add a glacier with a weaker gradient and one with a stronger gradient. We will again make use of the GlacierCollection to quickly progress and visualise the glaciers. Creating a complex mass balance profile It is also possible to create a more complex mass balance profile. This is achieved by passing a list of gradients, and another list with the altitude of the breakpoints between them. A stronger mass balance gradient (flatter line in plot above) implies a larger change of the mass balance with altitude. We can see this in the plot above: The annual mass balance hardly changes with altitude for the glacier with the weakest mass balance gradient (blue) while there is a considerable difference between the top and bottom annual mass balance for the glacier with the strongest mass balance gradient (green). This in turn affects the growth of the glacier. A strong mass balance gradient implies that more ice is added to the accumulation zone while more ice is removed from the ablation zone each year compared to a glacier with a weaker gradient. This results in a greater ice flux and the glacier thus grows faster. This is why the glacier with the strongest gradient exhibits the largest growth during our experiments (Green glacier in Collection plot above). What do you think: where do we find glaciers with high MBGs? Click for details Equilibrium state Glaciers change their geometry as a way to adapt to the climate³. If the accumulation increases, the glacier will grow further down below the ELA to increase the ablation. Similarly, if the temperature rises and the ablation increases, the glacier length will decrease. If the climate remains constant for a long enough time, glaciers will reach an equilibrium state with its climate, where the accumulation = ablation ⁴. With this in mind, we will take a look at how fast our glaciers, with different gradients, reach this state and compare their shapes: The different glaciers reach their equilibrium state after a different number of years. What does the figure show us? Which glacier is the thickest and longest? Let's look at specific numbers: The glacier with the strongest gradient reaches the equilibrium state first. This is also the largest and longest glacier. Response time The glacier response time is the period of time a glacier needs to adjust its geometry to changes in mass balance caused by climate change and reach a new equilibrium state. There are a some different definitions for its calculation, OGGM-Edu use the definition from Oerlemans (see formula below) ⁵. A OGGM-Edu glacier has an attribute .response_time which is calculated based on difference between the last two equilibrium states in the glacier history. So far we've only showed you how to progress a glacier to equilibrium, but not how to leave it and reach a second one. This will be the first step to getting the response time of a glacier. We use the glacier from the start of the notebook. First we progress the glacier to equilibrium We can access the stored equilibrium states of a glacier Now we want to set up a climate change scenario for the glacier. This is easily done with the .add_temperature_bias method. This method takes a desired temperature bias (+/−) and a duration, which specifies how long it will take for the glacier to reach the climate state. For instance, if we set the bias to 1. and the duration to 50, it will take 50 years for the climate to become 1 degree warmer. When a glacier has a climate change scenario the progress_ methods will internally work a little bit differently, but this is not anything you will notice. Since we are purely interested in the response of the glacier, we create a climate change scenario with the duration of 1 year. The next step is to calculate the response times for our glaciers. One could think that it is as simple as looking at the years above and do a simple subtraction. However this is not the case! In reality the rate at which a glacier changes is ever decreasing and a complete equilibrium state is never really achieved. Because of this the response time is considered the time it has taken the glacier to complete most of the adjustment, more specifically all but a factor of 1/e. For numerical models like our glaciers it is common to use the volume response time, from Oerlemans: τ = t(V = V2 −V 2 − V1e) where V1 and V2 corresponds to the glacier volume at the initial and new equilibrium state respectively. Luckily this is done by our glacier object, so we can just take look at the .response_time attribute or just look at the representation Now that we have introduced the concept of response time we can apply it and see how the different mass balance gradients affect the response time. For this we need a new collection. We then have to set up a climate change scenario for the glaciers in the collection We can also look at the state history for one of the glaciers The glacier with weakest MBG need the longest time to adjust to a changed climate compared to the other glaciers. On the other hand, the glacier with the strongest gradient only needs a around two decades to adjust its shape to the new climate (A real world example: Franz Josef glacier in New Zealand⁶)⁷. The response time of glaciers with weak gradients is in reality much longer than 200 years, actually closer to 2000 years.
3,067
3,180
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) complex_mb = MassBalance(ela=3000, gradient=[3, 7, 10, 15], breakpoints=[2700, 2250, 1800]) glacier_complex_mb = Glacier(bed=bed, mass_balance=complex_mb) collection.add(glacier_complex_mb) collection.progress_to_year(300) collection.plot() collection.plot_mass_balance() collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) collection.progress_to_equilibrium() collection.plot() collection glacier glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.add_temperature_bias(bias=1., duration=1) glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.response_time glacier bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[1, 4, 15]} ) collection.progress_to_equilibrium() collection collection.glaciers[0].add_temperature_bias(bias=1., duration=1) collection.glaciers[1].add_temperature_bias(bias=1., duration=1) collection.glaciers[2].add_temperature_bias(bias=1., duration=1) collection.progress_to_equilibrium() collection collection.plot_history() collection.glaciers[0].plot_state_history(eq_states=True)
686
887
1
mass_balance_gradients-2
mass_balance_gradients-2
Mass balance gradients (MBG) and their influence on glacier flow In the intro notebook we touched briefly on the mass balance gradient of a glacier. This is what we are going to take a closer look at now. If the concept of mass balance is completely new to you, have a short read about it here, up to the paragraph "So what is Glacier Mass Balance?". In this notebook we will set up a few simple glaciers to further explore what characteristics of glaciers change with different mass balance gradients. We will also take a look at the topics of volume and response time. Goals of this notebook: The student will be able to explain the terms: Mass balance gradient, Equilibrium state Response time. First, we have to import the relevant classes Initialising the glacier We start by setting up a simple glacier with a linear bedrock (see Getting started with OGGM Edu) to generate a starting point for our experiment. Changing the mass balance gradient (MBG) The MBG is defined as the change of the mass balance with altitude ¹. It depends strongly on the climate at the glacier ². Let's take a look at the effects of the MBG by creating a few glaciers with different gradients. In the intro notebook our glacier had a gradient of 4 mm/m so lets add a glacier with a weaker gradient and one with a stronger gradient. We will again make use of the GlacierCollection to quickly progress and visualise the glaciers. Creating a complex mass balance profile It is also possible to create a more complex mass balance profile. This is achieved by passing a list of gradients, and another list with the altitude of the breakpoints between them. A stronger mass balance gradient (flatter line in plot above) implies a larger change of the mass balance with altitude. We can see this in the plot above: The annual mass balance hardly changes with altitude for the glacier with the weakest mass balance gradient (blue) while there is a considerable difference between the top and bottom annual mass balance for the glacier with the strongest mass balance gradient (green). This in turn affects the growth of the glacier. A strong mass balance gradient implies that more ice is added to the accumulation zone while more ice is removed from the ablation zone each year compared to a glacier with a weaker gradient. This results in a greater ice flux and the glacier thus grows faster. This is why the glacier with the strongest gradient exhibits the largest growth during our experiments (Green glacier in Collection plot above). What do you think: where do we find glaciers with high MBGs? Click for details Equilibrium state Glaciers change their geometry as a way to adapt to the climate³. If the accumulation increases, the glacier will grow further down below the ELA to increase the ablation. Similarly, if the temperature rises and the ablation increases, the glacier length will decrease. If the climate remains constant for a long enough time, glaciers will reach an equilibrium state with its climate, where the accumulation = ablation ⁴. With this in mind, we will take a look at how fast our glaciers, with different gradients, reach this state and compare their shapes: The different glaciers reach their equilibrium state after a different number of years. What does the figure show us? Which glacier is the thickest and longest? Let's look at specific numbers: The glacier with the strongest gradient reaches the equilibrium state first. This is also the largest and longest glacier. Response time The glacier response time is the period of time a glacier needs to adjust its geometry to changes in mass balance caused by climate change and reach a new equilibrium state. There are a some different definitions for its calculation, OGGM-Edu use the definition from Oerlemans (see formula below) ⁵. A OGGM-Edu glacier has an attribute .response_time which is calculated based on difference between the last two equilibrium states in the glacier history. So far we've only showed you how to progress a glacier to equilibrium, but not how to leave it and reach a second one. This will be the first step to getting the response time of a glacier. We use the glacier from the start of the notebook. First we progress the glacier to equilibrium We can access the stored equilibrium states of a glacier Now we want to set up a climate change scenario for the glacier. This is easily done with the .add_temperature_bias method. This method takes a desired temperature bias (+/−) and a duration, which specifies how long it will take for the glacier to reach the climate state. For instance, if we set the bias to 1. and the duration to 50, it will take 50 years for the climate to become 1 degree warmer. When a glacier has a climate change scenario the progress_ methods will internally work a little bit differently, but this is not anything you will notice. Since we are purely interested in the response of the glacier, we create a climate change scenario with the duration of 1 year. The next step is to calculate the response times for our glaciers. One could think that it is as simple as looking at the years above and do a simple subtraction. However this is not the case! In reality the rate at which a glacier changes is ever decreasing and a complete equilibrium state is never really achieved. Because of this the response time is considered the time it has taken the glacier to complete most of the adjustment, more specifically all but a factor of 1/e. For numerical models like our glaciers it is common to use the volume response time, from Oerlemans: τ = t(V = V2 −V 2 − V1e) where V1 and V2 corresponds to the glacier volume at the initial and new equilibrium state respectively. Luckily this is done by our glacier object, so we can just take look at the .response_time attribute or just look at the representation Now that we have introduced the concept of response time we can apply it and see how the different mass balance gradients affect the response time. For this we need a new collection. We then have to set up a climate change scenario for the glaciers in the collection We can also look at the state history for one of the glaciers The glacier with weakest MBG need the longest time to adjust to a changed climate compared to the other glaciers. On the other hand, the glacier with the strongest gradient only needs a around two decades to adjust its shape to the new climate (A real world example: Franz Josef glacier in New Zealand⁶)⁷. The response time of glaciers with weak gradients is in reality much longer than 200 years, actually closer to 2000 years.
4,261
4,317
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) complex_mb = MassBalance(ela=3000, gradient=[3, 7, 10, 15], breakpoints=[2700, 2250, 1800]) glacier_complex_mb = Glacier(bed=bed, mass_balance=complex_mb) collection.add(glacier_complex_mb) collection.progress_to_year(300) collection.plot() collection.plot_mass_balance() collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) collection.progress_to_equilibrium() collection.plot() collection glacier glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.add_temperature_bias(bias=1., duration=1) glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.response_time glacier bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[1, 4, 15]} ) collection.progress_to_equilibrium() collection collection.glaciers[0].add_temperature_bias(bias=1., duration=1) collection.glaciers[1].add_temperature_bias(bias=1., duration=1) collection.glaciers[2].add_temperature_bias(bias=1., duration=1) collection.progress_to_equilibrium() collection collection.plot_history() collection.glaciers[0].plot_state_history(eq_states=True)
965
983
2
mass_balance_gradients-3
mass_balance_gradients-3
Mass balance gradients (MBG) and their influence on glacier flow In the intro notebook we touched briefly on the mass balance gradient of a glacier. This is what we are going to take a closer look at now. If the concept of mass balance is completely new to you, have a short read about it here, up to the paragraph "So what is Glacier Mass Balance?". In this notebook we will set up a few simple glaciers to further explore what characteristics of glaciers change with different mass balance gradients. We will also take a look at the topics of volume and response time. Goals of this notebook: The student will be able to explain the terms: Mass balance gradient, Equilibrium state Response time. First, we have to import the relevant classes Initialising the glacier We start by setting up a simple glacier with a linear bedrock (see Getting started with OGGM Edu) to generate a starting point for our experiment. Changing the mass balance gradient (MBG) The MBG is defined as the change of the mass balance with altitude ¹. It depends strongly on the climate at the glacier ². Let's take a look at the effects of the MBG by creating a few glaciers with different gradients. In the intro notebook our glacier had a gradient of 4 mm/m so lets add a glacier with a weaker gradient and one with a stronger gradient. We will again make use of the GlacierCollection to quickly progress and visualise the glaciers. Creating a complex mass balance profile It is also possible to create a more complex mass balance profile. This is achieved by passing a list of gradients, and another list with the altitude of the breakpoints between them. A stronger mass balance gradient (flatter line in plot above) implies a larger change of the mass balance with altitude. We can see this in the plot above: The annual mass balance hardly changes with altitude for the glacier with the weakest mass balance gradient (blue) while there is a considerable difference between the top and bottom annual mass balance for the glacier with the strongest mass balance gradient (green). This in turn affects the growth of the glacier. A strong mass balance gradient implies that more ice is added to the accumulation zone while more ice is removed from the ablation zone each year compared to a glacier with a weaker gradient. This results in a greater ice flux and the glacier thus grows faster. This is why the glacier with the strongest gradient exhibits the largest growth during our experiments (Green glacier in Collection plot above). What do you think: where do we find glaciers with high MBGs? Click for details Equilibrium state Glaciers change their geometry as a way to adapt to the climate³. If the accumulation increases, the glacier will grow further down below the ELA to increase the ablation. Similarly, if the temperature rises and the ablation increases, the glacier length will decrease. If the climate remains constant for a long enough time, glaciers will reach an equilibrium state with its climate, where the accumulation = ablation ⁴. With this in mind, we will take a look at how fast our glaciers, with different gradients, reach this state and compare their shapes: The different glaciers reach their equilibrium state after a different number of years. What does the figure show us? Which glacier is the thickest and longest? Let's look at specific numbers: The glacier with the strongest gradient reaches the equilibrium state first. This is also the largest and longest glacier. Response time The glacier response time is the period of time a glacier needs to adjust its geometry to changes in mass balance caused by climate change and reach a new equilibrium state. There are a some different definitions for its calculation, OGGM-Edu use the definition from Oerlemans (see formula below) ⁵. A OGGM-Edu glacier has an attribute .response_time which is calculated based on difference between the last two equilibrium states in the glacier history. So far we've only showed you how to progress a glacier to equilibrium, but not how to leave it and reach a second one. This will be the first step to getting the response time of a glacier. We use the glacier from the start of the notebook. First we progress the glacier to equilibrium We can access the stored equilibrium states of a glacier Now we want to set up a climate change scenario for the glacier. This is easily done with the .add_temperature_bias method. This method takes a desired temperature bias (+/−) and a duration, which specifies how long it will take for the glacier to reach the climate state. For instance, if we set the bias to 1. and the duration to 50, it will take 50 years for the climate to become 1 degree warmer. When a glacier has a climate change scenario the progress_ methods will internally work a little bit differently, but this is not anything you will notice. Since we are purely interested in the response of the glacier, we create a climate change scenario with the duration of 1 year. The next step is to calculate the response times for our glaciers. One could think that it is as simple as looking at the years above and do a simple subtraction. However this is not the case! In reality the rate at which a glacier changes is ever decreasing and a complete equilibrium state is never really achieved. Because of this the response time is considered the time it has taken the glacier to complete most of the adjustment, more specifically all but a factor of 1/e. For numerical models like our glaciers it is common to use the volume response time, from Oerlemans: τ = t(V = V2 −V 2 − V1e) where V1 and V2 corresponds to the glacier volume at the initial and new equilibrium state respectively. Luckily this is done by our glacier object, so we can just take look at the .response_time attribute or just look at the representation Now that we have introduced the concept of response time we can apply it and see how the different mass balance gradients affect the response time. For this we need a new collection. We then have to set up a climate change scenario for the glaciers in the collection We can also look at the state history for one of the glaciers The glacier with weakest MBG need the longest time to adjust to a changed climate compared to the other glaciers. On the other hand, the glacier with the strongest gradient only needs a around two decades to adjust its shape to the new climate (A real world example: Franz Josef glacier in New Zealand⁶)⁷. The response time of glaciers with weak gradients is in reality much longer than 200 years, actually closer to 2000 years.
773
834
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) complex_mb = MassBalance(ela=3000, gradient=[3, 7, 10, 15], breakpoints=[2700, 2250, 1800]) glacier_complex_mb = Glacier(bed=bed, mass_balance=complex_mb) collection.add(glacier_complex_mb) collection.progress_to_year(300) collection.plot() collection.plot_mass_balance() collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) collection.progress_to_equilibrium() collection.plot() collection glacier glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.add_temperature_bias(bias=1., duration=1) glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.response_time glacier bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[1, 4, 15]} ) collection.progress_to_equilibrium() collection collection.glaciers[0].add_temperature_bias(bias=1., duration=1) collection.glaciers[1].add_temperature_bias(bias=1., duration=1) collection.glaciers[2].add_temperature_bias(bias=1., duration=1) collection.progress_to_equilibrium() collection collection.plot_history() collection.glaciers[0].plot_state_history(eq_states=True)
79
233
3
mass_balance_gradients-4
mass_balance_gradients-4
Mass balance gradients (MBG) and their influence on glacier flow In the intro notebook we touched briefly on the mass balance gradient of a glacier. This is what we are going to take a closer look at now. If the concept of mass balance is completely new to you, have a short read about it here, up to the paragraph "So what is Glacier Mass Balance?". In this notebook we will set up a few simple glaciers to further explore what characteristics of glaciers change with different mass balance gradients. We will also take a look at the topics of volume and response time. Goals of this notebook: The student will be able to explain the terms: Mass balance gradient, Equilibrium state Response time. First, we have to import the relevant classes Initialising the glacier We start by setting up a simple glacier with a linear bedrock (see Getting started with OGGM Edu) to generate a starting point for our experiment. Changing the mass balance gradient (MBG) The MBG is defined as the change of the mass balance with altitude ¹. It depends strongly on the climate at the glacier ². Let's take a look at the effects of the MBG by creating a few glaciers with different gradients. In the intro notebook our glacier had a gradient of 4 mm/m so lets add a glacier with a weaker gradient and one with a stronger gradient. We will again make use of the GlacierCollection to quickly progress and visualise the glaciers. Creating a complex mass balance profile It is also possible to create a more complex mass balance profile. This is achieved by passing a list of gradients, and another list with the altitude of the breakpoints between them. A stronger mass balance gradient (flatter line in plot above) implies a larger change of the mass balance with altitude. We can see this in the plot above: The annual mass balance hardly changes with altitude for the glacier with the weakest mass balance gradient (blue) while there is a considerable difference between the top and bottom annual mass balance for the glacier with the strongest mass balance gradient (green). This in turn affects the growth of the glacier. A strong mass balance gradient implies that more ice is added to the accumulation zone while more ice is removed from the ablation zone each year compared to a glacier with a weaker gradient. This results in a greater ice flux and the glacier thus grows faster. This is why the glacier with the strongest gradient exhibits the largest growth during our experiments (Green glacier in Collection plot above). What do you think: where do we find glaciers with high MBGs? Click for details Equilibrium state Glaciers change their geometry as a way to adapt to the climate³. If the accumulation increases, the glacier will grow further down below the ELA to increase the ablation. Similarly, if the temperature rises and the ablation increases, the glacier length will decrease. If the climate remains constant for a long enough time, glaciers will reach an equilibrium state with its climate, where the accumulation = ablation ⁴. With this in mind, we will take a look at how fast our glaciers, with different gradients, reach this state and compare their shapes: The different glaciers reach their equilibrium state after a different number of years. What does the figure show us? Which glacier is the thickest and longest? Let's look at specific numbers: The glacier with the strongest gradient reaches the equilibrium state first. This is also the largest and longest glacier. Response time The glacier response time is the period of time a glacier needs to adjust its geometry to changes in mass balance caused by climate change and reach a new equilibrium state. There are a some different definitions for its calculation, OGGM-Edu use the definition from Oerlemans (see formula below) ⁵. A OGGM-Edu glacier has an attribute .response_time which is calculated based on difference between the last two equilibrium states in the glacier history. So far we've only showed you how to progress a glacier to equilibrium, but not how to leave it and reach a second one. This will be the first step to getting the response time of a glacier. We use the glacier from the start of the notebook. First we progress the glacier to equilibrium We can access the stored equilibrium states of a glacier Now we want to set up a climate change scenario for the glacier. This is easily done with the .add_temperature_bias method. This method takes a desired temperature bias (+/−) and a duration, which specifies how long it will take for the glacier to reach the climate state. For instance, if we set the bias to 1. and the duration to 50, it will take 50 years for the climate to become 1 degree warmer. When a glacier has a climate change scenario the progress_ methods will internally work a little bit differently, but this is not anything you will notice. Since we are purely interested in the response of the glacier, we create a climate change scenario with the duration of 1 year. The next step is to calculate the response times for our glaciers. One could think that it is as simple as looking at the years above and do a simple subtraction. However this is not the case! In reality the rate at which a glacier changes is ever decreasing and a complete equilibrium state is never really achieved. Because of this the response time is considered the time it has taken the glacier to complete most of the adjustment, more specifically all but a factor of 1/e. For numerical models like our glaciers it is common to use the volume response time, from Oerlemans: τ = t(V = V2 −V 2 − V1e) where V1 and V2 corresponds to the glacier volume at the initial and new equilibrium state respectively. Luckily this is done by our glacier object, so we can just take look at the .response_time attribute or just look at the representation Now that we have introduced the concept of response time we can apply it and see how the different mass balance gradients affect the response time. For this we need a new collection. We then have to set up a climate change scenario for the glaciers in the collection We can also look at the state history for one of the glaciers The glacier with weakest MBG need the longest time to adjust to a changed climate compared to the other glaciers. On the other hand, the glacier with the strongest gradient only needs a around two decades to adjust its shape to the new climate (A real world example: Franz Josef glacier in New Zealand⁶)⁷. The response time of glaciers with weak gradients is in reality much longer than 200 years, actually closer to 2000 years.
5,783
5,819
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) complex_mb = MassBalance(ela=3000, gradient=[3, 7, 10, 15], breakpoints=[2700, 2250, 1800]) glacier_complex_mb = Glacier(bed=bed, mass_balance=complex_mb) collection.add(glacier_complex_mb) collection.progress_to_year(300) collection.plot() collection.plot_mass_balance() collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) collection.progress_to_equilibrium() collection.plot() collection glacier glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.add_temperature_bias(bias=1., duration=1) glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.response_time glacier bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[1, 4, 15]} ) collection.progress_to_equilibrium() collection collection.glaciers[0].add_temperature_bias(bias=1., duration=1) collection.glaciers[1].add_temperature_bias(bias=1., duration=1) collection.glaciers[2].add_temperature_bias(bias=1., duration=1) collection.progress_to_equilibrium() collection collection.plot_history() collection.glaciers[0].plot_state_history(eq_states=True)
1,108
1,130
4
mass_balance_gradients-5
mass_balance_gradients-5
Mass balance gradients (MBG) and their influence on glacier flow In the intro notebook we touched briefly on the mass balance gradient of a glacier. This is what we are going to take a closer look at now. If the concept of mass balance is completely new to you, have a short read about it here, up to the paragraph "So what is Glacier Mass Balance?". In this notebook we will set up a few simple glaciers to further explore what characteristics of glaciers change with different mass balance gradients. We will also take a look at the topics of volume and response time. Goals of this notebook: The student will be able to explain the terms: Mass balance gradient, Equilibrium state Response time. First, we have to import the relevant classes Initialising the glacier We start by setting up a simple glacier with a linear bedrock (see Getting started with OGGM Edu) to generate a starting point for our experiment. Changing the mass balance gradient (MBG) The MBG is defined as the change of the mass balance with altitude ¹. It depends strongly on the climate at the glacier ². Let's take a look at the effects of the MBG by creating a few glaciers with different gradients. In the intro notebook our glacier had a gradient of 4 mm/m so lets add a glacier with a weaker gradient and one with a stronger gradient. We will again make use of the GlacierCollection to quickly progress and visualise the glaciers. Creating a complex mass balance profile It is also possible to create a more complex mass balance profile. This is achieved by passing a list of gradients, and another list with the altitude of the breakpoints between them. A stronger mass balance gradient (flatter line in plot above) implies a larger change of the mass balance with altitude. We can see this in the plot above: The annual mass balance hardly changes with altitude for the glacier with the weakest mass balance gradient (blue) while there is a considerable difference between the top and bottom annual mass balance for the glacier with the strongest mass balance gradient (green). This in turn affects the growth of the glacier. A strong mass balance gradient implies that more ice is added to the accumulation zone while more ice is removed from the ablation zone each year compared to a glacier with a weaker gradient. This results in a greater ice flux and the glacier thus grows faster. This is why the glacier with the strongest gradient exhibits the largest growth during our experiments (Green glacier in Collection plot above). What do you think: where do we find glaciers with high MBGs? Click for details Equilibrium state Glaciers change their geometry as a way to adapt to the climate³. If the accumulation increases, the glacier will grow further down below the ELA to increase the ablation. Similarly, if the temperature rises and the ablation increases, the glacier length will decrease. If the climate remains constant for a long enough time, glaciers will reach an equilibrium state with its climate, where the accumulation = ablation ⁴. With this in mind, we will take a look at how fast our glaciers, with different gradients, reach this state and compare their shapes: The different glaciers reach their equilibrium state after a different number of years. What does the figure show us? Which glacier is the thickest and longest? Let's look at specific numbers: The glacier with the strongest gradient reaches the equilibrium state first. This is also the largest and longest glacier. Response time The glacier response time is the period of time a glacier needs to adjust its geometry to changes in mass balance caused by climate change and reach a new equilibrium state. There are a some different definitions for its calculation, OGGM-Edu use the definition from Oerlemans (see formula below) ⁵. A OGGM-Edu glacier has an attribute .response_time which is calculated based on difference between the last two equilibrium states in the glacier history. So far we've only showed you how to progress a glacier to equilibrium, but not how to leave it and reach a second one. This will be the first step to getting the response time of a glacier. We use the glacier from the start of the notebook. First we progress the glacier to equilibrium We can access the stored equilibrium states of a glacier Now we want to set up a climate change scenario for the glacier. This is easily done with the .add_temperature_bias method. This method takes a desired temperature bias (+/−) and a duration, which specifies how long it will take for the glacier to reach the climate state. For instance, if we set the bias to 1. and the duration to 50, it will take 50 years for the climate to become 1 degree warmer. When a glacier has a climate change scenario the progress_ methods will internally work a little bit differently, but this is not anything you will notice. Since we are purely interested in the response of the glacier, we create a climate change scenario with the duration of 1 year. The next step is to calculate the response times for our glaciers. One could think that it is as simple as looking at the years above and do a simple subtraction. However this is not the case! In reality the rate at which a glacier changes is ever decreasing and a complete equilibrium state is never really achieved. Because of this the response time is considered the time it has taken the glacier to complete most of the adjustment, more specifically all but a factor of 1/e. For numerical models like our glaciers it is common to use the volume response time, from Oerlemans: τ = t(V = V2 −V 2 − V1e) where V1 and V2 corresponds to the glacier volume at the initial and new equilibrium state respectively. Luckily this is done by our glacier object, so we can just take look at the .response_time attribute or just look at the representation Now that we have introduced the concept of response time we can apply it and see how the different mass balance gradients affect the response time. For this we need a new collection. We then have to set up a climate change scenario for the glaciers in the collection We can also look at the state history for one of the glaciers The glacier with weakest MBG need the longest time to adjust to a changed climate compared to the other glaciers. On the other hand, the glacier with the strongest gradient only needs a around two decades to adjust its shape to the new climate (A real world example: Franz Josef glacier in New Zealand⁶)⁷. The response time of glaciers with weak gradients is in reality much longer than 200 years, actually closer to 2000 years.
1,323
1,370
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) complex_mb = MassBalance(ela=3000, gradient=[3, 7, 10, 15], breakpoints=[2700, 2250, 1800]) glacier_complex_mb = Glacier(bed=bed, mass_balance=complex_mb) collection.add(glacier_complex_mb) collection.progress_to_year(300) collection.plot() collection.plot_mass_balance() collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) collection.progress_to_equilibrium() collection.plot() collection glacier glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.add_temperature_bias(bias=1., duration=1) glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.response_time glacier bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[1, 4, 15]} ) collection.progress_to_equilibrium() collection collection.glaciers[0].add_temperature_bias(bias=1., duration=1) collection.glaciers[1].add_temperature_bias(bias=1., duration=1) collection.glaciers[2].add_temperature_bias(bias=1., duration=1) collection.progress_to_equilibrium() collection collection.plot_history() collection.glaciers[0].plot_state_history(eq_states=True)
235
379
5
mass_balance_gradients-6
mass_balance_gradients-6
Mass balance gradients (MBG) and their influence on glacier flow In the intro notebook we touched briefly on the mass balance gradient of a glacier. This is what we are going to take a closer look at now. If the concept of mass balance is completely new to you, have a short read about it here, up to the paragraph "So what is Glacier Mass Balance?". In this notebook we will set up a few simple glaciers to further explore what characteristics of glaciers change with different mass balance gradients. We will also take a look at the topics of volume and response time. Goals of this notebook: The student will be able to explain the terms: Mass balance gradient, Equilibrium state Response time. First, we have to import the relevant classes Initialising the glacier We start by setting up a simple glacier with a linear bedrock (see Getting started with OGGM Edu) to generate a starting point for our experiment. Changing the mass balance gradient (MBG) The MBG is defined as the change of the mass balance with altitude ¹. It depends strongly on the climate at the glacier ². Let's take a look at the effects of the MBG by creating a few glaciers with different gradients. In the intro notebook our glacier had a gradient of 4 mm/m so lets add a glacier with a weaker gradient and one with a stronger gradient. We will again make use of the GlacierCollection to quickly progress and visualise the glaciers. Creating a complex mass balance profile It is also possible to create a more complex mass balance profile. This is achieved by passing a list of gradients, and another list with the altitude of the breakpoints between them. A stronger mass balance gradient (flatter line in plot above) implies a larger change of the mass balance with altitude. We can see this in the plot above: The annual mass balance hardly changes with altitude for the glacier with the weakest mass balance gradient (blue) while there is a considerable difference between the top and bottom annual mass balance for the glacier with the strongest mass balance gradient (green). This in turn affects the growth of the glacier. A strong mass balance gradient implies that more ice is added to the accumulation zone while more ice is removed from the ablation zone each year compared to a glacier with a weaker gradient. This results in a greater ice flux and the glacier thus grows faster. This is why the glacier with the strongest gradient exhibits the largest growth during our experiments (Green glacier in Collection plot above). What do you think: where do we find glaciers with high MBGs? Click for details Equilibrium state Glaciers change their geometry as a way to adapt to the climate³. If the accumulation increases, the glacier will grow further down below the ELA to increase the ablation. Similarly, if the temperature rises and the ablation increases, the glacier length will decrease. If the climate remains constant for a long enough time, glaciers will reach an equilibrium state with its climate, where the accumulation = ablation ⁴. With this in mind, we will take a look at how fast our glaciers, with different gradients, reach this state and compare their shapes: The different glaciers reach their equilibrium state after a different number of years. What does the figure show us? Which glacier is the thickest and longest? Let's look at specific numbers: The glacier with the strongest gradient reaches the equilibrium state first. This is also the largest and longest glacier. Response time The glacier response time is the period of time a glacier needs to adjust its geometry to changes in mass balance caused by climate change and reach a new equilibrium state. There are a some different definitions for its calculation, OGGM-Edu use the definition from Oerlemans (see formula below) ⁵. A OGGM-Edu glacier has an attribute .response_time which is calculated based on difference between the last two equilibrium states in the glacier history. So far we've only showed you how to progress a glacier to equilibrium, but not how to leave it and reach a second one. This will be the first step to getting the response time of a glacier. We use the glacier from the start of the notebook. First we progress the glacier to equilibrium We can access the stored equilibrium states of a glacier Now we want to set up a climate change scenario for the glacier. This is easily done with the .add_temperature_bias method. This method takes a desired temperature bias (+/−) and a duration, which specifies how long it will take for the glacier to reach the climate state. For instance, if we set the bias to 1. and the duration to 50, it will take 50 years for the climate to become 1 degree warmer. When a glacier has a climate change scenario the progress_ methods will internally work a little bit differently, but this is not anything you will notice. Since we are purely interested in the response of the glacier, we create a climate change scenario with the duration of 1 year. The next step is to calculate the response times for our glaciers. One could think that it is as simple as looking at the years above and do a simple subtraction. However this is not the case! In reality the rate at which a glacier changes is ever decreasing and a complete equilibrium state is never really achieved. Because of this the response time is considered the time it has taken the glacier to complete most of the adjustment, more specifically all but a factor of 1/e. For numerical models like our glaciers it is common to use the volume response time, from Oerlemans: τ = t(V = V2 −V 2 − V1e) where V1 and V2 corresponds to the glacier volume at the initial and new equilibrium state respectively. Luckily this is done by our glacier object, so we can just take look at the .response_time attribute or just look at the representation Now that we have introduced the concept of response time we can apply it and see how the different mass balance gradients affect the response time. For this we need a new collection. We then have to set up a climate change scenario for the glaciers in the collection We can also look at the state history for one of the glaciers The glacier with weakest MBG need the longest time to adjust to a changed climate compared to the other glaciers. On the other hand, the glacier with the strongest gradient only needs a around two decades to adjust its shape to the new climate (A real world example: Franz Josef glacier in New Zealand⁶)⁷. The response time of glaciers with weak gradients is in reality much longer than 200 years, actually closer to 2000 years.
6,057
6,124
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) complex_mb = MassBalance(ela=3000, gradient=[3, 7, 10, 15], breakpoints=[2700, 2250, 1800]) glacier_complex_mb = Glacier(bed=bed, mass_balance=complex_mb) collection.add(glacier_complex_mb) collection.progress_to_year(300) collection.plot() collection.plot_mass_balance() collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) collection.progress_to_equilibrium() collection.plot() collection glacier glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.add_temperature_bias(bias=1., duration=1) glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.response_time glacier bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[1, 4, 15]} ) collection.progress_to_equilibrium() collection collection.glaciers[0].add_temperature_bias(bias=1., duration=1) collection.glaciers[1].add_temperature_bias(bias=1., duration=1) collection.glaciers[2].add_temperature_bias(bias=1., duration=1) collection.progress_to_equilibrium() collection collection.plot_history() collection.glaciers[0].plot_state_history(eq_states=True)
1,491
1,686
6
mass_balance_gradients-7
mass_balance_gradients-7
Mass balance gradients (MBG) and their influence on glacier flow In the intro notebook we touched briefly on the mass balance gradient of a glacier. This is what we are going to take a closer look at now. If the concept of mass balance is completely new to you, have a short read about it here, up to the paragraph "So what is Glacier Mass Balance?". In this notebook we will set up a few simple glaciers to further explore what characteristics of glaciers change with different mass balance gradients. We will also take a look at the topics of volume and response time. Goals of this notebook: The student will be able to explain the terms: Mass balance gradient, Equilibrium state Response time. First, we have to import the relevant classes Initialising the glacier We start by setting up a simple glacier with a linear bedrock (see Getting started with OGGM Edu) to generate a starting point for our experiment. Changing the mass balance gradient (MBG) The MBG is defined as the change of the mass balance with altitude ¹. It depends strongly on the climate at the glacier ². Let's take a look at the effects of the MBG by creating a few glaciers with different gradients. In the intro notebook our glacier had a gradient of 4 mm/m so lets add a glacier with a weaker gradient and one with a stronger gradient. We will again make use of the GlacierCollection to quickly progress and visualise the glaciers. Creating a complex mass balance profile It is also possible to create a more complex mass balance profile. This is achieved by passing a list of gradients, and another list with the altitude of the breakpoints between them. A stronger mass balance gradient (flatter line in plot above) implies a larger change of the mass balance with altitude. We can see this in the plot above: The annual mass balance hardly changes with altitude for the glacier with the weakest mass balance gradient (blue) while there is a considerable difference between the top and bottom annual mass balance for the glacier with the strongest mass balance gradient (green). This in turn affects the growth of the glacier. A strong mass balance gradient implies that more ice is added to the accumulation zone while more ice is removed from the ablation zone each year compared to a glacier with a weaker gradient. This results in a greater ice flux and the glacier thus grows faster. This is why the glacier with the strongest gradient exhibits the largest growth during our experiments (Green glacier in Collection plot above). What do you think: where do we find glaciers with high MBGs? Click for details Equilibrium state Glaciers change their geometry as a way to adapt to the climate³. If the accumulation increases, the glacier will grow further down below the ELA to increase the ablation. Similarly, if the temperature rises and the ablation increases, the glacier length will decrease. If the climate remains constant for a long enough time, glaciers will reach an equilibrium state with its climate, where the accumulation = ablation ⁴. With this in mind, we will take a look at how fast our glaciers, with different gradients, reach this state and compare their shapes: The different glaciers reach their equilibrium state after a different number of years. What does the figure show us? Which glacier is the thickest and longest? Let's look at specific numbers: The glacier with the strongest gradient reaches the equilibrium state first. This is also the largest and longest glacier. Response time The glacier response time is the period of time a glacier needs to adjust its geometry to changes in mass balance caused by climate change and reach a new equilibrium state. There are a some different definitions for its calculation, OGGM-Edu use the definition from Oerlemans (see formula below) ⁵. A OGGM-Edu glacier has an attribute .response_time which is calculated based on difference between the last two equilibrium states in the glacier history. So far we've only showed you how to progress a glacier to equilibrium, but not how to leave it and reach a second one. This will be the first step to getting the response time of a glacier. We use the glacier from the start of the notebook. First we progress the glacier to equilibrium We can access the stored equilibrium states of a glacier Now we want to set up a climate change scenario for the glacier. This is easily done with the .add_temperature_bias method. This method takes a desired temperature bias (+/−) and a duration, which specifies how long it will take for the glacier to reach the climate state. For instance, if we set the bias to 1. and the duration to 50, it will take 50 years for the climate to become 1 degree warmer. When a glacier has a climate change scenario the progress_ methods will internally work a little bit differently, but this is not anything you will notice. Since we are purely interested in the response of the glacier, we create a climate change scenario with the duration of 1 year. The next step is to calculate the response times for our glaciers. One could think that it is as simple as looking at the years above and do a simple subtraction. However this is not the case! In reality the rate at which a glacier changes is ever decreasing and a complete equilibrium state is never really achieved. Because of this the response time is considered the time it has taken the glacier to complete most of the adjustment, more specifically all but a factor of 1/e. For numerical models like our glaciers it is common to use the volume response time, from Oerlemans: τ = t(V = V2 −V 2 − V1e) where V1 and V2 corresponds to the glacier volume at the initial and new equilibrium state respectively. Luckily this is done by our glacier object, so we can just take look at the .response_time attribute or just look at the representation Now that we have introduced the concept of response time we can apply it and see how the different mass balance gradients affect the response time. For this we need a new collection. We then have to set up a climate change scenario for the glaciers in the collection We can also look at the state history for one of the glaciers The glacier with weakest MBG need the longest time to adjust to a changed climate compared to the other glaciers. On the other hand, the glacier with the strongest gradient only needs a around two decades to adjust its shape to the new climate (A real world example: Franz Josef glacier in New Zealand⁶)⁷. The response time of glaciers with weak gradients is in reality much longer than 200 years, actually closer to 2000 years.
6,126
6,187
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) complex_mb = MassBalance(ela=3000, gradient=[3, 7, 10, 15], breakpoints=[2700, 2250, 1800]) glacier_complex_mb = Glacier(bed=bed, mass_balance=complex_mb) collection.add(glacier_complex_mb) collection.progress_to_year(300) collection.plot() collection.plot_mass_balance() collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) collection.progress_to_equilibrium() collection.plot() collection glacier glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.add_temperature_bias(bias=1., duration=1) glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.response_time glacier bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[1, 4, 15]} ) collection.progress_to_equilibrium() collection collection.glaciers[0].add_temperature_bias(bias=1., duration=1) collection.glaciers[1].add_temperature_bias(bias=1., duration=1) collection.glaciers[2].add_temperature_bias(bias=1., duration=1) collection.progress_to_equilibrium() collection collection.plot_history() collection.glaciers[0].plot_state_history(eq_states=True)
1,765
1,823
7
mass_balance_gradients-8
mass_balance_gradients-8
Mass balance gradients (MBG) and their influence on glacier flow In the intro notebook we touched briefly on the mass balance gradient of a glacier. This is what we are going to take a closer look at now. If the concept of mass balance is completely new to you, have a short read about it here, up to the paragraph "So what is Glacier Mass Balance?". In this notebook we will set up a few simple glaciers to further explore what characteristics of glaciers change with different mass balance gradients. We will also take a look at the topics of volume and response time. Goals of this notebook: The student will be able to explain the terms: Mass balance gradient, Equilibrium state Response time. First, we have to import the relevant classes Initialising the glacier We start by setting up a simple glacier with a linear bedrock (see Getting started with OGGM Edu) to generate a starting point for our experiment. Changing the mass balance gradient (MBG) The MBG is defined as the change of the mass balance with altitude ¹. It depends strongly on the climate at the glacier ². Let's take a look at the effects of the MBG by creating a few glaciers with different gradients. In the intro notebook our glacier had a gradient of 4 mm/m so lets add a glacier with a weaker gradient and one with a stronger gradient. We will again make use of the GlacierCollection to quickly progress and visualise the glaciers. Creating a complex mass balance profile It is also possible to create a more complex mass balance profile. This is achieved by passing a list of gradients, and another list with the altitude of the breakpoints between them. A stronger mass balance gradient (flatter line in plot above) implies a larger change of the mass balance with altitude. We can see this in the plot above: The annual mass balance hardly changes with altitude for the glacier with the weakest mass balance gradient (blue) while there is a considerable difference between the top and bottom annual mass balance for the glacier with the strongest mass balance gradient (green). This in turn affects the growth of the glacier. A strong mass balance gradient implies that more ice is added to the accumulation zone while more ice is removed from the ablation zone each year compared to a glacier with a weaker gradient. This results in a greater ice flux and the glacier thus grows faster. This is why the glacier with the strongest gradient exhibits the largest growth during our experiments (Green glacier in Collection plot above). What do you think: where do we find glaciers with high MBGs? Click for details Equilibrium state Glaciers change their geometry as a way to adapt to the climate³. If the accumulation increases, the glacier will grow further down below the ELA to increase the ablation. Similarly, if the temperature rises and the ablation increases, the glacier length will decrease. If the climate remains constant for a long enough time, glaciers will reach an equilibrium state with its climate, where the accumulation = ablation ⁴. With this in mind, we will take a look at how fast our glaciers, with different gradients, reach this state and compare their shapes: The different glaciers reach their equilibrium state after a different number of years. What does the figure show us? Which glacier is the thickest and longest? Let's look at specific numbers: The glacier with the strongest gradient reaches the equilibrium state first. This is also the largest and longest glacier. Response time The glacier response time is the period of time a glacier needs to adjust its geometry to changes in mass balance caused by climate change and reach a new equilibrium state. There are a some different definitions for its calculation, OGGM-Edu use the definition from Oerlemans (see formula below) ⁵. A OGGM-Edu glacier has an attribute .response_time which is calculated based on difference between the last two equilibrium states in the glacier history. So far we've only showed you how to progress a glacier to equilibrium, but not how to leave it and reach a second one. This will be the first step to getting the response time of a glacier. We use the glacier from the start of the notebook. First we progress the glacier to equilibrium We can access the stored equilibrium states of a glacier Now we want to set up a climate change scenario for the glacier. This is easily done with the .add_temperature_bias method. This method takes a desired temperature bias (+/−) and a duration, which specifies how long it will take for the glacier to reach the climate state. For instance, if we set the bias to 1. and the duration to 50, it will take 50 years for the climate to become 1 degree warmer. When a glacier has a climate change scenario the progress_ methods will internally work a little bit differently, but this is not anything you will notice. Since we are purely interested in the response of the glacier, we create a climate change scenario with the duration of 1 year. The next step is to calculate the response times for our glaciers. One could think that it is as simple as looking at the years above and do a simple subtraction. However this is not the case! In reality the rate at which a glacier changes is ever decreasing and a complete equilibrium state is never really achieved. Because of this the response time is considered the time it has taken the glacier to complete most of the adjustment, more specifically all but a factor of 1/e. For numerical models like our glaciers it is common to use the volume response time, from Oerlemans: τ = t(V = V2 −V 2 − V1e) where V1 and V2 corresponds to the glacier volume at the initial and new equilibrium state respectively. Luckily this is done by our glacier object, so we can just take look at the .response_time attribute or just look at the representation Now that we have introduced the concept of response time we can apply it and see how the different mass balance gradients affect the response time. For this we need a new collection. We then have to set up a climate change scenario for the glaciers in the collection We can also look at the state history for one of the glaciers The glacier with weakest MBG need the longest time to adjust to a changed climate compared to the other glaciers. On the other hand, the glacier with the strongest gradient only needs a around two decades to adjust its shape to the new climate (A real world example: Franz Josef glacier in New Zealand⁶)⁷. The response time of glaciers with weak gradients is in reality much longer than 200 years, actually closer to 2000 years.
4,221
4,259
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) complex_mb = MassBalance(ela=3000, gradient=[3, 7, 10, 15], breakpoints=[2700, 2250, 1800]) glacier_complex_mb = Glacier(bed=bed, mass_balance=complex_mb) collection.add(glacier_complex_mb) collection.progress_to_year(300) collection.plot() collection.plot_mass_balance() collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) collection.progress_to_equilibrium() collection.plot() collection glacier glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.add_temperature_bias(bias=1., duration=1) glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.response_time glacier bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[1, 4, 15]} ) collection.progress_to_equilibrium() collection collection.glaciers[0].add_temperature_bias(bias=1., duration=1) collection.glaciers[1].add_temperature_bias(bias=1., duration=1) collection.glaciers[2].add_temperature_bias(bias=1., duration=1) collection.progress_to_equilibrium() collection collection.plot_history() collection.glaciers[0].plot_state_history(eq_states=True)
913
947
8
mass_balance_gradients-9
mass_balance_gradients-9
Mass balance gradients (MBG) and their influence on glacier flow In the intro notebook we touched briefly on the mass balance gradient of a glacier. This is what we are going to take a closer look at now. If the concept of mass balance is completely new to you, have a short read about it here, up to the paragraph "So what is Glacier Mass Balance?". In this notebook we will set up a few simple glaciers to further explore what characteristics of glaciers change with different mass balance gradients. We will also take a look at the topics of volume and response time. Goals of this notebook: The student will be able to explain the terms: Mass balance gradient, Equilibrium state Response time. First, we have to import the relevant classes Initialising the glacier We start by setting up a simple glacier with a linear bedrock (see Getting started with OGGM Edu) to generate a starting point for our experiment. Changing the mass balance gradient (MBG) The MBG is defined as the change of the mass balance with altitude ¹. It depends strongly on the climate at the glacier ². Let's take a look at the effects of the MBG by creating a few glaciers with different gradients. In the intro notebook our glacier had a gradient of 4 mm/m so lets add a glacier with a weaker gradient and one with a stronger gradient. We will again make use of the GlacierCollection to quickly progress and visualise the glaciers. Creating a complex mass balance profile It is also possible to create a more complex mass balance profile. This is achieved by passing a list of gradients, and another list with the altitude of the breakpoints between them. A stronger mass balance gradient (flatter line in plot above) implies a larger change of the mass balance with altitude. We can see this in the plot above: The annual mass balance hardly changes with altitude for the glacier with the weakest mass balance gradient (blue) while there is a considerable difference between the top and bottom annual mass balance for the glacier with the strongest mass balance gradient (green). This in turn affects the growth of the glacier. A strong mass balance gradient implies that more ice is added to the accumulation zone while more ice is removed from the ablation zone each year compared to a glacier with a weaker gradient. This results in a greater ice flux and the glacier thus grows faster. This is why the glacier with the strongest gradient exhibits the largest growth during our experiments (Green glacier in Collection plot above). What do you think: where do we find glaciers with high MBGs? Click for details Equilibrium state Glaciers change their geometry as a way to adapt to the climate³. If the accumulation increases, the glacier will grow further down below the ELA to increase the ablation. Similarly, if the temperature rises and the ablation increases, the glacier length will decrease. If the climate remains constant for a long enough time, glaciers will reach an equilibrium state with its climate, where the accumulation = ablation ⁴. With this in mind, we will take a look at how fast our glaciers, with different gradients, reach this state and compare their shapes: The different glaciers reach their equilibrium state after a different number of years. What does the figure show us? Which glacier is the thickest and longest? Let's look at specific numbers: The glacier with the strongest gradient reaches the equilibrium state first. This is also the largest and longest glacier. Response time The glacier response time is the period of time a glacier needs to adjust its geometry to changes in mass balance caused by climate change and reach a new equilibrium state. There are a some different definitions for its calculation, OGGM-Edu use the definition from Oerlemans (see formula below) ⁵. A OGGM-Edu glacier has an attribute .response_time which is calculated based on difference between the last two equilibrium states in the glacier history. So far we've only showed you how to progress a glacier to equilibrium, but not how to leave it and reach a second one. This will be the first step to getting the response time of a glacier. We use the glacier from the start of the notebook. First we progress the glacier to equilibrium We can access the stored equilibrium states of a glacier Now we want to set up a climate change scenario for the glacier. This is easily done with the .add_temperature_bias method. This method takes a desired temperature bias (+/−) and a duration, which specifies how long it will take for the glacier to reach the climate state. For instance, if we set the bias to 1. and the duration to 50, it will take 50 years for the climate to become 1 degree warmer. When a glacier has a climate change scenario the progress_ methods will internally work a little bit differently, but this is not anything you will notice. Since we are purely interested in the response of the glacier, we create a climate change scenario with the duration of 1 year. The next step is to calculate the response times for our glaciers. One could think that it is as simple as looking at the years above and do a simple subtraction. However this is not the case! In reality the rate at which a glacier changes is ever decreasing and a complete equilibrium state is never really achieved. Because of this the response time is considered the time it has taken the glacier to complete most of the adjustment, more specifically all but a factor of 1/e. For numerical models like our glaciers it is common to use the volume response time, from Oerlemans: τ = t(V = V2 −V 2 − V1e) where V1 and V2 corresponds to the glacier volume at the initial and new equilibrium state respectively. Luckily this is done by our glacier object, so we can just take look at the .response_time attribute or just look at the representation Now that we have introduced the concept of response time we can apply it and see how the different mass balance gradients affect the response time. For this we need a new collection. We then have to set up a climate change scenario for the glaciers in the collection We can also look at the state history for one of the glaciers The glacier with weakest MBG need the longest time to adjust to a changed climate compared to the other glaciers. On the other hand, the glacier with the strongest gradient only needs a around two decades to adjust its shape to the new climate (A real world example: Franz Josef glacier in New Zealand⁶)⁷. The response time of glaciers with weak gradients is in reality much longer than 200 years, actually closer to 2000 years.
4,941
5,004
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) complex_mb = MassBalance(ela=3000, gradient=[3, 7, 10, 15], breakpoints=[2700, 2250, 1800]) glacier_complex_mb = Glacier(bed=bed, mass_balance=complex_mb) collection.add(glacier_complex_mb) collection.progress_to_year(300) collection.plot() collection.plot_mass_balance() collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) collection.progress_to_equilibrium() collection.plot() collection glacier glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.add_temperature_bias(bias=1., duration=1) glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.response_time glacier bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[1, 4, 15]} ) collection.progress_to_equilibrium() collection collection.glaciers[0].add_temperature_bias(bias=1., duration=1) collection.glaciers[1].add_temperature_bias(bias=1., duration=1) collection.glaciers[2].add_temperature_bias(bias=1., duration=1) collection.progress_to_equilibrium() collection collection.plot_history() collection.glaciers[0].plot_state_history(eq_states=True)
985
1,035
9
mass_balance_gradients-10
mass_balance_gradients-10
Mass balance gradients (MBG) and their influence on glacier flow In the intro notebook we touched briefly on the mass balance gradient of a glacier. This is what we are going to take a closer look at now. If the concept of mass balance is completely new to you, have a short read about it here, up to the paragraph "So what is Glacier Mass Balance?". In this notebook we will set up a few simple glaciers to further explore what characteristics of glaciers change with different mass balance gradients. We will also take a look at the topics of volume and response time. Goals of this notebook: The student will be able to explain the terms: Mass balance gradient, Equilibrium state Response time. First, we have to import the relevant classes Initialising the glacier We start by setting up a simple glacier with a linear bedrock (see Getting started with OGGM Edu) to generate a starting point for our experiment. Changing the mass balance gradient (MBG) The MBG is defined as the change of the mass balance with altitude ¹. It depends strongly on the climate at the glacier ². Let's take a look at the effects of the MBG by creating a few glaciers with different gradients. In the intro notebook our glacier had a gradient of 4 mm/m so lets add a glacier with a weaker gradient and one with a stronger gradient. We will again make use of the GlacierCollection to quickly progress and visualise the glaciers. Creating a complex mass balance profile It is also possible to create a more complex mass balance profile. This is achieved by passing a list of gradients, and another list with the altitude of the breakpoints between them. A stronger mass balance gradient (flatter line in plot above) implies a larger change of the mass balance with altitude. We can see this in the plot above: The annual mass balance hardly changes with altitude for the glacier with the weakest mass balance gradient (blue) while there is a considerable difference between the top and bottom annual mass balance for the glacier with the strongest mass balance gradient (green). This in turn affects the growth of the glacier. A strong mass balance gradient implies that more ice is added to the accumulation zone while more ice is removed from the ablation zone each year compared to a glacier with a weaker gradient. This results in a greater ice flux and the glacier thus grows faster. This is why the glacier with the strongest gradient exhibits the largest growth during our experiments (Green glacier in Collection plot above). What do you think: where do we find glaciers with high MBGs? Click for details Equilibrium state Glaciers change their geometry as a way to adapt to the climate³. If the accumulation increases, the glacier will grow further down below the ELA to increase the ablation. Similarly, if the temperature rises and the ablation increases, the glacier length will decrease. If the climate remains constant for a long enough time, glaciers will reach an equilibrium state with its climate, where the accumulation = ablation ⁴. With this in mind, we will take a look at how fast our glaciers, with different gradients, reach this state and compare their shapes: The different glaciers reach their equilibrium state after a different number of years. What does the figure show us? Which glacier is the thickest and longest? Let's look at specific numbers: The glacier with the strongest gradient reaches the equilibrium state first. This is also the largest and longest glacier. Response time The glacier response time is the period of time a glacier needs to adjust its geometry to changes in mass balance caused by climate change and reach a new equilibrium state. There are a some different definitions for its calculation, OGGM-Edu use the definition from Oerlemans (see formula below) ⁵. A OGGM-Edu glacier has an attribute .response_time which is calculated based on difference between the last two equilibrium states in the glacier history. So far we've only showed you how to progress a glacier to equilibrium, but not how to leave it and reach a second one. This will be the first step to getting the response time of a glacier. We use the glacier from the start of the notebook. First we progress the glacier to equilibrium We can access the stored equilibrium states of a glacier Now we want to set up a climate change scenario for the glacier. This is easily done with the .add_temperature_bias method. This method takes a desired temperature bias (+/−) and a duration, which specifies how long it will take for the glacier to reach the climate state. For instance, if we set the bias to 1. and the duration to 50, it will take 50 years for the climate to become 1 degree warmer. When a glacier has a climate change scenario the progress_ methods will internally work a little bit differently, but this is not anything you will notice. Since we are purely interested in the response of the glacier, we create a climate change scenario with the duration of 1 year. The next step is to calculate the response times for our glaciers. One could think that it is as simple as looking at the years above and do a simple subtraction. However this is not the case! In reality the rate at which a glacier changes is ever decreasing and a complete equilibrium state is never really achieved. Because of this the response time is considered the time it has taken the glacier to complete most of the adjustment, more specifically all but a factor of 1/e. For numerical models like our glaciers it is common to use the volume response time, from Oerlemans: τ = t(V = V2 −V 2 − V1e) where V1 and V2 corresponds to the glacier volume at the initial and new equilibrium state respectively. Luckily this is done by our glacier object, so we can just take look at the .response_time attribute or just look at the representation Now that we have introduced the concept of response time we can apply it and see how the different mass balance gradients affect the response time. For this we need a new collection. We then have to set up a climate change scenario for the glaciers in the collection We can also look at the state history for one of the glaciers The glacier with weakest MBG need the longest time to adjust to a changed climate compared to the other glaciers. On the other hand, the glacier with the strongest gradient only needs a around two decades to adjust its shape to the new climate (A real world example: Franz Josef glacier in New Zealand⁶)⁷. The response time of glaciers with weak gradients is in reality much longer than 200 years, actually closer to 2000 years.
5,857
6,039
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) complex_mb = MassBalance(ela=3000, gradient=[3, 7, 10, 15], breakpoints=[2700, 2250, 1800]) glacier_complex_mb = Glacier(bed=bed, mass_balance=complex_mb) collection.add(glacier_complex_mb) collection.progress_to_year(300) collection.plot() collection.plot_mass_balance() collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) collection.progress_to_equilibrium() collection.plot() collection glacier glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.add_temperature_bias(bias=1., duration=1) glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.response_time glacier bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[1, 4, 15]} ) collection.progress_to_equilibrium() collection collection.glaciers[0].add_temperature_bias(bias=1., duration=1) collection.glaciers[1].add_temperature_bias(bias=1., duration=1) collection.glaciers[2].add_temperature_bias(bias=1., duration=1) collection.progress_to_equilibrium() collection collection.plot_history() collection.glaciers[0].plot_state_history(eq_states=True)
1,142
1,477
10
mass_balance_gradients-11
mass_balance_gradients-11
Mass balance gradients (MBG) and their influence on glacier flow In the intro notebook we touched briefly on the mass balance gradient of a glacier. This is what we are going to take a closer look at now. If the concept of mass balance is completely new to you, have a short read about it here, up to the paragraph "So what is Glacier Mass Balance?". In this notebook we will set up a few simple glaciers to further explore what characteristics of glaciers change with different mass balance gradients. We will also take a look at the topics of volume and response time. Goals of this notebook: The student will be able to explain the terms: Mass balance gradient, Equilibrium state Response time. First, we have to import the relevant classes Initialising the glacier We start by setting up a simple glacier with a linear bedrock (see Getting started with OGGM Edu) to generate a starting point for our experiment. Changing the mass balance gradient (MBG) The MBG is defined as the change of the mass balance with altitude ¹. It depends strongly on the climate at the glacier ². Let's take a look at the effects of the MBG by creating a few glaciers with different gradients. In the intro notebook our glacier had a gradient of 4 mm/m so lets add a glacier with a weaker gradient and one with a stronger gradient. We will again make use of the GlacierCollection to quickly progress and visualise the glaciers. Creating a complex mass balance profile It is also possible to create a more complex mass balance profile. This is achieved by passing a list of gradients, and another list with the altitude of the breakpoints between them. A stronger mass balance gradient (flatter line in plot above) implies a larger change of the mass balance with altitude. We can see this in the plot above: The annual mass balance hardly changes with altitude for the glacier with the weakest mass balance gradient (blue) while there is a considerable difference between the top and bottom annual mass balance for the glacier with the strongest mass balance gradient (green). This in turn affects the growth of the glacier. A strong mass balance gradient implies that more ice is added to the accumulation zone while more ice is removed from the ablation zone each year compared to a glacier with a weaker gradient. This results in a greater ice flux and the glacier thus grows faster. This is why the glacier with the strongest gradient exhibits the largest growth during our experiments (Green glacier in Collection plot above). What do you think: where do we find glaciers with high MBGs? Click for details Equilibrium state Glaciers change their geometry as a way to adapt to the climate³. If the accumulation increases, the glacier will grow further down below the ELA to increase the ablation. Similarly, if the temperature rises and the ablation increases, the glacier length will decrease. If the climate remains constant for a long enough time, glaciers will reach an equilibrium state with its climate, where the accumulation = ablation ⁴. With this in mind, we will take a look at how fast our glaciers, with different gradients, reach this state and compare their shapes: The different glaciers reach their equilibrium state after a different number of years. What does the figure show us? Which glacier is the thickest and longest? Let's look at specific numbers: The glacier with the strongest gradient reaches the equilibrium state first. This is also the largest and longest glacier. Response time The glacier response time is the period of time a glacier needs to adjust its geometry to changes in mass balance caused by climate change and reach a new equilibrium state. There are a some different definitions for its calculation, OGGM-Edu use the definition from Oerlemans (see formula below) ⁵. A OGGM-Edu glacier has an attribute .response_time which is calculated based on difference between the last two equilibrium states in the glacier history. So far we've only showed you how to progress a glacier to equilibrium, but not how to leave it and reach a second one. This will be the first step to getting the response time of a glacier. We use the glacier from the start of the notebook. First we progress the glacier to equilibrium We can access the stored equilibrium states of a glacier Now we want to set up a climate change scenario for the glacier. This is easily done with the .add_temperature_bias method. This method takes a desired temperature bias (+/−) and a duration, which specifies how long it will take for the glacier to reach the climate state. For instance, if we set the bias to 1. and the duration to 50, it will take 50 years for the climate to become 1 degree warmer. When a glacier has a climate change scenario the progress_ methods will internally work a little bit differently, but this is not anything you will notice. Since we are purely interested in the response of the glacier, we create a climate change scenario with the duration of 1 year. The next step is to calculate the response times for our glaciers. One could think that it is as simple as looking at the years above and do a simple subtraction. However this is not the case! In reality the rate at which a glacier changes is ever decreasing and a complete equilibrium state is never really achieved. Because of this the response time is considered the time it has taken the glacier to complete most of the adjustment, more specifically all but a factor of 1/e. For numerical models like our glaciers it is common to use the volume response time, from Oerlemans: τ = t(V = V2 −V 2 − V1e) where V1 and V2 corresponds to the glacier volume at the initial and new equilibrium state respectively. Luckily this is done by our glacier object, so we can just take look at the .response_time attribute or just look at the representation Now that we have introduced the concept of response time we can apply it and see how the different mass balance gradients affect the response time. For this we need a new collection. We then have to set up a climate change scenario for the glaciers in the collection We can also look at the state history for one of the glaciers The glacier with weakest MBG need the longest time to adjust to a changed climate compared to the other glaciers. On the other hand, the glacier with the strongest gradient only needs a around two decades to adjust its shape to the new climate (A real world example: Franz Josef glacier in New Zealand⁶)⁷. The response time of glaciers with weak gradients is in reality much longer than 200 years, actually closer to 2000 years.
718
745
from oggm_edu import MassBalance, GlacierBed, Glacier, GlacierCollection bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) complex_mb = MassBalance(ela=3000, gradient=[3, 7, 10, 15], breakpoints=[2700, 2250, 1800]) glacier_complex_mb = Glacier(bed=bed, mass_balance=complex_mb) collection.add(glacier_complex_mb) collection.progress_to_year(300) collection.plot() collection.plot_mass_balance() collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[0.3, 4, 15]} ) collection.progress_to_equilibrium() collection.plot() collection glacier glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.add_temperature_bias(bias=1., duration=1) glacier.progress_to_equilibrium() glacier.plot() glacier.eq_states glacier.response_time glacier bed = GlacierBed(top=3400, bottom=1500, width=400) mass_balance = MassBalance(ela=3000, gradient=4) glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.fill(glacier, n=3, attributes_to_change= {'gradient':[1, 4, 15]} ) collection.progress_to_equilibrium() collection collection.glaciers[0].add_temperature_bias(bias=1., duration=1) collection.glaciers[1].add_temperature_bias(bias=1., duration=1) collection.glaciers[2].add_temperature_bias(bias=1., duration=1) collection.progress_to_equilibrium() collection collection.plot_history() collection.glaciers[0].plot_state_history(eq_states=True)
4
77
11
surging_experiment-0
surging_experiment-0
Glacier surging experiments Goals of this notebook: Learn how to set up a surging glacier using OGGM-Edu. Understand and describe the effects of glacier surging. In this notebook we are going to explore surging glaciers and how we can experiment with them using OGGM-Edu. What is a glacier surge? A small percentage of glaciers undergo short periods of faster flow. They experience a change in morphology and surface characteristics, which sometimes leads to a marked frontal advance. The speed of the ice increases up to 10 - 1000 times of the normal velocity. Record flows are observed with velocities that exceed 100m per day. Surges happen in decadal cycles and can last for 1 up to 15 years.(Jiskoot, 2011) We start with importing the necessary classes: Basics We set up a glacier with a linear bedrock and variable width (see Intro notebook) as a setting for our experiment. We can then define a surging glacier using the SurgingGlacier class The surging glacier is essentially the same as a Glacier but with some added attributes, namely the .normal_years , .surging_years and the .basal_sliding_surge. By default these are set to 50 years of non-surging and 5 years of surging, with a basal sliding during a surge 10 times higher then when not surging. These can easily be changed by the user after initialisation. There are also some changes to how the progression works, and it is not possible to progress a surging glacier to equilibrium. When we progress this glacier the basal sliding will be increased every 50 years resulting in an increased ice flow. To learn more about ice flow parameters, take a look at this notebook. In the plot above we can distinguish the surging periods as a rapid expansion in both length and area (also marked in orange). Surging glacier experiment We can compare this to a non-surging glacier. For this we will again employ the glacier collection. Next we can create a glacier with a stronger surge, add this to the collection and compare it to the two previous glaciers.
1,459
1,575
from oggm_edu import SurgingGlacier, Glacier, GlacierBed, MassBalance, GlacierCollection bed = GlacierBed(altitudes=[3400, 3000, 2500, 1500], widths=[500, 400, 300, 300]) mass_balance = MassBalance(ela=2900, gradient=4) bed.plot() surging_glacier = SurgingGlacier(bed=bed, mass_balance=mass_balance) surging_glacier.normal_years surging_glacier.surging_years surging_glacier surging_glacier.basal_sliding surging_glacier.basal_sliding_surge surging_glacier.progress_to_year(400) surging_glacier.plot_history() surging_glacier.plot() glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.add([surging_glacier, glacier]) collection.progress_to_year(400) collection.plot_history() collection.plot() collection surging_glacier_strong = SurgingGlacier(bed=bed, mass_balance=mass_balance) surging_glacier_strong.basal_sliding_surge = 5.7e-20 * 50 collection.add(surging_glacier_strong) collection.progress_to_year(400) collection collection.plot_history()
707
740
0
surging_experiment-1
surging_experiment-1
Glacier surging experiments Goals of this notebook: Learn how to set up a surging glacier using OGGM-Edu. Understand and describe the effects of glacier surging. In this notebook we are going to explore surging glaciers and how we can experiment with them using OGGM-Edu. What is a glacier surge? A small percentage of glaciers undergo short periods of faster flow. They experience a change in morphology and surface characteristics, which sometimes leads to a marked frontal advance. The speed of the ice increases up to 10 - 1000 times of the normal velocity. Record flows are observed with velocities that exceed 100m per day. Surges happen in decadal cycles and can last for 1 up to 15 years.(Jiskoot, 2011) We start with importing the necessary classes: Basics We set up a glacier with a linear bedrock and variable width (see Intro notebook) as a setting for our experiment. We can then define a surging glacier using the SurgingGlacier class The surging glacier is essentially the same as a Glacier but with some added attributes, namely the .normal_years , .surging_years and the .basal_sliding_surge. By default these are set to 50 years of non-surging and 5 years of surging, with a basal sliding during a surge 10 times higher then when not surging. These can easily be changed by the user after initialisation. There are also some changes to how the progression works, and it is not possible to progress a surging glacier to equilibrium. When we progress this glacier the basal sliding will be increased every 50 years resulting in an increased ice flow. To learn more about ice flow parameters, take a look at this notebook. In the plot above we can distinguish the surging periods as a rapid expansion in both length and area (also marked in orange). Surging glacier experiment We can compare this to a non-surging glacier. For this we will again employ the glacier collection. Next we can create a glacier with a stronger surge, add this to the collection and compare it to the two previous glaciers.
1,804
1,903
from oggm_edu import SurgingGlacier, Glacier, GlacierBed, MassBalance, GlacierCollection bed = GlacierBed(altitudes=[3400, 3000, 2500, 1500], widths=[500, 400, 300, 300]) mass_balance = MassBalance(ela=2900, gradient=4) bed.plot() surging_glacier = SurgingGlacier(bed=bed, mass_balance=mass_balance) surging_glacier.normal_years surging_glacier.surging_years surging_glacier surging_glacier.basal_sliding surging_glacier.basal_sliding_surge surging_glacier.progress_to_year(400) surging_glacier.plot_history() surging_glacier.plot() glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.add([surging_glacier, glacier]) collection.progress_to_year(400) collection.plot_history() collection.plot() collection surging_glacier_strong = SurgingGlacier(bed=bed, mass_balance=mass_balance) surging_glacier_strong.basal_sliding_surge = 5.7e-20 * 50 collection.add(surging_glacier_strong) collection.progress_to_year(400) collection collection.plot_history()
575
740
1
surging_experiment-2
surging_experiment-2
Glacier surging experiments Goals of this notebook: Learn how to set up a surging glacier using OGGM-Edu. Understand and describe the effects of glacier surging. In this notebook we are going to explore surging glaciers and how we can experiment with them using OGGM-Edu. What is a glacier surge? A small percentage of glaciers undergo short periods of faster flow. They experience a change in morphology and surface characteristics, which sometimes leads to a marked frontal advance. The speed of the ice increases up to 10 - 1000 times of the normal velocity. Record flows are observed with velocities that exceed 100m per day. Surges happen in decadal cycles and can last for 1 up to 15 years.(Jiskoot, 2011) We start with importing the necessary classes: Basics We set up a glacier with a linear bedrock and variable width (see Intro notebook) as a setting for our experiment. We can then define a surging glacier using the SurgingGlacier class The surging glacier is essentially the same as a Glacier but with some added attributes, namely the .normal_years , .surging_years and the .basal_sliding_surge. By default these are set to 50 years of non-surging and 5 years of surging, with a basal sliding during a surge 10 times higher then when not surging. These can easily be changed by the user after initialisation. There are also some changes to how the progression works, and it is not possible to progress a surging glacier to equilibrium. When we progress this glacier the basal sliding will be increased every 50 years resulting in an increased ice flow. To learn more about ice flow parameters, take a look at this notebook. In the plot above we can distinguish the surging periods as a rapid expansion in both length and area (also marked in orange). Surging glacier experiment We can compare this to a non-surging glacier. For this we will again employ the glacier collection. Next we can create a glacier with a stronger surge, add this to the collection and compare it to the two previous glaciers.
771
831
from oggm_edu import SurgingGlacier, Glacier, GlacierBed, MassBalance, GlacierCollection bed = GlacierBed(altitudes=[3400, 3000, 2500, 1500], widths=[500, 400, 300, 300]) mass_balance = MassBalance(ela=2900, gradient=4) bed.plot() surging_glacier = SurgingGlacier(bed=bed, mass_balance=mass_balance) surging_glacier.normal_years surging_glacier.surging_years surging_glacier surging_glacier.basal_sliding surging_glacier.basal_sliding_surge surging_glacier.progress_to_year(400) surging_glacier.plot_history() surging_glacier.plot() glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.add([surging_glacier, glacier]) collection.progress_to_year(400) collection.plot_history() collection.plot() collection surging_glacier_strong = SurgingGlacier(bed=bed, mass_balance=mass_balance) surging_glacier_strong.basal_sliding_surge = 5.7e-20 * 50 collection.add(surging_glacier_strong) collection.progress_to_year(400) collection collection.plot_history()
97
245
2
surging_experiment-3
surging_experiment-3
Glacier surging experiments Goals of this notebook: Learn how to set up a surging glacier using OGGM-Edu. Understand and describe the effects of glacier surging. In this notebook we are going to explore surging glaciers and how we can experiment with them using OGGM-Edu. What is a glacier surge? A small percentage of glaciers undergo short periods of faster flow. They experience a change in morphology and surface characteristics, which sometimes leads to a marked frontal advance. The speed of the ice increases up to 10 - 1000 times of the normal velocity. Record flows are observed with velocities that exceed 100m per day. Surges happen in decadal cycles and can last for 1 up to 15 years.(Jiskoot, 2011) We start with importing the necessary classes: Basics We set up a glacier with a linear bedrock and variable width (see Intro notebook) as a setting for our experiment. We can then define a surging glacier using the SurgingGlacier class The surging glacier is essentially the same as a Glacier but with some added attributes, namely the .normal_years , .surging_years and the .basal_sliding_surge. By default these are set to 50 years of non-surging and 5 years of surging, with a basal sliding during a surge 10 times higher then when not surging. These can easily be changed by the user after initialisation. There are also some changes to how the progression works, and it is not possible to progress a surging glacier to equilibrium. When we progress this glacier the basal sliding will be increased every 50 years resulting in an increased ice flow. To learn more about ice flow parameters, take a look at this notebook. In the plot above we can distinguish the surging periods as a rapid expansion in both length and area (also marked in orange). Surging glacier experiment We can compare this to a non-surging glacier. For this we will again employ the glacier collection. Next we can create a glacier with a stronger surge, add this to the collection and compare it to the two previous glaciers.
887
954
from oggm_edu import SurgingGlacier, Glacier, GlacierBed, MassBalance, GlacierCollection bed = GlacierBed(altitudes=[3400, 3000, 2500, 1500], widths=[500, 400, 300, 300]) mass_balance = MassBalance(ela=2900, gradient=4) bed.plot() surging_glacier = SurgingGlacier(bed=bed, mass_balance=mass_balance) surging_glacier.normal_years surging_glacier.surging_years surging_glacier surging_glacier.basal_sliding surging_glacier.basal_sliding_surge surging_glacier.progress_to_year(400) surging_glacier.plot_history() surging_glacier.plot() glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.add([surging_glacier, glacier]) collection.progress_to_year(400) collection.plot_history() collection.plot() collection surging_glacier_strong = SurgingGlacier(bed=bed, mass_balance=mass_balance) surging_glacier_strong.basal_sliding_surge = 5.7e-20 * 50 collection.add(surging_glacier_strong) collection.progress_to_year(400) collection collection.plot_history()
259
328
3
surging_experiment-4
surging_experiment-4
Glacier surging experiments Goals of this notebook: Learn how to set up a surging glacier using OGGM-Edu. Understand and describe the effects of glacier surging. In this notebook we are going to explore surging glaciers and how we can experiment with them using OGGM-Edu. What is a glacier surge? A small percentage of glaciers undergo short periods of faster flow. They experience a change in morphology and surface characteristics, which sometimes leads to a marked frontal advance. The speed of the ice increases up to 10 - 1000 times of the normal velocity. Record flows are observed with velocities that exceed 100m per day. Surges happen in decadal cycles and can last for 1 up to 15 years.(Jiskoot, 2011) We start with importing the necessary classes: Basics We set up a glacier with a linear bedrock and variable width (see Intro notebook) as a setting for our experiment. We can then define a surging glacier using the SurgingGlacier class The surging glacier is essentially the same as a Glacier but with some added attributes, namely the .normal_years , .surging_years and the .basal_sliding_surge. By default these are set to 50 years of non-surging and 5 years of surging, with a basal sliding during a surge 10 times higher then when not surging. These can easily be changed by the user after initialisation. There are also some changes to how the progression works, and it is not possible to progress a surging glacier to equilibrium. When we progress this glacier the basal sliding will be increased every 50 years resulting in an increased ice flow. To learn more about ice flow parameters, take a look at this notebook. In the plot above we can distinguish the surging periods as a rapid expansion in both length and area (also marked in orange). Surging glacier experiment We can compare this to a non-surging glacier. For this we will again employ the glacier collection. Next we can create a glacier with a stronger surge, add this to the collection and compare it to the two previous glaciers.
1,905
2,027
from oggm_edu import SurgingGlacier, Glacier, GlacierBed, MassBalance, GlacierCollection bed = GlacierBed(altitudes=[3400, 3000, 2500, 1500], widths=[500, 400, 300, 300]) mass_balance = MassBalance(ela=2900, gradient=4) bed.plot() surging_glacier = SurgingGlacier(bed=bed, mass_balance=mass_balance) surging_glacier.normal_years surging_glacier.surging_years surging_glacier surging_glacier.basal_sliding surging_glacier.basal_sliding_surge surging_glacier.progress_to_year(400) surging_glacier.plot_history() surging_glacier.plot() glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.add([surging_glacier, glacier]) collection.progress_to_year(400) collection.plot_history() collection.plot() collection surging_glacier_strong = SurgingGlacier(bed=bed, mass_balance=mass_balance) surging_glacier_strong.basal_sliding_surge = 5.7e-20 * 50 collection.add(surging_glacier_strong) collection.progress_to_year(400) collection collection.plot_history()
801
1,010
4
surging_experiment-5
surging_experiment-5
Glacier surging experiments Goals of this notebook: Learn how to set up a surging glacier using OGGM-Edu. Understand and describe the effects of glacier surging. In this notebook we are going to explore surging glaciers and how we can experiment with them using OGGM-Edu. What is a glacier surge? A small percentage of glaciers undergo short periods of faster flow. They experience a change in morphology and surface characteristics, which sometimes leads to a marked frontal advance. The speed of the ice increases up to 10 - 1000 times of the normal velocity. Record flows are observed with velocities that exceed 100m per day. Surges happen in decadal cycles and can last for 1 up to 15 years.(Jiskoot, 2011) We start with importing the necessary classes: Basics We set up a glacier with a linear bedrock and variable width (see Intro notebook) as a setting for our experiment. We can then define a surging glacier using the SurgingGlacier class The surging glacier is essentially the same as a Glacier but with some added attributes, namely the .normal_years , .surging_years and the .basal_sliding_surge. By default these are set to 50 years of non-surging and 5 years of surging, with a basal sliding during a surge 10 times higher then when not surging. These can easily be changed by the user after initialisation. There are also some changes to how the progression works, and it is not possible to progress a surging glacier to equilibrium. When we progress this glacier the basal sliding will be increased every 50 years resulting in an increased ice flow. To learn more about ice flow parameters, take a look at this notebook. In the plot above we can distinguish the surging periods as a rapid expansion in both length and area (also marked in orange). Surging glacier experiment We can compare this to a non-surging glacier. For this we will again employ the glacier collection. Next we can create a glacier with a stronger surge, add this to the collection and compare it to the two previous glaciers.
716
761
from oggm_edu import SurgingGlacier, Glacier, GlacierBed, MassBalance, GlacierCollection bed = GlacierBed(altitudes=[3400, 3000, 2500, 1500], widths=[500, 400, 300, 300]) mass_balance = MassBalance(ela=2900, gradient=4) bed.plot() surging_glacier = SurgingGlacier(bed=bed, mass_balance=mass_balance) surging_glacier.normal_years surging_glacier.surging_years surging_glacier surging_glacier.basal_sliding surging_glacier.basal_sliding_surge surging_glacier.progress_to_year(400) surging_glacier.plot_history() surging_glacier.plot() glacier = Glacier(bed=bed, mass_balance=mass_balance) collection = GlacierCollection() collection.add([surging_glacier, glacier]) collection.progress_to_year(400) collection.plot_history() collection.plot() collection surging_glacier_strong = SurgingGlacier(bed=bed, mass_balance=mass_balance) surging_glacier_strong.basal_sliding_surge = 5.7e-20 * 50 collection.add(surging_glacier_strong) collection.progress_to_year(400) collection collection.plot_history()
5
94
5