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

CO2 Emissions Output Issue in GCAM v7.0 Model #515

Closed
FanWu1020 opened this issue Feb 10, 2025 · 4 comments
Closed

CO2 Emissions Output Issue in GCAM v7.0 Model #515

FanWu1020 opened this issue Feb 10, 2025 · 4 comments

Comments

@FanWu1020
Copy link

Dear all,

I am currently using GCAM v7.0 and have encountered a couple of questions regarding the CO2 emissions outputs.

  1. While comparing the model outputs for "CO2 emissions by region" with the sum of "CO2 emissions by tech (excluding resource production)" and "CO2 emissions by resource production", I noticed that the sum does NOT match "CO2 emissions by region." However, according to the official GCAM documentation(https://jgcri.github.io/gcam-doc/v7.0/outputs_emissions.html), "CO2 emissions by region" is defined as the sum of these two components. Could you help explain why there is a discrepancy between the sum and the "CO2 emissions by region"?

  2. Additionally, could you please clarify which specific query in GCAM v7.0 corresponds to "fossil fuel and industrial CO2 emissions"?

Thank you for your assistance in advance!

@pkyle
Copy link
Contributor

pkyle commented Feb 10, 2025

All of these queries represent fossil fuel and industrial CO2. Land use change CO2 is estimated in a different query called LUC emissions by region.
I just checked from a recent run and don't see any discrepancy; the screengrab is for the USA region. Just to be clear I've copied the XPATH of the queries below; one thing to check is whether fugitive CO2 emissions CO2_FUG from resource production are being correctly handled in your queries.

<emissionsQueryBuilder title="CO2 emissions by region">
    <axis1 name="region">region</axis1>
    <axis2 name="Year">emissions</axis2>
    <xPath buildList="true" dataName="emissions" group="false" sumAll="false">*[@type = 'sector' (:collapse:) or @type = 'resource' (:collapse:)](: / *[@type = 'subresource' (: collapse :)] :)//*[((@name='CO2' or @name = 'CO2_FUG'))]/emissions/node()</xPath>
    <comments/>
</emissionsQueryBuilder>

<emissionsQueryBuilder title="CO2 emissions by tech (excluding resource production)">
    <axis1 name="technology">technology</axis1>
    <axis2 name="Year">emissions</axis2>
    <xPath buildList="true" dataName="emissions" group="false" sumAll="false">*[@type = 'sector' ]/*[@type='subsector']/*[@type='technology']//
            CO2/emissions/node()</xPath>
    <comments/>
</emissionsQueryBuilder>

<emissionsQueryBuilder title="CO2 emissions by resource production ">
    <axis1 name="GHG">GHG</axis1>
    <axis2 name="Year">emissions</axis2>
    <xPath buildList="true" dataName="emissions" group="false" sumAll="false">*[@type = 'resource']//*[@type = 'GHG' and (@name = "CO2" or @name = "CO2_FUG")]/emissions/node()</xPath>
    <comments/>
    <labelRewriteList append-values="false">
        <level name="GHG">
            <rewrite from="CO2_FUG" to="CO2"/>
        </level>
    </labelRewriteList>
</emissionsQueryBuilder>
Image

@FanWu1020
Copy link
Author

All of these queries represent fossil fuel and industrial CO2. Land use change CO2 is estimated in a different query called LUC emissions by region. I just checked from a recent run and don't see any discrepancy; the screengrab is for the USA region. Just to be clear I've copied the XPATH of the queries below; one thing to check is whether fugitive CO2 emissions CO2_FUG from resource production are being correctly handled in your queries.

<emissionsQueryBuilder title="CO2 emissions by region">
    <axis1 name="region">region</axis1>
    <axis2 name="Year">emissions</axis2>
    <xPath buildList="true" dataName="emissions" group="false" sumAll="false">*[@type = 'sector' (:collapse:) or @type = 'resource' (:collapse:)](: / *[@type = 'subresource' (: collapse :)] :)//*[((@name='CO2' or @name = 'CO2_FUG'))]/emissions/node()</xPath>
    <comments/>
</emissionsQueryBuilder>

<emissionsQueryBuilder title="CO2 emissions by tech (excluding resource production)">
    <axis1 name="technology">technology</axis1>
    <axis2 name="Year">emissions</axis2>
    <xPath buildList="true" dataName="emissions" group="false" sumAll="false">*[@type = 'sector' ]/*[@type='subsector']/*[@type='technology']//
            CO2/emissions/node()</xPath>
    <comments/>
</emissionsQueryBuilder>

<emissionsQueryBuilder title="CO2 emissions by resource production ">
    <axis1 name="GHG">GHG</axis1>
    <axis2 name="Year">emissions</axis2>
    <xPath buildList="true" dataName="emissions" group="false" sumAll="false">*[@type = 'resource']//*[@type = 'GHG' and (@name = "CO2" or @name = "CO2_FUG")]/emissions/node()</xPath>
    <comments/>
    <labelRewriteList append-values="false">
        <level name="GHG">
            <rewrite from="CO2_FUG" to="CO2"/>
        </level>
    </labelRewriteList>
</emissionsQueryBuilder>
Image

Hi Page, really appreciate the quick feedback and suggestions. I'll check my database and model settings again. Super grateful for this.

@FanWu1020
Copy link
Author

All of these queries represent fossil fuel and industrial CO2. Land use change CO2 is estimated in a different query called LUC emissions by region. I just checked from a recent run and don't see any discrepancy; the screengrab is for the USA region. Just to be clear I've copied the XPATH of the queries below; one thing to check is whether fugitive CO2 emissions CO2_FUG from resource production are being correctly handled in your queries.

<emissionsQueryBuilder title="CO2 emissions by region">
    <axis1 name="region">region</axis1>
    <axis2 name="Year">emissions</axis2>
    <xPath buildList="true" dataName="emissions" group="false" sumAll="false">*[@type = 'sector' (:collapse:) or @type = 'resource' (:collapse:)](: / *[@type = 'subresource' (: collapse :)] :)//*[((@name='CO2' or @name = 'CO2_FUG'))]/emissions/node()</xPath>
    <comments/>
</emissionsQueryBuilder>

<emissionsQueryBuilder title="CO2 emissions by tech (excluding resource production)">
    <axis1 name="technology">technology</axis1>
    <axis2 name="Year">emissions</axis2>
    <xPath buildList="true" dataName="emissions" group="false" sumAll="false">*[@type = 'sector' ]/*[@type='subsector']/*[@type='technology']//
            CO2/emissions/node()</xPath>
    <comments/>
</emissionsQueryBuilder>

<emissionsQueryBuilder title="CO2 emissions by resource production ">
    <axis1 name="GHG">GHG</axis1>
    <axis2 name="Year">emissions</axis2>
    <xPath buildList="true" dataName="emissions" group="false" sumAll="false">*[@type = 'resource']//*[@type = 'GHG' and (@name = "CO2" or @name = "CO2_FUG")]/emissions/node()</xPath>
    <comments/>
    <labelRewriteList append-values="false">
        <level name="GHG">
            <rewrite from="CO2_FUG" to="CO2"/>
        </level>
    </labelRewriteList>
</emissionsQueryBuilder>
Image

Hi Page, after checking my model setup, I found that I had added constraints for a few special CO2 gases, other than CO2 and CO2_FUG, in some policy files. However, when using the queries to call the CO2 emission results, I had not accounted for the need to exclude these specific CO2 gases, which led to the issue of double-counting in the results.
I have now resolved the issue. Once again, thanks for your support!

@pkyle
Copy link
Contributor

pkyle commented Feb 11, 2025

Oh yeah, that's a very common error when using named CO2 objects, because so many of the queries were written in a way that just adds up (i.e. double counts) all of the CO2 quantities from technologies that produce multiple named CO2 objects. One workaround is to modify your Main_queries.xml file to always disambiguate the CO2 type. In the XPATH, instead of, e.g.,

<xPath buildList="true" dataName="emissions" group="false" sumAll="false">*[@type = 'sector' ]/*[@type='subsector']/*[@type='technology']//
            CO2/emissions/node()</xPath>

To instead use the notation you see in the resource queries:

<xPath buildList="true" dataName="emissions" group="false" sumAll="false">*[@type = 'sector' ]/*[@type='subsector']/*[@type='technology']//
           *[@type = 'GHG' and contains(@name, "CO2")]/emissions/node()</xPath>

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

2 participants