Skip to content

Commit

Permalink
Merge pull request #1938 from lecfab/learningDoc
Browse files Browse the repository at this point in the history
Tutorials: update 12_calibration, add 17_regions-and-abbr
  • Loading branch information
lecfab authored Dec 30, 2024
2 parents 841c444 + 6b09c6f commit 8bdd346
Show file tree
Hide file tree
Showing 6 changed files with 281 additions and 131 deletions.
2 changes: 1 addition & 1 deletion tutorials/02_RunningREMIND.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ The optimization in REMIND requires a lot of input data. For example, the model
/p/projects/rd3mod/inputdata/sources
```

The data are mostly in csv files. During the input data preparation, these files are read and processed, using functions from the *mrremind* package. Input data are available on country-level. Then, depending on the regionmapping file you chose in the config file of your run, the country-level data are aggregated into regions, e.g. to LAM (Latin America), EUR (Europe) and so on. Finally, the data are stored as .cs3r or .cs4r files in various input folders of your REMIND directory. These files are basically tables, too, that you can open with a text editor or Excel. For example, you find the input file `pm_histCap.cs3r` in your REMIND directory under `core/input`. It provides the model with historically observed values of installed capacities of some technologies in the respective regions.
The data are mostly in csv files. During the input data preparation, these files are read and processed, using functions from the *mrremind* package. Input data are available on country-level. Then, depending on the regionmapping file you chose in the config file of your run, the country-level data are aggregated into regions, e.g. to LAM (Latin America), EUR (Europe) and so on. Finally, the data are stored as `.cs3r` or `.cs4r` files in various input folders of your REMIND directory. These files are basically tables, too, that you can open with a text editor or Excel. For example, you find the input file `pm_histCap.cs3r` in your REMIND directory under `core/input`. It provides the model with historically observed values of installed capacities of some technologies in the respective regions.
The regional resolution of the run is set in the `config/default.cfg` by
``` bash
cfg$regionmapping
Expand Down
2 changes: 1 addition & 1 deletion tutorials/04_RunningREMINDandMAgPIE.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Here's an example of a simple case. If you start a new coupled run with the scen

This process will continue until for as many iterations as set in `max_iterations` in `start_bundle_coupled.R` (see Check the Convergence below). The last iteration will run REMIND only, so REMIND will have run `max_iterations` times and MAgPIE wil have run `max_iterations - 1` times. So, if `max_iterations` is 5, the last REMIND run in this case will be `C_Base-rem-5` and the last MAgPIE iteration will be `C_Base-mag-4`.

The output of both models can be analyzed normally from these two runs. The REMIND .mif file contains also the MAgPIE variables. Additionally, at the end of a successful coupled run the coupling script will automatically merge the reports of the last runs of both models in a `.mif` file located in the root of REMIND's output folder, using the joint model name "REMIND-MAgPIE". In our example, that file will be `path_remind/output/C_SSP-Base.mif`.
The output of both models can be analyzed normally from these two runs. The REMIND `.mif` file contains also the MAgPIE variables. Additionally, at the end of a successful coupled run the coupling script will automatically merge the reports of the last runs of both models in a `.mif` file located in the root of REMIND's output folder, using the joint model name "REMIND-MAgPIE". In our example, that file will be `path_remind/output/C_SSP-Base.mif`.

So, in the end of the coupled run in this example, you should have a directory structure like:

Expand Down
2 changes: 1 addition & 1 deletion tutorials/06_Advanced_ChangeInputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ If you want to peek inside the archive to debug something or out of curiosity yo
2. Clone or pull the latest version of the [remind-preprocessing repo](https://github.com/remindmodel/pre-processing) to your tmp folder on the cluster and edit its `config/default.cfg` file by inserting the next revision number. Use the additional argument `dev` for testing. If an old revision number is used, the input data will not be recalculated. Input data for a new regional resolution will be recalculated based on the existing cache information in the PUC file.

3. Start the script with `Rscript submit_preprocessing.R`.
The .log file lists the progress and potential errors. This process might take a while (currently >8 hours).
The `.log` file lists the progress and potential errors. This process might take a while (currently >8 hours).

4. If the process terminates without errors, do a test run with the new input data. To do this, clone the REMIND repo and update the data input version `cfg$revision` in `config/default.cfg` using your recently created data revision number file and run one scenario (e.g. SSP2-Base).

Expand Down
2 changes: 1 addition & 1 deletion tutorials/09_Advanced_StandaloneModels.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ You can start a standalone model in the same manner as the main REMIND model by

There are a just a couple minor differences:

**scenario-config**: it is recommended to create a new .csv file tailored to your model, including the following:
**scenario-config**: it is recommended to create a new `.csv` file tailored to your model, including the following:
* Add a column named **model** and set this to your standalone model's filepath (e.g. standalone/NewModel.gms). This tells the start_functions to run the standalone model instead of main.gms.
* Add a column named **output** and set this to your new reporting file(s) (e.g. reporting_NewModel,validationSummary)
* **IF** running with start.R, edit **default.cfg** instead: set **cfg$model** to your model's filepath and **cfg$output** to your reporting file (e.g. c("reporting_NewModel","validationSummary"))
Expand Down
Loading

0 comments on commit 8bdd346

Please sign in to comment.