%!TEX root=report.tex
\section{Data}

The GRACE dataset can be downloaded from GRGS \cite{GRACE-data-source}.
This report is based on the Equivalent Water Height (denoted EWH) dataset from release 2 in the GRGS format with a 10-day interval.

This dataset contains quite a few text files, each containing information in both its filename and its content.
The filenames have the format:

\begin{lstlisting}
grid.water.10day_model_minus_RL02MF.19202_19211.txt
grid.water.10day_model_minus_RL02MF.19212_19221.txt
...
\end{lstlisting}

In the filename, the last two numbers (e.g. \texttt{19202\_19211}) are important.
The first number denotes the start date and the second number the end date for the file content.
Each number specifies the number of days since ``1950-01-01'' \cite{GRACE-data-format-dates}.

The actual content of each text file should be read as a ``Space Separated Values'' format.
When this is done one will have a $6480 \times 10$ matrix.
This matrix can then be \texttt{reshape}'ed row-wise into a $180 \times 360$ matrix.
The result is a matrix with decreasing latitude on the rows and increasing longitude on the columns \cite{GRACE-data-format-grids}.

\subsection{Data example}

\begin{figure}[H]
	\centering
	\includegraphics[width=\textwidth]{figures/data-example-world}
	\caption{Plot of the data, 10 day period starting on 3 April 2009}
	\label{fig:data-example-world}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=\textwidth]{figures/data-example-scatter}
	\caption{Plot of EWH at 63.5 N 49.5 W, west coast of Greenland.}
	\label{fig:data-example-scatter}
\end{figure}

From Figure \ref{fig:data-example-world} local mass losses at Greenland and the South Pole are seen.
In Figure \ref{fig:data-example-scatter}, the mass loss at Greenland is seen with a yearly periodic trend. For both locations, the ice melting may be caused by ice melting.
However it is also possible that these changes are caused by post glacial rebound, in partially because no glacial isostatic adjustment (GIA) have been performed on this version of the GRACE dataset.
In fact it is quite complicated to do sufficient adjustments to conclusively say something about ice melting \cite{NASA-GIA-incomplete}.
When that is said, attempts to analyze the GRACE data with the prospect of saying something about the ice melting patterns, will still be made.

From Figure \ref{fig:data-example-world} a mass increment in South America can also been seen, this is caused by the rain season.


\subsection{The function \stackempty}
\Label{sec:stackempty}
\Label{sec:stackemptywd}

The function \stackempty is the runtime version of the predicate \logicref{StackEmpty}.

\input{Listings/stack_empty.h.tex}

As in the definition of the predicate \StackEmpty the implementation of
\stackempty in the next listing simply checks whether the
size of the stack is zero.

\input{Listings/stack_empty.c.tex}

The following listing shows our check whether \stackempty is well-defined.

\input{Listings/stack_empty_wd.c.tex}