Install command:
$ conda install notebook pymt_permamodel
Download a local copy of the notebook:
$ curl -O https://raw.githubusercontent.com/csdms/pymt/master/docs/demos/frost_number.ipynb
Start a Jupyter Notebook session in the current directory:
$ jupyter notebook
This lab has been designed and developed by Irina Overeem and Mark Piper, CSDMS, University of Colorado, CO with assistance of Kang Wang, Scott Stewart at CSDMS, University of Colorado, CO, and Elchin Jafarov, at Los Alamos National Labs, NM. These labs are developed with support from NSF Grant 1503559, ‘Towards a Tiered Permafrost Modeling Cyberinfrastructure’
This lab is the first in a series of introduction to permafrost process modeling, designed for inexperienced users. In this first lesson, we explore the Air Frost Number model and learn to use the CSDMS Python Modeling Toolkit (PyMT). We implemented a basic configuration of the Air Frost Number (as formulated by Nelson and Outcalt in 1987). This series of labs is designed for inexperienced modelers to gain some experience with running a numerical model, changing model inputs, and analyzing model output. Specifically, this first lab looks at what controls permafrost occurrence and compares the occurrence of permafrost in Russia. Basic theory on the Air Frost Number is presented in Frost Number Model Lecture 1.
This lab will likely take ~ 1,5 hours to complete in the classroom. This time assumes you are unfamiiar with the PyMT and need to learn setting parameters, saving runs, downloading data and looking at output (otherwise it will be much faster).
We will use netcdf files for output, this is a standard output from all CSDMS models. If you have no experience with visualizing these files, Panoply software will be helpful. Find instructions on how to use this software.
Nelson, F.E., Outcalt, S.I., 1987. A computational method for prediction and prediction and regionalization of permafrost. Arct. Alp. Res. 19, 279–288.
Janke, J., Williams, M., Evans, A., 2012. A comparison of permafrost prediction models along a section of Trail Ridge Road, RMNP, CO. Geomorphology 138, 111-120.
The Air Frost number uses the mean annual air temperature of a location (MAAT), as well as the yearly temperature amplitude. In the Air Frost parametrization the Mean monthly temperature of the warmest month (Tw) and coldest month (Tc) set that amplitude. The 'degree thawing days' are above 0 C, the 'degree freezing days' are below 0 C. To arrive at the cumulative freezing degree days and thawing degree days the annual temperature curve is approximated by a cosine as defined by the warmest and coldest months, and one can integrate under the cosine curve (see figure, and more detailed notes in the associated presentation).
In [1]:
# Import standard Python modules
import numpy as np
import pandas
import matplotlib.pyplot as plt
In [2]:
# Import the FrostNumber PyMT model
import pymt.models
frost_number = pymt.models.FrostNumber()
In [3]:
config_file, config_folder = frost_number.setup(T_air_min=-13., T_air_max=19.5)
In [4]:
frost_number.initialize(config_file, config_folder)
In [5]:
frost_number.update()
In [6]:
frost_number.output_var_names
Out[6]:
In [7]:
frost_number.get_value('frostnumber__air')
Out[7]:
In [8]:
args = frost_number.setup(T_air_min=-40.9, T_air_max=19.5)
In [9]:
frost_number.initialize(*args)
frost_number.update()
frost_number.get_value('frostnumber__air')
Out[9]:
In [10]:
data = pandas.read_csv("https://raw.githubusercontent.com/mcflugen/pymt_frost_number/master/data/t_air_min_max.csv")
data
Out[10]:
In [11]:
frost_number = pymt.models.FrostNumber()
config_file, run_folder = frost_number.setup()
In [12]:
frost_number.initialize(config_file, run_folder)
In [13]:
t_air_min = data["atmosphere_bottom_air__time_min_of_temperature"]
t_air_max = data["atmosphere_bottom_air__time_max_of_temperature"]
fn = np.empty(6)
for i in range(6):
frost_number.set_value("atmosphere_bottom_air__time_min_of_temperature", t_air_min.values[i])
frost_number.set_value("atmosphere_bottom_air__time_max_of_temperature", t_air_max.values[i])
frost_number.update()
fn[i] = frost_number.get_value('frostnumber__air')
In [14]:
years = range(2000, 2006)
plt.subplot(211)
plt.plot(years, t_air_min, years, t_air_max)
plt.subplot(212)
plt.plot(years, fn)
Out[14]: