JGCRI / gcam-core

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

Errors in running GCAM v6.0 for GHG constraints #232

Open Cermouth opened 1 year ago

Cermouth commented 1 year ago

I used the files in /input/policy folder to create a scenario with global GHG emissions constraints. In the configuration file, I added the two lines:

    .......
    <Value name = "wind_update">../input/gcamdata/xml_original/onshore_wind.xml</Value>
<Value name = "solver">../input/solution/cal_broyden_config.xml</Value>
    <Value name = "dac">../input/gcamdata/xml_original/dac_ssp2.xml</Value>
**<Value name = "ghglimit">../input/policy/ghg_net0_constraint_global.xml</Value>
<Value name = "ghgmarket">../input/policy/ghg_link_global.xml</Value>**
</ScenarioComponents>
    ......

Then I ran the model but found so many error messages including "receive hector exception, timestep must equal 1". Since I changed the max iteration to 15,000, the model has been running for nearly 24 hours. Could anyone help me with that? I made it with GCAM v5.4 but got confused with v6.0.

Cermouth commented 1 year ago

I unpacked the release package again and that errors still appeared. After long messages of unsolved markets (that I met before), there are the messages I mentioned in this issue:

ERROR: ERROR:Receieve hector exception while running year 2026: ERROR:* Program exception: msg: Assertion failed: timestep must equal 1 ERROR:func: Hector::OHComponent::run ERROR:file: C:\Users\Pralit\model\gcam-core\cvs\objects\climate\source\hector\src\oh_component.cpp ERROR:ffile: C:\Users\Pralit\model\gcam-core\cvs\objects\climate\source\hector\src\oh_component.cpp ERROR: ERROR:line: 144 ERROR:

Could anyone help me with that? I didn't know how to deal with Hector issues... Thanks in advance!

ouyang363 commented 1 year ago

It seems like in ghg_link_global.xml, all markets are regions ... <market>USA</market>, <market>Africa_Northern</market> etc., I'm guessing all of them should be updated into <market>Global</market>, because the ghg_net0_constraint_global.xml is defined under a Global market

Cermouth commented 1 year ago

@ouyang363 Thanks for your advice! I updated the markets to Global and tried to re-run the model. But other errors occurred... Do you know what's wrong here?

ERROR: ERROR:Receieve hector exception while running year 2046: ERROR:* Program exception: msg: Assertion failed: box carbon is negative ERROR:func: Hector::oceanbox::update_state ERROR:file: C:\Users\Pralit\model\gcam-core\cvs\objects\climate\source\hector\src\oceanbox.cpp ERROR:ffile: C:\Users\Pralit\model\gcam-core\cvs\objects\climate\source\hector\src\oceanbox.cpp ERROR: ERROR:line: 337 ERROR:

Cermouth commented 1 year ago

Thanks in advance for anyone's attention and help! I uploaded the files I used this time here and hope that can be useful for finding errors: ghg0g_main_log.zip

ouyang363 commented 1 year ago

<constraint year="2050">0</constraint> Three things: 1) try not using a hard-zero constraints (you can use a -2 instead) 2) increase maximum iteration times from the default 2500 into 5000 3) include the dac_ssp2.xml add-on (already in the xml folder but not in default configuration) Try #1 and #2 first, if still having issues, then add #3.

pralitp commented 1 year ago

In GCAM 6.0 the accounting for the negative emission budget changed. Making it more stringent than in GCAM 5.4. Ultimately this depends on a number of factors, however most likely a net zero GHG constraint and stringent limit on negative CO2 emissions renders yours scenario infeasible. (I.e. too many non-CO2 GHG emissions which can not be sufficiently offset by negative CO2 emissions).

I would recommend removing the negative_emissions_budget_gSSP2.xml add on file and including the dac_ssp2.xml add on.

Cermouth commented 1 year ago

@pralitp @ouyang363 Thank you so much! It worked finally. Is there any document telling the difference about the influence of the emissions budget?

ouyang363 commented 1 year ago

Great! To complete this story, would you mind sharing all the modifications you've taken? (which can greatly help other users and improve our internal documentation)

Cermouth commented 1 year ago

Sure! I just followed what @ouyang363 and @pralitp recommended: 1) use emissions constraints of -1 instead of 0 2) increase maximum iteration times from the default 2500 into 5000 3) remove the negative_emissions_budget_gSSP2.xml line in the configuration xml 3) include the dac_ssp2.xml add-on in the configuration xml

Cermouth commented 1 year ago

Hello there. I am sorry to ask again about this issue, because I was trying to change the global GHG constraints to regional ones. I used the regional emissions constraints and GHG markets similar to the files for global constraints, but found the results are incorrect as shown in the screenshot, where only USA has net-zero emissions around 2050 and other regions just have emissions like that in the reference scenario. I didn't see any errors when running the model. So what may be the problem?

configuration.zip image

ouyang363 commented 1 year ago

if setting as regional markets, you need to 1) have region-specific constraints under each region: changing from <market>Global</market> into <market>USA</market>; <market>Canada</market> etc. for each region. 2) in the linked ghg file, also linked to regional markets for each region <market>Global</market> into <market>USA</market>; <market>Canada</market> etc

Cermouth commented 1 year ago

@ouyang363 Thanks for your reply! I think I have done what you said in the uploaded files, and I've got the results while just USA's are correct. I don't know why other regions cannot follow the emissions constraints I set here. Besides, these files worked well with GCAM v5.4, so I guess maybe it relates to some updated settings within the model...

ouyang363 commented 1 year ago

oh sorry I just saw your attachments and checked it. I think you may want to try to copy all those details (price-adjust, demand-adjust thing) currently only in your market USA for other regions in the linked GHG file (yes they are the same).

Cermouth commented 1 year ago

YES, it is the key! Thank you for answering!

debibooo commented 1 year ago

YES, it is the key! Thank you for answering!

Thanks for @ouyang363 @Cermouth useful information. But I am still confused when I just aim to constrain Chinese CO2 emissions. My questions are

  1. the ghg_net0_constraint_global seems to limit all GHG emissions, is it correct that setprice adjust=0 for nonco2 gases could represent CO2 constraint?
  2. I only renamed the market name for China and changed it in linked_co2_policy_China.xml, should I change all the market names and price-adjust for other regions? China_CN.zip