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

Question about parsing xml after changing the Historical Year #339

Open
837288251 opened this issue Sep 9, 2023 · 8 comments
Open

Question about parsing xml after changing the Historical Year #339

837288251 opened this issue Sep 9, 2023 · 8 comments

Comments

@837288251
Copy link

837288251 commented Sep 9, 2023

I have changed the Historical year and have successfully generated the whole xml file. I have also got rid of the "Historical Year" error checking in C++ source code. But when I what to run the run-gcam.bat file to parse xml file , the parsing work stopped after socioeconomics_gSSP2.xml and let me press any key to close the cmd screen, withouting showing any further information.
264525388-3d3a8901-2348-41b2-bc11-132b42dea7b0

I don't know if the problem is socioeconomics_gSSP2.xml or resources.xml? Or the problem of share-weight?Thanks.

@Lance-bot
Copy link

Did you solve it? I have the same problem

@837288251
Copy link
Author

Did you solve it? I have the same problem

It seemed that there were some NAs in the xml, and technology disappearred under the subsector might also cause the silent crash.

@Lance-bot
Copy link

Lance-bot commented Jan 5, 2025

Yes, I also found that there was a problem with some data in the xml file. How did you solve it?Image

@Lance-bot
Copy link

How to eliminate these NAs?Thanks.

@ssmithClimate
Copy link
Contributor

I assume you are regenerating the set of XMLs using gcamdata. We are aware that the current R scripts are not robust to changing the historical years. We are working on this, and we are aiming for the next model release to have some significant improvements in this area.

@Lance-bot
Copy link

Thank you for your response! I understand that this is a known limitation in the current R scripts for GCAM, and I appreciate that improvements are being planned for the next model release.

When I used interpolation to fill in the missing data, I encountered warnings during run-gcam. Is there currently a solution to this issue?Image

@837288251
Copy link
Author

Yes, I also found that there was a problem with some data in the xml file. How did you solve it?Image

It seems that you want to change the time step from 5 years to 1 year, which needs to make lots of changes to the gcamdata. As you showed in the picture, you need to find the csv file related to income-elasticity and fill the time gaps. However, I don't know whether the 1-year-time-step makes sense when you run gcam.bat,maybe it's related to the core C++ code.

@pkyle
Copy link
Contributor

pkyle commented Jan 9, 2025

The issue is in input/gcamdata/R/zenergy_L210.resources.R which has the code

    A21.globalrsrctech_cost %>%
      repeat_add_columns(GCAM_region_names) %>%
      select(LEVEL2_DATA_NAMES[["ResReserveTechCost"]]) -> L210.ResTechCost

    A21.globalrsrctech_coef %>%
      repeat_add_columns(GCAM_region_names) %>%
      select(LEVEL2_DATA_NAMES[["ResReserveTechCoef"]])-> L210.ResTechCoef

That code block should be doing the standard interpolation/extrapolation to all model years. I copied an example block in a different issue #504 (comment)
Alternatively you could ad 1-year timesteps to the columns of data tables energy/A21.globalrsrctech_coef.csv and energy/A21.globalrsrctech_cost.csv but it would be a pain and you'd also need to update the "Column types" of those csv files to include all of the new years.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants