Welcome
Project Overview
Contributor Covenant Code of Conduct
1
About the PEcAn Book
1.1
How to Contribute
1.1.1
Editing the book yourself
1.1.2
Feedback/Comments/Suggestions
2
Main Topics
2.0.1
Using PEcAn
I Basic User Guide
3
Getting Started
3.1
How PEcAn Works in a nutshell
3.2
Quick Start
3.2.1
Working with the PEcAn VM
3.2.2
Using AmazonWeb Services (AWS)
3.2.3
Working with the PEcAn Containers (Docker) [Experimental]
3.3
PEcAN Demos
4
The model-site page
4.1
Selecting a model
4.2
Selecting a site
4.2.1
Using existing sites
4.2.2
Adding a new site
4.2.3
Troubleshooting
5
Basic model configuration
5.1
Choosing meteorology
5.1.1
Met workflow
5.1.2
Troubleshooting meteorological conversions
5.2
Choosing initial vegetation
5.2.1
Spin up
5.2.2
Veg workflow
5.3
Selecting a soils product
5.3.1
Soil texture, depth, and physical parameters
5.4
Other model inputs
6
VM Desktop Conversion
6.0.1
Install RStudio Desktop
II Advanced User Guide - Web
7
Advanced Web Interface Guide
7.0.1
What do all those other buttons on the web interface do?
7.0.2
How do I perform specific analyses?
8
Using Browndog
9
PEcAn XML Configuration
9.1
PEcAn folders
9.2
Database Access
9.3
BETY Database Configuration
9.4
Brown Dog Configuration
9.5
PFT Selection
9.6
Meta Analysis
9.7
Ensemble Runs
9.8
Sensitivity Runs
9.9
Model Setup
9.10
Run Setup
9.11
State Data Assimilation Tags
9.12
Parameter Data Assimilation
9.13
Benchmarking
10
Parameter Data Assimilation
10.1
All functions pertaining to Parameter Data Assimilation are housed within:
pecan/modules/assim.batch
10.1.1
pda.mcmc.R
10.1.2
pda.mcmc.bs.R
10.1.3
pda.emulator
10.1.4
pda.mcmc.recover.R
10.1.5
pda.utils.R
10.1.6
**get.da.data.*.R, plot.da.R** Old codes written by Carl Davidson. Defunct now, but may contain good ideas so currently left in.
10.2
For a detailed usage of the module, please see the vignette under
/modules/assim.batch/vignettes
11
State Data Assimilation
11.1
sda.enkf.R is housed within:
/pecan/modules/assim.sequential/R
11.2
The tree ring tutorial is housed within:
/pecan/documentation/tutorials/StateAssimilation
11.2.1
sda.enkf.R Description
11.2.2
sda.enkf.R Arguments
11.2.3
State Data Assimilation Workflow
11.2.4
State Data Assimilation Tags Example
11.2.5
State Data Assimilation Tags Descriptions
11.2.6
Model Specific Functions for SDA Workflow
11.2.7
Analysis Options
11.2.8
The Generalized Ensemble Filter
12
Specific Model Configurations
13
Advanced Setup
III Advanced User Guide - Cmd Line
14
Advanced Command Line Guide
15
Run PEcAn from COmmand Line
16
Working with the VM
16.1
Connecting to the VM via SSH
17
Extra Tools In PEcAn
IV User Appendix
18
User Appendix
18.0.1
File download: Alternative options when behind a firewall
19
Updating PEcAn Code and Bety Database
19.0.1
Updating PEcAn
19.1
Updating BETY
20
PEcAn Models
20.1
BioCro
20.2
BioCro Configuration
20.3
CLM
20.4
DALEC
20.5
ED
20.5.1
ED Configuration
20.6
ED2IN configuration variables
20.7
GDAY
20.8
LINKAGES
20.9
LPJ-GUESS
20.10
MAESPA
20.11
PRELES
20.12
Sipnet
21
Model Output Variables
22
Available Meteorological Drivers
22.1
Ameriflux
22.2
AmerifluxLBL
22.3
Fluxnet2015
22.4
NARR
22.5
CRUNCEP
22.6
CMIP5
22.7
NLDAS
22.8
GLDAS
22.9
PalEON
22.10
FluxnetLaThuile
22.11
Geostreams
V PEcAn Workflow
23
Workflow
24
Input Data
24.1
Meteorological Data
24.2
Initial Conditions
25
The PEcAN BETY connection
VI Development Guide
26
Overview
26.1
Bugs, Issues, Features, etc.
26.1.1
Reporting a bug
26.1.2
Required content
26.2
Requesting a feature
26.3
Closing an issue
26.4
When to submit an issue?
26.4.1
Ideally, non-trivial code changes will be linked to an issue and a commit.
27
Using Git
27.1
Git
27.1.1
PEcAnProject on GitHub:
https://github.com/organizations/PecanProject
27.1.2
Milestones, Issues, Tasks
27.1.3
Quick and Easy
27.2
Recommended Git Workflow
27.2.1
Before any work is done:
27.3
During development:
27.3.1
Basic Workflow
27.3.2
Advanced Workflow: A new branch for each change
27.3.3
After pull request is merged
27.3.4
Link commits to issues
27.4
For PEcAn
27.4.1
Committing Changes Using Pull Requests
27.4.2
Other Useful Git Commands:
27.4.3
Tags
27.5
Git + Rstudio
27.5.1
Creating a Read-only version:
27.6
For development:
27.7
References:
28
Directory structure
28.1
Overview of PEcAn repository as of PEcAn 1.2
28.2
Generic R package structure:
29
Adding An Ecosystem Model
29.1
PEcAn Database
29.2
Define MODEL_TYPE
29.3
MACHINE
29.4
MODEL
29.5
FORMATS
29.5.1
Formats -> Variables
29.5.2
MODEL_TYPE -> Formats
29.6
INPUTS
29.7
PFTS (Plant Functional Types)
29.7.1
Species
29.8
PRIORS
29.9
Interface Modules
29.9.1
Setting up the module directory (required)
29.9.2
DESCRIPTION
29.9.3
NAMESPACE
29.9.4
Building the package
29.9.5
write.config.MODEL (required)
29.9.6
Output Conversions
29.9.7
met2model.MODEL
29.9.8
Commit changes
30
Input Conversion
30.1
Meterological Data conversion
30.1.1
Adding a function to PEcAn to convert a met data source
30.1.2
Dimensions:
30.1.3
The variable names should be
standard_name
30.1.4
Adding Single-Site Specific Meteorological Data
30.1.5
Processing Met data outside of the workflow using PEcAn functions
30.2
Vegetation Data
30.3
Soil Data
31
How to Insert new Input Data
31.1
Create a Format Record
31.1.1
PEcAn Configuration Files
31.1.2
Model-specific configuration files
32
Coding Style
32.1
Use Roxygen2 documentation
32.2
Write your name at the top
32.3
Use testthat testing package
32.4
Don’t use shortcuts
32.4.1
Function Names (
verb.noun
)
32.4.2
File Names
32.4.3
Use “<-” as an assignment operator
32.4.4
Use Spaces
32.4.5
Use curly braces
32.5
Package Dependencies:
32.5.1
library vs require
32.5.2
DEPENDS, SUGGESTS, IMPORTS
33
Roxygen2
33.1
Canonical references:
33.2
Basic Roxygen2 instructions:
33.2.1
Tags
33.2.2
Text markup
33.3
Example
33.4
Updating documentation
34
Testing
34.1
Rationale
34.2
Tests makes development easier and less error prone
34.3
Quick Start:
34.4
Test files
34.4.1
Settings
34.4.2
Helper functions created to make testing easier
34.4.3
When should I test?
34.4.4
What types of testing are important to understand?
34.4.5
Unit Testing / Test Driven Development
34.4.6
Regression Testing
34.4.7
How should I test in R? The testthat package.
34.4.8
basic use of the testthat package
35
Package Data
35.1
Summary:
35.2
Accessing data
35.3
Packages used in development
35.3.1
roxygen2
35.3.2
devtools
36
Logging
36.1
PEcAn logging functions
36.1.1
Examples
36.1.2
Related Issues (requires Redmine developer account)
36.2
Other R logging packages
36.2.1
logging
36.2.2
futile
36.3
Example Usage
36.4
Inputs
36.4.1
Defining new input formats
36.5
Outputs
VII Appendix
37
Installing PEcAn
37.1
Installing Prerequisites
37.1.1
Set
R_LIBS_USER
37.2
Install models
37.2.1
ED2
37.2.2
SIPNET
37.2.3
BioCro
37.2.4
Linkages
37.2.5
DALEC
37.2.6
LINKAGES
37.2.7
CLM 4.5
37.3
CLM-FATES
37.4
PEcAn Installation
37.5
Installing PEcAn
37.6
Installing BETY
37.6.1
Install Postgres
37.6.2
Install Database + Data
37.6.3
Installing BETYdb Web Application
37.6.4
PEcAn Testrun
38
Creating a Virtual Machine
39
CentOS/RedHat
39.1
Install build environment
39.2
Install Postgres
39.3
Apache Configuration PEcAn
39.4
Apache Configuration BETY
39.5
Rstudio-server
39.6
Additional packages
40
CentOS / RHEL
40.1
Install build environment
40.2
Apache Configuration
40.3
Install and configure Rstudio-server
40.4
Install Postgres
41
Mac OSX
41.1
Install build environment
41.2
Install Postgres
41.3
Additional installs
41.3.1
Install JAGS
41.3.2
Install udunits
41.4
Apache Configuration
41.5
Ruby
41.6
Rstudio Server
42
Ubuntu
42.1
Install build environment
42.2
Install Postgres
42.3
Apache Configuration BETY
42.4
Rstudio-server
42.5
Additional packages
42.6
Download and Install Models
42.7
Install instructions
42.7.1
ED2
42.7.2
SIPNET
42.7.3
BioCro
42.7.4
Linkages
42.7.5
DALEC
42.7.6
LINKAGES
42.7.7
CLM 4.5
42.7.8
JULES
42.7.9
MAESPA
42.7.10
GDAY
42.7.11
LPJ-GUESS
43
Porting VM to AWS
43.0.1
Convert PEcAn VM
43.0.2
Set up an account on
AWS
43.0.3
Install
EC2 command line tools
43.0.4
Create an AWS S3 ‘bucket’ to upload VM to
43.0.5
Upload
43.0.6
Configuring the VM
43.0.7
Set up multiple instances (optional)
43.0.8
Booting the VM
44
Installing and configuring Shiny for PEcAn
44.1
Install the Shiny R package and Shiny server
44.2
Modify the shiny configuration file
44.3
Set the Apache proxy
44.3.1
Ubuntu only:
Enable the new shiny configuration
44.4
Enable and start the shiny server, and restart apache
44.4.1
On CentOS
44.4.2
On Ubuntu
44.5
Troubleshooting
44.6
Further reading
45
Installing and configuring Thredds for PEcAn
45.1
Install the Tomcat 8 and Thredds webapp
45.2
Ubuntu
45.3
Customize the Thredds server
45.4
Update the catalog
45.5
Troubleshooting
45.6
Further reading
46
FAQ
The Predictive Ecosystem Analyzer
15
Run PEcAn from COmmand Line