Skip to content

Scm Run#47

Merged
mzecc merged 20 commits intoopenscm:mainfrom
mzecc:scm_running
Apr 1, 2026
Merged

Scm Run#47
mzecc merged 20 commits intoopenscm:mainfrom
mzecc:scm_running

Conversation

@mzecc
Copy link
Copy Markdown
Collaborator

@mzecc mzecc commented Mar 15, 2026

Description

Added class for MAGICC run.

Checklist

Please confirm that this pull request has done the following:

  • Tests added
  • Documentation added (where applicable)
  • Changelog item added to changelog/

@mzecc
Copy link
Copy Markdown
Collaborator Author

mzecc commented Mar 15, 2026

It seems to work fine but I still have to check it with a REMIND output. I leave here some considerations/questions:

  1. I have created a class very similar to
    class AR6SCMRunner:
    . I tried as well to use directly the function and the class and both work.
  2. The files with the GSAT ensemble members are very large. Should we just assess the quantiles? Are the ensemble members guaranteed to have the same ordering?
  3. I am getting different results compared to the emissions_harmonization_historical for the same input and I do not really understand why.

@znichollscr
Copy link
Copy Markdown
Collaborator

  1. I tried as well to use directly the function and the class and both work

Ok great. Once you've fixed the merge conflicts I'll take a look. Maybe there are some simplifications we can make, but sounds like a good start.

2. Should we just assess the quantiles?

Yep: this is sufficient. I would use the quantiles plus the peak warming and 2100 warming metadata (which is technically a test of post-processing, but ok, they're the key numbers that people really care about so that's what we should test).

3. I am getting different results compared to the emissions_harmonization_historical for the same input and I do not really understand why

I'll take a look once you've fixed the merge conflicts. There are probably some tricks I played in setting things up in emissions_harmonization_historical that we'll need to find and copy out and apply here too

@mzecc
Copy link
Copy Markdown
Collaborator Author

mzecc commented Mar 21, 2026

I have updated PR #47 on my fork (mzecc#6) but I still get different values for the GSAT values of the ensemble members. I do not really understand why, the input seems to be the same to me but the output is definitely not.

@znichollscr
Copy link
Copy Markdown
Collaborator

Hmmm is the regression output you're comparing against from the gridding or global workflow?

If you compare the key metrics e.g. peak warming, are you close or miles away there too?

Also are we comparing post-processed temperatures or raw temperatures?

@mzecc
Copy link
Copy Markdown
Collaborator Author

mzecc commented Mar 23, 2026

Ok solved. I wasn't taking care of some Nans coming from the infilled emissions. I am pushing in a few minutes once the tests on all models-scenarios are done. I have 2 questions though:

  1. How do we includemagicc7.6.0a3? I guess there must be a smarter way than simply adding the whole folder.
  2. The GSAT ensamble members are heavy (~4-5MB). Should the whole file be included? Should I remove some members?

@znichollscr
Copy link
Copy Markdown
Collaborator

  1. How do we includemagicc7.6.0a3? I guess there must be a smarter way than simply adding the whole folder

There are smarter ways but for ease, just add it.

2. The GSAT ensamble members are heavy (~4-5MB). Should the whole file be included? Should I remove some members?

Nope: only check against the key metrics i.e. peak warming and quantiles. Then we don't have to save the ensemble members anywhere

@mzecc
Copy link
Copy Markdown
Collaborator Author

mzecc commented Mar 23, 2026

There are smarter ways but for ease, just add it.

Some filer are a bit large though. E.g. magicc-ar7-fast-track-drawnset-v0-3-0.json is 5MB.

@mzecc
Copy link
Copy Markdown
Collaborator Author

mzecc commented Mar 23, 2026

Ok I got it all green here: mzecc#6

I did some ci tweaking for lfs and long windows path names in the ci.yaml file that I guess should be repeated in some other yaml file.

@znichollscr
Copy link
Copy Markdown
Collaborator

Some filer are a bit large though. E.g. magicc-ar7-fast-track-drawnset-v0-3-0.json is 5MB

Yep this isn't ideal, but we have to make a tradeoff. Just commit with git commit -n

I did some ci tweaking for lfs

Ok good idea, but in my experience lfs is a trap. When we try and pull this into main (which may be soon or now?), we will do this differently and not use lfs at all (including making sure there are no lfs files in history).

Delete tests/regression/cmip7-scenariomip/cmip7-scenariomip-workflow-inputs/magicc-v7.6.0a3/run/openscm-runner (which you should be able to and still have everything work) then see if these long-path issues go away (hopefully that's the fix, the openscm-runner doesn't need to be/shouldn't be in the git history).

@mzecc
Copy link
Copy Markdown
Collaborator Author

mzecc commented Mar 24, 2026

All green here, I'll add the changelog and that's it I guess.

@znichollscr
Copy link
Copy Markdown
Collaborator

Once #43 is merged, can you please squash and rebase onto main (I want to squash and rebase in this case so we're sure we didn't add any git lfs stuff by mistake).

@znichollscr
Copy link
Copy Markdown
Collaborator

Once you've squashed and rebased, please add the CHANGELOG entries, then I'll review properly and then we can hopefully merge

@mzecc mzecc force-pushed the scm_running branch 2 times, most recently from 8dd6fc0 to a6e978d Compare March 28, 2026 23:24
@mzecc
Copy link
Copy Markdown
Collaborator Author

mzecc commented Mar 28, 2026

Ok, this looks a bit more clean now I think.

Copy link
Copy Markdown
Collaborator

@znichollscr znichollscr left a comment

Choose a reason for hiding this comment

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

Nice, few things to clean up then good to go I think

Comment thread changelog/47.feature.md Outdated
Comment thread src/gcages/cmip7_scenariomip/__init__.py Outdated
Comment thread src/gcages/cmip7_scenariomip/scm_running.py
Comment thread src/gcages/cmip7_scenariomip/scm_running.py Outdated
Comment thread src/gcages/cmip7_scenariomip/scm_running.py Outdated
Comment thread src/gcages/cmip7_scenariomip/scm_running.py Outdated
Comment thread src/gcages/cmip7_scenariomip/scm_running.py Outdated
Comment on lines 377 to 386
complete_emissions.columns = complete_emissions.columns.astype(int)
magicc_start_year = 2015
if min(complete_emissions.columns) != magicc_start_year:
msg = "Emissions starting year must be set to `2015`"
raise AssertionError(msg)
else:
complete_emissions = get_complete_scenarios_for_magicc(
scenarios=in_emissions,
history=self.historical_emissions,
)
Copy link
Copy Markdown
Collaborator Author

@mzecc mzecc Mar 30, 2026

Choose a reason for hiding this comment

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

Is something like this acceptable?
I mean, should we allow for a unique dataframe with history and emissions already prepared to run through?

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.

Hmm it still doesn't really explain what is going on. Like this code just says, "If there's no historical emissions, you have to start in 2015, otherwise I will join history and the scenarios", but what we actually want is, "If you're running MAGICC and there's no historical emissions, you have to start in 2015, otherwise if you're running MAGICC, I will join history and the scenarios, otherwise (if you're running some other SCM) I'll just try to use the emissions as given".

If it's too much headache, just leave it so you can get to the runs you need to do and we can clean up in future.

Comment thread src/gcages/cmip7_scenariomip/scm_running.py
@mzecc
Copy link
Copy Markdown
Collaborator Author

mzecc commented Mar 31, 2026

Ok, all green. Ready to be merged away?

@znichollscr
Copy link
Copy Markdown
Collaborator

Let's go for it

@mzecc mzecc merged commit 9c0e13e into openscm:main Apr 1, 2026
75 of 78 checks passed
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.

2 participants