Files

61 lines
4.4 KiB
Plaintext

# -------------------------------------------
Compute ecosystem services with phoreau exports
edited: 2026(e)ko irailaren 16(a), asteazkena 11:09
contact: hector.hernandez [at] cefe.cnrs.fr
hector.hernandez [at] udl.cat
# -------------------------------------------
During all the code, the region of interest is denoted with 3 letters (PYR) because the code was developed for Pyrenees Airegoises. The 2 following numbers are the ID number of the sites. These numbers are arbitrary.
The structure of this folder is:
[Folder] 01_SITE: (*.site) forceps files
[Folder] 02_CLIMATE: (*.climate) Climate files in daily format. The future projectors are 3: ssp245 and ssp585 from MRI-ESM2-0-HR and a random resample of the last 40 yrs (BASE)
[Folder] 03_INVENTORY: (*.inv) inventory files
[Folder] 04_SOIL: needed for sureau to work, in .txt format. Where that data comes from? good question, this is something only Tanguy knows...
[Folder] 05_MANAGEMENT: management files. This methodology uses 3 shared managements for all sites: CC-plan = clear cut and plant; FD = free development so no management; and IFM aka Integrative Forest Management, in forceps its implemented as continuous cover management. Beyond that, each site has a varying number of management denoted as R1, R2, R3...
[Folder] 06_PHENOLOGY: phenofit parameters and stuff.
[Folder] 10_EXPORTS: This is where magic happens, I will explain it later.
In the main folder there should be the initial forceps.setup file along with other required files like "YassoSpeciesParameters.csv", "forceps.regelib", "forceps3.New_species" and "yassoPArameters.txt"
In addition, the main folder also need to have 2 more folders (phenofit4 and SureauHydraulicTraits) with parameters to work.
---
# 10_EXPORTS folder:
Here is when the analyses beyond forceps start. But before starting the analyses, it is needed to edit forceps outputs to make it readable in R, so some tweaks are needed. Further, R scrips will only work if the folder structure and the file naming conditions are meet.
## data treatment before R
- Each site must have a folder with the site name to store the forceps export files. Site names are defined with 5 characters in the form XXXYY where XXX is the region (PYR) and YY is the numeric ID of each site (01, 02 ... 30). ID numbers are arbitrary.
- Site folders must store all the outputs files, and 5 forceps export files are needed per simulation. There is a file in 10_EXPORTS folder ("forceps_export_equivalence_list.txt") that indicates the outputs needed as well as the naming structure. The naming follows this rule:
- EXPORT-NAME_SITE_MANAGEMENT_CLIMATE.csv
+ EXPORT-NAME: one of the showed in "forceps_export_equivalence_list.txt"
+ SITE: 5 characters (XXXYY); XXX = region, YY = ID number
+ MANAGEMENT: 2 characters (XX)
+ CLIMATE: 2 or 3 characters. Either 245, 585 or BASE
- forceps outputs have a format that it's not ready for R, so it is needed to remove the first rows with the headers for all outputs. I couldn't find a proper way to do this automatically, so I have to open each file and remove all the rows containing either a header or no information.
## R scripts
There is an R project in the folder. The only usefull script here is "02_read-exports.R", the others are not needed. there are 2 functions "lag_apply.R" (to compute rolling means and averages) and "scale_calues.R" (to scale values) that are important and also some *.Rds files that contains the headers of the outputs.
### 02_read-exports.R [!!!!]
Mainly this script loads all the data and compute ecosystem services, but it is still not finished!! I have to implement some fixes regarding flux vs accumulative ecosystemic functions and others about PARETO front stuff. Despite that, everything should work.
If the input data doesn't follow the naming stated before it simply won't work.
Besides some graphs, these script creates dataframes ready to be used in further analyses like mixed-effects models. Before that step, there is a translation of the management codes from the codes used in the simulation to more meaningful codes. The equivalence list is the file named "MANAGEMENT_TYPES.csv". The new codes are more interesnting because it encompass the intensity of the management scenarios.
Some outputs are raw values, other are scaled, other are in the form 0 OR 1 (abscence or presence of the ecosystem service based on a threshold) and other simply are averaged values during all the simulation period.
THA END