#+TITLE:       Integrated Models, Scenarios and Dynamics of Climate, Land Use and Common Birds for France: Dynamic Maps
#+AUTHOR:      Jean-Sauveur Ay $<$ jsay.site@gmail.com $>$
#+OPTIONS:     toc:nil tags:nil date:nil H:3
#+LANGUAGE:    en
#+LaTeX_CLASS: ManueStat
#+HTML_HEAD:   <link rel="stylesheet" type="text/css" href="stylesheet.css"/> <base target="_blank">
#+INFOJS_OPT:  view:overview mouse:#cccccc buttons:nil ftoc:2 ltoc:nil
#+PROPERTY:    session *R*
#+PROPERTY:    exports both
#+PROPERTY:    eval no
#+BIND:        org-image-actual-width nil
#+BIND:        org-latex-image-default-width ""
#+BIND:        org-latex-tables-booktabs t

This page contains the dynamic maps associated to the following
*research paper*:

#+BEGIN_HTML...
#+BEGIN_LaTeX...

* Presentation
** Framework

  We present here only a brief overview of the methods used in this
  research, a more complete picture can be found in the [[./WPMOBILIS.pdf][last working
  paper version]] and the associated online ressources.

  The modeling framework is structured in 3 blocks:

  - Species Distribution Models :: relating climate, land use and
       environmental variables (elevation, slope, etc.) to common
       birds abundances. They are calibrated on FBBS survey 2001--2011
       through negative binomial Generalized Additive Models.
  - Land Use Change Econometric Models :: relating climate, returns
       from land (in euros) and environmental variables (slope, land
       quality, etc.) to land use choices. They are calibrated on
       TERUTI survey 1993--2003 through multinomial models.
  - Ricardian Models :: relating climate and environmental variables
       (slope, geographical coordinates, etc.) to the economic returns
       from land (approximated by land prices). They are calibrated on
       land price data from the French Ministry of Agriculture
       1990--2005 through gaussian Generalized Additive Models.

  Because some of our data have a restricted access, not all our work
  is reproducible from this page. From here, only the output data
  frames from our simulations are available. This suffices
  nevertheless to reproduce all the Figures of the paper and to
  produce some dynamic maps that reflect more precisely than the
  published paper the dynamic content of our results.

** Scenarios

  As illustrated by the following Figure, we simulate 5 different
  scenarios in order to disentangle the respective effects of the
  integrated modeling blocks.

#+ATTR_HTML: :width 650px
#+ATTR_LaTeX: :options scale= .3
#+Caption: Modelling structure and differences between scenarios
./output/schema.png

  In the Figure, *CC* counts for climate change, *SDM* for species
  distribution models, *RIC* for Ricardian models of returns from
  land, *LU* for land use and *CP* for conservation
  payments. Simulations of bird population by SDM pursue the observed
  2001--2009 trends and integrate climate change in all scenarios. In
  scenario S0, land use is constant. In scenario S1, the model of LUC
  is used to extrapolate the temporal trends to obtain a kind of
  business-as-usual scenario. In scenario S2, the effects of climate
  change on the returns from land and, consequently, on LUC are taken
  into account. Scenario S3 and S4 are respectively equivalent to S1
  and S2 with a conservation policy providing uniform payments for
  pastures.

** Content

  The rest of this file first presents the Land Use Changes (section
  LUC) and the Bird Abundances (section BAB) associated to each
  scenario. Each section contains the data from simulations (in
  compressed =.Rda= format for the R software). Sections AKN and ADM
  are the Acknowledgements and some Additional Material required to
  run the R codes (they are tangled in =myFunctions.R= and are loaded
  in the workspace with =source("myFunctions.R")=) that allow to
  produce the dynamic maps. Moreover, this HTML page is exported from
  an Org Mode file than can be opened with GNU Emacs and is also
  available as a =.pdf= file for easy print. More details on this work
  flow is available at the following webpage. If you see any errors or
  strange results, you can contact me at
  =jsay_dot_site_at_gmail_dot_com=.
  
* <<LUC>> Land Use Changes
** Scenario S0

   Land use is constant in this scenario, only birds are impacted by
   climate change, see section 1.2 for a description of scenarios.

** Scenario S1

   This scenario is a kind of "business as usual" scenario in terms of
   land use changes. The dynamics 1990--2005 of returns from land is
   extrapolated to 2053. In particular, it does not integrate the
   climate change effects on returns.

   You can download the data from this scenario simulation here. See
   Section MAP for the functions.

   This scenario presents an increase in annual crops, forests and
   urban area and a decrease in pastures and perennial crops. The
   following Table contains the links to the R Codes and the
   Animations 2003--2053 at the national scale.

#+CAPTION: Land Use Changes according to scenario S1
| <l>             | <c>                   | <c>        | <c>        |
| Land Use        | Variations 2003--2053 | R Code     | Animation  |
|-----------------+-----------------------+------------+------------|
| Annual Crops    | + 3.17%               | Click here | Click here |
| Pastures        | - 17.7%               | Click here | Click here |
| Perennial Crops | - 17.7%               | Click here | Click here |
| Forests         | + 9.11%               | Click here | Click here |
| Urban Area      | + 33.4%               | Click here | Click here |

   /More interpretations to come./

** Scenario S2

   This scenario integrates climate-induced land use changes. The
   dynamics 1990--2005 of returns from land are modeled through
   climate variables, and the IPCC projection A1B is used to estimate
   the future returns from land. Then, the econometric model of land
   use allows to establish the consequences in terms of land use
   changes.

   You can download the data from this scenario simulation here. See
   Section MAP for the functions.

   This scenario presents an increase in annual crops, perennial
   crops, forests and urban area. The pastures are proven to
   potentially suffer from climate change, with a strong decrease of
   the acreages. The following Table contains the links to the R Codes
   and the Animations 2003--2053 at the national scale.

#+CAPTION: Land Use Changes according to scenario S2
| <l>             | <c>                   | <c>        | <c>        |
| Land Use        | Variations 2003--2053 | R Code     | Animation  |
|-----------------+-----------------------+------------+------------|
| Annual Crops    | + 27.2%               | Click here | Click here |
| Pastures        | - 55.5%               | Click here | Click here |
| Perennial Crops | + 177 %               | Click here | Click here |
| Forests         | + 1.71%               | Click here | Click here |
| Urban Area      | + 60.1%               | Click here | Click here |

   /More interpretations to come./

** Scenario S3

   This scenario corresponds to S1 coupled with a payment of \EUR{}
   200 per hectare for pastures.

   You can download the data from this scenario simulation here. See
   Section MAP for the functions.

   This scenario presents an increase in pastures and urban area and a
   decrease in annual crops, perennial crops and forests. For this
   scenario, the animations of the following Table are not the
   absolute land use changes but the land use change relatively to S1,
   to show the net effect of the policy of payments for pastures.

#+CAPTION: Land Use Changes from scenario S3 relatively to S1
| <l>             | <c>                   | <c>        | <c>        |
| Land Use        | Variations 2003--2053 | R Code     | Animation  |
|-----------------+-----------------------+------------+------------|
| Annual Crops    | - 20.8%               | Click here | Click here |
| Pastures        | + 22.6%               | Click here | Click here |
| Perennial Crops | - 27.6%               | Click here | Click here |
| Forests         | - 2.15%               | Click here | Click here |
| Urban Area      | + 17.5%               | Click here | Click here |

   /More interpretations to come./

** Scenario S4

   This scenario corresponds to S2 coupled with a payment of \EUR{}
   200 per hectare for pastures.

   You can download the data from this scenario simulation here. See
   Section MAP for the functions.

   This scenario presents an increase in annual crops, perennial crops
   and urban area and a decrease in pastures and forests. With
   climate-induced land use changes, the payments are not sufficient
   to reverse the decreasing trend of pastures. For this scenario, the
   animations of the following Table are not the absolute land use
   changes but the land use change relatively to S2, to show the net
   effect of the policy of payments for pastures.

#+CAPTION: Land Use Changes according to scenario S4 relatively to scenario S2
| <l>             | <c>                   | <c>        | <c>        |
| Land Use        | Variations 2003--2053 | R Code     | Animation  |
|-----------------+-----------------------+------------+------------|
| Annual Crops    | + 16.2%               | Click here | Click here |
| Pastures        | - 19.4%               | Click here | Click here |
| Perennial Crops | + 83.7%               | Click here | Click here |
| Forests         | - 9.43%               | Click here | Click here |
| Urban Area      | + 23.5%               | Click here | Click here |

   /More interpretations to come./

* <<BAB>> Bird Abundances
** Scenario S0

   This scenario is with constant land use, it shows the direct
   response of birds' distributions from the climate projections IPCC
   A1B.

   Download the data for the simulation here. The dynamic map
   2003--2053 for the aggregate bird index as presented in the working
   paper (equation 9) is here with the corresponding R code.

   Species names are available from this =.csv= file from which we
   build the following tabular containing the animations 2003--2053 of
   bird abundances from all the species studied in this research. The
   R Code using to generate the simulations from the raw data is
   here. The Table is simply obtained from the following R script.

#+begin_src R :results value table :colnames yes...

#+LaTeX: {\footnotesize
#+ATTR_LaTeX: :environment longtable 
#+CAPTION: Links to the animations 2003--2053 for scenario S0 and each bird species
#+RESULTS:...
#+LaTeX: }

   /More interpretations to come./

** Scenario S1

   This scenario corresponds to a "business-as-usual" scenario for
   land use, with climate effects on birds as in S0.

   Download the data for the simulation here. The dynamic map
   2003--2053 for the aggregate bird index as presented in the working
   paper (equation 9) is here with the corresponding R code.

   Species names are available from this =.csv= file from which we
   build the following tabular containing the animations 2003--2053 of
   bird abundances from all the species studied in this research. The
   R Code using to generate the simulations from the raw data is
   here. The Table is simply obtained from the following R script.

#+begin_src R :results value table :colnames yes...

#+LaTeX: {\footnotesize
#+ATTR_LaTeX: :environment longtable 
#+CAPTION: Links to the animations 2003--2053 for scenario S1 and each bird species
#+RESULTS:...
#+LaTeX: }

   /More interpretations to come./

** Scenario S2

   This scenario corresponds to a climate-induced scenario for land
   use, with climate effects on birds as in S0.

   Download the data for the simulation here. The dynamic map
   2003--2053 for the aggregate bird index as presented in the working
   paper (equation 9) is here with the corresponding R code. Some
   explanations.

   Species names are available from this =.csv= file from which we
   build the following tabular containing the animations 2003--2053 of
   bird abundances from all the species studied in this research. The
   R Code using to generate the simulations from the raw data is
   here. The Table is simply obtained from the following R script.

#+begin_src R :results value table :colnames yes...

#+LaTeX: {\footnotesize
#+ATTR_LaTeX: :environment longtable 
#+CAPTION: Links to the animations 2003--2053 for scenario S2 and each bird species
#+RESULTS:...
#+LaTeX: }

   /More interpretations to come./

** Scenario S3

   Scenario S1 coupled with a payment of \EUR{} 200 per hectare for
   pastures, with climate effects on birds as in S0.

   Download the data for the simulation here. The dynamic map
   2003--2053 for the aggregate bird index as presented in the working
   paper (equation 9) is here with the corresponding R code. Some
   explanations.

   Species names are available from this =.csv= file from which we
   build the following tabular containing the animations 2003--2053 of
   bird abundances from all the species studied in this research. The
   R Code using to generate the simulations from the raw data is
   here. The Table is simply obtained from the following R script.

#+begin_src R :results value table :colnames yes...

#+LaTeX: {\footnotesize
#+ATTR_LaTeX: :environment longtable 
#+CAPTION: Links to the animations 2003--2053 for scenario S3 and each bird species
#+RESULTS:...
#+LaTeX: }

   /More interpretations to come./

** Scenario S4

   Scenario S2 coupled with a payment of \EUR{} 200 per hectare for
   pastures, with climate effects on birds as in S0.

   Download the data for the simulation here. The dynamic map
   2003--2053 for the aggregate bird index as presented in the working
   paper (equation 9) is here with the corresponding R code. Some
   explanations.

   Species names are available from this =.csv= file from which we
   build the following tabular containing the animations 2003--2053 of
   bird abundances from all the species studied in this research. The
   R Code using to generate the simulations from the raw data is
   here. The Table is simply obtained from the following R script.

#+begin_src R :results value table :colnames yes...

#+LaTeX: {\footnotesize
#+ATTR_LaTeX: :environment longtable 
#+CAPTION: Links to the animations 2003--2053 for scenario S4 and each bird species
#+RESULTS:...
#+LaTeX: }

   /More interpretations to come./

* <<AKN>> Acknowledgements

  This research has been founded by the FRB (/Fondation de Recherche
  sur la Biodiversité/) and GDF--SUEZ through the MOBILIS
  project. R. Chakir also acknowledges the financial support from
  French /Agence Nationale de la Recherche/ through the ModULand
  project (ANR--11--BSH1--005). The authors also acknowledge volunteer
  ornithologists, French Ministry of Agriculture (/Service de la
  Statistique et de la Prospective/), IGN, INRA InfoSol, and Météo
  France for the production of data that allow such work. We are
  grateful to Laurent Terray, Christian Pagé and Julian Boé for the
  regional climate scenarios, Vincent Badeau for the development of
  the 8km soil data set and Christophe Fran\c{c}ois for his assistance
  in the use of climate and soils data sets.

* <<ADM>> Additional Material
** <<MAP>> Geographic files

   The compressed geographical shapefiles are available here.

#+begin_src R :results silent :tangle ./myFunctions.R
library(sp) ; library(rgdal)
MAP    <- readOGR("./Data", "GrMaille", verbose= FALSE)
CRD    <- data.frame(MAP, coordinates(MAP))
F2C    <- readOGR("./Data", "F2C"     , verbose= FALSE)
FD.CRT <- list("sp.polygons", F2C, lwd= 10)
#+end_src

** <<LAP>> Linear Approx.

#+begin_src R :results silent :tangle ./myFunctions.R
LinApprox <- function(pdat, nc= 2: 52){
    prd <- matrix(0, ncol= length(nc))
    for (i in unique(pdat$MAILLE)){
        yop <- approx(pdat$time[pdat$MAILLE== i],
                      pdat$value[pdat$MAILLE== i], n= length(nc))$y
        prd <- rbind(prd, yop)
    }
    DAT <<- data.frame(unique(pdat$MAILLE), prd[-1, ], row.names= NULL)
    names(DAT) <<- c("MAILLE", paste("N", 2003: 2053, sep= ""))
    DAT[, nc]  <<- (DAT[, nc]- DAT[, 2])* 100
}
#+end_src

** <<ANM>> Animations

#+begin_src R :results silent :tangle ./myFunctions.R
library(RColorBrewer) ; library(classInt) ; library(animation)
AnimHTML <- function(SPDF, ttle, brks, pal, t1, t2, dir, name){
    IC <- classIntervals(-100: 100, n= length(brks)+ 1,
                         style= "fixed", fixedBreaks= brks)
    CR <- attr(findColours(IC, brewer.pal(5, pal)), "palette")
    saveHTML({
        oopt <- ani.options(interval= 0.15, nmax= 100, title= ttle)
        opar <- par(mar= c(3, 3, 1, 0.5), mgp= c(2, .5, 0),
                    tcl= -0.3, cex.axis= 1.5, cex.lab= 1.5, cex.main= 2)
        for(i in 2: 52){
            dev.hold()
            mp <- spplot(SPDF[, i], cuts= IC$brks, col.regions= CR,
                         cex= 1, pch= 15, colorkey= T, sp.layout= FD.CRT,
                         main= paste(t1, substr(names(SPDF)[ i], 2, 5),
                                     t2, sep= ""),
                         par.settings= list(panel.background=
                                            list(col="grey")))
            mp$legend$right$args$key$at <- IC$brks ; print(mp)
            ani.pause()
        }
    }, autoplay= FALSE, loop= FALSE, verbose= FALSE, outdir = dir,
             htmlfile = name, autobrowse= FALSE, single.opts=
             "'controls': ['first', 'previous',
              'play', 'next', 'last', 'loop', 'speed'], 'delayMin': 0")
}
#+end_src