Chapter 8 | Running the scripts: overview
8.1 Summary of steps and scripts
The generation of national SOC sequestration potential maps using the spatially explicit R-version of the RothC model shall be divided in three stages (Figure 8.1.):
- Preparation and Harmonization of data (consists of eleven R scripts, one QGIS model script, and one Google Earth Engine script)
- Running the model in three phases (three R scripts),
- Transformation of vector data to raster data (map generation, one R script).

Figure 8.1. Workflow for generating the national GSOCseq layers.
8.2 Stage 1: Preparation of data
Running the model over an area will require several spatial layers of information (climate, clay content, land use, vegetation cover, NPP layers) and defining target points where the model will be run. So before running the model, we will “harmonize” the different spatial layers, in order to have the same extent, same pixel size and same Coordinate Reference System (CRS). On the other hand, each modeling phase (spin up, short spin-up/warm up, forward runs) will require a different selection of layers for the different time series. So we will create ‘stacks’ of the different layers for the single modeling phases. Land cover classes need to be re-classified into land use types that the model will recognize. We will reclassify land cover classes (like the ones provided by ESA; European Space Agency) to match the FAO land cover classes. At this stage, we will also create other input layers (like NPP and vegetation cover layers) which are necessary to run the model. Finally, we will create target points over the land use classes of interest (agricultural lands). These target points will become the modeling units (where the model is to be run). So, the first step (Fig. 8.1; see Chapter 9) is aimed at:
- preparing, organizing and harmonizing all the required input data layers to run the model in the different phases
- creating supplementary input data layers
- creating target points for land use classes of interests
Eleven R scripts, one QGIS script and one Google earth engine script are provided to complete these tasks (Table 8.1.).
8.3 Stage 2: Running the model
Once the input data layers are prepared and stacked, we will run the spatialized RothC model at each target point using three specific scripts (Table 8.1. in the following three phases (Chapter 10):
- Long spin up phase: he equilibrium carbon inputs (carbon inputs in tha-1 y-1 required to reach SOC stocks in year 2000) and the initial stocks of the different SOC pools are calculated;
- Short spin up or Warm Up phase: SOC stocks are adjusted for the 2000-2020 period;
- Forward" phase: SOC stocks are projected (2020 to 2040) under a “business as usual” scenario (no changes in carbon inputs), “low” scenario (5 \(\%\) increase in carbon inputs), “medium” scenario (10\(\%\) increase in carbon inputs), and “high” scenario (20 \(\%\) increase in carbon inputs).
8.4 Stage 3: generation of the map
After the “forward” modeling phase, in the final step we will calculate the average absolute and relative SOC sequestration rates over a 20-years period for each scenario and for each target point. The vector target points will be then rasterized and saved to geotiff format to obtain the final product, using a specific R script. All the provided scripts are summarized in Table 8.1.
Table 8.1 Summary of the scripts for the complete modelling process
Type of Layer | Script | Objective |
---|---|---|
SOC layer | R- Script number 0 | Cut the SOC layer by the area of interest polygon |
Climate layers | R- Script number 1 R- Script number 2 R- Script number 3 | Rearrangement of climate layers (CRU layers from .ncd to .tif) |
NPP layers | R- Script number 5 | Creation of NPP layers |
Vegetation Cover (VC) | GEE Script number (Google Earth Engine) R- Script number 7 | Creation of VC layers |
Clay layers | R-Script number 8 | Obtaining clay contents 0-30 cm from different depths (ISRIC) |
Land Use layer | R-Script number 9 | Re-classification into FAO land cover classes |
STACK for SPIN UP | R-Script number 10 | Stack input data layers for the spin up phase |
STACK for WARM UP | R-Script number 11 | Stack input data layers for the warm up phase |
STACK for FORWARD | R-Script number 12 | Stack input data layers for the forward phase |
Target points | QGis model script | Creation of target points |
SPIN UP | R- Script number 13 | Run long spin up phase |
WARM UP | R- Script number 14 | Run warm up phase |
FORWARD | R- Script number 15 | Run forward phase |
POINTS TO RASTER | R- Script number 16 | Rasterize points |