Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating magpie #26

Merged
merged 3,279 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
3279 commits
Select commit Hold shift + click to select a range
8bfc059
added slack variable to make CES function feasible in linear version
Feb 10, 2023
107836e
updated changelog
FelicitasBeier Feb 10, 2023
2f3f0fb
removed multiple cropping factor from water demand equations
FelicitasBeier Feb 10, 2023
f909c88
merged develop
FelicitasBeier Feb 10, 2023
b75f0b9
changelog
Feb 10, 2023
ac16d8d
Merge branch 'develop' of github.com:magpiemodel/magpie into f_initLa…
Feb 10, 2023
a379b97
Merge pull request #39 from magpiemodel/develop
caviddhen Feb 12, 2023
656097b
merge develop
Feb 12, 2023
5e3dd27
addressed comments on PR
Feb 13, 2023
3ed2e09
bugfix
flohump Feb 13, 2023
f6e8070
Merge pull request #525 from deleip/f_initLaborNeed
deleip Feb 13, 2023
9a40366
Update CHANGELOG.md
FelicitasBeier Feb 13, 2023
b7c1717
Merge branch 'develop' into fsec_multicroppingfix
FelicitasBeier Feb 13, 2023
a165c62
Merge pull request #522 from FelicitasBeier/fsec_multicroppingfix
FelicitasBeier Feb 13, 2023
e9de817
Merge branch 'develop' of github.com:magpiemodel/magpie into PR526
flohump Feb 13, 2023
53e1a03
bugfix
flohump Feb 13, 2023
e965fc1
changelog
flohump Feb 14, 2023
4dcbec4
Merge pull request #526 from flohump/PR526
flohump Feb 14, 2023
f43fbca
adjusted ExternalPressures Scenario and preprocessing and HR title
FelicitasBeier Feb 14, 2023
ec868e1
Merge branch 'FSEC' of github.com:FelicitasBeier/magpie into FSEC
FelicitasBeier Feb 14, 2023
b762550
update calibration run
FelicitasBeier Feb 14, 2023
fb0be15
yaml fixes
FelicitasBeier Feb 14, 2023
e5103c9
update input data
Feb 14, 2023
0307cf0
Merge pull request #40 from magpiemodel/develop
caviddhen Feb 14, 2023
bcd49c4
re-activate renv
Feb 14, 2023
2bb2067
Merge branch 'develop' of https://github.com/caviddhen/magpie into de…
Feb 14, 2023
396daba
add .snapshot.Rprofile again
Feb 14, 2023
be1c3db
revert permissions
Feb 14, 2023
d0e8c83
revert permissions
Feb 14, 2023
544f244
Merge pull request #527 from caviddhen/develop
caviddhen Feb 14, 2023
33299ae
update config and input files
Feb 14, 2023
bd039ce
cleanup cfg
Feb 14, 2023
2d96b74
updated calibration file
FelicitasBeier Feb 14, 2023
ab4ee64
update scenario_config cellular input vector to rev81
Feb 15, 2023
6937b1e
Merge branch 'develop' of https://github.com/caviddhen/magpie into de…
Feb 15, 2023
e75f76e
bugfixes in highres script
FelicitasBeier Feb 15, 2023
7c9295a
Merge pull request #528 from caviddhen/develop
caviddhen Feb 15, 2023
ff39876
updated order of output scripts
FelicitasBeier Feb 15, 2023
2700651
updated to newest develop
FelicitasBeier Feb 15, 2023
36895a1
removed merge conflict line
FelicitasBeier Feb 15, 2023
30dfea0
updated version number
FelicitasBeier Feb 15, 2023
b27a85d
aff switch
flohump Feb 15, 2023
18409ba
add fade out of trade tariffs option in bilateral trade realization
Feb 15, 2023
6fa9e0d
merge develop
Feb 15, 2023
baae8a5
update
flohump Feb 15, 2023
9741a71
c_price_aff
flohump Feb 16, 2023
5c61edd
bugfix
flohump Feb 16, 2023
9a7804c
division by zero in peatland preloop addressed
FelicitasBeier Feb 16, 2023
fdcb32a
convert tabs to spaces
FelicitasBeier Feb 16, 2023
a36b7c9
division of zero in postsolve of peatland module fixed
FelicitasBeier Feb 16, 2023
1b0d6ab
changelog
flohump Feb 16, 2023
060230d
division by zero and highres paste of title
FelicitasBeier Feb 16, 2023
f7bde88
changelog
flohump Feb 16, 2023
6e29182
order
flohump Feb 16, 2023
ddc9964
division by zero and fsec script adjustment
FelicitasBeier Feb 16, 2023
e87385c
adjustment of title pating
FelicitasBeier Feb 16, 2023
1f4b5d7
changelog
flohump Feb 16, 2023
138d738
Merge pull request #530 from flohump/PR530
abhimishr Feb 16, 2023
0e482fe
Merge branch 'develop' into FSEC
FelicitasBeier Feb 16, 2023
2e46e73
bugfix BII outputdir
flohump Feb 16, 2023
5b70a16
Merge branch 'develop' of https://github.com/magpiemodel/magpie into …
pvjeetze Feb 16, 2023
c842194
checkNoTabs performance
pfuehrlich-pik Feb 17, 2023
c0e2f73
clean up preloop eqns
Feb 17, 2023
cc183f8
cleanup literature
pfuehrlich-pik Feb 17, 2023
ebc41e3
replace 1e-40 with 1e-20
flohump Feb 17, 2023
dbe2d0c
documentation and copyright cleanup
Feb 18, 2023
50d4efb
Merge pull request #449 from caviddhen/bilateral_trade
caviddhen Feb 20, 2023
cad75b2
Updated start script
vartika271987 Feb 20, 2023
48ddbbf
remove conflict in main.gms and fixed ecodiet macro and factor cost r…
vartika271987 Feb 20, 2023
853a978
Updated description of exo nin in default cfg
vartika271987 Feb 20, 2023
e9d2797
Updated changelog
vartika271987 Feb 20, 2023
4e2fefe
Merge branch 'develop' into FSEC
FelicitasBeier Feb 20, 2023
c874204
Merge pull request #529 from FelicitasBeier/FSEC
FelicitasBeier Feb 20, 2023
89ff5fa
Merge branch 'develop' of github.com:magpiemodel/magpie into develop
pfuehrlich-pik Feb 21, 2023
a65b8db
Merge pull request #531 from pfuehrlich-pik/develop
pfuehrlich-pik Feb 22, 2023
91f0de9
magpie release 4.6.4
pfuehrlich-pik Feb 22, 2023
ff1b1bf
Merge pull request #534 from pfuehrlich-pik/develop
pfuehrlich-pik Feb 22, 2023
f4d2762
merge master into develop
pfuehrlich-pik Feb 22, 2023
f2f5b83
Merge pull request #535 from pfuehrlich-pik/develop
pfuehrlich-pik Feb 23, 2023
47b7e2a
Added india nin start script
vartika271987 Feb 23, 2023
34db592
Merge branch 'diets2' of https://github.com/vartika271987/magpie into…
vartika271987 Feb 23, 2023
5e1b6e0
Changes to include NIN diets
vartika271987 Feb 23, 2023
d15e9f7
Added start script
vartika271987 Feb 23, 2023
5292b6a
added some variables
flohump Feb 24, 2023
ad2249b
Merge branch 'develop' of https://github.com/magpiemodel/magpie into …
pvjeetze Feb 24, 2023
a5d894c
IrrC + 30by30
pvjeetze Feb 24, 2023
32b0063
gov state
flohump Feb 24, 2023
70c0b2d
bugfix
flohump Feb 24, 2023
0f674d4
land conservation is included in disaggregation
pvjeetze Mar 1, 2023
48fe223
updated changelog
pvjeetze Mar 1, 2023
0a6c7fe
test
flohump Mar 1, 2023
2294289
bugfix
flohump Mar 1, 2023
8919b0d
c56_mute_ghgprices_until
flohump Mar 1, 2023
4eb949e
merged disaggregation of BII into standard disaggregation
pvjeetze Mar 1, 2023
7453a3b
updated changelog
pvjeetze Mar 1, 2023
bb7784a
bugfix
flohump Mar 1, 2023
faf2911
minor changes
pvjeetze Mar 2, 2023
f5b7eeb
changed changelog
pvjeetze Mar 2, 2023
cfa9c0a
p32_aff_pol_timestep threshold
flohump Mar 2, 2023
596af6f
Merge pull request #536 from pvjeetze/f_ConsvDisagg
pvjeetze Mar 2, 2023
bb88a6f
Merge branch 'develop' into FSEC
FelicitasBeier Mar 2, 2023
86895ca
updates
flohump Mar 2, 2023
24580a9
update FSDP collect
flohump Mar 2, 2023
36cbf5e
updated disaggregation
pvjeetze Mar 2, 2023
1952e73
Merge branch 'develop' of https://github.com/magpiemodel/magpie into …
pvjeetze Mar 2, 2023
51e849b
cleanup
flohump Mar 2, 2023
f4c0c65
Remove mute_ghgprices_until from start_functions.R, because it is now…
dklein-pik Mar 2, 2023
fe39787
ndc only
flohump Mar 2, 2023
6e6e52a
Merge pull request #10 from dklein-pik/f_LUSPA2
flohump Mar 3, 2023
dc7e15a
changelog
flohump Mar 3, 2023
8c800d8
changelog
flohump Mar 3, 2023
c8f5237
changelog
flohump Mar 3, 2023
3683856
changelog
flohump Mar 3, 2023
df5099f
Merge branch 'develop' into f_LUSPA2
flohump Mar 3, 2023
20a7043
changelog
flohump Mar 3, 2023
dfc6b76
desc
flohump Mar 3, 2023
af05b85
revision
flohump Mar 3, 2023
ba00644
update
flohump Mar 3, 2023
617a00f
Update config/default.cfg
flohump Mar 3, 2023
6da9c46
desc
flohump Mar 3, 2023
45cc7c3
Merge pull request #539 from flohump/f_LUSPA2
flohump Mar 3, 2023
b4bc6b2
add marco's indicators to FSDP_collect for SI plots
Mar 5, 2023
9b526aa
bugfix pasture suitabilty
flohump Mar 6, 2023
044e374
Merge pull request #540 from flohump/f_LUSPA2
flohump Mar 6, 2023
843554f
Merge branch 'develop' of https://github.com/magpiemodel/magpie into …
vartika271987 Mar 7, 2023
8c72fd6
Updated changelog and removed india nin start script
vartika271987 Mar 7, 2023
6c4bfeb
added Resources|Land Cover
flohump Mar 7, 2023
b792ff0
added memory clean-up to disaggregation
pvjeetze Mar 8, 2023
6cf8bfe
changelog update
pvjeetze Mar 8, 2023
8eaab41
add country column
pfuehrlich-pik Mar 9, 2023
8060f00
changelog
pfuehrlich-pik Mar 9, 2023
67ad8cf
Merge pull request #542 from pvjeetze/f_ConsvDisagg
pvjeetze Mar 9, 2023
08b0f30
Merge branch 'develop' into FSEC
FelicitasBeier Mar 10, 2023
0747b4e
updated fsec scenario config to harmonize emission scenarios of
FelicitasBeier Mar 10, 2023
21ce99e
added SSP1energy for emissions in fsdp and energy scenario
FelicitasBeier Mar 10, 2023
dcef0db
removed air pollution scenario
FelicitasBeier Mar 10, 2023
a8e4dc8
Merge branch 'develop' of https://github.com/magpiemodel/magpie into …
pvjeetze Mar 10, 2023
03d729f
update version number
FelicitasBeier Mar 10, 2023
565d82d
fix in sticky_labor for capitalSubst scenario
Mar 10, 2023
c1bd516
Merge pull request #544 from deleip/f_capitalSubstBugfix
deleip Mar 10, 2023
46b72f5
Merge branch 'develop' into diets2
vartika271987 Mar 13, 2023
a483b4a
Merge branch 'develop' of https://github.com/magpiemodel/magpie into …
pvjeetze Mar 13, 2023
9238691
new inputdata and updated changelog
pvjeetze Mar 13, 2023
cc21edd
Updated description in config and module
vartika271987 Mar 13, 2023
8d523d1
UPdated branch head
vartika271987 Mar 13, 2023
87a1aca
Updated branch locally
vartika271987 Mar 13, 2023
25342af
Removed lines from merge conflict and updated description
vartika271987 Mar 13, 2023
6a0aef5
Added description of c15 switch and updated changelog
vartika271987 Mar 13, 2023
6abb72d
use magpie4::clusterOutputToTerraVector
pfuehrlich-pik Mar 13, 2023
22fb767
Removed erronesouly included NIN references in old anthro realization
vartika271987 Mar 14, 2023
6ab0312
Removed erronesouly included NIN references in old anthro realization
vartika271987 Mar 14, 2023
feac187
Removed erronesouly included NIN references in old anthro realization
vartika271987 Mar 14, 2023
6971041
Removed erronesouly included NIN references in old anthro realization
vartika271987 Mar 14, 2023
640688b
max calib factor divergence to max divergence
emolinab Mar 14, 2023
f8af56e
Merge pull request #545 from emolinab/develop
emolinab Mar 15, 2023
cd69dad
Merge pull request #543 from pfuehrlich-pik/develop
pfuehrlich-pik Mar 15, 2023
fdc8f89
Updated changelog
vartika271987 Mar 16, 2023
5cc9222
Removed references of c15_NIN_scen and elaborated on settings for Ind…
vartika271987 Mar 16, 2023
9357e70
Merge branch 'develop' into diets2
vartika271987 Mar 16, 2023
96bbf7e
Merge branch 'develop' of https://github.com/magpiemodel/magpie into …
pvjeetze Mar 16, 2023
88165cd
changed fsec config
pvjeetze Mar 16, 2023
b3ecac9
removed test start scripts
pvjeetze Mar 16, 2023
5b8fc22
changed naming in FSEC input files
pvjeetze Mar 16, 2023
efb9036
bugfix
flohump Mar 16, 2023
8dcc89e
bugfix
flohump Mar 16, 2023
5b42e04
Merge pull request #546 from flohump/f_LUSPA2
flohump Mar 17, 2023
46257d6
Merge branch 'develop' into FSEC
FelicitasBeier Mar 21, 2023
a41049e
bugfix in fsec script
pvjeetze Mar 23, 2023
70208d3
updated RCPs
FelicitasBeier Mar 24, 2023
ac1898a
new calibration title
FelicitasBeier Mar 24, 2023
0f9327c
new calibration
pvjeetze Mar 24, 2023
f25f8aa
Merge branch 'develop' of https://github.com/magpiemodel/magpie into …
pvjeetze Mar 24, 2023
6807880
bugfix in test run script
pvjeetze Mar 24, 2023
64ae07f
Merge pull request #537 from pvjeetze/f_newConsvPrio
pvjeetze Mar 24, 2023
454d647
merged develop
FelicitasBeier Mar 24, 2023
d172510
reverted merge-conflict in scenario_fsce, updated default preprocessi…
FelicitasBeier Mar 27, 2023
9d23b66
updated to newest calibration
FelicitasBeier Mar 27, 2023
bcadcf3
Added nutrient surplus variables to FSDP_collect
mscrawford Mar 27, 2023
9418691
bugfix removed units from cropland nutrient surplus
mscrawford Mar 28, 2023
34a3316
updated RCPs
FelicitasBeier Mar 29, 2023
29a6346
magpie release 4.6.5
pfuehrlich-pik Mar 29, 2023
ea7e5af
Merge pull request #548 from pfuehrlich-pik/release_4.6.5
pfuehrlich-pik Mar 29, 2023
de51ac0
merge master into develop
pfuehrlich-pik Mar 29, 2023
18ef2be
Merge pull request #549 from pfuehrlich-pik/release_4.6.5
pfuehrlich-pik Mar 29, 2023
b5d8485
Merged with new release and updated changelog
vartika271987 Mar 30, 2023
0b2e71f
Merged with new release and updated changelog
vartika271987 Mar 30, 2023
e017733
Removed reference of c15_nin from config file as it is not used
vartika271987 Mar 30, 2023
31e8ade
Updated description in default.cfg
vartika271987 Mar 30, 2023
d9dacac
Updated changelog
vartika271987 Mar 30, 2023
1dcdc12
Updated changelog
vartika271987 Mar 30, 2023
5a9f697
on.exit -> withr::defer
pfuehrlich-pik Mar 30, 2023
33ada5e
removed ssp2bau scenario as it is equivalent to c_BAU
FelicitasBeier Apr 3, 2023
b2871ad
bugfix BII grid
flohump Apr 3, 2023
f6762bf
Apply suggestions from code review
pfuehrlich-pik Apr 3, 2023
24f27e6
Merge pull request #550 from pfuehrlich-pik/remove_on_exit
pfuehrlich-pik Apr 3, 2023
4b01d0a
remove ssp2bau as it is the same as BAU
FelicitasBeier Apr 3, 2023
fafa69d
Replaced NIN switch with option in existing s15 exo diet switch
vartika271987 Apr 4, 2023
27e407b
Merge branch 'develop' of https://github.com/magpiemodel/magpie into …
vartika271987 Apr 4, 2023
8faae10
Merge branch 'develop' into FSEC
FelicitasBeier Apr 5, 2023
ac8166e
Merge pull request #547 from FelicitasBeier/FSEC
FelicitasBeier Apr 5, 2023
f58e235
Bugfix in changelog
vartika271987 Apr 5, 2023
27e10ee
Bugfix in changelog
vartika271987 Apr 5, 2023
8fd23c8
Merge pull request #541 from vartika271987/diets2
vartika271987 Apr 5, 2023
a783c00
show snapshot errors
pfuehrlich-pik Apr 6, 2023
1062818
Merge pull request #551 from pfuehrlich-pik/show-snapshot-errors
pfuehrlich-pik Apr 6, 2023
6f3c591
bugfix in fsec.R script in c_BAU scenario
FelicitasBeier Apr 11, 2023
68eb2f1
added SSP2fsdp in FSDPcollect
flohump Apr 11, 2023
7913ef9
Added more YLL variables to FSDP_collect
mscrawford Apr 11, 2023
0f785cb
added output script for forest area change
flohump Apr 14, 2023
80e9a60
Merge pull request #552 from flohump/f_script
flohump Apr 14, 2023
3504ed9
revert accidentally introduced bug in fsec.R regarding India script
FelicitasBeier Apr 15, 2023
c3a517a
Merge branch 'FSEC' of github.com:FelicitasBeier/magpie into FSEC
FelicitasBeier Apr 20, 2023
0ca0320
removed reference to semantic versioning as MAgPIE does not fullfill …
tscheypidi Apr 21, 2023
e633e94
Added appendReportMAGICC7 to FSDP_collect
mscrawford Apr 22, 2023
48089d0
removed subfolder structure to avoid scattering of files across subfo…
flohump Apr 24, 2023
34f431b
Merge branch 'FSEC' of github.com:FelicitasBeier/magpie into FSEC
flohump Apr 24, 2023
e577968
adjusted npi_ndc scripts to hopefully work with 67k cells as well as …
tscheypidi Apr 26, 2023
5131826
update
tscheypidi Apr 26, 2023
15548d3
bugfix
tscheypidi Apr 26, 2023
01eeae4
update scenario_config SSP2EU + GHG emissions pricing policies with e…
flohump Apr 26, 2023
b0c902e
bugfix in start_npi_ndc
tscheypidi Apr 27, 2023
32a47cc
updated config
tscheypidi Apr 27, 2023
2d0c1cd
added comment
tscheypidi Apr 27, 2023
37fbb83
Update scripts/npi_ndc/start_npi_ndc.R
tscheypidi Apr 27, 2023
2fbab47
Merge pull request #553 from tscheypidi/develop
tscheypidi Apr 27, 2023
252106d
Update config/default.cfg
flohump Apr 27, 2023
90221d2
fixed 2 typos and added missing CHANGELOG entry
tscheypidi Apr 27, 2023
48a6325
Merge pull request #555 from tscheypidi/develop
tscheypidi Apr 27, 2023
afd9c13
changelog
flohump Apr 27, 2023
5d7afc9
Update input data rev4.85
flohump Apr 28, 2023
414d5f3
debug sets drivers module
flohump Apr 28, 2023
537cced
Merge pull request #554 from flohump/f_SSP2EU
flohump Apr 28, 2023
174e4c8
update GST maps
flohump May 5, 2023
d424d1c
Update validation.tgz in fsec.R
flohump May 5, 2023
fd93541
magpie release 4.6.6
pfuehrlich-pik May 5, 2023
e50c826
added EFV volume grid level output for plotting
FelicitasBeier May 5, 2023
acf63c4
change in FSDP_collect to incorporate new water output
FelicitasBeier May 5, 2023
9578fcc
updated changelog
FelicitasBeier May 5, 2023
78d8412
added new output variable for water
FelicitasBeier May 8, 2023
ec45169
unit bugfix in water script
FelicitasBeier May 9, 2023
d0ab926
Merge branch 'FSEC' of github.com:FelicitasBeier/magpie
pfuehrlich-pik May 10, 2023
709582f
magpie release 4.6.6
pfuehrlich-pik May 10, 2023
0b4547b
Update CHANGELOG.md
FelicitasBeier May 10, 2023
e243879
Merge pull request #556 from pfuehrlich-pik/master
pfuehrlich-pik May 10, 2023
e67fb52
merge master into develop
pfuehrlich-pik May 10, 2023
136da8e
Merge branch 'master' into master_to_develop
pfuehrlich-pik May 10, 2023
40b8f25
Merge pull request #559 from pfuehrlich-pik/master_to_develop
pfuehrlich-pik May 10, 2023
234a49a
magpie release 4.6.7
pfuehrlich-pik May 10, 2023
8e21adf
move changelog message
pfuehrlich-pik May 10, 2023
62ae230
Merge pull request #560 from pfuehrlich-pik/master
pfuehrlich-pik May 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
^renv$
^renv\.lock$
^.*\.zenodo.json$
39 changes: 21 additions & 18 deletions .Rprofile
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
# source global .Rprofile (very important to load user specific settings)
# DO NOT EDIT THIS LINE!
if(file.exists("~/.Rprofile")) source("~/.Rprofile")
# | (C) 2008-2023 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: magpie@pik-potsdam.de
Sys.setenv(RENV_PATHS_LIBRARY = "renv/library")

source("renv/activate.R")

# This profile can be used to link the model to a specified library snapshot
# (e.g. if your model version is from an older date and does not work with the
# newest libraries anymore)
# By default it is not active. Just uncomment the following lines and set the
# snapshot path to a path of your choice
# Please make also sure that in your config file this .Rprofile file is copied
# to the model output folder. Otherwise, the run itself will again use the
# default library set!
if (!"https://rse.pik-potsdam.de/r/packages" %in% getOption("repos")) {
options(repos = c(getOption("repos"), pik = "https://rse.pik-potsdam.de/r/packages"))
}

# bootstrapping, will only run once after this repo is freshly cloned
if (isTRUE(rownames(installed.packages(priority = "NA")) == "renv")) {
message("R package dependencies are not installed in this renv, installing now...")
renv::hydrate() # auto-detect and install all dependencies
message("Finished installing R package dependencies.")
}

# snapshot <- "/p/projects/rd3mod/R/libraries/snapshots/2020_03_10"
# if(file.exists(snapshot)) {
# cat("Setting libPaths to",snapshot,"\n")
# .libPaths(snapshot)
# } else {
# cat("Could not find",snapshot,"\n")
# }
# source global .Rprofile (very important to load user specific settings)
if (file.exists("~/.Rprofile")) {
source("~/.Rprofile")
}
33 changes: 21 additions & 12 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
#!/usr/bin/env Rscript

if(!requireNamespace("gms", quietly = TRUE)) install.packages("gms", repos = c("https://rse.pik-potsdam.de/r/packages/", "https://cloud.r-project.org"))
gmsRequiredVersion <- "0.24.1"
if (tryCatch(utils::packageVersion("gms") < gmsRequiredVersion, error = function(error) TRUE)) {
message("gms >= ", gmsRequiredVersion, " is required, installing now...")
install.packages("gms")
}

message("Checking files for tabs... ", appendLF = FALSE)
gms::checkNoTabs(pattern = "\\.(R|Rprofile|gms|cfg|bib)$", excludeFolders = c("output", "renv", ".git"))
message("done.")

# run codeCheck
null <- gms::codeCheck(strict=TRUE)
invisible(gms::codeCheck(strict = TRUE))
message("")

# make sure that files are not too big

maxfilesize <- function(max=512) {
files <- union(system("git ls-tree -r HEAD --name-only", intern=TRUE),
system("git diff --cached --name-only", intern=TRUE))
out <- data.frame(files=files,size=round(file.size(files)/1024,2))
out <- out[!is.na(out$size),]
out <- out[out$size > max,]
if(nrow(out)>0) {
stop(nrow(out), " files with size > ",max,"kB detected: \n",paste0(out$files," (", out$size, "kB)", collapse = "\n"))
# make sure that files are not too big
maxfilesize <- function(max) {
files <- union(system("git ls-tree -r HEAD --name-only", intern = TRUE),
system("git diff --cached --name-only", intern = TRUE))
out <- data.frame(files = files, size = round(file.size(files) / 1024, 2))
out <- out[!is.na(out$size), ]
out <- out[out$size > max, ]
if (nrow(out) > 0) {
stop(nrow(out), " files with size > ", max, "kB detected: \n",
paste0(out$files, " (", out$size, "kB)", collapse = "\n"))
}
message("All files are smaller than ",max,"kB\n")
message("All files are smaller than ", max, "kB\n")
}

maxfilesize(250)
100 changes: 48 additions & 52 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,53 @@
## :bird: Purpose of this PR :bird:
## :bird: Description of this PR :bird:

- Briefly explain the purpose of this pull request

## :wrench: Checklist for PR creator :wrench:

- [ ] Labeling pull request correctly [from the label list](https://github.com/magpiemodel/magpie/labels).

* Low risk : Simple bugfixes (missing files, updated documentation, typos) or Start/output scripts
* Medium risk : New realization / Changes to existing realization / Other changes which don't modify default.cfg
* High risk : New input files (if cfg$input is changed in default.cfg) / Modification to core model (eg. changes in equations, calculations, introduction of new sets etc.) / Other changes in default.cfg

- [ ] Providing additional information based on PR label

* Low risk : No new model run needed.
* Medium risk : Default run based on the current version of the fork from which PR is made
* High risk
* Default run from the current develop branch
* Default run based on the current version of the fork from which PR is made

- [ ] :chart_with_downwards_trend: Performance loss/gain from current default behavior :chart_with_upwards_trend:
* Current develop branch default : ** mins
* This PR's default : ** mins

- [ ] Added changes to `CHANGELOG.md`
- [ ] Compilation check (model starts without compilation errors - use `gams main.gms action=c` in model folder for testing).
- [ ] No hard coded numbers and cluster/country/region names.
- [ ] The new code doesn't contain declared but unused parameters or variables.
- [ ] Where relevant, In-code comments added including documentation comments.
- [ ] Made sure that documentation created with [`goxygen`](https://github.com/pik-piam/goxygen) is okay (use `goxygen::goxygen()` for testing).
- [ ] Changes to [`magpie4`](https://github.com/pik-piam/magpie4) R library for post processing of model output (ideally backward compatible).
- [ ] Self-review of my own code.
- [ ] For high risk runs: validation of major model indicators - Land-use, emissions, food prices, Tau. %Delete this line in case it is not a high risk run%

## :warning: Additional notes or warnings :warning:
NA

## :rotating_light: Checklist for RSE reviewer :rotating_light:

- [ ] PR is labeled correctly.
- [ ] `CHANGELOG` is updated correctly
- [ ] No hard coded numbers and cluster/country/region names.
- [ ] No unnecessary increase in module interfaces
- [ ] All required updates in interfaces (if any) have been properly adressed in the module contracts
- [ ] In-code comments and documentation comments are satisfactory.
- [ ] model behavior/performance is satisfactory.
- [ ] Requested changes (if any) were applied correctly

## :rotating_light: Checklist for MAgPIE reviewer :rotating_light:

- [ ] PR is labeled correctly.
- [ ] `CHANGELOG` is updated correctly
- [ ] No hard coded numbers and cluster/country/region names.
- [ ] Changes to the model are scientifically sound
- [ ] In-code comments and documentation comments are satisfactory.
- [ ] model behavior/performance is satisfactory.
- [ ] Requested changes (if any) were applied correctly
- [ ] Label pull request [from the label list](https://github.com/magpiemodel/magpie/labels).
- **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`](https://github.com/pik-piam/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()`](https://github.com/pik-piam/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 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,...)

### :chart_with_downwards_trend: Performance changes :chart_with_upwards_trend:

- Current develop branch default : ** mins
- This PR's default : ** 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)
33 changes: 11 additions & 22 deletions .github/workflows/test-code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,30 @@ on:
- main
- master
- develop

name: check

jobs:
check:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1

- name: Query dependencies
run: |
saveRDS("gms", ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
- name: Remove .Rprofile
run: rm .Rprofile

- name: Cache R packages
uses: actions/cache@v2
- uses: r-lib/actions/setup-r@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
extra-repositories: https://cloud.r-project.org https://rse.pik-potsdam.de/r/packages/

- name: Install R dependencies
run: |
repos <- c("https://cloud.r-project.org","https://rse.pik-potsdam.de/r/packages/")
install.packages(c("remotes"), repos=repos)
remotes::install_cran("gms", repos=repos)
shell: Rscript {0}

uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: gms
extra-packages: gms

- name: pre-commit Hook
run: source(".githooks/pre-commit")
shell: Rscript {0}


7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,16 @@ magpie_calib.*
#ignore run specific files and folders
/225*/
/run_details/
/logs/
*.out
/scripts/npi_ndc/npi_ndc_overview.txt
Rplots.pdf

#ignore GAMS license
gamslice.txt

#ignore lock file
/.lock

/renv.lock
.Rproj.user
2 changes: 2 additions & 0 deletions .lintr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
linters: lucode2::lintrRules()
encoding: "UTF-8"
23 changes: 23 additions & 0 deletions .snapshot.Rprofile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# source global .Rprofile (very important to load user specific settings)
# DO NOT EDIT THIS LINE!
if(file.exists("~/.Rprofile")) source("~/.Rprofile")


# This profile can be used to link the model to a specified library snapshot
# (e.g. if your model version is from an older date and does not work with the
# newest libraries anymore).
# By default it is not active. Just uncomment the following lines and set the
# snapshot path to a path of your choice.
# Please make also sure that in your config file this .Rprofile file is copied
# to the model output folder. Otherwise, the run itself will again use the
# default library set!

# PLEASE NOTE: snapshots ending with '_R4' require R 4.1 (piam/1.24 and newer),
# other snapshots require R 3.6 (piam/1.20)
# snapshot <- "/p/projects/rd3mod/R/libraries/snapshots/2022_10_28_R4"
# if(file.exists(snapshot)) {
# cat("Setting libPaths to",snapshot,"\n")
# .libPaths(snapshot, include.site = FALSE)
# } else {
# cat("Could not find",snapshot,"\n")
# }
17 changes: 15 additions & 2 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "MAgPIE - An Open Source land-use modeling framework",
"version": "4.3.4",
"version": "4.6.7",
"creators": [
{
"name": "Dietrich, Jan Philipp",
Expand Down Expand Up @@ -65,10 +65,18 @@
"affiliation": "Potsdam Institute for Climate Impact Research",
"orcid": "0000-0003-1282-400X"
},
{
"name": "Leip, Debbora",
"affiliation": "Potsdam Institute for Climate Impact Research"
},
{
"name": "Klein, David",
"affiliation": "Potsdam Institute for Climate Impact Research"
},
{
"name": "Singh, Vartika",
"affiliation": "Potsdam Institute for Climate Impact Research"
},
{
"name": "Ambrósio, Geanderson",
"affiliation": "Potsdam Institute for Climate Impact Research"
Expand All @@ -81,6 +89,11 @@
"name": "Biewald, Anne",
"affiliation": "Potsdam Institute for Climate Impact Research"
},
{
"name": "Führlich, Pascal",
"affiliation": "Potsdam Institute for Climate Impact Research",
"orcid": "0000-0002-6856-8239"
},
{
"name": "Lotze-Campen, Hermann",
"affiliation": "Potsdam Institute for Climate Impact Research",
Expand All @@ -96,5 +109,5 @@
"license": {
"id": "AGPL-3.0-or-later"
},
"publication_date": "2021-04-30"
"publication_date": "2023-05-10"
}
Loading