Skip to content

New options for IPLC land conservation and minor fixes in SEALS submission#868

Open
pvjeetze wants to merge 9 commits into
magpiemodel:developfrom
pvjeetze:f_landMark
Open

New options for IPLC land conservation and minor fixes in SEALS submission#868
pvjeetze wants to merge 9 commits into
magpiemodel:developfrom
pvjeetze:f_landMark

Conversation

@pvjeetze
Copy link
Copy Markdown
Contributor

@pvjeetze pvjeetze commented Mar 11, 2026

🐦 Description of this PR 🐦

🔧 Checklist for PR creator 🔧

If a point is not applicable, check the checkbox anyway and write "non-applicable" next to the checkbox.

  • 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)
  • 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
  • Perform test runs

    • Low risk:
      • Run a compilation check via Rscript start.R --> "compilation check"
    • Medium risk:
      • Run default run via Rscript start.R --> "default"
      • Check logs for errors/warnings
      • Fill in performance section below
    • 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,...)
      • Fill in performance section below
  • Reporting produces no errors and no new warnings

  • Get two approving reviews (at least one from RSE)

📉 Performance 📈

  • This PR's default : ** mins
  • For comparison: runtimes of weekly test

🚨 Checklist for reviewer 🚨

  • 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

Comment thread config/default.cfg
# * ("LandMark_IPLC_indicative") Indicative Indigenous Peoples’ and Local Community
# * Lands from LandMark
# * ("LandMark_IPLC_all) Delineated + indicative Indigenous Peoples’ and Local
# * Community Lands from LandMark
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just pointing out for other reviewers (correct me if I'm wrong): only the three LandMark options are new. (It's hard to see due to added alignment spaces for other options here)

if (!is.null(dependsID)) {
# check if job is still in SLURM memory using scontrol
scontrolCheck <- system(paste("scontrol show job", dependsID),
intern = TRUE, ignore.stderr = TRUE)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
intern = TRUE, ignore.stderr = TRUE)
intern = TRUE, ignore.stderr = TRUE)

submitFile <- file.path(dirProject, "run_submit", paste0("submit_seals_", title, ".sh"))

# Check job status if dependsID is provided
useDependency <- inputDataExists <- FALSE
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
useDependency <- inputDataExists <- FALSE
useDependency <- FALSE
inputDataExists <- FALSE

} else {
# Job purged from SLURM memory - check completion status with sacct
sacctCheck <- system(paste("sacct -j", dependsID, "-o State -n -X"),
intern = TRUE, ignore.stderr = TRUE)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
intern = TRUE, ignore.stderr = TRUE)
intern = TRUE, ignore.stderr = TRUE)

if (jobState == "COMPLETED") {
inputDataExists <- TRUE
} else {
stop(paste("Initial data preparation run (Job ID:", dependsID, ") did not complete successfully. Status:", jobState))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
stop(paste("Initial data preparation run (Job ID:", dependsID, ") did not complete successfully. Status:", jobState))
stop("Initial data preparation run (Job ID: ",
dependsID, ") did not complete successfully. Status: ", jobState)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stop already has paste0 built-in

stop(paste("Initial data preparation run (Job ID:", dependsID, ") did not complete successfully. Status:", jobState))
}
} else {
stop(paste("Could not find initial data preparation run (Job ID:", dependsID, ") in SLURM history"))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
stop(paste("Could not find initial data preparation run (Job ID:", dependsID, ") in SLURM history"))
stop("Could not find initial data preparation run (Job ID: ", dependsID, ") in SLURM history")

Copy link
Copy Markdown
Contributor

@weindl weindl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants