% Template GRASS newsletter - Article
% Language: Latex
%

% Head


\title{Simultaneous simulation of hydrological and carbon cycle processes in a GIS framework}
\subtitle{Integration of an existing distributed, process-oriented
ecosystem model into GRASS GIS in combination with R}
\author{by Oliver Sonnentag}

\maketitle

\section{Introduction}
\label{sec:label_of_your_section} The application of modeling
techniques is a promising and widely used approach to many
environmental problems and tasks in academia and industry,
especially under circumstances in which direct measurements are not
feasible and also for prediction purposes. Process-oriented models
simulate physical processes based on fundamental principles, often
with some degree of empirical generalization. \\The simultaneous
simulation of carbon cycle and controlling hydrological processes
using a \textit{distributed}, process-oriented ecosystem model such
as the Boreal Ecosystem Productivity Simulator (BEPS) developed by
\citet{liu:1997, liu:1999, liu:2002} is very data-intensive. A
variety of software including GIS, remote sensing image processing,
and statistical packages has to be employed to pre-process the
required input data sets from different sources, as well as
post-process, visualize, and analyze the model outputs.
\\BEPS has been developed in ANSI C as a stand-alone application on
Microsoft's Windows$^{\textregistered}$ platform. The current
version of BEPS contains a graphical user interface (GUI) based on
the Microsoft Foundation Class$^{\textregistered}$ library written
in Microsoft's Visual C++$^{\textregistered}$
(fig.~\ref{fig:bepsgui}). Previous versions of BEPS were executed
from the Windows command line and through parameter files. The main
purpose of the GUI is to provide a tool that simplifies model
parameterization and allows on-screen display of spatial model
outputs. As a result, user interaction is minimized which is
beneficial, for example, for teaching purposes. However, the
drawback of this increased user-friendliness is less flexibility
with regard to future efforts that involve the further development
and application of BEPS as a research tool.


%\setkeys{Gin}{width=1\textwidth}
\begin{figure}[htbp]
   \centering
   %name of your graphic, without the path AND in EPS format:
   \includegraphics[scale=0.50]{images/bepsgui}
   %caption of the figure
   \caption{Application of the current version of BEPS containing a GUI on Microsoft's Windows platform.}
   %label of the figure, which has to correspond to \ref{}:
   \label{fig:bepsgui}
\end{figure}


My doctoral research involves the further development of BEPS
towards a distributed, process-oriented ecosystem model of general
applicability to individual peatlands of contrasting climatic,
topographic, and (hydro) geologic settings in northern ecozones,
able to reliably simulate the relevant hydrological and carbon cycle
processes at the (sub-) watershed scale (1 - 100 km$^2$).\\In a
first preparatory step I qualitatively evaluated the potential
technical and scientific benefits of the application of BEPS in a
GRASS GIS framework (v. 5.3.0) in combination with the mathematical
and statistical programming language R (v. 1.9.1) on a Linux
platform (SuSe$^{\textregistered}$ v. 9.0). A brief introduction to
the main modeling hypotheses underlying BEPS, a description of the
technical efforts undertaken for the integration of BEPS into GRASS
GIS, and a discussion of the potential benefits of the integration
are provided in the following sections.

\section{The Boreal Ecosystem Productivity Simulator}
\label{sec:label_of_your_section}

BEPS was originally developed to assist in natural resource
management and to simulate the carbon budget over the Canadian
landmass. The most significant features of BEPS include modeling
hypotheses related to the calculation of net primary productivity
(NPP) and evapotranspiration (ET) in boreal and (sub-) arctic
ecozones at a daily time-step. \\NPP is the difference between gross
primary productivity (GPP) and autotrophic respiration. In BEPS, GPP
is calculated for overstory \citep {liu:1999} using a canopy-level
photosynthesis model based on an instantaneous leaf-level
photosynthesis model \citep {farquhar:1980}. The upscaling of
photosynthesis from leaf to canopy and from an instance of time to a
day is accomplished with a spatial and temporal scaling scheme
\citep {chen:1999}. Autotrophic respiration for overstory is
calculated as the sum of maintenance and growth respiration.
Maintenance respiration is a product of biomass; growth respiration
is calculated as a fraction of GPP \citep {liu:1999}.\\ET is
calculated for several common overstory, understory, and soil
components including snow sublimation from plants and soil.
Transpiration from overstory and understory and evaporation from
soil are calculated using the Penman-Monteith equation \citep
{monteith:1965}. The upscaling of transpiration from leaf to canopy
and from an instance of time to a day is accomplished by replacing
stomatal resistance with canopy resistance using the same sunlit and
shaded leaf separation approach as for NPP. Evaporation and
sublimation from plants are both calculated from intercepted
precipitation and the available energy for conversion of liquid or
solid water to water vapour. Intercepted precipitation is assumed to
be proportional to LAI, constrained by precipitation, either rain or
snow. Sublimation from snow is simply calculated based on available
energy for conversion of solid water to water vapour. The soil water
balance, and therefore the soil moisture content used for the
calculation of the leaf water potential \citep{running:1988}
required for the estimation of stomatal conductance \citep
{jarvis:1976}, is calculated using a simple "bucket" model \citep
{liu:1997}, only considering vertical fluxes of water. In order to
include topographic effects on the calculation of the soil water
balance and the spatial variability of soil moisture content, the
Distributed Hydrology Soil Vegetation Model (DHSVM) developed by
\citet {wigmosta:1994} was adopted with several modifications and
integrated in BEPS.

%\setkeys{Gin}{width=1\textwidth}
\begin{figure}[htbp]
   \centering
   %name of your graphic, without the path AND in EPS format:
   \includegraphics [scale=0.47]{images/bepswork}
   %caption of the figure
   \caption{Workflow of the current version of BEPS as a stand-alone application on
Microsoft's Windows platform.}
   %label of the figure, which has to correspond to \ref{}:
   \label{fig:bepswork}
\end{figure}

BEPS operates with geographically prescribed,
non-dynamic input data sets as square grid rasters and requires
information on land cover type and leaf area index (LAI), both
derived from satellite remote sensing images. Furthermore, spatially
explicit input data of available soil water holding capacity, soil
texture, initial soil water content, initial snow depth, and soil
depth in addition to slope, aspect, and a watershed boundary derived
from a digital elevation model (DEM) are required. Spatially
explicit daily climatological input data sets (surface radiation,
precipitation, and maximum, minimum, and dew point temperature) are
constructed from measured time series data and corrected for
temperature (slope and aspect) and surface radiation (elevation)
before BEPS is run using the climate calculation and correction
module.


\section{Integration of BEPS and GRASS GIS in combination with R}
\label{sec:label_of_your_section}

The workflow for the application of the current version of BEPS on
Micrososft's Windows platform generally encompasses several data
conversions between various formats and applications
(fig.~\ref{fig:bepswork}) \footnote{This figure includes a word that
is or is asserted to be a proprietary term or trade mark. Its
inclusion does not imply it has acquired for legal purposes a
non-propietary or general significance, nor is any other judgment
implied concerning its legal status.}.



For example, in \citep{liu:1997, liu:1999, liu:2002} information on
available soil water holding capacity was obtained from processing
ESRI coverages from the Soil Landscapes of Canada (SLC) database
\footnote{\url{http://sis.agr.gc.ca/cansis/nsdb/sic/intro.html}
}using ESRI's ArcInfo$^{\textregistered}$ workstation. Generally,
satellite remote sensing images (e.g., Landsat TM/ETM+) used for
land cover classification and LAI mapping are subjected to several
corrections such as geometric, radiometric, and atmospheric, and
require the application of a remote sensing image processing
software package such as PCI Geomatica$^{\textregistered}$. However,
regardless of the software package used for the preparation of the
respective data set, for the actual model run, all data sets have to
be converted to binary files.\\The binary model outputs obtained
from BEPS can be displayed for a first visual inspection using the
basic spatial data handling capabilities provided by the GUI of the
current version (fig.~\ref{fig:bepsgui}). Further analysis and
validation of the model outputs as well as subsequent map production
requires the application of GIS, remote sensing image processing,
and statistical packages (e.g., Matlab)
(fig.~\ref{fig:bepswork}).\\In order to make use of the square grid
raster, image processing, and graphic production capabilities of
GRASS GIS in combination with the analytical capabilities of R
\citep{bivand:2000} for the modeling purposes with BEPS, the BEPS
source code was "tightly coupled" \citep {brimicombe:2003} with
GRASS GIS. For this purpose, the two new commands

\begin{itemize}
\item r.climatecalc
\item r.bepsterrain
\end{itemize}

for the climate calculation and correction module and the actual
BEPS model, respectively, were created (fig.~\ref{fig:bepsgrass}).
After typing any of the two commands at the shell prompt, the user
is asked to specify a file for certain simulation parameters such as
day of the year for the start and the end of the simulation, corner
coordinates of the square grid raster, and vertical and horizontal
resolution, and the required spatially explicit input data sets, all
of which are accessed as GRASS GIS raster files from the database in
the specified mapset.\\Over the years, the original version of BEPS
has undergone continuous refinement and further development by
different scientists. As a result, the current implementation of
BEPS' modeling hypotheses including utility functions such as data
I/O consists of about 8500 lines of just sparsely documented and
commented source code. A detailed analysis of the source code
revealed that almost all data input/output (I/O) is accomplished
through standard ANSI C library functions from the main() functions
of the climate calculation and correction module and the actual
simulation code, respectively. However, some of the input data sets
used by BEPS during execution are accessed by the respective
function from different modules when needed, which at the beginning
lead to difficulties in tracing the data flow.\\ After centralizing
all data I/O in the respective main() function, the programming
effort for the integration of BEPS and GRASS GIS was minimal. The
integration was accomplished by following the approach pursued by \textit{r.example}
which is available from the GRASS GIS CVS repository.

%\setkeys{Gin}{width=1\textwidth}
\begin{figure}[htbp]
   \centering
   %name of your graphic, without the path AND in EPS format:
   \includegraphics[scale=0.41]{images/bepsgrass}
   %caption of the figure
   \caption{Application of BEPS integrated in GRASS GIS on a Linux platform.}
   %label of the figure, which has to correspond to \ref{}:
   \label{fig:bepsgrass}
\end{figure}


\section{Discussion and conclusions}
\label{sec:label_of_your_section}

The application of GRASS GIS as an integrated platform for the
modeling purposes with BEPS in combination with R supersedes the
application of multiple software packages and the implied conversion
from proprietary data formats to binary files and back
(fig.~\ref{fig:bepsworknew}). Furthermore, using Open Source
software in the model development process allows the quick and
straightforward adaptation of modeling source code as was
demonstrated by simply adopting the well documented approach of
r.example. Thereby, as demonstrated with the tight integration of
BEPS and GRASS GIS, the full range of capabilities provided by GRASS
GIS and R can be easily utilized by existing legacy modeling source
code. As a result, GRASS GIS can be considered as the ideal
computational platform for the modeling purposes with BEPS and their
integrated use is of great technical and computational benefit.
However, the current state-of-the-art for the integrated use of GIS
and process-oriented models in general, regardless of the level of
integration (loosely coupled, tightly coupled, and embedded after
\citep {brimicombe:2003}), is still purely a technical solution as
to how both technologies "can share the same data rather than being
integrated in terms of achieving compatible views of the world"
\citep[see][p. 170]{brimicombe:2003}.


%\setkeys{Gin}{width=1\textwidth}
\begin{figure}[htbp]
   \centering
   %name of your graphic, without the path AND in EPS format:
   \includegraphics[scale=0.47]{images/bepsworknew}
   %caption of the figure
   \caption{Workflow of BEPS integrated in GRASS GIS in combination with R on a Linux platform.}
   %label of the figure, which has to correspond to \ref{}:
   \label{fig:bepsworknew}
\end{figure}

The reason for this deficiency lies in the fundamentally different
abstraction of the world, represented by the underlying conceptual
data models. Therefore, none of the currently applied ways of
integrating GIS and process-oriented models has the capability to be
considered as an enhanced means to provide additional insights into
the functioning of complex environmental systems such as peatlands
other than the insights gained from the application of the model
itself. \\As a result, for the purposes of my doctoral research,
GRASS GIS is going to be of great importance from a technical and
computational point of view, but is completely irrelevant for the
achievement of my scientific goals.

\section{Acknowledgements}
\label{sec:label_of_your_section} The author would like to thank Dr.
Tarmo Remmel for his helpful comments and discussions regarding this
work.

\begin{footnotesize}
\begin{thebibliography}{99}


\bibitem[Bivand (2000)]{bivand:2000}
R. S. Bivand (2000)
\newblock Using the R statistical data analysis language on GRASS 5.0 GIS database files.
\newblock {\em Computers \& Geosciences} 26: 1043-1052.

%{brimicombe:2003}%
\bibitem[Brimicombe (2003) Brimicombe]{brimicombe:2003}
A. Brimicombe (2003)
\newblock {\em GIS, environmental modelling and
engineering}. New York, USA: Taylor \& Francis


\bibitem[Chen et~al. (1999) Chen, Liu, Cihlar, Goulden]{chen:1999}
J. M. Chen, J. Liu, J. Chilar, M.L. Goulden (1999)
\newblock Daily canopy photosynthesis model through temporal and spatial scaling for remote sensing applications.
\newblock {\em Ecological Modelling} 124: 99-119.

\bibitem[Farqhuar et~al. (1980) Farquhar, von Caemmerer, Berry]{farquhar:1980}
G. D. Farquhar, S. von Caemmerer, J.A. Berry (1980)
\newblock A biochemical model of photosynthetic $CO_2$ assimilation in leaves of $C_3$ species.
\newblock {\em Planta} 149: 78-90.

\bibitem[Jarvis (1976) Jarvis] {jarvis:1976}
P. G. Jarvis (1976)
\newblock The interpretation of the variations in leaf water potential and stomatal conductance found in canopies in the field.
\newblock {\em Philosophical Transactions Of The Royal Society Of London}: 593-610.

\bibitem[Liu et~al. (1997) Liu, Chen, Cihlar, Park]{liu:1997}
J. Liu, J. M. Chen, J. Chilar, W. M. Park (1997)
\newblock A process-based Boreal Ecosystem Productivity Simulator using remote sensing inputs.
\newblock {\em Remote Sensing of Environment} 62: 158-175.

\bibitem[Liu et~al. (1999) Liu, Chen, Cihlar, Chen]{liu:1999}
J. Liu, J. M. Chen, J. Chilar, W. Chen (1999)
\newblock Net primary productivity distribution in the BOREAS region
from a process model using satellite and surface data.
\newblock {\em Journal of Geophysical Research-Atmospheres} 104: 27735-27754.

\bibitem[Liu et~al. (2002) Liu, Chen, Cihlar, Chen]{liu:2002}
J. Liu, J. M. Chen, J. Chilar, W. Chen (2002)
\newblock Net primary productivity mapped for Canada at 1-km resolution.
\newblock {\em Global Ecology and Biogeography} 11: 115-129.

\bibitem[Monteith (1965) Monteith] {monteith:1965}
J. L. Monteith (1965)
\newblock Evaporation and environment. in
\newblock {\em Proceedings of the 19th Symposium of the Society for Experimental Biology } New York, USA: Cambridge University Press.

\bibitem[Running et~al. (1988) Running, Coughlan] {running:1988}
S. W. Running, J. C. Coughlan (1988)
\newblock A general model of forest ecosystem processes for regional applications. 1. Hydrologic
balance, canopy gas-exchange and primary production processes.
\newblock {\em Ecological Modelling} 42: 125-154.

\bibitem[Wigmosta et~al. (1994) Wigmosta, Vail, Lettenmaier]{wigmosta:1994}
M. S, Wigmosta, L. W. Vail, D. P. Lettenmaier (1994)
\newblock A distributed hydrology-vegetation model for complex terrain.
\newblock {\em Water Resources Research} 30: 1665-1679.

\end{thebibliography}
\end{footnotesize}


\address{Oliver Sonnentag\\
  Department of Geography\\
  University of Toronto\\
  Toronto, ON, Canada\\
% \url{your homepage}\\
  \email{oliver.sonnentag (at) gmail.com}}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: main_document.tex
%%% End:
