Skip to content

Commit

Permalink
Merge pull request #99 from IamShubhamGupto/fix/references
Browse files Browse the repository at this point in the history
Update references
  • Loading branch information
dhruvbalwada authored Apr 12, 2023
2 parents ecc0c71 + 523fd3b commit 5a3e8c5
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 17 deletions.
6 changes: 6 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ latex:
bibtex_bibfiles:
- references.bib

# set to author_year format
sphinx:
html4_writer: {"citation_show_urls": False, "citation_references": "full", "external_links": False}
config:
bibtex_reference_style: author_year

# Information about where the book exists on the web
repository:
url: https://github.com/m2lines/L96_demo # Online location of your book
Expand Down
2 changes: 1 addition & 1 deletion intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

The climate system is composed of many interacting components (e.g., ocean, atmosphere, ice) and described by complex nonlinear equations. To simulate, understand and predict climate, these equations are solved numerically under a number of simplifications, therefore leading to errors. The errors are the result of numerics used to solve the equations and the lack of appropriate representations of processes occurring below the resolution of the climate model grid (i.e., subgrid processes).

The goal of this book is to conceptualize the problems associated with climate models within a simple and computationally accessible framework. We will introduce the readers to climate modeling by using a simple tool, the {cite:t}`Lorenz1995` (L96) two-timescale model. We discuss the numerical aspects of the L96 model, the approximate representation of subgrid processes (known as parameterizations or closures), and simple data assimilation problems (a data-model fusion method). We will then use the L96 results to demonstrate how to learn subgrid parameterizations from data with machine learning, and then test the parameterizations offline (apriori) and online (aposteriori), with a focus on the interpretability of the results.
The goal of this book is to conceptualize the problems associated with climate models within a simple and computationally accessible framework. We will introduce the readers to climate modeling by using a simple tool, the {cite}`Lorenz1995` two-timescale model. We discuss the numerical aspects of the L96 model, the approximate representation of subgrid processes (known as parameterizations or closures), and simple data assimilation problems (a data-model fusion method). We will then use the L96 results to demonstrate how to learn subgrid parameterizations from data with machine learning, and then test the parameterizations offline (apriori) and online (aposteriori), with a focus on the interpretability of the results.

The book was created by and as part of [M<sup>2</sup>LInES](https://m2lines.github.io/), an international collaboration supported by [Schmidt Futures](https://www.schmidtfutures.com/), to improve climate models with scientific machine learning. The goal for this book was for our team to work together and learn from each other; in particular, to get up to speed on the key scientific aspects of our collaboration (parameterizations, machine learning, data assimilation, uncertainty quantification) and to develop new ideas. Ultimately, we are happy to share these resources with the scientific community, to introduce our research ideas and foster the use of machine learning techniques for tackling climate science problems.
4 changes: 2 additions & 2 deletions notebooks/DA_demo_L96.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"id": "2b0a10bb",
"metadata": {},
"source": [
"{cite:p}`Lorenz1995` describes a two-time scale dynamical system using two equations which are:\n",
"{cite}`Lorenz1995` describes a two-time scale dynamical system using two equations which are:\n",
"\n",
"\\begin{align}\n",
"\\frac{d}{dt} X_k\n",
Expand All @@ -32,7 +32,7 @@
"&= - cbY_{j+1,k} \\left( Y_{j+2,k} - X_{j-1,k} \\right) - c Y_{j,k} + \\frac{hc}{b} X_k\n",
"\\end{align}\n",
"\n",
"where $X_k$, $k=0,\\ldots,K-1$, denotes the _large scale_ with $K$ degrees of freedom. The $k$ index is periodic, meaning $k=K$ is referring to $k=0$, $k=-1$ is referring to $k=K-1$, and so on. The $j$ indices represent a sub-division of each $k$-element denoting that the $J$ $Y$-values are coupled to a single $X$ value. When $(j+1,k)$ refers to a value beyond $J$, it cycles and refers back to the first value $(1,k+1)$. The slow time-scale queation is forced by the parameter $F$, which determines the chaotic behaviour of the system {cite:t}`Wilks2005`. The overall structure is illustrated in Fig. 1.\n",
"where $X_k$, $k=0,\\ldots,K-1$, denotes the _large scale_ with $K$ degrees of freedom. The $k$ index is periodic, meaning $k=K$ is referring to $k=0$, $k=-1$ is referring to $k=K-1$, and so on. The $j$ indices represent a sub-division of each $k$-element denoting that the $J$ $Y$-values are coupled to a single $X$ value. When $(j+1,k)$ refers to a value beyond $J$, it cycles and refers back to the first value $(1,k+1)$. The slow time-scale queation is forced by the parameter $F$, which determines the chaotic behaviour of the system {cite}`Wilks2005`. The overall structure is illustrated in Fig. 1.\n",
"\n",
"\n",
"<center>\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/L96-two-scale-description.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.9.6"
}
},
"nbformat": 4,
Expand Down
29 changes: 16 additions & 13 deletions notebooks/gcm-analogue.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "15939db9-43b8-4d20-8a31-84bdbc80fd2d",
"metadata": {},
Expand All @@ -20,8 +21,8 @@
"\n",
"We will first describe a simulation with the two time-scale model from the {doc}`L96-two-scale-description`, which is taken as the control simulation that we hope to replicate with the single time-scale model. \n",
"\n",
"The forcing and resolution parameters, $F$, $J$ and $K$, for the two time-scale model are fixed based on {cite:t}`Wilks2005`, as $F=18$ or $20$, $K=8$, and $J=32$. Here, the value chosen for the parameter $F$ is set large enough to ensure chaotic behavior. We also use the reference values for the $h$, $b$ and $c$ parameters to be, $h=1$, $b=10$, and $c=10$.\n",
"With this particular choice of parameter values, one model time unit (MTU) is approximately equivalent to five atmospheric days. This estimate is obtained by comparing error-doubling times in the Lorenz-96 model and the real atmosphere {cite:p}`Lorenz1995`.\n",
"The forcing and resolution parameters, $F$, $J$ and $K$, for the two time-scale model are fixed based on {cite}`Wilks2005`, as $F=18$ or $20$, $K=8$, and $J=32$. Here, the value chosen for the parameter $F$ is set large enough to ensure chaotic behavior. We also use the reference values for the $h$, $b$ and $c$ parameters to be, $h=1$, $b=10$, and $c=10$.\n",
"With this particular choice of parameter values, one model time unit (MTU) is approximately equivalent to five atmospheric days. This estimate is obtained by comparing error-doubling times in the Lorenz-96 model and the real atmosphere {cite}`Lorenz1995`.\n",
"\n",
"In the following code, we solve the L96 system using an accurate time-stepping scheme (RK4 with sufficiently small $\\Delta t$), and plot the time evolution for the $X_k$ and $Y_{j,k}$ variables."
]
Expand Down Expand Up @@ -155,12 +156,14 @@
"\n",
"In this notebook, we consider the particular choice of modeling the unknown parameterization with a plynomial approximation. \n",
"Example of such a parameterization include the form proposed by\n",
"{cite:t}`Wilks2005`: \n",
"$$P(X_k)=b_0 + b_1 X_k + b_2 X_k^2 + b_3 X_k^3 + b_4 X_k^4 + e_k$$ \n",
"{cite}`Wilks2005`: \n",
"\\begin{equation*}\n",
"P(X_k)=b_0 + b_1 X_k + b_2 X_k^2 + b_3 X_k^3 + b_4 X_k^4 + e_k\n",
"\\end{equation*}\n",
"where $e_k$ is a stochastic component. \n",
"\n",
"Alternatively, we also consider a lower-order polynomial as suggested by\n",
"{cite:t}`Arnold2013`: \n",
"{cite}`Arnold2013`: \n",
"\\begin{equation*}\n",
"P(X_k)=b_0 + b_1 X_k + e_k\n",
"\\end{equation*}\n",
Expand Down Expand Up @@ -273,7 +276,7 @@
"- \"Real world\": corresponding to the \"truth\" model goverened by the full two time-scale Lorenz-96 system.\n",
"- GCM without parameterization: corresponding to the one time-scale Lorenz-96 system without any the coupling term. We use a forward-Euler scheme to integrate the model forward.\n",
"- GCM with our parameterization: corresponding to the one time-scale Lorenz-96 system with the linear polynomial approximation of the coupling terms as obtained above.\n",
"- GCM with {cite:t}`Wilks2005` parameterization: corresponding to the one time-scale Lorenz-96 system with a third-order polynomial approximation of the coupling terms."
"- GCM with {cite}`Wilks2005` parameterization: corresponding to the one time-scale Lorenz-96 system with a third-order polynomial approximation of the coupling terms."
]
},
{
Expand Down Expand Up @@ -421,7 +424,7 @@
" X(t=0) \\rightarrow X(t=0) + error\n",
" \\end{equation*}\n",
" \n",
"The next code estimates these sources of error and the next figure shows their relative contributions. For reference, we also plot the error of the GCM using {cite:t}`Wilks2005` polynomial coupling term and without any of the sources of error listed above. All errors are evaluated by comparing the GCMs to the \"truth\" model goverened by the full two time-scale Lorenz-96 system."
"The next code estimates these sources of error and the next figure shows their relative contributions. For reference, we also plot the error of the GCM using {cite}`Wilks2005` polynomial coupling term and without any of the sources of error listed above. All errors are evaluated by comparing the GCMs to the \"truth\" model goverened by the full two time-scale Lorenz-96 system."
]
},
{
Expand Down Expand Up @@ -492,7 +495,7 @@
"\n",
"Next, we run the following two variations of two time-scale Lorenz-96:\n",
"1. The GCM with our parameterization corresponding to the one time-scale Lorenz-96 system, with the linear polynomial approximation of the coupling terms.\n",
"2. The GCM with {cite:t}`Wilks2005` parameterization corresponding to the one time-scale Lorenz-96 system with a third-order polynomial approximation of the coupling terms."
"2. The GCM with {cite}`Wilks2005` parameterization corresponding to the one time-scale Lorenz-96 system with a third-order polynomial approximation of the coupling terms."
]
},
{
Expand Down Expand Up @@ -533,7 +536,7 @@
"plt.plot(t2, X2.mean(axis=1), label=\"Model with Wilks, %.2f\" % (X2.mean()))\n",
"plt.xlabel(\"$t$\")\n",
"plt.ylabel(r\"$\\frac{1}{K}\\sum_{k=1}^K X_k(t)$\")\n",
"plt.legend(fontsize=7)"
"plt.legend(fontsize=7);"
]
},
{
Expand All @@ -554,9 +557,9 @@
"id": "c195d28d",
"metadata": {},
"source": [
"As expected, the {cite:t}`Wilks2005` parameterization gives a mean value of the slow variables that is closer to the one obtained with the \"truth\" model compared to the model with linear parameterization since {cite:t}`Wilks2005` coupling term is modeled with a third-order polynomial.\n",
"As expected, the {cite}`Wilks2005` parameterization gives a mean value of the slow variables that is closer to the one obtained with the \"truth\" model compared to the model with linear parameterization since {cite}`Wilks2005` coupling term is modeled with a third-order polynomial.\n",
"\n",
"Next, we consider the model with the full parameterization proposed by {cite:t}`Wilks2005` by adding a stochastic component such that the parameterization has the following form: $P(X_k)=b_0 + b_1 X_k + b_2 X_k^2 + b_3 X_k^3 + b_4 X_k^4 + e_k$ where $e_k$ is a stochastic component."
"Next, we consider the model with the full parameterization proposed by {cite}`Wilks2005` by adding a stochastic component such that the parameterization has the following form: $P(X_k)=b_0 + b_1 X_k + b_2 X_k^2 + b_3 X_k^3 + b_4 X_k^4 + e_k$ where $e_k$ is a stochastic component."
]
},
{
Expand Down Expand Up @@ -644,8 +647,8 @@
"- We compared the few different sources of errors in models.\n",
"- We also compared the results obtained:\n",
" 1. A GCM corresponding to the one time-scale Lorenz-96 system with a linear polynomial parameterization of the coupling terms.\n",
" 2. A GCM with {cite:t}`Wilks2005` parameterization corresponding to the one time-scale Lorenz-96 system with a third-order polynomial approximation of the coupling terms.\n",
" 3. A GCM with the full {cite:t}`Wilks2005` parameterization corresponding to the one time-scale Lorenz-96 system with a third-order polynomial approximation of the coupling terms and a stochastic component."
" 2. A GCM with {cite}`Wilks2005` parameterization corresponding to the one time-scale Lorenz-96 system with a third-order polynomial approximation of the coupling terms.\n",
" 3. A GCM with the full {cite}`Wilks2005` parameterization corresponding to the one time-scale Lorenz-96 system with a third-order polynomial approximation of the coupling terms and a stochastic component."
]
}
],
Expand Down

0 comments on commit 5a3e8c5

Please sign in to comment.