magpie icon indicating copy to clipboard operation
magpie copied to clipboard

AgroForestry: treecover on cropland and betr

Open flohump opened this issue 11 months ago • 1 comments

:bird: Description of this PR :bird:

This PR adds tree cover on cropland and bioenergy trees as two different AgroForestry systems to MAgPIE To intergrate cropland tree cover properly into the existing model, the following changes are applied:

  • new module 29_cropland, accouting for crop area, fallow cropland and tree cover on cropland
  • module 30_crop renamed to 30_croparea, which now only accounts for crop area.
  • module 29_ageclass has been renamed to 28_ageclass
  • SNV has been moved from 30_crop to 29_cropland
  • 30_crop/penalty and 30_crop/rotation realizations have been merged into a singe 30_croparea/detail_apr24 realization
  • the previous 30_crop/endo_apr21 crop realization has been renamed to 30_croparea/simple_apr24
  • The new module 29_cropland has two realizations: detail_apr24 and simple_apr24 (default)
  • 29_cropland/detail_apr24 includes all tree cover (includign age-classes) and fallow land calculations
  • 29_cropland/simple_apr24 assumes zero tree cover and fallow land.

todo: include input files for 30_croparea in additional_data.tgz.

todo: emisCO2 in magpie4 reporting

Changelog

changed

  • 29_ageclass module 29_ageclass has been renamed to 28_ageclass to make space for 29_cropland just before 30_croparea
  • 30_crop module 30_crop renamed to 30_croparea, which now only accounts for crop area.
  • 30_crop SNV implementation has been moved from 30_crop to 29_cropland/detail_apr24
  • 30_crop the two realizations penalty_apr22 and rotation_apr22 have been merged into a single 30_croparea/detail_apr24 realization
  • 30_crop the previous 30_crop/endo_apr21 realization has been moved to 30_croparea/simple_apr24
  • 80_optimization Simplifed cycling through CONOPT4, CONOPT4 with OPTFILE, CONOPT4 without preprocessing and CONOPT3.

added

  • 29_cropland new module 29_cropland accounting for crop area, fallow cropland and tree cover on cropland with two realizations: detail_apr24 and simple_apr24 (default) .
  • 10_land added interface pm_land_hist with historic land use patterns
  • 32_forestry added technical balance term v32_land_missing_ndc
  • default.cfg cfg$gms$s80_secondsolve option for second solve statement with 0=off as default

fixed

  • 80_optimization bugfix in nlp_par. Double solve statement was not working

:wrench: Checklist for PR creator :wrench:

  • [x] Label pull request from the label list.

    • Low risk: Simple bugfixes (missing files, updated documentation, typos) or changes in start or output scripts
    • Medium risk: Uncritical changes in the model core (e.g. moderate modifications in non-default realizations)
    • High risk: Critical changes in model core or default settings (e.g. changing a model default or adjusting a core mechanic in the model)
  • [ ] Self-review own code

    • No hard coded numbers and cluster/country/region names.
    • The new code doesn't contain declared but unused parameters or variables.
    • magpie4 R library has been updated accordingly and backwards compatible where necessary.
    • scenario_config.csv has been updated accordingly (important if default.cfg has been updated)
  • [x] Document changes

    • Add changes to CHANGELOG.md
    • Where relevant, put In-code documentation comments
    • Properly address updates in interfaces in the module documentations
    • run goxygen::goxygen() and verify the modified code is properly documented
  • [x] Perform test runs

    • Low risk:
      • Run a compilation check via Rscript start.R --> "compilation check"
    • Medium risk:
      • Run test runs via Rscript start.R --> "test runs"
      • Check logs for errors/warnings
    • High risk:
      • Run test runs via Rscript start.R --> "test runs"
      • Check logs for errors/warnings
      • Default run from the PR target branch for comparison
      • Provide relevant comparison plots (land-use, emissions, food prices, land-use intensity,...)

Resources_Land_Cover_Cropland-100 Resources_Land_Cover_Cropland_Tree_Cover Productivity_Landuse_Intensity_Indicator_Tau-87 Emissions_CO2_Land_Land_use_Change-86 Prices_Index2020_Agriculture_Food_products-2

:chart_with_downwards_trend: Performance changes :chart_with_upwards_trend:

  • Current develop branch default : 27 mins
  • This PR's default : 27 mins

:rotating_light: Checklist for reviewer :rotating_light:

  • PR is labeled correctly
  • Code changes look reasonable
    • No hard coded numbers and cluster/country/region names.
    • No unnecessary increase in module interfaces
    • model behavior/performance is satisfactory.
  • Changes are properly documented
    • CHANGELOG is updated correctly
    • Updates in interfaces have been properly addressed in the module documentations
    • In-code documentation looks appropriate
  • [ ] content review done (at least 1)
  • [ ] RSE review done (at least 1)

flohump avatar Mar 11 '24 12:03 flohump

A few documentation changes. Seems good to me, but should be done analogous for all 3 realizations. Please let me know if you need help with understanding the penalty implementation!

Sure. This will be included in all 3 realizations once we agreed that the overall approach is fine.

flohump avatar Mar 12 '24 08:03 flohump