forked from magpiemodel/magpie
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
701 changed files
with
1,164 additions
and
883 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,24 @@ | ||
# | (C) 2008-2023 Potsdam Institute for Climate Impact Research (PIK) | ||
# | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK) | ||
# | authors, and contributors see CITATION.cff file. This file is part | ||
# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of | ||
# | AGPL-3.0, you are granted additional permissions described in the | ||
# | MAgPIE License Exception, version 1.0 (see LICENSE file). | ||
# | Contact: [email protected] | ||
Sys.setenv(RENV_PATHS_LIBRARY = "renv/library") | ||
if (Sys.info()[["sysname"]] == "Windows") { | ||
# make renv use R's default download function to prevent | ||
# curl: (35) schannel: next InitializeSecurityContext failed: Unknown error | ||
# (0x80092012) - The revocation function was unable to check revocation for the certificate. | ||
options(renv.download.override = utils::download.file) | ||
} | ||
|
||
source("renv/activate.R") | ||
# do not check if library and renv.lock are in sync, because normally renv.lock does not exist | ||
options(renv.config.synchronized.check = FALSE, | ||
renv.config.user.profile = TRUE) # load user specific settings from ~/.Rprofile | ||
|
||
renvVersion <- "0.16.0" | ||
if (packageVersion("renv") != renvVersion) { | ||
renvLockExisted <- file.exists(renv::paths$lockfile()) | ||
renv::upgrade(version = renvVersion, reload = TRUE, prompt = FALSE) | ||
if (!renvLockExisted) { | ||
unlink(renv::paths$lockfile()) | ||
} | ||
} | ||
# the text "renvVersion" is required for a check in a coupling script, will be removed soon | ||
|
||
source("renv/activate.R") | ||
|
||
if (!"https://rse.pik-potsdam.de/r/packages" %in% getOption("repos")) { | ||
options(repos = c(getOption("repos"), pik = "https://rse.pik-potsdam.de/r/packages")) | ||
|
@@ -28,7 +31,7 @@ if (isTRUE(rownames(installed.packages(priority = "NA")) == "renv")) { | |
message("Finished installing R package dependencies.") | ||
} | ||
|
||
# source global .Rprofile (very important to load user specific settings) | ||
if (file.exists("~/.Rprofile")) { | ||
source("~/.Rprofile") | ||
# in case bootstrapping fails halfway, install piamenv and rely on requirement auto-fixing | ||
if (!requireNamespace("piamenv", quietly = TRUE)) { | ||
renv::install("piamenv", prompt = FALSE) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,8 +137,8 @@ authors: | |
email: [email protected] | ||
|
||
title: MAgPIE - An Open Source land-use modeling framework | ||
version: 4.7.1dev | ||
date-released: 2024-02-28 | ||
version: 4.7.2dev | ||
date-released: 2024-04-02 | ||
repository-code: https://github.com/magpiemodel/magpie | ||
keywords: | ||
- landuse | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,8 +24,8 @@ https://www.pik-potsdam.de/research/projects/activities/land-use-modelling/magpi | |
A framework description paper has been published in | ||
Geoscientific Model Development (GMD): https://doi.org/10.5194/gmd-12-1299-2019 | ||
|
||
The model documentation for version 4.7.1 can be found at | ||
https://rse.pik-potsdam.de/doc/magpie/4.7.1/ | ||
The model documentation for version 4.7.2 can be found at | ||
https://rse.pik-potsdam.de/doc/magpie/4.7.2/ | ||
|
||
A most recent version of the documentation can also be extracted from the | ||
model source code via the R package goxygen | ||
|
@@ -65,31 +65,69 @@ When using a modified version of **MAgPIE** which is not identical to versions | |
in the official main repository at https://github.com/magpiemodel add a suffix | ||
to the name to allow distinguishing versions (format **MAgPIE-suffix**). | ||
|
||
## SYSTEM REQUIREMENTS | ||
## HARDWARE REQUIREMENTS | ||
The model is quite resource heavy and works best on machines with high CPU clock | ||
and memory. Recommended is a machine with Windows, MacOS or Linux, with at least | ||
16GB of memory and a Core i7 CPU or similar. | ||
and memory. Recommended is a machine with at least 16GB of memory and a Core i7 CPU or similar. | ||
|
||
## HOW TO INSTALL | ||
MAgPIE requires *GAMS* (https://www.gams.com/) including licenses for the | ||
solvers *CONOPT* and (optionally) *CPLEX* for its core calculations. As the model | ||
benefits significantly of recent improvements in *GAMS* and *CONOPT4* it is | ||
recommended to work with the most recent versions of both. | ||
Please make sure that the GAMS installation path is added to the PATH variable | ||
of the system. | ||
|
||
In addition *R* (https://www.r-project.org/) is required for pre- and | ||
postprocessing and run management (needs to be added to the PATH variable | ||
as well). | ||
|
||
Several R packages are required to run MAgPIE. Under Windows you first need to install | ||
Rtools (https://cran.r-project.org/bin/windows/Rtools/) and to add it to the PATH | ||
variable. When running R from the MAgPIE folder for the first time all | ||
required packages are automatically installed into an isolated, | ||
project specific R package environment (renv). | ||
For post-processing model outputs *Latex* is required | ||
(https://www.latex-project.org/get/). To be seen by the model it also needs to | ||
added to the PATH variable of your system. | ||
Commands formatted as `code` should generally be run in a terminal (PowerShell on Windows). | ||
|
||
### List of Requirements | ||
- license for gams incl. CONOPT solver | ||
- gams >= 43.4.1 | ||
- git >= 2.16.1 | ||
- R >= 4.1.2 (+ matching Rtools on Windows) | ||
- pandoc >= 2.14.2 | ||
- TeX >= 3.14159265 | ||
|
||
### OS specific setup | ||
Choose your operating system and follow the instructions there. You can also | ||
install requirements differently (e.g. using only installers on Windows), in | ||
the end it is only important that all requirements are installed in a suitable | ||
version and added to the PATH environment variable, so MAgPIE can use them. | ||
|
||
#### Ubuntu | ||
1. make sure you have a gams license incl. the CONOPT solver | ||
1. [install gams](https://www.gams.com/46/docs/UG_UNIX_INSTALL.html) | ||
1. install git, R, and pandoc with `sudo apt install git r-base pandoc` | ||
1. install TinyTeX with `Rscript -e 'install.packages("tinytex"); tinytex::install_tinytex()'` | ||
|
||
#### macOS | ||
1. make sure you have a gams license incl. the CONOPT solver | ||
1. [install gams](https://www.gams.com/46/docs/UG_MAC_INSTALL.html) | ||
1. install git, R, and pandoc with `brew install git r pandoc` | ||
1. install TinyTeX with `Rscript -e 'install.packages("tinytex"); tinytex::install_tinytex()'` | ||
|
||
#### Windows | ||
1. make sure you have a gams license incl. the CONOPT solver | ||
1. [install gams](https://www.gams.com/46/docs/UG_WIN_INSTALL.html) | ||
1. [download .msi pandoc file](https://github.com/jgm/pandoc/releases/latest) and run installer (`choco install pandoc` did not work in testing) | ||
1. [install chocolatey](https://chocolatey.org/install) | ||
1. install git, rig (R installer), and tinytex with `choco install -y git rig tinytex` | ||
1. restart terminal | ||
1. install R and Rtools with `rig add release; rig add rtools` | ||
|
||
### check setup is complete | ||
- restart terminal | ||
- `gams` should print many lines including "The installed license is valid." | ||
- `git --version` | ||
- `Rscript --version` | ||
- `pandoc --version` | ||
- `tex --version` | ||
|
||
If any of these are not found: Find the path to that executable | ||
(gams/git/Rscript/pandoc/tex, on Windows ending in '.exe') and add it to your | ||
PATH environment variable. Search for a tutorial online if you are unsure how to do that. | ||
|
||
### download and run MAgPIE | ||
1. download MAgPIE with `git clone https://github.com/magpiemodel/magpie.git` | ||
1. go into the MAgPIE folder `cd magpie` | ||
1. start a MAgPIE run with `Rscript start.R`, first time: installs all required R packages (takes a while) | ||
1. choose "1" for a default run | ||
1. then select "1" for direct execution | ||
|
||
### troubleshooting | ||
Please check [this discussion](https://github.com/magpiemodel/magpie/discussions/650) for known problems and solutions and to report new problems you encounter while setting up MAgPIE. | ||
|
||
## DOCKER | ||
To use Docker, copy your `gamslice.txt` | ||
|
@@ -188,7 +226,7 @@ [email protected] | |
Please contact [email protected] | ||
|
||
## CITATION | ||
See file CITATION.cff or the [How-to-Cite section](https://rse.pik-potsdam.de/doc/magpie/4.7.1/#how-to-cite) in the model documentation for information how to cite the model. | ||
See file CITATION.cff or the [How-to-Cite section](https://rse.pik-potsdam.de/doc/magpie/4.7.2/#how-to-cite) in the model documentation for information how to cite the model. | ||
|
||
## AUTHORS | ||
See list of authors in CITATION.cff | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.