You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ For more information about this file see also [Keep a Changelog](http://keepacha
9
9
## Unreleased
10
10
11
11
### Added
12
+
- Added ensemble calibration diagnostics to `inst/ilamb/` in PEcAn.benchmark (rank histogram, spread-skill ratio, coverage, reliability) for assessing whether an ensemble's spread is well calibrated against observations, complementing the ensemble-mean benchmarking.
12
13
- Added `make_scorecard.sh` and documentation to `inst/ilamb/` in PEcAn.benchmark for generating and serving the ILAMB HTML scorecard.
13
14
- New function `PEcAn.utils::netcdf2df()` flattens all dims and vars of a netCDF into a dataframe,
Copy file name to clipboardExpand all lines: models/peprmt/demo_run/01_run_pecan_peprmt.qmd
+50-54Lines changed: 50 additions & 54 deletions
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,6 @@
2
2
title: "Running PEPRMT Using PEcAn"
3
3
author:
4
4
- "Abby Lewis"
5
-
- "Aritra Dey"
6
-
- "David LeBauer"
7
5
format:
8
6
html: default
9
7
pdf: default
@@ -14,74 +12,71 @@ fig-height: 6
14
12
fig-dpi: 300
15
13
---
16
14
17
-
# Introduction {#introduction}
15
+
# Introduction
18
16
19
17
Welcome to this PEcAn workflow notebook! This notebook will guide you through running the PEPRMT model using PEcAn's programmatic interface.
20
18
21
19
## What Is PEcAn?
22
20
23
21
PEcAn (Predictive Ecosystem Analyzer) is a scientific workflow system designed to make ecosystem modeling more transparent, repeatable, and accessible. It helps researchers:
24
22
25
-
-Run ecosystem models with standardized inputs and outputs
26
-
-Perform uncertainty analysis on model parameters
27
-
-Compare model predictions with observations
28
-
-Share and reproduce scientific workflows
23
+
- Run ecosystem models with standardized inputs and outputs
24
+
- Perform uncertainty analysis on model parameters
25
+
- Compare model predictions with observations
26
+
- Share and reproduce scientific workflows
29
27
30
28
## What This Notebook Does
31
29
32
-
This notebook demonstrates how to:
30
+
This notebook is patterned after [PEcAn demo 1](https://pecanproject.github.io/pecan-documentation/develop/run-demo-1.html), which was written by Aritra Dey and David LeBauer. It demonstrates how to:
33
31
34
32
1. Set up and configure a PEcAn workflow
35
-
2. Run an ecosystem model simulation
33
+
2. Run an ecosystem model simulation using the PEPRMT model
36
34
3. Analyze and visualize the results
37
35
38
36
### The Scenario Being Modeled:
39
37
40
-
We are modeling greenhouse gas dynamics (gross primary productivity, ecosystem respiration, and methane emissions) at five sites. The model configuration uses the PEPRMT-Tidal process-based ecosystem model (Oikawa et al. 2024).
38
+
We are modeling greenhouse gas dynamics (gross primary productivity, ecosystem respiration, and methane emissions) at five sites. The model configuration uses the PEPRMT-Tidal process-based ecosystem model (Oikawa et al. 2024).
41
39
42
40
The simulation is run for the duration of data at each site, which ranges from 2011 to 2021.
43
41
44
-
This scenario is designed to be a minimal, reproducible example to demonstrate how to run PEPRMT within the PEcAn workflow. In later steps, this same framework can be extended to include more ensemble members, longer time periods, or alternative meteorological inputs.
42
+
This scenario is designed to be a minimal, reproducible example to demonstrate how to run PEPRMT within the PEcAn workflow. In later steps, this same framework can be extended to include more ensemble members, longer time periods, or alternative meteorological inputs (e.g., see `pecan/models/peprmt/demo_run/02_input_demo.qmd` and `pecan/models/peprmt/demo_run/03_event_demo.qmd`).
45
43
46
44
## Prerequisites
47
45
48
46
Before running this notebook, make sure you have:
49
47
50
-
-All the PEcAn packages installed. You can install all PEcAn packages and their dependencies by running the following command in the root of your PEcAn repository. This chunk does not run automatically since it will overwrite a version of PEcAn you installed by other methods. Run it by hand when needed.
48
+
- All the PEcAn packages installed. You can install all PEcAn packages and their dependencies by running the following command in the root of your PEcAn repository. This chunk does not run automatically since it will overwrite a version of PEcAn you installed by other methods. Run it by hand when needed.
After specifying the path to the `pecan.xml` file, the next step involves reading and preparing these settings. PEcAn provides utilities to process and validate the configurations before execution begins.
128
129
129
-
-`PEcAn.settings::read.settings(settings_path)`: Reads the `pecan.xml` file and converts it to an R list object.
130
-
-`PEcAn.settings::prepare.settings(settings)`: Prepares and validates settings. It sets defaults for missing fields, changes file paths to absolute paths, and generally ensures consistency.
130
+
-`PEcAn.settings::read.settings(settings_path)`: Reads the `pecan.xml` file and converts it to an R list object.
131
+
-`PEcAn.settings::prepare.settings(settings)`: Prepares and validates settings. It sets defaults for missing fields, changes file paths to absolute paths, and generally ensures consistency.
Once the settings have been read and prepared, it is useful to inspect the structure of the `settings` object. This object is an R list containing all parameters and configurations for the PEcAn workflow.
143
144
144
-
-`str(settings)` displays the internal structure of the `settings` object. This shows how the settings are represented in R and is useful for debugging and verifying settings.
145
+
-`str(settings)` displays the internal structure of the `settings` object. This shows how the settings are represented in R and is useful for debugging and verifying settings.
145
146
146
147
```{r explore-settings}
147
148
str(settings)
@@ -165,22 +166,25 @@ Editing the more interesting settings to change the PFT (`settings$pfts`) or ext
165
166
166
167
The directory structure created by PEcAn for this demo run will look like this:
167
168
168
-
```
169
+
```
169
170
demo_outdir/ # Root output directory
171
+
├── ensemble.samples.<ensemble_id>.Rdata # contains the selected parameter values for each ensemble member
170
172
├── run/ # Configuration & execution metadata
171
173
│ ├── runs.txt # List of run IDs (one per model realization)
│ └── config.* # Generated model configs (e.g., SIPNET)
174
+
│ └── <runid>/ # Model-specific configs, including run job and driver data
174
175
├── out/ # Raw model outputs by run ID
175
-
│ └── <runid>/ # E.g., daily PEPRMT output files
176
+
│ └── <runid>/ # E.g., PEPRMT output files
177
+
├── STATUS # timestamp and ok/error status of each workflow step
178
+
├── pecan.*.xml # copies of the run settings saved at different steps
179
+
├── run_manifest.csv # info about site, PFT, etc for each runid
180
+
└── samples.Rdata # draws from parameter distributions
181
+
176
182
```
177
183
178
184
The root output directory is defined here as `demo_outdir/` by `settings$outdir`. This directory contains log and record files from the PEcAn workflow. They provide a detailed record of how data was generated and are key components of the analysis metadata and provenance. These can be useful for debugging as well as for downstream analysis.
179
185
180
186
Key subdirectories include `run/` and `out/` that contain files used to configure and run the model, files generated by the underlying ecosystem model, and PEcAn standard outputs used in downstream analyses. These are described in subsequent sections.
181
187
182
-
Additional outputs include logs, a `STATUS` file that records the steps of the workflow along with timestamps and whether each step was successful, and a copy of the `pecan.*.xml` file.
183
-
184
188
# Write Model Configuration Files
185
189
186
190
This step generates the model-specific configuration files and scripts that will be used to run the ecosystem model. The process involves generating PEPRMT configuration files using the `runModule.run.write.configs()` function.
This section executes the actual model simulations and retrieves the results. The process is managed by PEcAn's workflow system, which handles the execution of your chosen ecosystem model.
195
199
196
-
-`runModule_start_model_runs(settings)`: This function initiates the model runs based on your configuration. It manages the execution of your chosen ecosystem model, using the configuration files generated in the previous step.
200
+
-`runModule_start_model_runs(settings)`: This function initiates the model runs based on your configuration. It manages the execution of your chosen ecosystem model, using the configuration files generated in the previous step.
This step generates raw model outputs in model-specific format (in this case, `out.csv`) as well as log files.
204
207
205
208
# Extract Model Results and Prepare for Analysis
206
209
207
210
After the model simulation completes, we need to extract the results and prepare them for analysis. This involves:
208
211
209
-
1. Reading the run ID
210
-
2. Setting up output paths
211
-
3. Defining time period
212
-
4. Loading model output
213
-
5. Convert to a standard format
212
+
1.Reading the run ID
213
+
2.Setting up output paths
214
+
3.Defining time period
215
+
4.Loading model output
216
+
5.Convert to a standard format
214
217
215
-
Here we read output one site at a time to account for differing simulation periods.
216
-
For runs where all sites have the same dates, it should also work to pass the entire runid vector to a single `read.output` call.
218
+
Here we read output one site at a time to account for differing simulation periods. For runs where all sites have the same dates, it should also work to pass the entire runid vector to a single `read.output` call.
Running this code will convert model specific output files into a standardized netCDF ([year].nc) that can be downloaded for visualization and analysis (R, Matlab, ncview, panoply, etc). This is a key step, because this standardization enables PEcAn to apply downstream analyses to outputs from different ecosystem models.
241
+
Running this code will convert model specific output files into a standardized netCDF (\[year\].nc) that can be downloaded for visualization and analysis (R, Matlab, ncview, panoply, etc). This is a key step, because this standardization enables PEcAn to apply downstream analyses to outputs from different ecosystem models.
240
242
241
243
# Display Available Model Variables
242
244
243
-
This section shows all the variables that are available in the model output. These variables represent different ecosystem processes and states that the model has simulated.
245
+
This section shows all the variables that are available in the model output. These variables represent different ecosystem processes and states that the model has simulated. Here we are referencing PEcAn standard variables for documentation.
0 commit comments