Skip to content

Process CO2 emission forcings for ScenarioMIP - #148

Open
paul-leopardi wants to merge 7 commits into
127-n2-and-o3-for-esm16-h-and-vlfrom
140-co2-emissions-scenarios
Open

Process CO2 emission forcings for ScenarioMIP#148
paul-leopardi wants to merge 7 commits into
127-n2-and-o3-for-esm16-h-and-vlfrom
140-co2-emissions-scenarios

Conversation

@paul-leopardi

@paul-leopardi paul-leopardi commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Closes #140

For each scenario, the code in CMIP7/esm1p6/atmosphere/co2/cmip7_ES_CO2_interpolate.py reads both the ScenarioMIP CO2 emission forcing data for CO2 and the ScenarioMIP aircraft CO2 emission forcing data, adds the two, then interpolates the time series and regrids the data to produce an ancillary file.

It turns out that the equivalent code in
CMIP7/esm1p6/atmosphere/co2/cmip7_EH_CO2_interpolate.py for the historical forcings interpolated monthly data from the cubes corresponding the the historical forcing data before collapsing the CO2 emission data by sector and the CO2 aircraft emission data by altitude. When this was tried for ScenarioMIP the task ran out of memory when interpolating the time series. The solution applied to both the EH and ES code is to collapse the respective cubes before interpolating the time series. That is why four files are changed.

The debugging work and a small amount of coding was assisted by Google Antigravity using Gemini 3.6 Flash (high).

@paul-leopardi paul-leopardi self-assigned this Aug 7, 2026
@read-the-docs-community

read-the-docs-community Bot commented Aug 7, 2026

Copy link
Copy Markdown

Documentation build overview

📚 CMIP7-Input | 🛠️ Build #34060792 | 📁 Comparing d3cd039 against latest (6217a09)

  🔍 Preview build  

1 file changed
± index.html

@paul-leopardi
paul-leopardi requested a review from blimlim August 7, 2026 06:23
@paul-leopardi
paul-leopardi marked this pull request as draft August 7, 2026 06:24
@paul-leopardi

Copy link
Copy Markdown
Collaborator Author

I created and ran the u-dq819.scenarios-co2 workflow. Logs are in /scratch/tm70/pcl851/cylc-run/u-dq819.scenarios-co2/run9/log

Output is in /g/data/tm70/pcl851/CMIP7/esm1p6_ancil/2026.08.07
In particular, the esm-scen7-h to esm-scen7-vl output is in

/g/data/tm70/pcl851/CMIP7/esm1p6_ancil/2026.08.07/esm-scenarios/h/atmosphere/forcing/global.N96/2026.08.07/CO2_fluxes_h_2022_2100_cmip7.anc
/g/data/tm70/pcl851/CMIP7/esm1p6_ancil/2026.08.07/esm-scenarios/hl/atmosphere/forcing/global.N96/2026.08.07/CO2_fluxes_hl_2022_2100_cmip7.anc
/g/data/tm70/pcl851/CMIP7/esm1p6_ancil/2026.08.07/esm-scenarios/m/atmosphere/forcing/global.N96/2026.08.07/CO2_fluxes_m_2022_2100_cmip7.anc
/g/data/tm70/pcl851/CMIP7/esm1p6_ancil/2026.08.07/esm-scenarios/vl/atmosphere/forcing/global.N96/2026.08.07/CO2_fluxes_vl_2022_2100_cmip7.anc

The directory name esm-scenarios is arbitrary and can be changed,

@paul-leopardi
paul-leopardi requested a review from MartinDix August 7, 2026 06:38
@paul-leopardi
paul-leopardi marked this pull request as ready for review August 7, 2026 06:38
@paul-leopardi

Copy link
Copy Markdown
Collaborator Author

See the comment in #140 as well as https://input4mips-cvs.readthedocs.io/en/latest/dataset-overviews/anthropogenic-slcf-co2-emissions/#scenariomip_2. The workflow needs to be re-run using 1-1-2 rather than 1-1-1 datasets.

@paul-leopardi
paul-leopardi marked this pull request as draft August 10, 2026 04:32
@paul-leopardi

Copy link
Copy Markdown
Collaborator Author

The 1-1-2 datasets are not yet available at /g/data/qv56/replicas/input4MIPs/CMIP7/ScenarioMIP/IIASA-IAMC
I have submitted https://track.nci.org.au/servicedesk/customer/portal/5/HELP-210008 to ask for these to be loaded.

@paul-leopardi

Copy link
Copy Markdown
Collaborator Author

The 1-1-2 datasets are now available, and I have updated and run the u-dq819.scenarios-co2 workflow. Logs are in /scratch/tm70/pcl851/cylc-run/u-dq819.scenarios-co2/run13/log and the relevant output is

/g/data/tm70/pcl851/CMIP7/esm1p6_ancil/2026.08.14/esm-scenarios/h/atmosphere/forcing/global.N96/2026.08.14/CO2_fluxes_h_2022_2100_cmip7.anc
/g/data/tm70/pcl851/CMIP7/esm1p6_ancil/2026.08.14/esm-scenarios/hl/atmosphere/forcing/global.N96/2026.08.14/CO2_fluxes_hl_2022_2100_cmip7.anc
/g/data/tm70/pcl851/CMIP7/esm1p6_ancil/2026.08.14/esm-scenarios/m/atmosphere/forcing/global.N96/2026.08.14/CO2_fluxes_m_2022_2100_cmip7.anc
/g/data/tm70/pcl851/CMIP7/esm1p6_ancil/2026.08.14/esm-scenarios/vl/atmosphere/forcing/global.N96/2026.08.14/CO2_fluxes_vl_2022_2100_cmip7.anc

@paul-leopardi
paul-leopardi marked this pull request as ready for review August 14, 2026 04:44

@blimlim blimlim left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @paul-leopardi, I've focused on the code changes in this review which overall look good to me. I've made a couple of suggestions which I think could help with performance and readability.

The suggestions will likely cause roundoff level changes in the produced files, and so
if there's a preference to get the simulations going as soon as possible with the existing files, then it might be best to skip my suggestions

Comment on lines +88 to +90
interpolated = interpolate_monthly(
cube, CMIP7_SM_BEG_YEAR, CMIP7_SM_END_YEAR
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is also relevant to #135, and so I'll add a comment there too in my review there.

It's not crucial, but might be good to move the call to interpolate_monthly out from the lower level load_cmip7_... functions and into the top level processing functions like cmip7_es_co2_anthro_interpolate.

This would allow for the time interpolation to be applied after the data has:

  1. been regridded onto the ESM1.6 atmosphere grid
  2. had air and non-air emissions combined together

The regridding onto the atmosphere grid reduces the grid size from 360x720 (259,200 points) to 145x192 (27,8400) points, and so applying the time interpolation afterwards should make it a bit quicker/need less resources.

I think this could also help a with readability. To me I think it's a bit clearer if the load_cmip7_... functions to return the loaded cubes with minimal processing, and for the bulk of the processing to be carried out in the top level processing functions. This would be consistent with how the regridding is applied in the top level processing functions.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paul-leopardi, following a bit more discussion - I'd ignore this suggestion. The order probably isn't causing a major bottleneck, and as long as we're happy with the output data as is, it might be better to leave this unchanged

Comment on lines +85 to +87
if cube.coords("altitude"):
cube = cube.collapsed(["altitude"], iris.analysis.SUM)
cube.remove_coord("altitude")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to this comment:

I think it would be clearest for the reduction on "altitude" and "sector" to be moved up to the top-level processing functions like cmip7_es_co2_anthro_interpolate. At the moment the reduction isn't applied at consistent levels for the scenarios and historical CO2, e.g. it's done within the loading functions used for the historical air emissions:

if cube.coords("altitude"):
cube = cube.collapsed(["altitude"], iris.analysis.SUM)
cube.remove_coord("altitude")
return cube

but for the non-air historical emissions, it's done in the "top level" processing function cmip7_eh_co2_anthro_interpolate:

if cube.coords("sector"):
cube = cube.collapsed(["sector"], iris.analysis.SUM)
cube.remove_coord("sector")

As you mentioned in the PR, there are performance reasons for applying the reduction before calling interpolate_monthly, and so as suggested here, it might make sense to move the interpolate_monthly call too.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to my comment here, happy for you to leave this as is and skip the above suggestion

@MartinDix

Copy link
Copy Markdown
Collaborator

Data looks good.

inew inew

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

Successfully merging this pull request may close these issues.

Produce CO2 ancillaries for the ACCESS-ESM1.6 emissions-driven ScenarioMIP h and vl experiments

3 participants