diff --git a/.dvc/.gitignore b/.dvc/.gitignore new file mode 100644 index 00000000..528f30c7 --- /dev/null +++ b/.dvc/.gitignore @@ -0,0 +1,3 @@ +/config.local +/tmp +/cache diff --git a/.dvc/config b/.dvc/config new file mode 100644 index 00000000..a48f8a53 --- /dev/null +++ b/.dvc/config @@ -0,0 +1,7 @@ +[core] + remote = gcbm_logs +['remote "gcbm_logs"'] + url = gdrive://17Ef_mOvbWtY7wdp1o9WwzsGbQH_nSkza +['remote "processed_output"'] + url = gdrive://1xXQGus0NJB6bRTasUPACxQmoAPd1QeET + \ No newline at end of file diff --git a/.dvcignore b/.dvcignore new file mode 100644 index 00000000..51973055 --- /dev/null +++ b/.dvcignore @@ -0,0 +1,3 @@ +# Add patterns of files dvc should ignore, which could improve +# the performance. Learn more at +# https://dvc.org/doc/user-guide/dvcignore diff --git a/.github/workflows/cml-container.yaml b/.github/workflows/cml-container.yaml new file mode 100644 index 00000000..75cd2395 --- /dev/null +++ b/.github/workflows/cml-container.yaml @@ -0,0 +1,99 @@ +name: gcbm-Carpathians-ubuntu-CML +on: + push: + branches: + - main + paths: + - Standalone_GCBM/input_database/gcbm_input.db + pull_request: + branches: + - main + paths: + - Standalone_GCBM/input_database/gcbm_input.db + +jobs: + run-on-container: + runs-on: [ubuntu-latest] + container: + image: ghcr.io/moja-global/rest_api_gcbm:master + ports: + - "8080:8080" + steps: + - uses: actions/checkout@v3 + + - name: Run GCBM + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: + cd Standalone_GCBM/gcbm_project + + /opt/gcbm/moja.cli --config_file gcbm_config.cfg --config_provider provider_config.json + + - name: Compile Results + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + cd Standalone_GCBM/tools/CompileGCBMResults + + python3 compileresults.py sqlite:///../../gcbm_project/output/gcbm_output.db --output_db sqlite:///../../processed_output/compiled_gcbm_output.db + + - uses: actions/upload-artifact@v3 + with: + name: compiled-gcbm-output + path: Standalone_GCBM/processed_output/compiled_gcbm_output.db + + - uses: actions/upload-artifact@v3 + with: + name: compiled-results-log + path: Standalone_GCBM/logs/compile_results.log + + run-on-vmhost: + runs-on: [ubuntu-latest] + needs: run-on-container + steps: + - uses: actions/checkout@v3 + - uses: r-lib/actions/setup-r@v2 + with: + r-version: '4.1.3' + - uses: r-lib/actions/setup-renv@v2 + - uses: iterative/setup-cml@v1 + - uses: iterative/setup-dvc@v1 + + - uses: actions/download-artifact@v3 + with: + name: compiled-gcbm-output + path: Standalone_GCBM/processed_output/ + - uses: actions/download-artifact@v3 + with: + name: compiled-results-log + path: Standalone_GCBM/logs/ + + - name: Installations and renv restore + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + pip install pandas + cd Postprocessing + Rscript -e "renv::activate()" + Rscript -e "renv::restore(lockfile = 'renv.lock')" + + - name: dvc repro - postprocessing + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + dvc repro -s postprocessing + + - name: Display plots for DOM stocks + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + dvc metrics diff --show-md > report.md + echo "## Figures created" >> report.md + echo "![](Postprocessing/Figures/Carpathians_Sensitivity_BorealWet.png)" >> report.md + echo "![](Postprocessing/Figures/Carpathians_Sensitivity_CoolTemperateMoist.png)" >> report.md + echo "![](Postprocessing/Figures/Carpathians_Sensitivity_CoolTemperateSteppe.png)" >> report.md + echo "![](Postprocessing/Figures/Carpathians_Sensitivity_CoolTemperateWet.png)" >> report.md + echo "![](Postprocessing/Figures/Carpathians_Sensitivity_PolarRainTundra.png)" >> report.md + cml comment create --pr=false report.md + + \ No newline at end of file diff --git a/.github/workflows/cml-windows.yaml b/.github/workflows/cml-windows.yaml new file mode 100644 index 00000000..084efca6 --- /dev/null +++ b/.github/workflows/cml-windows.yaml @@ -0,0 +1,107 @@ +name: gcbm-Carpathians-windows-CML +on: + push: + branches: + - main + paths: + - Standalone_GCBM/input_database/gcbm_input.db + pull_request: + branches: + - main + paths: + - Standalone_GCBM/input_database/gcbm_input.db + +jobs: + run-on-windows: + runs-on: [windows-latest] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.7.9' + + - name: Required Installations + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: cmd + run: | + pip install installation\GDAL-2.4.1-cp37-cp37m-win_amd64.whl + del /q "C:\hostedtoolcache\windows\Python\3.7.9\x64\lib\site-packages\osgeo\gdalplugins\*.*" + + pip install -r installation\requirements-py37.txt + + - name: Run GCBM + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: cmd + run: | + cd Standalone_GCBM/gcbm_project + run_gcbm.bat pythonLocation + + - name: Compile results + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: cmd + run: | + cd Standalone_GCBM/tools/CompileGCBMResults + python compileresults.py sqlite:///../../gcbm_project/output/gcbm_output.db --output_db sqlite:///../../processed_output/compiled_gcbm_output.db + + - uses: actions/upload-artifact@v3 + with: + name: compiled-gcbm-output + path: Standalone_GCBM/processed_output/compiled_gcbm_output.db + + - uses: actions/upload-artifact@v3 + with: + name: compiled-results-log + path: Standalone_GCBM/logs/compile_results.log + + run-on-ubuntu: + runs-on: [ubuntu-latest] + needs: run-on-windows + steps: + - uses: actions/checkout@v3 + - uses: r-lib/actions/setup-r@v2 + with: + r-version: '4.1.3' + - uses: r-lib/actions/setup-renv@v2 + - uses: iterative/setup-cml@v1 + - uses: iterative/setup-dvc@v1 + + - uses: actions/download-artifact@v3 + with: + name: compiled-gcbm-output + path: Standalone_GCBM/processed_output/ + - uses: actions/download-artifact@v3 + with: + name: compiled-results-log + path: Standalone_GCBM/logs/ + + - name: Installations and renv restore + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + pip install pandas + cd Postprocessing + Rscript -e "renv::activate()" + Rscript -e "renv::restore(lockfile = 'renv.lock')" + + - name: dvc repro - postprocessing + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + dvc repro -s postprocessing + + - name: Display plots for DOM stocks + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + dvc metrics diff --show-md > report.md + echo "## Figures created" >> report.md + echo "![](Postprocessing/Figures/Carpathians_Sensitivity_BorealWet.png)" >> report.md + echo "![](Postprocessing/Figures/Carpathians_Sensitivity_CoolTemperateMoist.png)" >> report.md + echo "![](Postprocessing/Figures/Carpathians_Sensitivity_CoolTemperateSteppe.png)" >> report.md + echo "![](Postprocessing/Figures/Carpathians_Sensitivity_CoolTemperateWet.png)" >> report.md + echo "![](Postprocessing/Figures/Carpathians_Sensitivity_PolarRainTundra.png)" >> report.md + cml comment create --pr=false report.md + \ No newline at end of file diff --git a/.github/workflows/cml_compiled_db.yaml b/.github/workflows/cml_compiled_db.yaml new file mode 100644 index 00000000..f5da7d68 --- /dev/null +++ b/.github/workflows/cml_compiled_db.yaml @@ -0,0 +1,55 @@ +name: compiled-db-CML +on: + push: + branches: + - main + paths: + - Standalone_GCBM/logs/compile_results.log + - Standalone_GCBM/processed_output/compiled_gcbm_output.db + pull_request: + branches: + - main + paths: + - Standalone_GCBM/logs/compile_results.log + - Standalone_GCBM/processed_output/compiled_gcbm_output.db + +jobs: + run: + runs-on: [ubuntu-latest] + steps: + - uses: actions/checkout@v3 + - uses: r-lib/actions/setup-r@v2 + with: + r-version: '4.1.3' + - uses: r-lib/actions/setup-renv@v2 + - uses: iterative/setup-cml@v1 + - uses: iterative/setup-dvc@v1 + + - name: Installations and renv restore + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + pip install pandas + cd Postprocessing + Rscript -e "renv::activate()" + Rscript -e "renv::restore(lockfile = 'renv.lock')" + + - name: dvc repro - postprocessing + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + dvc repro -s postprocessing + + - name: Display plots for DOM stocks + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + dvc metrics diff --show-md > report.md + echo "## Figures created" >> report.md + echo "![](Postprocessing/Figures/Carpathians_Sensitivity_BorealWet.png)" >> report.md + echo "![](Postprocessing/Figures/Carpathians_Sensitivity_CoolTemperateMoist.png)" >> report.md + echo "![](Postprocessing/Figures/Carpathians_Sensitivity_CoolTemperateSteppe.png)" >> report.md + echo "![](Postprocessing/Figures/Carpathians_Sensitivity_CoolTemperateWet.png)" >> report.md + echo "![](Postprocessing/Figures/Carpathians_Sensitivity_PolarRainTundra.png)" >> report.md + cml comment create --pr=false report.md + \ No newline at end of file diff --git a/Installation/GDAL-2.4.1-cp37-cp37m-win_amd64.whl b/Installation/GDAL-2.4.1-cp37-cp37m-win_amd64.whl new file mode 100644 index 00000000..331bf2a2 Binary files /dev/null and b/Installation/GDAL-2.4.1-cp37-cp37m-win_amd64.whl differ diff --git a/Installation/requirements-py37.txt b/Installation/requirements-py37.txt new file mode 100644 index 00000000..3f858917 --- /dev/null +++ b/Installation/requirements-py37.txt @@ -0,0 +1,24 @@ +cycler==0.10.0 +ftfy==5.6 +future==0.18.2 +geographiclib==1.50 +geopy==1.20.0 +imageio==2.6.1 +imageio-ffmpeg==0.3.0 +kiwisolver==1.1.0 +matplotlib==3.1.2 +pandas==0.25.3 +Pillow==7.0.0 +psutil==5.6.5 +pyparsing==2.4.6 +PySAL==1.14.4.post2 +python-dateutil==2.8.1 +pytz==2019.3 +scipy==1.4.1 +seaborn==0.10.0 +simplejson==3.16.0 +six==1.14.0 +SQLAlchemy==1.3.11 +utm==0.5.0 +wcwidth==0.1.8 +mojadata \ No newline at end of file diff --git a/Postprocessing/.Rprofile b/Postprocessing/.Rprofile new file mode 100644 index 00000000..f3d72d24 --- /dev/null +++ b/Postprocessing/.Rprofile @@ -0,0 +1 @@ +source("renv/activate.R") \ No newline at end of file diff --git a/Postprocessing/Figures/.gitignore b/Postprocessing/Figures/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/Postprocessing/Figures/Carpathians_Sensitivity_BorealWet.png b/Postprocessing/Figures/Carpathians_Sensitivity_BorealWet.png new file mode 100644 index 00000000..9066c739 Binary files /dev/null and b/Postprocessing/Figures/Carpathians_Sensitivity_BorealWet.png differ diff --git a/Postprocessing/Figures/Carpathians_Sensitivity_CoolTemperateMoist.png b/Postprocessing/Figures/Carpathians_Sensitivity_CoolTemperateMoist.png new file mode 100644 index 00000000..37fd264e Binary files /dev/null and b/Postprocessing/Figures/Carpathians_Sensitivity_CoolTemperateMoist.png differ diff --git a/Postprocessing/Figures/Carpathians_Sensitivity_CoolTemperateSteppe.png b/Postprocessing/Figures/Carpathians_Sensitivity_CoolTemperateSteppe.png new file mode 100644 index 00000000..57a81b71 Binary files /dev/null and b/Postprocessing/Figures/Carpathians_Sensitivity_CoolTemperateSteppe.png differ diff --git a/Postprocessing/Figures/Carpathians_Sensitivity_CoolTemperateWet.png b/Postprocessing/Figures/Carpathians_Sensitivity_CoolTemperateWet.png new file mode 100644 index 00000000..8ac65c10 Binary files /dev/null and b/Postprocessing/Figures/Carpathians_Sensitivity_CoolTemperateWet.png differ diff --git a/Postprocessing/Figures/Carpathians_Sensitivity_PolarRainTundra.png b/Postprocessing/Figures/Carpathians_Sensitivity_PolarRainTundra.png new file mode 100644 index 00000000..d731b683 Binary files /dev/null and b/Postprocessing/Figures/Carpathians_Sensitivity_PolarRainTundra.png differ diff --git a/Postprocessing/GCBM_Carpathians_Sensitivity.Rproj b/Postprocessing/GCBM_Carpathians_Sensitivity.Rproj new file mode 100644 index 00000000..8e3c2ebc --- /dev/null +++ b/Postprocessing/GCBM_Carpathians_Sensitivity.Rproj @@ -0,0 +1,13 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX diff --git a/Postprocessing/Metrics/Boreal_wet-Deadwood.json b/Postprocessing/Metrics/Boreal_wet-Deadwood.json new file mode 100644 index 00000000..0b1da328 --- /dev/null +++ b/Postprocessing/Metrics/Boreal_wet-Deadwood.json @@ -0,0 +1 @@ +{"pool_tc_per_ha_mean":61.3656,"pool_tc_per_ha_std":7.1105,"pool_tc_sum_mean":318510842.662800014,"area_sum_mean":5190377.0729} \ No newline at end of file diff --git a/Postprocessing/Metrics/Boreal_wet-Litter.json b/Postprocessing/Metrics/Boreal_wet-Litter.json new file mode 100644 index 00000000..4c0f3b82 --- /dev/null +++ b/Postprocessing/Metrics/Boreal_wet-Litter.json @@ -0,0 +1 @@ +{"pool_tc_per_ha_mean":17.5166,"pool_tc_per_ha_std":1.3261,"pool_tc_sum_mean":90917501.5828000009,"area_sum_mean":5190377.0729} \ No newline at end of file diff --git a/Postprocessing/Metrics/Boreal_wet-Soil_Carbon.json b/Postprocessing/Metrics/Boreal_wet-Soil_Carbon.json new file mode 100644 index 00000000..c58789c5 --- /dev/null +++ b/Postprocessing/Metrics/Boreal_wet-Soil_Carbon.json @@ -0,0 +1 @@ +{"pool_tc_per_ha_mean":65.9538,"pool_tc_per_ha_std":0.245,"pool_tc_sum_mean":342325029.793299973,"area_sum_mean":5190377.0729} \ No newline at end of file diff --git a/Postprocessing/Metrics/Boreal_wet-Total_Biomass.json b/Postprocessing/Metrics/Boreal_wet-Total_Biomass.json new file mode 100644 index 00000000..63ef657f --- /dev/null +++ b/Postprocessing/Metrics/Boreal_wet-Total_Biomass.json @@ -0,0 +1 @@ +{"pool_tc_per_ha_mean":21.956,"pool_tc_per_ha_std":7.7473,"pool_tc_sum_mean":113959785.5372000039,"area_sum_mean":5190377.0729} \ No newline at end of file diff --git a/Postprocessing/Metrics/Cool_temperate_moist-Deadwood.json b/Postprocessing/Metrics/Cool_temperate_moist-Deadwood.json new file mode 100644 index 00000000..48bd6d9f --- /dev/null +++ b/Postprocessing/Metrics/Cool_temperate_moist-Deadwood.json @@ -0,0 +1 @@ +{"pool_tc_per_ha_mean":59.8821,"pool_tc_per_ha_std":7.3325,"pool_tc_sum_mean":400746076.3432000279,"area_sum_mean":6692252.2209999999} \ No newline at end of file diff --git a/Postprocessing/Metrics/Cool_temperate_moist-Litter.json b/Postprocessing/Metrics/Cool_temperate_moist-Litter.json new file mode 100644 index 00000000..51486fc3 --- /dev/null +++ b/Postprocessing/Metrics/Cool_temperate_moist-Litter.json @@ -0,0 +1 @@ +{"pool_tc_per_ha_mean":16.7454,"pool_tc_per_ha_std":1.1646,"pool_tc_sum_mean":112064294.4546000063,"area_sum_mean":6692252.2209999999} \ No newline at end of file diff --git a/Postprocessing/Metrics/Cool_temperate_moist-Soil_Carbon.json b/Postprocessing/Metrics/Cool_temperate_moist-Soil_Carbon.json new file mode 100644 index 00000000..bdd8ecbe --- /dev/null +++ b/Postprocessing/Metrics/Cool_temperate_moist-Soil_Carbon.json @@ -0,0 +1 @@ +{"pool_tc_per_ha_mean":64.6953,"pool_tc_per_ha_std":0.2129,"pool_tc_sum_mean":432956982.3614000082,"area_sum_mean":6692252.2209999999} \ No newline at end of file diff --git a/Postprocessing/Metrics/Cool_temperate_moist-Total_Biomass.json b/Postprocessing/Metrics/Cool_temperate_moist-Total_Biomass.json new file mode 100644 index 00000000..931821e1 --- /dev/null +++ b/Postprocessing/Metrics/Cool_temperate_moist-Total_Biomass.json @@ -0,0 +1 @@ +{"pool_tc_per_ha_mean":21.956,"pool_tc_per_ha_std":7.7473,"pool_tc_sum_mean":146934917.6662999988,"area_sum_mean":6692252.2209999999} \ No newline at end of file diff --git a/Postprocessing/Metrics/Cool_temperate_steppe-Deadwood.json b/Postprocessing/Metrics/Cool_temperate_steppe-Deadwood.json new file mode 100644 index 00000000..a2327746 --- /dev/null +++ b/Postprocessing/Metrics/Cool_temperate_steppe-Deadwood.json @@ -0,0 +1 @@ +{"pool_tc_per_ha_mean":58.9054,"pool_tc_per_ha_std":7.4939,"pool_tc_sum_mean":2453711.0189,"area_sum_mean":41655.1375} \ No newline at end of file diff --git a/Postprocessing/Metrics/Cool_temperate_steppe-Litter.json b/Postprocessing/Metrics/Cool_temperate_steppe-Litter.json new file mode 100644 index 00000000..e1e6a5d0 --- /dev/null +++ b/Postprocessing/Metrics/Cool_temperate_steppe-Litter.json @@ -0,0 +1 @@ +{"pool_tc_per_ha_mean":16.2071,"pool_tc_per_ha_std":1.0556,"pool_tc_sum_mean":675107.9201,"area_sum_mean":41655.1375} \ No newline at end of file diff --git a/Postprocessing/Metrics/Cool_temperate_steppe-Soil_Carbon.json b/Postprocessing/Metrics/Cool_temperate_steppe-Soil_Carbon.json new file mode 100644 index 00000000..c3a5952b --- /dev/null +++ b/Postprocessing/Metrics/Cool_temperate_steppe-Soil_Carbon.json @@ -0,0 +1 @@ +{"pool_tc_per_ha_mean":63.7701,"pool_tc_per_ha_std":0.1911,"pool_tc_sum_mean":2656352.6812,"area_sum_mean":41655.1375} \ No newline at end of file diff --git a/Postprocessing/Metrics/Cool_temperate_steppe-Total_Biomass.json b/Postprocessing/Metrics/Cool_temperate_steppe-Total_Biomass.json new file mode 100644 index 00000000..e0406b56 --- /dev/null +++ b/Postprocessing/Metrics/Cool_temperate_steppe-Total_Biomass.json @@ -0,0 +1 @@ +{"pool_tc_per_ha_mean":21.956,"pool_tc_per_ha_std":7.7473,"pool_tc_sum_mean":914579.1274,"area_sum_mean":41655.1375} \ No newline at end of file diff --git a/Postprocessing/Metrics/Cool_temperate_wet-Deadwood.json b/Postprocessing/Metrics/Cool_temperate_wet-Deadwood.json new file mode 100644 index 00000000..85507486 --- /dev/null +++ b/Postprocessing/Metrics/Cool_temperate_wet-Deadwood.json @@ -0,0 +1 @@ +{"pool_tc_per_ha_mean":59.6229,"pool_tc_per_ha_std":7.3642,"pool_tc_sum_mean":10998396.6458999999,"area_sum_mean":184465.8729} \ No newline at end of file diff --git a/Postprocessing/Metrics/Cool_temperate_wet-Litter.json b/Postprocessing/Metrics/Cool_temperate_wet-Litter.json new file mode 100644 index 00000000..71addd27 --- /dev/null +++ b/Postprocessing/Metrics/Cool_temperate_wet-Litter.json @@ -0,0 +1 @@ +{"pool_tc_per_ha_mean":16.6263,"pool_tc_per_ha_std":1.1384,"pool_tc_sum_mean":3066986.6368,"area_sum_mean":184465.8729} \ No newline at end of file diff --git a/Postprocessing/Metrics/Cool_temperate_wet-Soil_Carbon.json b/Postprocessing/Metrics/Cool_temperate_wet-Soil_Carbon.json new file mode 100644 index 00000000..0d2f4b66 --- /dev/null +++ b/Postprocessing/Metrics/Cool_temperate_wet-Soil_Carbon.json @@ -0,0 +1 @@ +{"pool_tc_per_ha_mean":64.5214,"pool_tc_per_ha_std":0.2079,"pool_tc_sum_mean":11901988.0252,"area_sum_mean":184465.8729} \ No newline at end of file diff --git a/Postprocessing/Metrics/Cool_temperate_wet-Total_Biomass.json b/Postprocessing/Metrics/Cool_temperate_wet-Total_Biomass.json new file mode 100644 index 00000000..06eafd81 --- /dev/null +++ b/Postprocessing/Metrics/Cool_temperate_wet-Total_Biomass.json @@ -0,0 +1 @@ +{"pool_tc_per_ha_mean":21.956,"pool_tc_per_ha_std":7.7473,"pool_tc_sum_mean":4050127.9615000002,"area_sum_mean":184465.8729} \ No newline at end of file diff --git a/Postprocessing/Metrics/Polar_rain_tundra-Deadwood.json b/Postprocessing/Metrics/Polar_rain_tundra-Deadwood.json new file mode 100644 index 00000000..d26f97cf --- /dev/null +++ b/Postprocessing/Metrics/Polar_rain_tundra-Deadwood.json @@ -0,0 +1 @@ +{"pool_tc_per_ha_mean":63.2617,"pool_tc_per_ha_std":6.8518,"pool_tc_sum_mean":26225047.0208999999,"area_sum_mean":414548.8501} \ No newline at end of file diff --git a/Postprocessing/Metrics/Polar_rain_tundra-Litter.json b/Postprocessing/Metrics/Polar_rain_tundra-Litter.json new file mode 100644 index 00000000..b636936d --- /dev/null +++ b/Postprocessing/Metrics/Polar_rain_tundra-Litter.json @@ -0,0 +1 @@ +{"pool_tc_per_ha_mean":18.4499,"pool_tc_per_ha_std":1.5272,"pool_tc_sum_mean":7648375.8392000003,"area_sum_mean":414548.8501} \ No newline at end of file diff --git a/Postprocessing/Metrics/Polar_rain_tundra-Soil_Carbon.json b/Postprocessing/Metrics/Polar_rain_tundra-Soil_Carbon.json new file mode 100644 index 00000000..63f17426 --- /dev/null +++ b/Postprocessing/Metrics/Polar_rain_tundra-Soil_Carbon.json @@ -0,0 +1 @@ +{"pool_tc_per_ha_mean":67.4019,"pool_tc_per_ha_std":0.2848,"pool_tc_sum_mean":27941363.8114,"area_sum_mean":414548.8501} \ No newline at end of file diff --git a/Postprocessing/Metrics/Polar_rain_tundra-Total_Biomass.json b/Postprocessing/Metrics/Polar_rain_tundra-Total_Biomass.json new file mode 100644 index 00000000..33148073 --- /dev/null +++ b/Postprocessing/Metrics/Polar_rain_tundra-Total_Biomass.json @@ -0,0 +1 @@ +{"pool_tc_per_ha_mean":21.956,"pool_tc_per_ha_std":7.7473,"pool_tc_sum_mean":9101823.8918999992,"area_sum_mean":414548.8501} \ No newline at end of file diff --git a/Postprocessing/Summarize_DOM_Stocks.R b/Postprocessing/Summarize_DOM_Stocks.R new file mode 100644 index 00000000..231efde1 --- /dev/null +++ b/Postprocessing/Summarize_DOM_Stocks.R @@ -0,0 +1,185 @@ +# ---------------------------- +# Make Tables and Figures for the GCBM estimations on DOM pools +# ---------------------------- + +#------------------------------------------------------ +# Library management + +# Necessary libraries +library(ggplot2) # produce figures +library(readr) # Read data +library(tidyr) # Data cleaning +library(dplyr) # Data processing +library(RSQLite) # Connect with the SQLite database +library(writexl) # Write tables in excel format + +# Avoid scientific notation +options(scipen=10000) + +#------------------------ + +# List the directories of the different GCBM runs +# Here only one directory is listed, but mode than one can be made to make a sensitivity analysis +# e.g. runs <- c('../Standalone_GCBM','../Standalone_GCBM_decaymod','../Standalone_GCBM_turnovermod') +runs <- c('../Standalone_GCBM') + + +# Make a named vector to point the name you want each run to have in the graph +# Here only one name is listed, but mode than one can be made to make a sensitivity analysis +# e.g. names_runs <- c('Default','Modified Decay parameters',Modified Decay, Turnover and Spinup parameters') +names_runs <- c('Modified Decay, Turnover and Spinup parameters') +names_runs <- c('../Standalone_GCBM' = 'Modified Decay, Turnover and Spinup parameters') + +#Loop though the runs +for (run in runs) { + + # Path to the database + path_db<-paste0(run,"/processed_output/compiled_gcbm_output.db") + #---------------------- + + # Connect to the database + conn <- dbConnect(RSQLite::SQLite(), path_db) + + # List the tables in the databases + dbListTables(conn) + + # Pool indicators + pool_ind<-dbGetQuery(conn, "SELECT * FROM v_pool_indicators") + + + # Calculate the pools total carbon for forests per lifezone and year + pools_run<-pool_ind %>% filter(indicator %in% c("Total Biomass","Deadwood","Litter","Soil Carbon")) %>% + group_by(year,indicator,LifeZone) %>% + summarize(pool_tc_sum=sum(pool_tc)) + + + # Get the areas for each lifezone + age_ind<-dbGetQuery(conn, "SELECT * FROM v_age_indicators") + areas_run<-age_ind %>% + group_by(year,LifeZone) %>% + summarize(area_sum=sum(area)) %>% + ungroup() + + # Divide the DOM values per area to obtain ton/ha values + pools_run_area <- left_join(pools_run,areas_run,by = c("year","LifeZone")) + pools_run_area <- mutate(pools_run_area, pool_tc_per_ha = pool_tc_sum/area_sum) + pools_run_area$run <- run + + # Recode the runs + pools_run_area$run <- as.character(recode(pools_run_area$run, !!!names_runs)) + + + # Make a compiled database + if(exists("pools_full")){ + pools_full <- unique(rbind(pools_full, pools_run_area)) + } else { + pools_full <- pools_run_area + } + + dbDisconnect(conn) + +} + +# Check the recoding +unique(pools_full$run) + +#Write full table +write_csv(pools_full,"./Tables/Pools_DOM_Sensitivity_full.csv") + + +# Make a Table with the DOM stocks every 5 year, from 0 to 10 years old +pools_summary <- pools_full %>% + filter(year %in% seq(2010,2020,by=5)) %>% + mutate(Age = year - 2010) + +for (ag in unique(pools_summary$Age)) { + + # Make a pools table for that specific age (ag) + pools_forest <- pools_summary %>% + filter(Age == ag) %>% + select(indicator,LifeZone,pool_tc_per_ha,run) %>% + pivot_wider(names_from = run,values_from = pool_tc_per_ha) + + # Write a table every 10 years + write_csv(pools_forest,paste0("./Tables/Pools_DOM_Sensitivity_forest_",ag,"_years.csv")) + +} + +# Make figures for each life zone in Carpathians + +# Boreal wet forest + +p <- ggplot(filter(pools_full, LifeZone=="Boreal wet forest"), aes(x = year, y = pool_tc_per_ha, fill = indicator))+ + geom_area() + + facet_grid(indicator~run,labeller=label_wrap_gen(width=7)) + + ylab("Carbon Stock (ton C / ha)") + + scale_fill_manual(values = c("darkgoldenrod4","chartreuse3","gray14","forestgreen")) + + ggtitle("Carbon Stocks of Boreal wet forest (Carpathians) - GCBM Sensitivity analysis") + + theme_bw(14) + + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) + +p + +ggsave(filename=("./Figures/Carpathians_Sensitivity_BorealWet.png"), width = 300, height = 180, units = "mm", dpi = 300) + + +# Cool temperate moist forest +p <- ggplot(filter(pools_full,LifeZone=="Cool temperate moist forest"),aes(x = year,y = pool_tc_per_ha, fill = indicator))+ + geom_area() + + facet_grid(indicator~run,labeller = label_wrap_gen(width = 7)) + + ylab("Carbon Stock (ton C / ha)") + + scale_fill_manual(values = c("darkgoldenrod4","chartreuse3","gray14","forestgreen")) + + ggtitle("Carbon Stocks of Cool temperate moist forest (Carpathians) - GCBM Sensitivity analysis") + + theme_bw(14) + + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) + +p + +ggsave(filename=("./Figures/Carpathians_Sensitivity_CoolTemperateMoist.png"), width = 300, height = 180, units = "mm", dpi = 300) + + +# Cool temperate steppe +p <- ggplot(filter(pools_full,LifeZone=="Cool temperate steppe"), aes(x = year,y = pool_tc_per_ha, fill = indicator))+ + geom_area() + + facet_grid(indicator~run,labeller = label_wrap_gen(width = 7)) + + ylab("Carbon Stock (ton C / ha)") + + scale_fill_manual(values = c("darkgoldenrod4","chartreuse3","gray14","forestgreen")) + + ggtitle("Carbon Stocks of Cool temperate steppe (Carpathians) - GCBM Sensitivity analysis") + + theme_bw(14) + + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) + +p + +ggsave(filename=("./Figures/Carpathians_Sensitivity_CoolTemperateSteppe.png"), width = 300, height = 180, units = "mm", dpi = 300) + + +# Cool temperate wet forest +p <- ggplot(filter(pools_full,LifeZone=="Cool temperate wet forest"),aes(x = year, y = pool_tc_per_ha, fill = indicator))+ + geom_area() + + facet_grid(indicator~run,labeller = label_wrap_gen(width = 7)) + + ylab("Carbon Stock (ton C / ha)") + + scale_fill_manual(values = c("darkgoldenrod4","chartreuse3","gray14","forestgreen")) + + ggtitle("Carbon Stocks of Cool temperate wet forest (Carpathians) - GCBM Sensitivity analysis") + + theme_bw(14) + + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) + +p + +ggsave(filename=("./Figures/Carpathians_Sensitivity_CoolTemperateWet.png"), width = 300, height = 180, units = "mm", dpi = 300) + + +# Polar rain tundra +p <- ggplot(filter(pools_full,LifeZone=="Polar rain tundra"),aes(x = year, y = pool_tc_per_ha, fill = indicator))+ + geom_area() + + facet_grid(indicator~run,labeller = label_wrap_gen(width = 7)) + + ylab("Carbon Stock (ton C / ha)") + + scale_fill_manual(values = c("darkgoldenrod4","chartreuse3","gray14","forestgreen")) + + ggtitle("Carbon Stocks of Polar rain tundra (Carpathians) - GCBM Sensitivity analysis") + + theme_bw(14) + + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) + +p + +ggsave(filename=("./Figures/Carpathians_Sensitivity_PolarRainTundra.png"), width = 300, height = 180, units = "mm", dpi = 300) + + diff --git a/Postprocessing/Tables/Pools_DOM_Sensitivity_forest_0_years.csv b/Postprocessing/Tables/Pools_DOM_Sensitivity_forest_0_years.csv new file mode 100644 index 00000000..182d46e7 --- /dev/null +++ b/Postprocessing/Tables/Pools_DOM_Sensitivity_forest_0_years.csv @@ -0,0 +1,21 @@ +year,indicator,LifeZone,"Modified Decay, Turnover and Spinup parameters" +2010,Deadwood,Boreal wet forest,73.58179224334447 +2010,Deadwood,Cool temperate moist forest,72.52550928787807 +2010,Deadwood,Cool temperate steppe,71.86384336371181 +2010,Deadwood,Cool temperate wet forest,72.32585801122754 +2010,Deadwood,Polar rain tundra,74.98652449145649 +2010,Litter,Boreal wet forest,15.129277040731724 +2010,Litter,Cool temperate moist forest,14.621455944186161 +2010,Litter,Cool temperate steppe,14.266278728071175 +2010,Litter,Cool temperate wet forest,14.543188974398708 +2010,Litter,Polar rain tundra,15.742952191096096 +2010,Soil Carbon,Boreal wet forest,66.56031915071492 +2010,Soil Carbon,Cool temperate moist forest,65.23552361172705 +2010,Soil Carbon,Cool temperate steppe,64.26328368247972 +2010,Soil Carbon,Cool temperate wet forest,65.05172999424077 +2010,Soil Carbon,Polar rain tundra,68.087298689721493 +2010,Total Biomass,Boreal wet forest,7.8025902741616315 +2010,Total Biomass,Cool temperate moist forest,7.802590274163127 +2010,Total Biomass,Cool temperate steppe,7.802590274162565 +2010,Total Biomass,Cool temperate wet forest,7.802590274162495 +2010,Total Biomass,Polar rain tundra,7.802590274162545 diff --git a/Postprocessing/Tables/Pools_DOM_Sensitivity_forest_10_years.csv b/Postprocessing/Tables/Pools_DOM_Sensitivity_forest_10_years.csv new file mode 100644 index 00000000..1fc13640 --- /dev/null +++ b/Postprocessing/Tables/Pools_DOM_Sensitivity_forest_10_years.csv @@ -0,0 +1,21 @@ +year,indicator,LifeZone,"Modified Decay, Turnover and Spinup parameters" +2020,Deadwood,Boreal wet forest,51.97801680976807 +2020,Deadwood,Cool temperate moist forest,50.23813164916248 +2020,Deadwood,Cool temperate steppe,49.07798862980726 +2020,Deadwood,Cool temperate wet forest,49.941127771162144 +2020,Deadwood,Polar rain tundra,54.1773266314185 +2020,Litter,Boreal wet forest,19.162132656148984 +2020,Litter,Cool temperate moist forest,18.17520569034621 +2020,Litter,Cool temperate steppe,17.497160550850165 +2020,Litter,Cool temperate wet forest,18.01859461397586 +2020,Litter,Polar rain tundra,20.37354137103164 +2020,Soil Carbon,Boreal wet forest,65.76083322813157 +2020,Soil Carbon,Cool temperate moist forest,64.53084940708973 +2020,Soil Carbon,Cool temperate steppe,63.62334120081604 +2020,Soil Carbon,Cool temperate wet forest,64.36231220585685 +2020,Soil Carbon,Polar rain tundra,67.17068832531871 +2020,Total Biomass,Boreal wet forest,31.73040007648649 +2020,Total Biomass,Cool temperate moist forest,31.73040007649032 +2020,Total Biomass,Cool temperate steppe,31.73040007648949 +2020,Total Biomass,Cool temperate wet forest,31.730400076489836 +2020,Total Biomass,Polar rain tundra,31.730400076489524 diff --git a/Postprocessing/Tables/Pools_DOM_Sensitivity_forest_5_years.csv b/Postprocessing/Tables/Pools_DOM_Sensitivity_forest_5_years.csv new file mode 100644 index 00000000..797cdb71 --- /dev/null +++ b/Postprocessing/Tables/Pools_DOM_Sensitivity_forest_5_years.csv @@ -0,0 +1,21 @@ +year,indicator,LifeZone,"Modified Decay, Turnover and Spinup parameters" +2015,Deadwood,Boreal wet forest,60.44543387739029 +2015,Deadwood,Cool temperate moist forest,58.907439815598636 +2015,Deadwood,Cool temperate steppe,57.88896335053281 +2015,Deadwood,Cool temperate wet forest,58.641323171949416 +2015,Deadwood,Polar rain tundra,62.40156783270707 +2015,Litter,Boreal wet forest,17.763744375564222 +2015,Litter,Cool temperate moist forest,16.975097449560447 +2015,Litter,Cool temperate steppe,16.421094183664646 +2015,Litter,Cool temperate wet forest,16.85474674092171 +2015,Litter,Polar rain tundra,18.71267674667937 +2015,Soil Carbon,Boreal wet forest,65.8502500720393 +2015,Soil Carbon,Cool temperate moist forest,64.60644040320845 +2015,Soil Carbon,Cool temperate steppe,63.69244731171297 +2015,Soil Carbon,Cool temperate wet forest,64.43441109636422 +2015,Soil Carbon,Polar rain tundra,67.28197013078548 +2015,Total Biomass,Boreal wet forest,23.257593691960036 +2015,Total Biomass,Cool temperate moist forest,23.25759369196239 +2015,Total Biomass,Cool temperate steppe,23.25759369196129 +2015,Total Biomass,Cool temperate wet forest,23.257593691961205 +2015,Total Biomass,Polar rain tundra,23.257593691961425 diff --git a/Postprocessing/Tables/Pools_DOM_Sensitivity_full.csv b/Postprocessing/Tables/Pools_DOM_Sensitivity_full.csv new file mode 100644 index 00000000..9643da80 --- /dev/null +++ b/Postprocessing/Tables/Pools_DOM_Sensitivity_full.csv @@ -0,0 +1,221 @@ +year,indicator,LifeZone,pool_tc_sum,area_sum,pool_tc_per_ha,run +2010,Deadwood,Boreal wet forest,381917247.44476736,5190377.072927468,73.58179224334447,"Modified Decay, Turnover and Spinup parameters" +2010,Deadwood,Cool temperate moist forest,485359000.61185896,6692252.221012421,72.52550928787807,"Modified Decay, Turnover and Spinup parameters" +2010,Deadwood,Cool temperate steppe,2993498.2755331434,41655.13748523966,71.86384336371181,"Modified Decay, Turnover and Spinup parameters" +2010,Deadwood,Cool temperate wet forest,13341652.530735172,184465.87289243183,72.32585801122754,"Modified Decay, Turnover and Spinup parameters" +2010,Deadwood,Polar rain tundra,31085577.499807224,414548.8500850433,74.98652449145649,"Modified Decay, Turnover and Spinup parameters" +2010,Litter,Boreal wet forest,78526652.68218188,5190377.072927468,15.129277040731724,"Modified Decay, Turnover and Spinup parameters" +2010,Litter,Cool temperate moist forest,97850471.0169151,6692252.221012421,14.621455944186161,"Modified Decay, Turnover and Spinup parameters" +2010,Litter,Cool temperate steppe,594263.8018205548,41655.13748523966,14.266278728071175,"Modified Decay, Turnover and Spinup parameters" +2010,Litter,Cool temperate wet forest,2682722.048802048,184465.87289243183,14.543188974398708,"Modified Decay, Turnover and Spinup parameters" +2010,Litter,Polar rain tundra,6526222.727762699,414548.8500850433,15.742952191096096,"Modified Decay, Turnover and Spinup parameters" +2010,Soil Carbon,Boreal wet forest,345473154.4866058,5190377.072927468,66.56031915071492,"Modified Decay, Turnover and Spinup parameters" +2010,Soil Carbon,Cool temperate moist forest,436572577.77948856,6692252.221012421,65.23552361172705,"Modified Decay, Turnover and Spinup parameters" +2010,Soil Carbon,Cool temperate steppe,2676895.9170466512,41655.13748523966,64.26328368247972,"Modified Decay, Turnover and Spinup parameters" +2010,Soil Carbon,Cool temperate wet forest,11999824.156550413,184465.87289243183,65.05172999424077,"Modified Decay, Turnover and Spinup parameters" +2010,Soil Carbon,Polar rain tundra,28225511.37722092,414548.8500850433,68.087298689721493,"Modified Decay, Turnover and Spinup parameters" +2010,Total Biomass,Boreal wet forest,40498385.668455385,5190377.072927468,7.8025902741616315,"Modified Decay, Turnover and Spinup parameters" +2010,Total Biomass,Cool temperate moist forest,52216902.0919181,6692252.221012421,7.802590274163127,"Modified Decay, Turnover and Spinup parameters" +2010,Total Biomass,Cool temperate steppe,325017.9706112355,41655.13748523966,7.802590274162565,"Modified Decay, Turnover and Spinup parameters" +2010,Total Biomass,Cool temperate wet forest,1439311.6257453836,184465.87289243183,7.802590274162495,"Modified Decay, Turnover and Spinup parameters" +2010,Total Biomass,Polar rain tundra,3234554.8258388257,414548.8500850433,7.802590274162545,"Modified Decay, Turnover and Spinup parameters" +2011,Deadwood,Boreal wet forest,365342854.6000513,5190377.072927468,70.38849961511393,"Modified Decay, Turnover and Spinup parameters" +2011,Deadwood,Cool temperate moist forest,463075414.79091907,6692252.221012421,69.1957504735026,"Modified Decay, Turnover and Spinup parameters" +2011,Deadwood,Cool temperate steppe,2850504.325740752,41655.13748523966,68.43103871043078,"Modified Decay, Turnover and Spinup parameters" +2011,Deadwood,Cool temperate wet forest,12724082.399862532,184465.87289243183,68.97797516878565,"Modified Decay, Turnover and Spinup parameters" +2011,Deadwood,Polar rain tundra,29825352.44129329,414548.8500850433,71.9465328034916,"Modified Decay, Turnover and Spinup parameters" +2011,Litter,Boreal wet forest,82005261.58384202,5190377.072927468,15.79948054479008,"Modified Decay, Turnover and Spinup parameters" +2011,Litter,Cool temperate moist forest,101954653.78672713,6692252.221012421,15.234729717240569,"Modified Decay, Turnover and Spinup parameters" +2011,Litter,Cool temperate steppe,618057.471709883,41655.13748523966,14.837484858353648,"Modified Decay, Turnover and Spinup parameters" +2011,Litter,Cool temperate wet forest,2794394.841817752,184465.87289243183,15.148573543721318,"Modified Decay, Turnover and Spinup parameters" +2011,Litter,Polar rain tundra,6831133.584225806,414548.8500850433,16.478476741219815,"Modified Decay, Turnover and Spinup parameters" +2011,Soil Carbon,Boreal wet forest,343771261.6600822,5190377.072927468,66.23242528046019,"Modified Decay, Turnover and Spinup parameters" +2011,Soil Carbon,Cool temperate moist forest,434500936.4619264,6692252.221012421,64.92596544668096,"Modified Decay, Turnover and Spinup parameters" +2011,Soil Carbon,Cool temperate steppe,2664600.8185338746,41655.13748523966,63.96811964617967,"Modified Decay, Turnover and Spinup parameters" +2011,Soil Carbon,Cool temperate wet forest,11943133.974308403,184465.87289243183,64.74440928850206,"Modified Decay, Turnover and Spinup parameters" +2011,Soil Carbon,Polar rain tundra,28081379.14705646,414548.8500850433,67.73961414027723,"Modified Decay, Turnover and Spinup parameters" +2011,Total Biomass,Boreal wet forest,63127753.41789809,5190377.072927468,12.162459977554747,"Modified Decay, Turnover and Spinup parameters" +2011,Total Biomass,Cool temperate moist forest,81394249.79777604,6692252.221012421,12.162459977556333,"Modified Decay, Turnover and Spinup parameters" +2011,Total Biomass,Cool temperate steppe,506628.9425238414,41655.13748523966,12.162459977556512,"Modified Decay, Turnover and Spinup parameters" +2011,Total Biomass,Cool temperate wet forest,2243558.7962792213,184465.87289243183,12.162459977556471,"Modified Decay, Turnover and Spinup parameters" +2011,Total Biomass,Polar rain tundra,5041933.79790146,414548.8500850433,12.162459977556624,"Modified Decay, Turnover and Spinup parameters" +2012,Deadwood,Boreal wet forest,350466832.3368329,5190377.072927468,67.5224222465138,"Modified Decay, Turnover and Spinup parameters" +2012,Deadwood,Cool temperate moist forest,443144632.0155028,6692252.221012421,66.21756284440558,"Modified Decay, Turnover and Spinup parameters" +2012,Deadwood,Cool temperate steppe,2722962.838314075,41655.13748523966,65.36919579917235,"Modified Decay, Turnover and Spinup parameters" +2012,Deadwood,Cool temperate wet forest,12171897.003152736,184465.87289243183,65.98454669309251,"Modified Decay, Turnover and Spinup parameters" +2012,Deadwood,Polar rain tundra,28690038.68125329,414548.8500850433,69.20785976216706,"Modified Decay, Turnover and Spinup parameters" +2012,Litter,Boreal wet forest,85104473.76759394,5190377.072927468,16.39658787248639,"Modified Decay, Turnover and Spinup parameters" +2012,Litter,Cool temperate moist forest,105560783.32000943,6692252.221012421,15.773581125434617,"Modified Decay, Turnover and Spinup parameters" +2012,Litter,Cool temperate steppe,638749.0901945629,41655.13748523966,15.334221149093583,"Modified Decay, Turnover and Spinup parameters" +2012,Litter,Cool temperate wet forest,2892244.736958196,184465.87289243183,15.679023396619058,"Modified Decay, Turnover and Spinup parameters" +2012,Litter,Polar rain tundra,7106942.427809966,414548.8500850433,17.143799642314775,"Modified Decay, Turnover and Spinup parameters" +2012,Soil Carbon,Boreal wet forest,342816203.6901208,5190377.072927468,66.04841977247062,"Modified Decay, Turnover and Spinup parameters" +2012,Soil Carbon,Cool temperate moist forest,433410055.7207024,6692252.221012421,64.76295892732134,"Modified Decay, Turnover and Spinup parameters" +2012,Soil Carbon,Cool temperate steppe,2658465.1813250743,41655.13748523966,63.820823596299284,"Modified Decay, Turnover and Spinup parameters" +2012,Soil Carbon,Cool temperate wet forest,11913584.549995542,184465.87289243183,64.58422017682777,"Modified Decay, Turnover and Spinup parameters" +2012,Soil Carbon,Polar rain tundra,27995250.381991323,414548.8500850433,67.53184908424711,"Modified Decay, Turnover and Spinup parameters" +2012,Total Biomass,Boreal wet forest,80979788.58680499,5190377.072927468,15.601908579857936,"Modified Decay, Turnover and Spinup parameters" +2012,Total Biomass,Cool temperate moist forest,104411907.3456022,6692252.221012421,15.601908579860204,"Modified Decay, Turnover and Spinup parameters" +2012,Total Biomass,Cool temperate steppe,649899.6469261978,41655.13748523966,15.60190857985974,"Modified Decay, Turnover and Spinup parameters" +2012,Total Biomass,Cool temperate wet forest,2878019.684971777,184465.87289243183,15.601908579859893,"Modified Decay, Turnover and Spinup parameters" +2012,Total Biomass,Polar rain tundra,6467753.260912804,414548.8500850433,15.601908579859687,"Modified Decay, Turnover and Spinup parameters" +2013,Deadwood,Boreal wet forest,337038659.5263893,5190377.072927468,64.93529367728446,"Modified Decay, Turnover and Spinup parameters" +2013,Deadwood,Cool temperate moist forest,425212031.64770615,6692252.221012421,63.53795667064368,"Modified Decay, Turnover and Spinup parameters" +2013,Deadwood,Cool temperate steppe,2608503.401721336,41655.13748523966,62.621409007367916,"Modified Decay, Turnover and Spinup parameters" +2013,Deadwood,Cool temperate wet forest,11675227.268545548,184465.87289243183,63.29207178258799,"Modified Decay, Turnover and Spinup parameters" +2013,Deadwood,Polar rain tundra,27661621.020917118,414548.8500850433,66.72704800711045,"Modified Decay, Turnover and Spinup parameters" +2013,Litter,Boreal wet forest,87809332.2139627,5190377.072927468,16.917717341186663,"Modified Decay, Turnover and Spinup parameters" +2013,Litter,Cool temperate moist forest,108662191.48639114,6692252.221012421,16.237013773212578,"Modified Decay, Turnover and Spinup parameters" +2013,Litter,Cool temperate steppe,656353.0810651662,41655.13748523966,15.756833867076837,"Modified Decay, Turnover and Spinup parameters" +2013,Litter,Cool temperate wet forest,2976137.2608151096,184465.87289243183,16.1338095450891,"Modified Decay, Turnover and Spinup parameters" +2013,Litter,Polar rain tundra,7351538.666083097,414548.8500850433,17.7338295946906,"Modified Decay, Turnover and Spinup parameters" +2013,Soil Carbon,Boreal wet forest,342277571.4789239,5190377.072927468,65.94464461247188,"Modified Decay, Turnover and Spinup parameters" +2013,Soil Carbon,Cool temperate moist forest,432836869.0037224,6692252.221012421,64.67730962749664,"Modified Decay, Turnover and Spinup parameters" +2013,Soil Carbon,Cool temperate steppe,2655433.1832061266,41655.13748523966,63.748035500952774,"Modified Decay, Turnover and Spinup parameters" +2013,Soil Carbon,Cool temperate wet forest,11898279.54982501,184465.87289243183,64.50125089947284,"Modified Decay, Turnover and Spinup parameters" +2013,Soil Carbon,Polar rain tundra,27943299.3409335,414548.8500850433,67.40652961695837,"Modified Decay, Turnover and Spinup parameters" +2013,Total Biomass,Boreal wet forest,96019190.01427473,5190377.072927468,18.49946326926844,"Modified Decay, Turnover and Spinup parameters" +2013,Total Biomass,Cool temperate moist forest,123803074.15130953,6692252.221012421,18.499463269269953,"Modified Decay, Turnover and Spinup parameters" +2013,Total Biomass,Cool temperate steppe,770597.6858845621,41655.13748523966,18.499463269269498,"Modified Decay, Turnover and Spinup parameters" +2013,Total Biomass,Cool temperate wet forest,3412519.640007264,184465.87289243183,18.49946326926942,"Modified Decay, Turnover and Spinup parameters" +2013,Total Biomass,Polar rain tundra,7668931.225466134,414548.8500850433,18.49946326926942,"Modified Decay, Turnover and Spinup parameters" +2014,Deadwood,Boreal wet forest,324852161.0020869,5190377.072927468,62.58739132778734,"Modified Decay, Turnover and Spinup parameters" +2014,Deadwood,Cool temperate moist forest,408986134.60081923,6692252.221012421,61.11337724491005,"Modified Decay, Turnover and Spinup parameters" +2014,Deadwood,Cool temperate steppe,2505180.400148911,41655.13748523966,60.14097063145241,"Modified Decay, Turnover and Spinup parameters" +2014,Deadwood,Cool temperate wet forest,11225961.137207646,184465.87289243183,60.85657450445523,"Modified Decay, Turnover and Spinup parameters" +2014,Deadwood,Polar rain tundra,26725262.66586352,414548.8500850433,64.46830731862102,"Modified Decay, Turnover and Spinup parameters" +2014,Litter,Boreal wet forest,90157568.35747647,5190377.072927468,17.370138448655318,"Modified Decay, Turnover and Spinup parameters" +2014,Litter,Cool temperate moist forest,111317897.7939077,6692252.221012421,16.633846740621987,"Modified Decay, Turnover and Spinup parameters" +2014,Litter,Cool temperate steppe,671281.3334946977,41655.13748523966,16.115211088489712,"Modified Decay, Turnover and Spinup parameters" +2014,Litter,Cool temperate wet forest,3047742.0113577954,184465.87289243183,16.521982974785992,"Modified Decay, Turnover and Spinup parameters" +2014,Litter,Polar rain tundra,7567161.377167958,414548.8500850433,18.253967839051008,"Modified Decay, Turnover and Spinup parameters" +2014,Soil Carbon,Boreal wet forest,341970189.7948064,5190377.072927468,65.88542315711351,"Modified Decay, Turnover and Spinup parameters" +2014,Soil Carbon,Cool temperate moist forest,432532958.60294056,6692252.221012421,64.63189735211532,"Modified Decay, Turnover and Spinup parameters" +2014,Soil Carbon,Cool temperate steppe,2653926.0012568003,41655.13748523966,63.711853122492,"Modified Decay, Turnover and Spinup parameters" +2014,Soil Carbon,Cool temperate wet forest,11890319.224611923,184465.87289243183,64.45809752325061,"Modified Decay, Turnover and Spinup parameters" +2014,Soil Carbon,Polar rain tundra,27911581.223809063,414548.8500850433,67.33001724183555,"Modified Decay, Turnover and Spinup parameters" +2014,Total Biomass,Boreal wet forest,109104558.72814453,5190377.072927468,21.020545751333543,"Modified Decay, Turnover and Spinup parameters" +2014,Total Biomass,Cool temperate moist forest,140674793.99128163,6692252.221012421,21.020545751337504,"Modified Decay, Turnover and Spinup parameters" +2014,Total Biomass,Cool temperate steppe,875613.7232866914,41655.13748523966,21.020545751336474,"Modified Decay, Turnover and Spinup parameters" +2014,Total Biomass,Cool temperate wet forest,3877573.320695571,184465.87289243183,21.020545751336417,"Modified Decay, Turnover and Spinup parameters" +2014,Total Biomass,Polar rain tundra,8714043.069376457,414548.8500850433,21.020545751336183,"Modified Decay, Turnover and Spinup parameters" +2015,Deadwood,Boreal wet forest,313734594.16035986,5190377.072927468,60.44543387739029,"Modified Decay, Turnover and Spinup parameters" +2015,Deadwood,Cool temperate moist forest,394223444.9400955,6692252.221012421,58.907439815598636,"Modified Decay, Turnover and Spinup parameters" +2015,Deadwood,Cool temperate steppe,2411372.727244444,41655.13748523966,57.88896335053281,"Modified Decay, Turnover and Spinup parameters" +2015,Deadwood,Cool temperate wet forest,10817322.866480839,184465.87289243183,58.641323171949416,"Modified Decay, Turnover and Spinup parameters" +2015,Deadwood,Polar rain tundra,25868498.188552544,414548.8500850433,62.40156783270707,"Modified Decay, Turnover and Spinup parameters" +2015,Litter,Boreal wet forest,92200531.53627281,5190377.072927468,17.763744375564222,"Modified Decay, Turnover and Spinup parameters" +2015,Litter,Cool temperate moist forest,113601633.6087232,6692252.221012421,16.975097449560447,"Modified Decay, Turnover and Spinup parameters" +2015,Litter,Cool temperate steppe,684022.9358786203,41655.13748523966,16.421094183664646,"Modified Decay, Turnover and Spinup parameters" +2015,Litter,Cool temperate wet forest,3109125.5699449936,184465.87289243183,16.85474674092171,"Modified Decay, Turnover and Spinup parameters" +2015,Litter,Polar rain tundra,7757318.627349062,414548.8500850433,18.71267674667937,"Modified Decay, Turnover and Spinup parameters" +2015,Soil Carbon,Boreal wet forest,341787628.22045314,5190377.072927468,65.8502500720393,"Modified Decay, Turnover and Spinup parameters" +2015,Soil Carbon,Cool temperate moist forest,432362594.2800784,6692252.221012421,64.60644040320845,"Modified Decay, Turnover and Spinup parameters" +2015,Soil Carbon,Cool temperate steppe,2653117.649540787,41655.13748523966,63.69244731171297,"Modified Decay, Turnover and Spinup parameters" +2015,Soil Carbon,Cool temperate wet forest,11885949.88720062,184465.87289243183,64.43441109636422,"Modified Decay, Turnover and Spinup parameters" +2015,Soil Carbon,Polar rain tundra,27891663.349173352,414548.8500850433,67.28197013078548,"Modified Decay, Turnover and Spinup parameters" +2015,Total Biomass,Boreal wet forest,120715681.07021189,5190377.072927468,23.257593691960036,"Modified Decay, Turnover and Spinup parameters" +2015,Total Biomass,Cool temperate moist forest,155645683.04043978,6692252.221012421,23.25759369196239,"Modified Decay, Turnover and Spinup parameters" +2015,Total Biomass,Cool temperate steppe,968798.2628144902,41655.13748523966,23.25759369196129,"Modified Decay, Turnover and Spinup parameters" +2015,Total Biomass,Cool temperate wet forest,4290232.32176514,184465.87289243183,23.257593691961205,"Modified Decay, Turnover and Spinup parameters" +2015,Total Biomass,Polar rain tundra,9641408.720747765,414548.8500850433,23.257593691961425,"Modified Decay, Turnover and Spinup parameters" +2016,Deadwood,Boreal wet forest,303540166.53481174,5190377.072927468,58.48133233287606,"Modified Decay, Turnover and Spinup parameters" +2016,Deadwood,Cool temperate moist forest,380719205.5592478,6692252.221012421,56.88954823965849,"Modified Decay, Turnover and Spinup parameters" +2016,Deadwood,Cool temperate steppe,2325721.4230380123,41655.13748523966,55.83276309824023,"Modified Decay, Turnover and Spinup parameters" +2016,Deadwood,Cool temperate wet forest,10443615.867032347,184465.87289243183,56.61543624994725,"Modified Decay, Turnover and Spinup parameters" +2016,Deadwood,Polar rain tundra,25080768.590987537,414548.8500850433,60.50135849090476,"Modified Decay, Turnover and Spinup parameters" +2016,Litter,Boreal wet forest,93989985.12308633,5190377.072927468,18.108508072241897,"Modified Decay, Turnover and Spinup parameters" +2016,Litter,Cool temperate moist forest,115584979.77719928,6692252.221012421,17.271461977222565,"Modified Decay, Turnover and Spinup parameters" +2016,Litter,Cool temperate steppe,695040.3534568027,41655.13748523966,16.685585390351612,"Modified Decay, Turnover and Spinup parameters" +2016,Litter,Cool temperate wet forest,3162286.7730267644,184465.87289243183,17.142936649701046,"Modified Decay, Turnover and Spinup parameters" +2016,Litter,Polar rain tundra,7925726.897113438,414548.8500850433,19.118921438299736,"Modified Decay, Turnover and Spinup parameters" +2016,Soil Carbon,Boreal wet forest,341668538.6813392,5190377.072927468,65.82730577773454,"Modified Decay, Turnover and Spinup parameters" +2016,Soil Carbon,Cool temperate moist forest,432251865.63956165,6692252.221012421,64.58989460713563,"Modified Decay, Turnover and Spinup parameters" +2016,Soil Carbon,Cool temperate steppe,2652580.12964312,41655.13748523966,63.67954326361428,"Modified Decay, Turnover and Spinup parameters" +2016,Soil Carbon,Cool temperate wet forest,11883140.295434184,184465.87289243183,64.41918013942686,"Modified Decay, Turnover and Spinup parameters" +2016,Soil Carbon,Polar rain tundra,27878403.713185146,414548.8500850433,67.24998442877356,"Modified Decay, Turnover and Spinup parameters" +2016,Total Biomass,Boreal wet forest,131157552.78895402,5190377.072927468,25.26936886205432,"Modified Decay, Turnover and Spinup parameters" +2016,Total Biomass,Cool temperate moist forest,169108989.89069724,6692252.221012421,25.269368862059117,"Modified Decay, Turnover and Spinup parameters" +2016,Total Biomass,Cool temperate steppe,1052599.0341143094,41655.13748523966,25.26936886205918,"Modified Decay, Turnover and Spinup parameters" +2016,Total Biomass,Cool temperate wet forest,4661336.184580545,184465.87289243183,25.269368862058972,"Modified Decay, Turnover and Spinup parameters" +2016,Total Biomass,Polar rain tundra,10475387.804141406,414548.8500850433,25.269368862059117,"Modified Decay, Turnover and Spinup parameters" +2017,Deadwood,Boreal wet forest,294145354.77780426,5190377.072927468,56.67128816363641,"Modified Decay, Turnover and Spinup parameters" +2017,Deadwood,Cool temperate moist forest,368300635.9706178,6692252.221012421,55.03388452907119,"Modified Decay, Turnover and Spinup parameters" +2017,Deadwood,Cool temperate steppe,2247083.6442177375,41655.13748523966,53.94493404358545,"Modified Decay, Turnover and Spinup parameters" +2017,Deadwood,Cool temperate wet forest,10100034.365193114,184465.87289243183,54.752861365759394,"Modified Decay, Turnover and Spinup parameters" +2017,Deadwood,Polar rain tundra,24353090.912518874,414548.8500850433,58.74601004808702,"Modified Decay, Turnover and Spinup parameters" +2017,Litter,Boreal wet forest,95573061.3008932,5190377.072927468,18.413510224410004,"Modified Decay, Turnover and Spinup parameters" +2017,Litter,Cool temperate moist forest,117331289.89852813,6692252.221012421,17.532407031840464,"Modified Decay, Turnover and Spinup parameters" +2017,Litter,Cool temperate steppe,704734.0779519076,41655.13748523966,16.91829917021946,"Modified Decay, Turnover and Spinup parameters" +2017,Litter,Cool temperate wet forest,3208990.098384328,184465.87289243183,17.396118035641187,"Modified Decay, Turnover and Spinup parameters" +2017,Litter,Polar rain tundra,8075884.993062329,414548.8500850433,19.48114194842318,"Modified Decay, Turnover and Spinup parameters" +2017,Soil Carbon,Boreal wet forest,341577909.5967233,5190377.072927468,65.80984479496922,"Modified Decay, Turnover and Spinup parameters" +2017,Soil Carbon,Cool temperate moist forest,432161289.0091164,6692252.221012421,64.5763600559182,"Modified Decay, Turnover and Spinup parameters" +2017,Soil Carbon,Cool temperate steppe,2652098.105245537,41655.13748523966,63.6679714761546,"Modified Decay, Turnover and Spinup parameters" +2017,Soil Carbon,Cool temperate wet forest,11880815.298952516,184465.87289243183,64.40657620111995,"Modified Decay, Turnover and Spinup parameters" +2017,Soil Carbon,Polar rain tundra,27868676.91060286,414548.8500850433,67.22652084280465,"Modified Decay, Turnover and Spinup parameters" +2017,Total Biomass,Boreal wet forest,140640362.2105792,5190377.072927468,27.096367033552617,"Modified Decay, Turnover and Spinup parameters" +2017,Total Biomass,Cool temperate moist forest,181335722.46167883,6692252.221012421,27.096367033555396,"Modified Decay, Turnover and Spinup parameters" +2017,Total Biomass,Cool temperate steppe,1128702.8941332202,41655.13748523966,27.096367033554305,"Modified Decay, Turnover and Spinup parameters" +2017,Total Biomass,Cool temperate wet forest,4998354.997058297,184465.87289243183,27.09636703355424,"Modified Decay, Turnover and Spinup parameters" +2017,Total Biomass,Polar rain tundra,11232767.795242183,414548.8500850433,27.096367033554234,"Modified Decay, Turnover and Spinup parameters" +2018,Deadwood,Boreal wet forest,285445255.58050144,5190377.072927468,54.995090254493796,"Modified Decay, Turnover and Spinup parameters" +2018,Deadwood,Cool temperate moist forest,356821629.9508345,6692252.221012421,53.318616538462386,"Modified Decay, Turnover and Spinup parameters" +2018,Deadwood,Cool temperate steppe,2174496.436994886,41655.13748523966,52.202358899077225,"Modified Decay, Turnover and Spinup parameters" +2018,Deadwood,Cool temperate wet forest,9782515.635913271,184465.87289243183,53.031574255568565,"Modified Decay, Turnover and Spinup parameters" +2018,Deadwood,Polar rain tundra,23677802.685689192,414548.8500850433,57.11703863327994,"Modified Decay, Turnover and Spinup parameters" +2018,Litter,Boreal wet forest,96990513.66908383,5190377.072927468,18.68660259289782,"Modified Decay, Turnover and Spinup parameters" +2018,Litter,Cool temperate moist forest,118893924.28291675,6692252.221012421,17.765906059190666,"Modified Decay, Turnover and Spinup parameters" +2018,Litter,Cool temperate steppe,713434.3122716469,41655.13748523966,17.12716258647447,"Modified Decay, Turnover and Spinup parameters" +2018,Litter,Cool temperate wet forest,3250718.1536232885,184465.87289243183,17.622328198988278,"Modified Decay, Turnover and Spinup parameters" +2018,Litter,Polar rain tundra,8210906.46718579,414548.8500850433,19.806848976909116,"Modified Decay, Turnover and Spinup parameters" +2018,Soil Carbon,Boreal wet forest,341496231.07678926,5190377.072927468,65.79410826585266,"Modified Decay, Turnover and Spinup parameters" +2018,Soil Carbon,Cool temperate moist forest,432070620.26719964,6692252.221012421,64.5628117408036,"Modified Decay, Turnover and Spinup parameters" +2018,Soil Carbon,Cool temperate steppe,2651569.8302458357,41655.13748523966,63.65528936701768,"Modified Decay, Turnover and Spinup parameters" +2018,Soil Carbon,Cool temperate wet forest,11878431.561367406,184465.87289243183,64.39365382394668,"Modified Decay, Turnover and Spinup parameters" +2018,Soil Carbon,Polar rain tundra,27860607.459573586,414548.8500850433,67.20705522125577,"Modified Decay, Turnover and Spinup parameters" +2018,Total Biomass,Boreal wet forest,149317241.66409552,5190377.072927468,28.768091328647504,"Modified Decay, Turnover and Spinup parameters" +2018,Total Biomass,Cool temperate moist forest,192523323.0884437,6692252.221012421,28.768091328649636,"Modified Decay, Turnover and Spinup parameters" +2018,Total Biomass,Cool temperate steppe,1198338.7994829037,41655.13748523966,28.76809132865137,"Modified Decay, Turnover and Spinup parameters" +2018,Total Biomass,Cool temperate wet forest,5306731.078388882,184465.87289243183,28.768091328651412,"Modified Decay, Turnover and Spinup parameters" +2018,Total Biomass,Polar rain tundra,11925779.179433879,414548.8500850433,28.768091328651245,"Modified Decay, Turnover and Spinup parameters" +2019,Deadwood,Boreal wet forest,277350636.5816548,5190377.072927468,53.435546721314395,"Modified Decay, Turnover and Spinup parameters" +2019,Deadwood,Cool temperate moist forest,346158461.57930696,6692252.221012421,51.72525633335129,"Modified Decay, Turnover and Spinup parameters" +2019,Deadwood,Cool temperate steppe,2107147.37113121,41655.13748523966,50.58553394231071,"Modified Decay, Turnover and Spinup parameters" +2019,Deadwood,Cool temperate wet forest,9487620.303271323,184465.87289243183,51.432929866674414,"Modified Decay, Turnover and Spinup parameters" +2019,Deadwood,Polar rain tundra,23048356.087498546,414548.8500850433,55.59864918879947,"Modified Decay, Turnover and Spinup parameters" +2019,Litter,Boreal wet forest,98276443.16948882,5190377.072927468,18.934355209391192,"Modified Decay, Turnover and Spinup parameters" +2019,Litter,Cool temperate moist forest,120316353.38124953,6692252.221012421,17.978454697729216,"Modified Decay, Turnover and Spinup parameters" +2019,Litter,Cool temperate steppe,721404.0351388176,41655.13748523966,17.31848887533847,"Modified Decay, Turnover and Spinup parameters" +2019,Litter,Cool temperate wet forest,3288675.7262597876,184465.87289243183,17.82809836146507,"Modified Decay, Turnover and Spinup parameters" +2019,Litter,Polar rain tundra,8333470.315611533,414548.8500850433,20.102504961482705,"Modified Decay, Turnover and Spinup parameters" +2019,Soil Carbon,Boreal wet forest,341413117.9563548,5190377.072927468,65.77809534053593,"Modified Decay, Turnover and Spinup parameters" +2019,Soil Carbon,Cool temperate moist forest,431970318.94175494,6692252.221012421,64.54782406219671,"Modified Decay, Turnover and Spinup parameters" +2019,Soil Carbon,Cool temperate steppe,2650953.651638804,41655.13748523966,63.64049698739223,"Modified Decay, Turnover and Spinup parameters" +2019,Soil Carbon,Cool temperate wet forest,11875739.676426975,184465.87289243183,64.37906096241505,"Modified Decay, Turnover and Spinup parameters" +2019,Soil Carbon,Polar rain tundra,27853097.417467084,414548.8500850433,67.18893904000244,"Modified Decay, Turnover and Spinup parameters" +2019,Total Biomass,Boreal wet forest,157304385.6883193,5190377.072927468,30.306928278641752,"Modified Decay, Turnover and Spinup parameters" +2019,Total Biomass,Cool temperate moist forest,202821608.08483723,6692252.221012421,30.306928278646655,"Modified Decay, Turnover and Spinup parameters" +2019,Total Biomass,Cool temperate steppe,1262439.2642022474,41655.13748523966,30.30692827864481,"Modified Decay, Turnover and Spinup parameters" +2019,Total Biomass,Cool temperate wet forest,5590593.979608547,184465.87289243183,30.30692827864484,"Modified Decay, Turnover and Spinup parameters" +2019,Total Biomass,Polar rain tundra,12563702.267522058,414548.8500850433,30.30692827864474,"Modified Decay, Turnover and Spinup parameters" +2020,Deadwood,Boreal wet forest,269785506.74565876,5190377.072927468,51.97801680976807,"Modified Decay, Turnover and Spinup parameters" +2020,Deadwood,Cool temperate moist forest,336206248.108622,6692252.221012421,50.23813164916248,"Modified Decay, Turnover and Spinup parameters" +2020,Deadwood,Cool temperate steppe,2044350.3638736503,41655.13748523966,49.07798862980726,"Modified Decay, Turnover and Spinup parameters" +2020,Deadwood,Cool temperate wet forest,9212433.727539893,184465.87289243183,49.941127771162144,"Modified Decay, Turnover and Spinup parameters" +2020,Deadwood,Polar rain tundra,22459148.45573633,414548.8500850433,54.1773266314185,"Modified Decay, Turnover and Spinup parameters" +2020,Litter,Boreal wet forest,99458694.00687042,5190377.072927468,19.162132656148984,"Modified Decay, Turnover and Spinup parameters" +2020,Litter,Cool temperate moist forest,121633060.64857702,6692252.221012421,18.17520569034621,"Modified Decay, Turnover and Spinup parameters" +2020,Litter,Cool temperate steppe,728846.6283469753,41655.13748523966,17.497160550850165,"Modified Decay, Turnover and Spinup parameters" +2020,Litter,Cool temperate wet forest,3323815.783761928,184465.87289243183,18.01859461397586,"Modified Decay, Turnover and Spinup parameters" +2020,Litter,Polar rain tundra,8445828.147521222,414548.8500850433,20.37354137103164,"Modified Decay, Turnover and Spinup parameters" +2020,Soil Carbon,Boreal wet forest,341323521.083901,5190377.072927468,65.76083322813157,"Modified Decay, Turnover and Spinup parameters" +2020,Soil Carbon,Cool temperate moist forest,431856720.2684143,6692252.221012421,64.53084940708973,"Modified Decay, Turnover and Spinup parameters" +2020,Soil Carbon,Cool temperate steppe,2650239.0249903053,41655.13748523966,63.62334120081604,"Modified Decay, Turnover and Spinup parameters" +2020,Soil Carbon,Cool temperate wet forest,11872650.102428604,184465.87289243183,64.36231220585685,"Modified Decay, Turnover and Spinup parameters" +2020,Soil Carbon,Polar rain tundra,27845531.60468171,414548.8500850433,67.17068832531871,"Modified Decay, Turnover and Spinup parameters" +2020,Total Biomass,Boreal wet forest,164692741.07181147,5190377.072927468,31.73040007648649,"Modified Decay, Turnover and Spinup parameters" +2020,Total Biomass,Cool temperate moist forest,212347840.38550502,6692252.221012421,31.73040007649032,"Modified Decay, Turnover and Spinup parameters" +2020,Total Biomass,Cool temperate steppe,1321734.1776478288,41655.13748523966,31.73040007648949,"Modified Decay, Turnover and Spinup parameters" +2020,Total Biomass,Cool temperate wet forest,5853175.947335783,184465.87289243183,31.730400076489836,"Modified Decay, Turnover and Spinup parameters" +2020,Total Biomass,Polar rain tundra,13153800.864447102,414548.8500850433,31.730400076489524,"Modified Decay, Turnover and Spinup parameters" diff --git a/Postprocessing/create_metrics.py b/Postprocessing/create_metrics.py new file mode 100644 index 00000000..565f0da9 --- /dev/null +++ b/Postprocessing/create_metrics.py @@ -0,0 +1,29 @@ +#Necessary imports +import pandas as pd +import os + +#Read full csv with DOM sensitivity from year 2010-2020 +df = pd.read_csv(os.path.join("Tables", "Pools_DOM_Sensitivity_full.csv")) + +#DataFrame for the metrics json +#Statistical measures used - Mean and standard deviation +result = pd.DataFrame() +result['pool_tc_per_ha_mean'] = df.groupby(["LifeZone", "indicator"])['pool_tc_per_ha'].mean() +result['pool_tc_per_ha_std'] = df.groupby(["LifeZone", "indicator"])['pool_tc_per_ha'].std() +result['pool_tc_sum_mean'] = df.groupby(["LifeZone", "indicator"])['pool_tc_sum'].mean() +result['area_sum_mean'] = df.groupby(["LifeZone", "indicator"])['area_sum'].mean() + +result = result.round(4) + +#Necessary formatting +#Remove 'forest' for shorter names + +#For a dataframe, replace does full replacement searches, unless you turn on the regex switch +#Use regex=True for partial replacements +#For a Series, that is not required +result.reset_index(inplace=True) +result.replace({' forest': '', ' ': '_'}, inplace=True, regex=True) + +#Save metrics to json files for dvc +for i in result.index: + result.loc[i][2:].to_json(os.path.join("Metrics", f"{result.LifeZone[i]}-{result.indicator[i]}.json")) \ No newline at end of file diff --git a/Postprocessing/renv.lock b/Postprocessing/renv.lock new file mode 100644 index 00000000..0a18c17e --- /dev/null +++ b/Postprocessing/renv.lock @@ -0,0 +1,610 @@ +{ + "R": { + "Version": "4.1.2", + "Repositories": [ + { + "Name": "CRAN", + "URL": "https://cran.rstudio.com" + } + ] + }, + "Packages": { + "DBI": { + "Package": "DBI", + "Version": "1.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "030aaec5bc6553f35347cbb1e70b1a17", + "Requirements": [] + }, + "MASS": { + "Package": "MASS", + "Version": "7.3-54", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "0e59129db205112e3963904db67fd0dc", + "Requirements": [] + }, + "Matrix": { + "Package": "Matrix", + "Version": "1.3-4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "4ed05e9c9726267e4a5872e09c04587c", + "Requirements": [ + "lattice" + ] + }, + "R6": { + "Package": "R6", + "Version": "2.5.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "470851b6d5d0ac559e9d01bb352b4021", + "Requirements": [] + }, + "RColorBrewer": { + "Package": "RColorBrewer", + "Version": "1.1-2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "e031418365a7f7a766181ab5a41a5716", + "Requirements": [] + }, + "RSQLite": { + "Package": "RSQLite", + "Version": "2.2.8", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "1eab1dd4df2b76758fd8acab09a0e9b6", + "Requirements": [ + "DBI", + "Rcpp", + "bit64", + "blob", + "memoise", + "pkgconfig", + "plogr" + ] + }, + "Rcpp": { + "Package": "Rcpp", + "Version": "1.0.7", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "dab19adae4440ae55aa8a9d238b246bb", + "Requirements": [] + }, + "bit": { + "Package": "bit", + "Version": "4.0.4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "f36715f14d94678eea9933af927bc15d", + "Requirements": [] + }, + "bit64": { + "Package": "bit64", + "Version": "4.0.5", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "9fe98599ca456d6552421db0d6772d8f", + "Requirements": [ + "bit" + ] + }, + "blob": { + "Package": "blob", + "Version": "1.2.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "dc5f7a6598bb025d20d66bb758f12879", + "Requirements": [ + "rlang", + "vctrs" + ] + }, + "cachem": { + "Package": "cachem", + "Version": "1.0.6", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "648c5b3d71e6a37e3043617489a0a0e9", + "Requirements": [ + "fastmap", + "rlang" + ] + }, + "cli": { + "Package": "cli", + "Version": "3.1.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "66a3834e54593c89d8beefb312347e58", + "Requirements": [ + "glue" + ] + }, + "clipr": { + "Package": "clipr", + "Version": "0.7.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "ebaa97ac99cc2daf04e77eecc7b781d7", + "Requirements": [] + }, + "colorspace": { + "Package": "colorspace", + "Version": "2.0-2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "6baccb763ee83c0bd313460fdb8b8a84", + "Requirements": [] + }, + "cpp11": { + "Package": "cpp11", + "Version": "0.4.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "fa53ce256cd280f468c080a58ea5ba8c", + "Requirements": [] + }, + "crayon": { + "Package": "crayon", + "Version": "1.4.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "0a6a65d92bd45b47b94b84244b528d17", + "Requirements": [] + }, + "digest": { + "Package": "digest", + "Version": "0.6.29", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "cf6b206a045a684728c3267ef7596190", + "Requirements": [] + }, + "dplyr": { + "Package": "dplyr", + "Version": "1.0.7", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "36f1ae62f026c8ba9f9b5c9a08c03297", + "Requirements": [ + "R6", + "ellipsis", + "generics", + "glue", + "lifecycle", + "magrittr", + "pillar", + "rlang", + "tibble", + "tidyselect", + "vctrs" + ] + }, + "ellipsis": { + "Package": "ellipsis", + "Version": "0.3.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "bb0eec2fe32e88d9e2836c2f73ea2077", + "Requirements": [ + "rlang" + ] + }, + "fansi": { + "Package": "fansi", + "Version": "0.5.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "d447b40982c576a72b779f0a3b3da227", + "Requirements": [] + }, + "farver": { + "Package": "farver", + "Version": "2.1.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "c98eb5133d9cb9e1622b8691487f11bb", + "Requirements": [] + }, + "fastmap": { + "Package": "fastmap", + "Version": "1.1.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "77bd60a6157420d4ffa93b27cf6a58b8", + "Requirements": [] + }, + "generics": { + "Package": "generics", + "Version": "0.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "3f6bcfb0ee5d671d9fd1893d2faa79cb", + "Requirements": [] + }, + "ggplot2": { + "Package": "ggplot2", + "Version": "3.3.5", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "d7566c471c7b17e095dd023b9ef155ad", + "Requirements": [ + "MASS", + "digest", + "glue", + "gtable", + "isoband", + "mgcv", + "rlang", + "scales", + "tibble", + "withr" + ] + }, + "glue": { + "Package": "glue", + "Version": "1.5.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "e01bc1fe0c20954ec97eac86640abc70", + "Requirements": [] + }, + "gtable": { + "Package": "gtable", + "Version": "0.3.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "ac5c6baf7822ce8732b343f14c072c4d", + "Requirements": [] + }, + "hms": { + "Package": "hms", + "Version": "1.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "5b8a2dd0fdbe2ab4f6081e6c7be6dfca", + "Requirements": [ + "ellipsis", + "lifecycle", + "pkgconfig", + "rlang", + "vctrs" + ] + }, + "isoband": { + "Package": "isoband", + "Version": "0.2.5", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "7ab57a6de7f48a8dc84910d1eca42883", + "Requirements": [] + }, + "labeling": { + "Package": "labeling", + "Version": "0.4.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "3d5108641f47470611a32d0bdf357a72", + "Requirements": [] + }, + "lattice": { + "Package": "lattice", + "Version": "0.20-45", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "b64cdbb2b340437c4ee047a1f4c4377b", + "Requirements": [] + }, + "lifecycle": { + "Package": "lifecycle", + "Version": "1.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "a6b6d352e3ed897373ab19d8395c98d0", + "Requirements": [ + "glue", + "rlang" + ] + }, + "magrittr": { + "Package": "magrittr", + "Version": "2.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "41287f1ac7d28a92f0a286ed507928d3", + "Requirements": [] + }, + "memoise": { + "Package": "memoise", + "Version": "2.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "e2817ccf4a065c5d9d7f2cfbe7c1d78c", + "Requirements": [ + "cachem", + "rlang" + ] + }, + "mgcv": { + "Package": "mgcv", + "Version": "1.8-38", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "be3c61ffbb1e3d3b3df214d192ac5444", + "Requirements": [ + "Matrix", + "nlme" + ] + }, + "munsell": { + "Package": "munsell", + "Version": "0.5.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "6dfe8bf774944bd5595785e3229d8771", + "Requirements": [ + "colorspace" + ] + }, + "nlme": { + "Package": "nlme", + "Version": "3.1-153", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "2d632e0d963a653a0329756ce701ecdd", + "Requirements": [ + "lattice" + ] + }, + "pillar": { + "Package": "pillar", + "Version": "1.6.4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "60200b6aa32314ac457d3efbb5ccbd98", + "Requirements": [ + "cli", + "crayon", + "ellipsis", + "fansi", + "lifecycle", + "rlang", + "utf8", + "vctrs" + ] + }, + "pkgconfig": { + "Package": "pkgconfig", + "Version": "2.0.3", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "01f28d4278f15c76cddbea05899c5d6f", + "Requirements": [] + }, + "plogr": { + "Package": "plogr", + "Version": "0.2.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "09eb987710984fc2905c7129c7d85e65", + "Requirements": [] + }, + "prettyunits": { + "Package": "prettyunits", + "Version": "1.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "95ef9167b75dde9d2ccc3c7528393e7e", + "Requirements": [] + }, + "progress": { + "Package": "progress", + "Version": "1.2.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "14dc9f7a3c91ebb14ec5bb9208a07061", + "Requirements": [ + "R6", + "crayon", + "hms", + "prettyunits" + ] + }, + "purrr": { + "Package": "purrr", + "Version": "0.3.4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "97def703420c8ab10d8f0e6c72101e02", + "Requirements": [ + "magrittr", + "rlang" + ] + }, + "readr": { + "Package": "readr", + "Version": "2.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "e9df4b445fca203653f04ece2f97d51e", + "Requirements": [ + "R6", + "cli", + "clipr", + "cpp11", + "crayon", + "hms", + "lifecycle", + "rlang", + "tibble", + "tzdb", + "vroom" + ] + }, + "renv": { + "Package": "renv", + "Version": "0.15.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "206c4ef8b7ad6fb1060d69aa7b9dfe69", + "Requirements": [] + }, + "rlang": { + "Package": "rlang", + "Version": "0.4.12", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "0879f5388fe6e4d56d7ef0b7ccb031e5", + "Requirements": [] + }, + "scales": { + "Package": "scales", + "Version": "1.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "6f76f71042411426ec8df6c54f34e6dd", + "Requirements": [ + "R6", + "RColorBrewer", + "farver", + "labeling", + "lifecycle", + "munsell", + "viridisLite" + ] + }, + "tibble": { + "Package": "tibble", + "Version": "3.1.6", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "8a8f02d1934dfd6431c671361510dd0b", + "Requirements": [ + "ellipsis", + "fansi", + "lifecycle", + "magrittr", + "pillar", + "pkgconfig", + "rlang", + "vctrs" + ] + }, + "tidyr": { + "Package": "tidyr", + "Version": "1.1.4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "c8fbdbd9fcac223d6c6fe8e406f368e1", + "Requirements": [ + "cpp11", + "dplyr", + "ellipsis", + "glue", + "lifecycle", + "magrittr", + "purrr", + "rlang", + "tibble", + "tidyselect", + "vctrs" + ] + }, + "tidyselect": { + "Package": "tidyselect", + "Version": "1.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "7243004a708d06d4716717fa1ff5b2fe", + "Requirements": [ + "ellipsis", + "glue", + "purrr", + "rlang", + "vctrs" + ] + }, + "tzdb": { + "Package": "tzdb", + "Version": "0.2.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "5e069fb033daf2317bd628d3100b75c5", + "Requirements": [ + "cpp11" + ] + }, + "utf8": { + "Package": "utf8", + "Version": "1.2.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "c9c462b759a5cc844ae25b5942654d13", + "Requirements": [] + }, + "vctrs": { + "Package": "vctrs", + "Version": "0.3.8", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "ecf749a1b39ea72bd9b51b76292261f1", + "Requirements": [ + "ellipsis", + "glue", + "rlang" + ] + }, + "viridisLite": { + "Package": "viridisLite", + "Version": "0.4.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "55e157e2aa88161bdb0754218470d204", + "Requirements": [] + }, + "vroom": { + "Package": "vroom", + "Version": "1.5.7", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "976507b5a105bc3bdf6a5a5f29e0684f", + "Requirements": [ + "bit64", + "cli", + "cpp11", + "crayon", + "glue", + "hms", + "lifecycle", + "progress", + "rlang", + "tibble", + "tidyselect", + "tzdb", + "vctrs", + "withr" + ] + }, + "withr": { + "Package": "withr", + "Version": "2.4.3", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "a376b424c4817cda4920bbbeb3364e85", + "Requirements": [] + }, + "writexl": { + "Package": "writexl", + "Version": "1.4.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "edd181b6e10c87497db16d1f8c0d4ed5", + "Requirements": [] + } + } +} diff --git a/Postprocessing/renv/.gitignore b/Postprocessing/renv/.gitignore new file mode 100644 index 00000000..275e4ca3 --- /dev/null +++ b/Postprocessing/renv/.gitignore @@ -0,0 +1,6 @@ +library/ +local/ +cellar/ +lock/ +python/ +staging/ diff --git a/Postprocessing/renv/activate.R b/Postprocessing/renv/activate.R new file mode 100644 index 00000000..33833eef --- /dev/null +++ b/Postprocessing/renv/activate.R @@ -0,0 +1,902 @@ + +local({ + + # the requested version of renv + version <- "0.15.2" + + # the project directory + project <- getwd() + + # figure out whether the autoloader is enabled + enabled <- local({ + + # first, check config option + override <- getOption("renv.config.autoloader.enabled") + if (!is.null(override)) + return(override) + + # next, check environment variables + # TODO: prefer using the configuration one in the future + envvars <- c( + "RENV_CONFIG_AUTOLOADER_ENABLED", + "RENV_AUTOLOADER_ENABLED", + "RENV_ACTIVATE_PROJECT" + ) + + for (envvar in envvars) { + envval <- Sys.getenv(envvar, unset = NA) + if (!is.na(envval)) + return(tolower(envval) %in% c("true", "t", "1")) + } + + # enable by default + TRUE + + }) + + if (!enabled) + return(FALSE) + + # avoid recursion + if (identical(getOption("renv.autoloader.running"), TRUE)) { + warning("ignoring recursive attempt to run renv autoloader") + return(invisible(TRUE)) + } + + # signal that we're loading renv during R startup + options(renv.autoloader.running = TRUE) + on.exit(options(renv.autoloader.running = NULL), add = TRUE) + + # signal that we've consented to use renv + options(renv.consent = TRUE) + + # load the 'utils' package eagerly -- this ensures that renv shims, which + # mask 'utils' packages, will come first on the search path + library(utils, lib.loc = .Library) + + # check to see if renv has already been loaded + if ("renv" %in% loadedNamespaces()) { + + # if renv has already been loaded, and it's the requested version of renv, + # nothing to do + spec <- .getNamespaceInfo(.getNamespace("renv"), "spec") + if (identical(spec[["version"]], version)) + return(invisible(TRUE)) + + # otherwise, unload and attempt to load the correct version of renv + unloadNamespace("renv") + + } + + # load bootstrap tools + `%||%` <- function(x, y) { + if (is.environment(x) || length(x)) x else y + } + + bootstrap <- function(version, library) { + + # attempt to download renv + tarball <- tryCatch(renv_bootstrap_download(version), error = identity) + if (inherits(tarball, "error")) + stop("failed to download renv ", version) + + # now attempt to install + status <- tryCatch(renv_bootstrap_install(version, tarball, library), error = identity) + if (inherits(status, "error")) + stop("failed to install renv ", version) + + } + + renv_bootstrap_tests_running <- function() { + getOption("renv.tests.running", default = FALSE) + } + + renv_bootstrap_repos <- function() { + + # check for repos override + repos <- Sys.getenv("RENV_CONFIG_REPOS_OVERRIDE", unset = NA) + if (!is.na(repos)) + return(repos) + + # check for lockfile repositories + repos <- tryCatch(renv_bootstrap_repos_lockfile(), error = identity) + if (!inherits(repos, "error") && length(repos)) + return(repos) + + # if we're testing, re-use the test repositories + if (renv_bootstrap_tests_running()) + return(getOption("renv.tests.repos")) + + # retrieve current repos + repos <- getOption("repos") + + # ensure @CRAN@ entries are resolved + repos[repos == "@CRAN@"] <- getOption( + "renv.repos.cran", + "https://cloud.r-project.org" + ) + + # add in renv.bootstrap.repos if set + default <- c(FALLBACK = "https://cloud.r-project.org") + extra <- getOption("renv.bootstrap.repos", default = default) + repos <- c(repos, extra) + + # remove duplicates that might've snuck in + dupes <- duplicated(repos) | duplicated(names(repos)) + repos[!dupes] + + } + + renv_bootstrap_repos_lockfile <- function() { + + lockpath <- Sys.getenv("RENV_PATHS_LOCKFILE", unset = "renv.lock") + if (!file.exists(lockpath)) + return(NULL) + + lockfile <- tryCatch(renv_json_read(lockpath), error = identity) + if (inherits(lockfile, "error")) { + warning(lockfile) + return(NULL) + } + + repos <- lockfile$R$Repositories + if (length(repos) == 0) + return(NULL) + + keys <- vapply(repos, `[[`, "Name", FUN.VALUE = character(1)) + vals <- vapply(repos, `[[`, "URL", FUN.VALUE = character(1)) + names(vals) <- keys + + return(vals) + + } + + renv_bootstrap_download <- function(version) { + + # if the renv version number has 4 components, assume it must + # be retrieved via github + nv <- numeric_version(version) + components <- unclass(nv)[[1]] + + methods <- if (length(components) == 4L) { + list( + renv_bootstrap_download_github + ) + } else { + list( + renv_bootstrap_download_cran_latest, + renv_bootstrap_download_cran_archive + ) + } + + for (method in methods) { + path <- tryCatch(method(version), error = identity) + if (is.character(path) && file.exists(path)) + return(path) + } + + stop("failed to download renv ", version) + + } + + renv_bootstrap_download_impl <- function(url, destfile) { + + mode <- "wb" + + # https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17715 + fixup <- + Sys.info()[["sysname"]] == "Windows" && + substring(url, 1L, 5L) == "file:" + + if (fixup) + mode <- "w+b" + + utils::download.file( + url = url, + destfile = destfile, + mode = mode, + quiet = TRUE + ) + + } + + renv_bootstrap_download_cran_latest <- function(version) { + + spec <- renv_bootstrap_download_cran_latest_find(version) + + message("* Downloading renv ", version, " ... ", appendLF = FALSE) + + type <- spec$type + repos <- spec$repos + + info <- tryCatch( + utils::download.packages( + pkgs = "renv", + destdir = tempdir(), + repos = repos, + type = type, + quiet = TRUE + ), + condition = identity + ) + + if (inherits(info, "condition")) { + message("FAILED") + return(FALSE) + } + + # report success and return + message("OK (downloaded ", type, ")") + info[1, 2] + + } + + renv_bootstrap_download_cran_latest_find <- function(version) { + + # check whether binaries are supported on this system + binary <- + getOption("renv.bootstrap.binary", default = TRUE) && + !identical(.Platform$pkgType, "source") && + !identical(getOption("pkgType"), "source") && + Sys.info()[["sysname"]] %in% c("Darwin", "Windows") + + types <- c(if (binary) "binary", "source") + + # iterate over types + repositories + for (type in types) { + for (repos in renv_bootstrap_repos()) { + + # retrieve package database + db <- tryCatch( + as.data.frame( + utils::available.packages(type = type, repos = repos), + stringsAsFactors = FALSE + ), + error = identity + ) + + if (inherits(db, "error")) + next + + # check for compatible entry + entry <- db[db$Package %in% "renv" & db$Version %in% version, ] + if (nrow(entry) == 0) + next + + # found it; return spec to caller + spec <- list(entry = entry, type = type, repos = repos) + return(spec) + + } + } + + # if we got here, we failed to find renv + fmt <- "renv %s is not available from your declared package repositories" + stop(sprintf(fmt, version)) + + } + + renv_bootstrap_download_cran_archive <- function(version) { + + name <- sprintf("renv_%s.tar.gz", version) + repos <- renv_bootstrap_repos() + urls <- file.path(repos, "src/contrib/Archive/renv", name) + destfile <- file.path(tempdir(), name) + + message("* Downloading renv ", version, " ... ", appendLF = FALSE) + + for (url in urls) { + + status <- tryCatch( + renv_bootstrap_download_impl(url, destfile), + condition = identity + ) + + if (identical(status, 0L)) { + message("OK") + return(destfile) + } + + } + + message("FAILED") + return(FALSE) + + } + + renv_bootstrap_download_github <- function(version) { + + enabled <- Sys.getenv("RENV_BOOTSTRAP_FROM_GITHUB", unset = "TRUE") + if (!identical(enabled, "TRUE")) + return(FALSE) + + # prepare download options + pat <- Sys.getenv("GITHUB_PAT") + if (nzchar(Sys.which("curl")) && nzchar(pat)) { + fmt <- "--location --fail --header \"Authorization: token %s\"" + extra <- sprintf(fmt, pat) + saved <- options("download.file.method", "download.file.extra") + options(download.file.method = "curl", download.file.extra = extra) + on.exit(do.call(base::options, saved), add = TRUE) + } else if (nzchar(Sys.which("wget")) && nzchar(pat)) { + fmt <- "--header=\"Authorization: token %s\"" + extra <- sprintf(fmt, pat) + saved <- options("download.file.method", "download.file.extra") + options(download.file.method = "wget", download.file.extra = extra) + on.exit(do.call(base::options, saved), add = TRUE) + } + + message("* Downloading renv ", version, " from GitHub ... ", appendLF = FALSE) + + url <- file.path("https://api.github.com/repos/rstudio/renv/tarball", version) + name <- sprintf("renv_%s.tar.gz", version) + destfile <- file.path(tempdir(), name) + + status <- tryCatch( + renv_bootstrap_download_impl(url, destfile), + condition = identity + ) + + if (!identical(status, 0L)) { + message("FAILED") + return(FALSE) + } + + message("OK") + return(destfile) + + } + + renv_bootstrap_install <- function(version, tarball, library) { + + # attempt to install it into project library + message("* Installing renv ", version, " ... ", appendLF = FALSE) + dir.create(library, showWarnings = FALSE, recursive = TRUE) + + # invoke using system2 so we can capture and report output + bin <- R.home("bin") + exe <- if (Sys.info()[["sysname"]] == "Windows") "R.exe" else "R" + r <- file.path(bin, exe) + args <- c("--vanilla", "CMD", "INSTALL", "--no-multiarch", "-l", shQuote(library), shQuote(tarball)) + output <- system2(r, args, stdout = TRUE, stderr = TRUE) + message("Done!") + + # check for successful install + status <- attr(output, "status") + if (is.numeric(status) && !identical(status, 0L)) { + header <- "Error installing renv:" + lines <- paste(rep.int("=", nchar(header)), collapse = "") + text <- c(header, lines, output) + writeLines(text, con = stderr()) + } + + status + + } + + renv_bootstrap_platform_prefix <- function() { + + # construct version prefix + version <- paste(R.version$major, R.version$minor, sep = ".") + prefix <- paste("R", numeric_version(version)[1, 1:2], sep = "-") + + # include SVN revision for development versions of R + # (to avoid sharing platform-specific artefacts with released versions of R) + devel <- + identical(R.version[["status"]], "Under development (unstable)") || + identical(R.version[["nickname"]], "Unsuffered Consequences") + + if (devel) + prefix <- paste(prefix, R.version[["svn rev"]], sep = "-r") + + # build list of path components + components <- c(prefix, R.version$platform) + + # include prefix if provided by user + prefix <- renv_bootstrap_platform_prefix_impl() + if (!is.na(prefix) && nzchar(prefix)) + components <- c(prefix, components) + + # build prefix + paste(components, collapse = "/") + + } + + renv_bootstrap_platform_prefix_impl <- function() { + + # if an explicit prefix has been supplied, use it + prefix <- Sys.getenv("RENV_PATHS_PREFIX", unset = NA) + if (!is.na(prefix)) + return(prefix) + + # if the user has requested an automatic prefix, generate it + auto <- Sys.getenv("RENV_PATHS_PREFIX_AUTO", unset = NA) + if (auto %in% c("TRUE", "True", "true", "1")) + return(renv_bootstrap_platform_prefix_auto()) + + # empty string on failure + "" + + } + + renv_bootstrap_platform_prefix_auto <- function() { + + prefix <- tryCatch(renv_bootstrap_platform_os(), error = identity) + if (inherits(prefix, "error") || prefix %in% "unknown") { + + msg <- paste( + "failed to infer current operating system", + "please file a bug report at https://github.com/rstudio/renv/issues", + sep = "; " + ) + + warning(msg) + + } + + prefix + + } + + renv_bootstrap_platform_os <- function() { + + sysinfo <- Sys.info() + sysname <- sysinfo[["sysname"]] + + # handle Windows + macOS up front + if (sysname == "Windows") + return("windows") + else if (sysname == "Darwin") + return("macos") + + # check for os-release files + for (file in c("/etc/os-release", "/usr/lib/os-release")) + if (file.exists(file)) + return(renv_bootstrap_platform_os_via_os_release(file, sysinfo)) + + # check for redhat-release files + if (file.exists("/etc/redhat-release")) + return(renv_bootstrap_platform_os_via_redhat_release()) + + "unknown" + + } + + renv_bootstrap_platform_os_via_os_release <- function(file, sysinfo) { + + # read /etc/os-release + release <- utils::read.table( + file = file, + sep = "=", + quote = c("\"", "'"), + col.names = c("Key", "Value"), + comment.char = "#", + stringsAsFactors = FALSE + ) + + vars <- as.list(release$Value) + names(vars) <- release$Key + + # get os name + os <- tolower(sysinfo[["sysname"]]) + + # read id + id <- "unknown" + for (field in c("ID", "ID_LIKE")) { + if (field %in% names(vars) && nzchar(vars[[field]])) { + id <- vars[[field]] + break + } + } + + # read version + version <- "unknown" + for (field in c("UBUNTU_CODENAME", "VERSION_CODENAME", "VERSION_ID", "BUILD_ID")) { + if (field %in% names(vars) && nzchar(vars[[field]])) { + version <- vars[[field]] + break + } + } + + # join together + paste(c(os, id, version), collapse = "-") + + } + + renv_bootstrap_platform_os_via_redhat_release <- function() { + + # read /etc/redhat-release + contents <- readLines("/etc/redhat-release", warn = FALSE) + + # infer id + id <- if (grepl("centos", contents, ignore.case = TRUE)) + "centos" + else if (grepl("redhat", contents, ignore.case = TRUE)) + "redhat" + else + "unknown" + + # try to find a version component (very hacky) + version <- "unknown" + + parts <- strsplit(contents, "[[:space:]]")[[1L]] + for (part in parts) { + + nv <- tryCatch(numeric_version(part), error = identity) + if (inherits(nv, "error")) + next + + version <- nv[1, 1] + break + + } + + paste(c("linux", id, version), collapse = "-") + + } + + renv_bootstrap_library_root_name <- function(project) { + + # use project name as-is if requested + asis <- Sys.getenv("RENV_PATHS_LIBRARY_ROOT_ASIS", unset = "FALSE") + if (asis) + return(basename(project)) + + # otherwise, disambiguate based on project's path + id <- substring(renv_bootstrap_hash_text(project), 1L, 8L) + paste(basename(project), id, sep = "-") + + } + + renv_bootstrap_library_root <- function(project) { + + prefix <- renv_bootstrap_profile_prefix() + + path <- Sys.getenv("RENV_PATHS_LIBRARY", unset = NA) + if (!is.na(path)) + return(paste(c(path, prefix), collapse = "/")) + + path <- renv_bootstrap_library_root_impl(project) + if (!is.null(path)) { + name <- renv_bootstrap_library_root_name(project) + return(paste(c(path, prefix, name), collapse = "/")) + } + + renv_bootstrap_paths_renv("library", project = project) + + } + + renv_bootstrap_library_root_impl <- function(project) { + + root <- Sys.getenv("RENV_PATHS_LIBRARY_ROOT", unset = NA) + if (!is.na(root)) + return(root) + + type <- renv_bootstrap_project_type(project) + if (identical(type, "package")) { + userdir <- renv_bootstrap_user_dir() + return(file.path(userdir, "library")) + } + + } + + renv_bootstrap_validate_version <- function(version) { + + loadedversion <- utils::packageDescription("renv", fields = "Version") + if (version == loadedversion) + return(TRUE) + + # assume four-component versions are from GitHub; three-component + # versions are from CRAN + components <- strsplit(loadedversion, "[.-]")[[1]] + remote <- if (length(components) == 4L) + paste("rstudio/renv", loadedversion, sep = "@") + else + paste("renv", loadedversion, sep = "@") + + fmt <- paste( + "renv %1$s was loaded from project library, but this project is configured to use renv %2$s.", + "Use `renv::record(\"%3$s\")` to record renv %1$s in the lockfile.", + "Use `renv::restore(packages = \"renv\")` to install renv %2$s into the project library.", + sep = "\n" + ) + + msg <- sprintf(fmt, loadedversion, version, remote) + warning(msg, call. = FALSE) + + FALSE + + } + + renv_bootstrap_hash_text <- function(text) { + + hashfile <- tempfile("renv-hash-") + on.exit(unlink(hashfile), add = TRUE) + + writeLines(text, con = hashfile) + tools::md5sum(hashfile) + + } + + renv_bootstrap_load <- function(project, libpath, version) { + + # try to load renv from the project library + if (!requireNamespace("renv", lib.loc = libpath, quietly = TRUE)) + return(FALSE) + + # warn if the version of renv loaded does not match + renv_bootstrap_validate_version(version) + + # load the project + renv::load(project) + + TRUE + + } + + renv_bootstrap_profile_load <- function(project) { + + # if RENV_PROFILE is already set, just use that + profile <- Sys.getenv("RENV_PROFILE", unset = NA) + if (!is.na(profile) && nzchar(profile)) + return(profile) + + # check for a profile file (nothing to do if it doesn't exist) + path <- renv_bootstrap_paths_renv("profile", profile = FALSE) + if (!file.exists(path)) + return(NULL) + + # read the profile, and set it if it exists + contents <- readLines(path, warn = FALSE) + if (length(contents) == 0L) + return(NULL) + + # set RENV_PROFILE + profile <- contents[[1L]] + if (!profile %in% c("", "default")) + Sys.setenv(RENV_PROFILE = profile) + + profile + + } + + renv_bootstrap_profile_prefix <- function() { + profile <- renv_bootstrap_profile_get() + if (!is.null(profile)) + return(file.path("profiles", profile, "renv")) + } + + renv_bootstrap_profile_get <- function() { + profile <- Sys.getenv("RENV_PROFILE", unset = "") + renv_bootstrap_profile_normalize(profile) + } + + renv_bootstrap_profile_set <- function(profile) { + profile <- renv_bootstrap_profile_normalize(profile) + if (is.null(profile)) + Sys.unsetenv("RENV_PROFILE") + else + Sys.setenv(RENV_PROFILE = profile) + } + + renv_bootstrap_profile_normalize <- function(profile) { + + if (is.null(profile) || profile %in% c("", "default")) + return(NULL) + + profile + + } + + renv_bootstrap_path_absolute <- function(path) { + + substr(path, 1L, 1L) %in% c("~", "/", "\\") || ( + substr(path, 1L, 1L) %in% c(letters, LETTERS) && + substr(path, 2L, 3L) %in% c(":/", ":\\") + ) + + } + + renv_bootstrap_paths_renv <- function(..., profile = TRUE, project = NULL) { + renv <- Sys.getenv("RENV_PATHS_RENV", unset = "renv") + root <- if (renv_bootstrap_path_absolute(renv)) NULL else project + prefix <- if (profile) renv_bootstrap_profile_prefix() + components <- c(root, renv, prefix, ...) + paste(components, collapse = "/") + } + + renv_bootstrap_project_type <- function(path) { + + descpath <- file.path(path, "DESCRIPTION") + if (!file.exists(descpath)) + return("unknown") + + desc <- tryCatch( + read.dcf(descpath, all = TRUE), + error = identity + ) + + if (inherits(desc, "error")) + return("unknown") + + type <- desc$Type + if (!is.null(type)) + return(tolower(type)) + + package <- desc$Package + if (!is.null(package)) + return("package") + + "unknown" + + } + + renv_bootstrap_user_dir <- function(path) { + dir <- renv_bootstrap_user_dir_impl(path) + chartr("\\", "/", dir) + } + + renv_bootstrap_user_dir_impl <- function(path) { + + # use R_user_dir if available + tools <- asNamespace("tools") + if (is.function(tools$R_user_dir)) + return(tools$R_user_dir("renv", "cache")) + + # try using our own backfill for older versions of R + envvars <- c("R_USER_CACHE_DIR", "XDG_CACHE_HOME") + for (envvar in envvars) { + root <- Sys.getenv(envvar, unset = NA) + if (!is.na(root)) { + path <- file.path(root, "R/renv") + return(path) + } + } + + # use platform-specific default fallbacks + if (Sys.info()[["sysname"]] == "Windows") + file.path(Sys.getenv("LOCALAPPDATA"), "R/cache/R/renv") + else if (Sys.info()[["sysname"]] == "Darwin") + "~/Library/Caches/org.R-project.R/R/renv" + else + "~/.cache/R/renv" + + } + + renv_json_read <- function(file = NULL, text = NULL) { + + text <- paste(text %||% read(file), collapse = "\n") + + # find strings in the JSON + pattern <- '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + locs <- gregexpr(pattern, text)[[1]] + + # if any are found, replace them with placeholders + replaced <- text + strings <- character() + replacements <- character() + + if (!identical(c(locs), -1L)) { + + # get the string values + starts <- locs + ends <- locs + attr(locs, "match.length") - 1L + strings <- substring(text, starts, ends) + + # only keep those requiring escaping + strings <- grep("[[\\]{}:]", strings, perl = TRUE, value = TRUE) + + # compute replacements + replacements <- sprintf('"\032%i\032"', seq_along(strings)) + + # replace the strings + mapply(function(string, replacement) { + replaced <<- sub(string, replacement, replaced, fixed = TRUE) + }, strings, replacements) + + } + + # transform the JSON into something the R parser understands + transformed <- replaced + transformed <- gsub("[[{]", "list(", transformed) + transformed <- gsub("[]}]", ")", transformed) + transformed <- gsub(":", "=", transformed, fixed = TRUE) + text <- paste(transformed, collapse = "\n") + + # parse it + json <- parse(text = text, keep.source = FALSE, srcfile = NULL)[[1L]] + + # construct map between source strings, replaced strings + map <- as.character(parse(text = strings)) + names(map) <- as.character(parse(text = replacements)) + + # convert to list + map <- as.list(map) + + # remap strings in object + remapped <- renv_json_remap(json, map) + + # evaluate + eval(remapped, envir = baseenv()) + + } + + renv_json_remap <- function(json, map) { + + # fix names + if (!is.null(names(json))) { + lhs <- match(names(json), names(map), nomatch = 0L) + rhs <- match(names(map), names(json), nomatch = 0L) + names(json)[rhs] <- map[lhs] + } + + # fix values + if (is.character(json)) + return(map[[json]] %||% json) + + # handle true, false, null + if (is.name(json)) { + text <- as.character(json) + if (text == "true") + return(TRUE) + else if (text == "false") + return(FALSE) + else if (text == "null") + return(NULL) + } + + # recurse + if (is.recursive(json)) { + for (i in seq_along(json)) { + json[i] <- list(renv_json_remap(json[[i]], map)) + } + } + + json + + } + + # load the renv profile, if any + renv_bootstrap_profile_load(project) + + # construct path to library root + root <- renv_bootstrap_library_root(project) + + # construct library prefix for platform + prefix <- renv_bootstrap_platform_prefix() + + # construct full libpath + libpath <- file.path(root, prefix) + + # attempt to load + if (renv_bootstrap_load(project, libpath, version)) + return(TRUE) + + # load failed; inform user we're about to bootstrap + prefix <- paste("# Bootstrapping renv", version) + postfix <- paste(rep.int("-", 77L - nchar(prefix)), collapse = "") + header <- paste(prefix, postfix) + message(header) + + # perform bootstrap + bootstrap(version, libpath) + + # exit early if we're just testing bootstrap + if (!is.na(Sys.getenv("RENV_BOOTSTRAP_INSTALL_ONLY", unset = NA))) + return(TRUE) + + # try again to load + if (requireNamespace("renv", lib.loc = libpath, quietly = TRUE)) { + message("* Successfully installed and loaded renv ", version, ".") + return(renv::load()) + } + + # failed to download or load renv; warn the user + msg <- c( + "Failed to find an renv installation: the project will not be loaded.", + "Use `renv::activate()` to re-initialize the project." + ) + + warning(paste(msg, collapse = "\n"), call. = FALSE) + +}) diff --git a/Postprocessing/renv/settings.dcf b/Postprocessing/renv/settings.dcf new file mode 100644 index 00000000..169d82f1 --- /dev/null +++ b/Postprocessing/renv/settings.dcf @@ -0,0 +1,10 @@ +bioconductor.version: +external.libraries: +ignored.packages: +package.dependency.fields: Imports, Depends, LinkingTo +r.version: +snapshot.type: implicit +use.cache: TRUE +vcs.ignore.cellar: TRUE +vcs.ignore.library: TRUE +vcs.ignore.local: TRUE diff --git a/Standalone_GCBM/gcbm_project/run_gcbm.bat b/Standalone_GCBM/gcbm_project/run_gcbm.bat index 57a46252..ef89fe4e 100644 --- a/Standalone_GCBM/gcbm_project/run_gcbm.bat +++ b/Standalone_GCBM/gcbm_project/run_gcbm.bat @@ -2,7 +2,7 @@ REM *************************** USER CONFIGURATION *************************** REM Set Python path - change this to your Python installation directory. -set GCBM_PYTHON=C:\Python37 +if "%~1" == "" (set GCBM_PYTHON=C:\Python37) else (set GCBM_PYTHON=%~1) REM ************************************************************************** REM Set GDAL library paths. diff --git a/Standalone_GCBM/input_database/run_recliner2gcbm.bat b/Standalone_GCBM/input_database/run_recliner2gcbm.bat index 1b73a113..2edb5de0 100644 --- a/Standalone_GCBM/input_database/run_recliner2gcbm.bat +++ b/Standalone_GCBM/input_database/run_recliner2gcbm.bat @@ -5,5 +5,5 @@ REM Is your version of MS Access 32 (x86) or 64 (x64) bit? set PLATFORM=x64 REM ************************************************************************** -..\tools\recliner2gcbm-%PLATFORM%\Recliner2GCBM.exe -c recliner2gcbm_config.json +..\tools\recliner2gcbm-%PLATFORM%\Recliner2GCBM.exe -c recliner2gcbm_config.json > ../logs/recliner_log.log pause diff --git a/Standalone_GCBM/logs/compile_results.log b/Standalone_GCBM/logs/compile_results.log new file mode 100644 index 00000000..942c386c --- /dev/null +++ b/Standalone_GCBM/logs/compile_results.log @@ -0,0 +1,35 @@ +02/21 13:01:38 Compiling results tables... +02/21 13:01:38 00_setup +02/21 13:01:38 01_reporting_table_ddl +02/21 13:01:39 02_create_location_area_view +02/21 13:01:39 03_populate_change_type_categories +02/21 13:01:39 04_populate_pool_collections +02/21 13:01:39 05_populate_pool_collection_pools +02/21 13:01:39 06_populate_flux_indicators +02/21 13:01:39 07_create_flux_indicator_view +02/21 13:01:39 08_populate_flux_indicator_collections +02/21 13:01:39 09_populate_flux_indicator_collection_flux_indicators +02/21 13:01:39 10_populate_stock_changes +02/21 13:01:39 11_create_flux_indicator_aggregates_view +02/21 13:01:39 12_create_stock_change_indicators_view +02/21 13:01:39 13_populate_pool_indicators +02/21 13:01:39 14_create_pool_indicators_view +02/21 13:01:39 15_create_dist_indicators_view +02/21 13:01:39 16_create_age_indicators_view +02/21 13:01:39 17_create_error_indicators_view +02/21 13:01:39 18_create_total_disturbed_areas_view +02/21 13:01:39 20_create_disturbance_fluxes_view +02/21 13:01:39 19_create_density_views +02/21 13:01:39 Copying reporting tables to output database... +02/21 13:01:39 v_age_indicators +02/21 13:01:39 v_disturbance_fluxes +02/21 13:01:39 v_disturbance_indicators +02/21 13:01:39 v_error_indicators +02/21 13:01:39 v_flux_indicator_aggregates +02/21 13:01:39 v_flux_indicator_aggregates_density +02/21 13:01:39 v_flux_indicators +02/21 13:01:39 v_flux_indicators_density +02/21 13:01:39 v_pool_indicators +02/21 13:01:39 v_stock_change_indicators +02/21 13:01:39 v_stock_change_indicators_density +02/21 13:01:39 v_total_disturbed_areas diff --git a/Standalone_GCBM/tools/CompileGCBMResults/compileresults.py b/Standalone_GCBM/tools/CompileGCBMResults/compileresults.py index 8606bcc8..8f38dec2 100644 --- a/Standalone_GCBM/tools/CompileGCBMResults/compileresults.py +++ b/Standalone_GCBM/tools/CompileGCBMResults/compileresults.py @@ -226,8 +226,9 @@ def copy_reporting_tables(from_conn, from_schema, to_conn, to_schema=None): to_conn.execute(insert(output_table), batch) if __name__ == "__main__": - logging.basicConfig(level=logging.INFO, stream=sys.stdout, format="%(asctime)s %(message)s", - datefmt="%m/%d %H:%M:%S") + logging.basicConfig(level=logging.INFO, format="%(asctime)s %(message)s", + datefmt="%m/%d %H:%M:%S", filename=os.path.join('..','..','logs', 'compile_results.log')) + parser = ArgumentParser(description="Produce reporting tables from raw GCBM results. For connection strings, " "see https://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls") diff --git a/dvc.lock b/dvc.lock new file mode 100644 index 00000000..2f6feae8 --- /dev/null +++ b/dvc.lock @@ -0,0 +1,271 @@ +schema: '2.0' +stages: + tiler: + cmd: echo.| process_spatial_layers.bat + deps: + - path: ../tools/Tiler/tiler.py + md5: bf45eeb791e49a20914d96c465ffc33a + size: 4327 + - path: raw/environment + md5: 5f5f16344c5528b66b51430b0ad8a53f.dir + size: 112009 + nfiles: 2 + - path: raw/inventory + md5: efdd5481cdb2fdd51a62832a08ce5ae9.dir + size: 97417 + nfiles: 5 + outs: + - path: ../logs/tiler_log.txt + md5: 08ccf6ca8327ab68266d92a9602970b1 + size: 289 + recliner2gcbm_x64: + cmd: echo.| run_recliner2gcbm.bat + deps: + - path: ../logs/tiler_log.txt + md5: 08ccf6ca8327ab68266d92a9602970b1 + size: 289 + - path: ../tools/recliner2gcbm-x64/recliner2gcbm.exe + md5: a45c702ad1c9aff92edc6493cff99450 + size: 6656 + - path: ArchiveIndex_Beta_Install.mdb + md5: 9b2d736fff420a077e08f9ff00802af6 + size: 3817472 + - path: Growth_Curves.csv + md5: 865daf88474e6cb9f04524ea673eb539 + size: 19415 + - path: gcbm_input.db + md5: 1b814815bf13da736ac194b7adae4545 + size: 1536000 + - path: recliner2gcbm_config.json + md5: 61351afc14f468a344c475705e6578ff + size: 6251 + outs: + - path: ../logs/recliner_log.log + md5: 53768f58ab154111f79775364587d429 + size: 1410 + update_gcbm_configuration: + cmd: echo.| update_gcbm_configuration.bat + deps: + - path: ../input_database/gcbm_input.db + md5: 1b814815bf13da736ac194b7adae4545 + size: 1536000 + - path: ../layers/tiled + md5: 1dde42b857605e2da31659a3b3ea6620.dir + size: 73166 + nfiles: 8 + - path: ../logs/recliner_log.log + md5: 53768f58ab154111f79775364587d429 + size: 1410 + - path: ../tools/tiler/update_gcbm_config.py + md5: 3e04cbc0ee3588cc13f711750b8cda1e + size: 18002 + - path: templates + md5: d872ca059781e4cb4a77e9c0e17915c3.dir + size: 60895 + nfiles: 8 + - path: update_gcbm_configuration.bat + md5: 357408ed6c55d8b0cf29a6fa4eb5c28c + size: 1023 + outs: + - path: ../logs/update_gcbm_config.log + md5: d4d51a6212ce2b67195492ce56b0e10f + size: 702 + run_gcbm: + cmd: echo.| run_gcbm.bat + deps: + - path: ../input_database/gcbm_input.db + md5: 1b814815bf13da736ac194b7adae4545 + size: 1536000 + - path: ../layers/tiled/LifeZone_moja.tiff + md5: a93766233a930f5c1dd6c5dcbf6f4d85 + size: 7822 + - path: ../layers/tiled/mean_annual_temperature_moja.tiff + md5: 9444ba5aa3d50653775dc8097eb8a265 + size: 49421 + - path: ../logs/update_gcbm_config.log + md5: d4d51a6212ce2b67195492ce56b0e10f + size: 702 + - path: ../tools/GCBM/moja.cli.exe + md5: 22ea736fd836612c2d9a8330572cdcff + size: 125440 + - path: gcbm_config.cfg + md5: 4ba9c157d6b3d8462bae8be993063fcc + size: 176 + - path: internal_variables.json + md5: 84528ca440ad67d5e473ee5b6dc06553 + size: 943 + - path: localdomain.json + md5: 38c21accf7af137c75a537de3e31b9dd + size: 8886 + - path: modules_cbm.json + md5: 007b877fb2df64b67d06c3f8e234d833 + size: 1562 + - path: modules_output.json + md5: 572b5ca282fe26171fcca0cb1f90d897 + size: 38724 + - path: output/gcbm_output.db + md5: 9cb08922772cbb6e44dbbbf01fdf7a5b + size: 249856 + - path: pools_cbm.json + md5: b561bd8961d20c9c8fd3ef457b79d7b1 + size: 986 + - path: provider_config.json + md5: 5e2d7a51341de83dc259ffecda8d2dcc + size: 978 + - path: run_gcbm.bat + md5: 87e19cfc778d1f9f6dba32cd63a9f0ea + size: 818 + - path: spinup.json + md5: 84f240eaf2aa9100948e63712bd7ee0a + size: 2139 + - path: variables.json + md5: 9d192270d5a227e6ecb7cf9ae8543620 + size: 15464 + outs: + - path: ../logs/Moja_Debug.log + md5: 6985a11494093a1b21565772f31450da + size: 1664212 + create_tiffs: + cmd: create_tiffs.bat + deps: + - path: ..\..\gcbm_project\output + md5: d0dae9f655a70d9461148e7099288120.dir + size: 1085397 + nfiles: 1121 + - path: ..\..\logs\Moja_Debug.log + md5: abe5f7c1bf95e669cf3f3cf585e7a619 + size: 1664190 + - path: create_tiffs.bat + md5: b2db383968c07c559a29e00ef1debac9 + size: 1019 + - path: create_tiffs.py + md5: 24fe644eb30b67b82ea38f3c6e6211ad + size: 5675 + outs: + - path: ..\..\logs\create_tiffs.log + md5: ec63ab8c2e644a3aa2bebac032b2299b + size: 15633 + - path: ..\..\processed_output\spatial + md5: 3e05ae40b00046e6b592f1c2102756f0.dir + size: 43828971 + nfiles: 231 + compile_results: + cmd: echo.| CompileGCBMResults.bat + deps: + - path: ../../gcbm_project/output/gcbm_output.db + md5: 057f4fc43fa27bf75dc07ccfa1f946a9 + size: 720896 + - path: ../../logs/create_tiffs.log + md5: 4ac8cf584df853bbdbaed84912bc32d9 + size: 15693 + - path: ../../processed_output/compiled_gcbm_output.db + md5: 01359a658dcab03697668cad91f96762 + size: 413696 + - path: compileGCBMResults.bat + md5: 495d2830357c57c216242c7d1233c266 + size: 536 + - path: compileresults.json + md5: c1664af923128ae8641b521fc330f439 + size: 17854 + - path: compileresults.py + md5: 0828e025ddfebab9dd1820485807539a + size: 14182 + outs: + - path: ../../logs/compile_results.log + md5: 0431299ca90da31ac244ff7728666799 + size: 1656 + postprocessing: + cmd: "Rscript Summarize_DOM_Stocks.R\npython create_metrics.py\n" + deps: + - path: ../Standalone_GCBM/logs/compile_results.log + md5: 0431299ca90da31ac244ff7728666799 + size: 1656 + - path: ../Standalone_GCBM/processed_output/compiled_gcbm_output.db + md5: 01359a658dcab03697668cad91f96762 + size: 413696 + - path: Summarize_DOM_Stocks.R + md5: 2973b839d724e4e26c2f40379b00403c + size: 6980 + - path: Tables + md5: 3f03761e2975d7f410bedd4e96231bc2.dir + size: 34806 + nfiles: 4 + - path: create_metrics.py + md5: c06a59dce2c4c4ff680c77c3482ac4c5 + size: 1180 + outs: + - path: Figures/Carpathians_Sensitivity_BorealWet.png + md5: 3963c5830efcd8ec86e10a65f241b5e0 + size: 82156 + - path: Figures/Carpathians_Sensitivity_CoolTemperateMoist.png + md5: ee590d257c180cde5c0c390b72471dd4 + size: 83055 + - path: Figures/Carpathians_Sensitivity_CoolTemperateSteppe.png + md5: 61d5696658e280fb5e695021433240f9 + size: 82555 + - path: Figures/Carpathians_Sensitivity_CoolTemperateWet.png + md5: d802bf0582f4f58a14e042551e5bb5f5 + size: 83197 + - path: Figures/Carpathians_Sensitivity_PolarRainTundra.png + md5: a3192f831f60e96af244a37e92b84966 + size: 82184 + - path: Metrics/Boreal_wet-Deadwood.json + md5: a93e6d7eb24ce95f1176b49c1a4a5da1 + size: 127 + - path: Metrics/Boreal_wet-Litter.json + md5: 2966b6b3ad417338bafc991bcdbaaf7d + size: 127 + - path: Metrics/Boreal_wet-Soil_Carbon.json + md5: 94d4cc3581545ad91e4ee634be8dc653 + size: 126 + - path: Metrics/Boreal_wet-Total_Biomass.json + md5: 79dde2c88c6384aef498ac0a21412ad8 + size: 127 + - path: Metrics/Cool_temperate_moist-Deadwood.json + md5: a690d1a185969f0f72b3b486ef7277dc + size: 134 + - path: Metrics/Cool_temperate_moist-Litter.json + md5: 9c1b0264c215b3453f2e49b94bee8f26 + size: 134 + - path: Metrics/Cool_temperate_moist-Soil_Carbon.json + md5: 1fe6801c68739031b504fcdc489a63fb + size: 134 + - path: Metrics/Cool_temperate_moist-Total_Biomass.json + md5: 096c779a4f3d6d7247a2685496a9d743 + size: 133 + - path: Metrics/Cool_temperate_steppe-Deadwood.json + md5: a0e05a7774b01184ce1da2313f26b00b + size: 118 + - path: Metrics/Cool_temperate_steppe-Litter.json + md5: 60eb4a72926fdece0276c199c93c1b78 + size: 117 + - path: Metrics/Cool_temperate_steppe-Soil_Carbon.json + md5: 9033181dc655e3f2de60f19eba172065 + size: 118 + - path: Metrics/Cool_temperate_steppe-Total_Biomass.json + md5: b800a91721127b6ce13db8df0bfbc796 + size: 116 + - path: Metrics/Cool_temperate_wet-Deadwood.json + md5: bc4ff6b4162a0ea9a1c1bffaa3ba3574 + size: 126 + - path: Metrics/Cool_temperate_wet-Litter.json + md5: d94078effed2e6b18d5d133f0d1647d6 + size: 119 + - path: Metrics/Cool_temperate_wet-Soil_Carbon.json + md5: 115fd2eab5eea9fd0d0a11f40e401b43 + size: 120 + - path: Metrics/Cool_temperate_wet-Total_Biomass.json + md5: dcbee97d634228a8fd1a332f3a915bb0 + size: 124 + - path: Metrics/Polar_rain_tundra-Deadwood.json + md5: 5afe7446e7aba27ad4a1ff1de8641214 + size: 126 + - path: Metrics/Polar_rain_tundra-Litter.json + md5: d06e749e36da6a0aa908b344460b4785 + size: 125 + - path: Metrics/Polar_rain_tundra-Soil_Carbon.json + md5: 6b141953d9dfdeeb47989c512d5f5fdd + size: 120 + - path: Metrics/Polar_rain_tundra-Total_Biomass.json + md5: 26a6f541bc9d7442ff599bac6cec0730 + size: 124 diff --git a/dvc.yaml b/dvc.yaml new file mode 100644 index 00000000..2d24f650 --- /dev/null +++ b/dvc.yaml @@ -0,0 +1,146 @@ +vars: + - python_path: python + - R_path: Rscript + +stages: + tiler: + cmd: echo.| process_spatial_layers.bat + wdir: Standalone_GCBM/layers + deps: + - ../tools/Tiler/tiler.py + - raw/environment + - raw/inventory + outs: + - ../logs/tiler_log.txt + recliner2gcbm_x64: + cmd: echo.| run_recliner2gcbm.bat + wdir: Standalone_GCBM/input_database + deps: + - ../logs/tiler_log.txt + - ../tools/recliner2gcbm-x64/recliner2gcbm.exe + - recliner2gcbm_config.json + - ArchiveIndex_Beta_Install.mdb + - Growth_Curves.csv + - gcbm_input.db + outs: + - ../logs/recliner_log.log + update_gcbm_configuration: + cmd: echo.| update_gcbm_configuration.bat + wdir: Standalone_GCBM/gcbm_project + deps: + - ../logs/recliner_log.log + - update_gcbm_configuration.bat + - ../tools/tiler/update_gcbm_config.py + - templates + - ../layers/tiled + - ../input_database/gcbm_input.db + outs: + - ../logs/update_gcbm_config.log + run_gcbm: + cmd: echo.| run_gcbm.bat + wdir: Standalone_GCBM/gcbm_project + deps: + - ../logs/update_gcbm_config.log + - run_gcbm.bat + - ../tools/GCBM/moja.cli.exe + - gcbm_config.cfg + - localdomain.json + - pools_cbm.json + - modules_cbm.json + - modules_output.json + - spinup.json + - variables.json + - internal_variables.json + - provider_config.json + - ../layers/tiled/LifeZone_moja.tiff + - ../layers/tiled/mean_annual_temperature_moja.tiff + - ../input_database/gcbm_input.db + - output/gcbm_output.db + outs: + - ../logs/Moja_Debug.log + create_tiffs: + cmd: echo.| create_tiffs.bat + wdir: Standalone_GCBM/tools/CompileGCBMSpatialOutput + deps: + - ../../logs/Moja_Debug.log + - create_tiffs.bat + - create_tiffs.py + - ../../gcbm_project/output + outs: + - ../../logs/create_tiffs.log + - ../../processed_output/spatial + compile_results: + cmd: echo.| CompileGCBMResults.bat + wdir: Standalone_GCBM/tools/CompileGCBMResults + deps: + - ../../gcbm_project/output/gcbm_output.db + - ../../logs/create_tiffs.log + - ../../processed_output/compiled_gcbm_output.db + - compileGCBMResults.bat + - compileresults.json + - compileresults.py + outs: + - ../../logs/compile_results.log + postprocessing: + cmd: | + ${R_path} Summarize_DOM_Stocks.R + ${python_path} create_metrics.py + wdir: Postprocessing + deps: + - ../Standalone_GCBM/processed_output/compiled_gcbm_output.db + - ../Standalone_GCBM/logs/compile_results.log + - Summarize_DOM_Stocks.R + - create_metrics.py + - Tables + plots: + - Figures/Carpathians_Sensitivity_BorealWet.png: + cache: false + - Figures/Carpathians_Sensitivity_CoolTemperateMoist.png: + cache: false + - Figures/Carpathians_Sensitivity_CoolTemperateSteppe.png: + cache: false + - Figures/Carpathians_Sensitivity_CoolTemperateWet.png: + cache: false + - Figures/Carpathians_Sensitivity_PolarRainTundra.png: + cache: false + metrics: + - Metrics/Boreal_wet-Deadwood.json: + cache: false + - Metrics/Boreal_wet-Litter.json: + cache: false + - Metrics/Boreal_wet-Soil_Carbon.json: + cache: false + - Metrics/Boreal_wet-Total_Biomass.json: + cache: false + - Metrics/Cool_temperate_moist-Deadwood.json: + cache: false + - Metrics/Cool_temperate_moist-Litter.json: + cache: false + - Metrics/Cool_temperate_moist-Soil_Carbon.json: + cache: false + - Metrics/Cool_temperate_moist-Total_Biomass.json: + cache: false + - Metrics/Cool_temperate_steppe-Deadwood.json: + cache: false + - Metrics/Cool_temperate_steppe-Litter.json: + cache: false + - Metrics/Cool_temperate_steppe-Soil_Carbon.json: + cache: false + - Metrics/Cool_temperate_steppe-Total_Biomass.json: + cache: false + - Metrics/Cool_temperate_wet-Deadwood.json: + cache: false + - Metrics/Cool_temperate_wet-Litter.json: + cache: false + - Metrics/Cool_temperate_wet-Soil_Carbon.json: + cache: false + - Metrics/Cool_temperate_wet-Total_Biomass.json: + cache: false + - Metrics/Polar_rain_tundra-Deadwood.json: + cache: false + - Metrics/Polar_rain_tundra-Litter.json: + cache: false + - Metrics/Polar_rain_tundra-Soil_Carbon.json: + cache: false + - Metrics/Polar_rain_tundra-Total_Biomass.json: + cache: false \ No newline at end of file