JGCRI / gcam-core

GCAM -- The Global Change Analysis Model
http://jgcri.github.io/gcam-doc/
Other
263 stars 159 forks source link

Historical calibration to xx is not possible! Setting final calibration year to default year (2015) #328

Closed 837288251 closed 11 months ago

837288251 commented 11 months ago

Hi! For some reason I have to change historical year to future year(2020). Now I have already changed the file in gcamdata and have successfully generated the xml files. But when I want to use the ModelInterface to show my result, the cmd shows "Historical calibration to 2020 is not possible! Setting final calibration year to default year (2015)". I don't know which file to change in order to further parsing the xml file. I used exe/run-gcam.bat to run the xml. Is that right?

837288251 commented 11 months ago
image
pralitp commented 11 months ago

First let me caveat that I'm not quite sure what gcamdata is doing when you set the final calibration year to 2020. I can tell you for sure that most (all?) of the historical data sets do not have values up to and including 2020. Perhaps gcamdata is simply extending historical values but that is almost certainly not what you are looking for.

With respect to your error directly: This looks like a well intentioned error checking that is baked into the C++. The idea being we don't want users to think they can simply change the final-calibration-year in the XML and the model will know what to do. But of course it is too simplistic to be able to understand if you re-configured gcamdata to generate an alternative final-calibration-year as you did.

To fix this will unfortunately need a modification to the C++ source code. You can find: https://github.com/JGCRI/gcam-core/blob/8d00382cde133119b0beca9716e8494506a8fc9c/cvs/objects/util/base/source/model_time.cpp#L116

And get rid of all of the error checking such that the if block reads:

            else if ( nodeName == "final-calibration-year" ){
                mFinalCalibrationYear =  XMLParseHelper::getValue<int>( aNode );
            }

Once you make the change to do forget to recompile the C++.

(Note: My links are all to GCAM v6 as that appears to be what you are running, if you want to switch to a different version you can adjust the links accordingly)

837288251 commented 10 months ago

@pralitp

Sorry to have another question.These days I have tried the method you provided and was able to get rid of the "Historical Year" error checking. Now the run-gcam.bat file shows me another error.

image

After that the parsing work stopped and let me press any key to close the cmd screen, withouting showing any further information. I don't know if the problem is socioeconomics_gSSP2.xml or resources.xml.