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

Add carbon cycle variables to output #84

Closed
NortonAlex opened this issue Jul 24, 2018 · 9 comments
Closed

Add carbon cycle variables to output #84

NortonAlex opened this issue Jul 24, 2018 · 9 comments

Comments

@NortonAlex
Copy link

Is your feature request related to a problem? Please describe.

Enabling carbon cycle output in pymagicc does not return carbon cycle output variables. It seems that the output file name (CARBONCYCLE.OUT) may need to be standardised by placing DAT at the start of the filename in the same format as other optional output.

Describe the solution you'd like

It would be good to return the carbon cycle output variables (currently in CARBONCYCLE.OUT) when the flag is on (i.e. out_carboncycle=1).

Describe alternatives you've considered

I could write my own python script to handle this. But, the infrastructure is already in place with pymagicc so it "should be" trivial to add this feature in.

Additional context

Note that the carbon cycle output file differs from others such that the columns are different variables (e.g. CURRENT_GPP), not different regions (e.g. GLOBAL, NH-OCEAN). However, I don't think this should change how it is handled.

@rgieseke
Copy link
Member

Can you check the numberof lines with meta info, i.e. the number of lines to skip when reading the file?

@NortonAlex
Copy link
Author

NortonAlex commented Jul 24, 2018 via email

@rgieseke
Copy link
Member

Alright, this means we need some special treatment here:

https://github.com/openclimatedata/pymagicc/blob/master/pymagicc/api.py#L163

Filenames and lines to skip need to accept this special case.

Could you also check whether there is a difference in rows to skip between MAGICC6 and 7 carboncycle output?

@NortonAlex
Copy link
Author

Okay. @znicholls are you able to check this please? I'm unsure where to look

@NortonAlex
Copy link
Author

Would be better to change the name of the output file from CARBONCYCLE.OUT to DAT_CARBONCYCLE.OUT in the source code or to modify pymagicc?

@rgieseke
Copy link
Member

For the compiled MAGICC6 we can't change it, so we need a fix/workaround. If "DAT_" has no specific meaning it might be worth considering for MAGICC7.

Is your info re rows to skip based on the latest MAGICC, then I can check MAGICC6 myself.

@rgieseke
Copy link
Member

@NortonAlex what's your level of Python knowledge btw?

@NortonAlex
Copy link
Author

Yes, my info is on the latest version of MAGICC.

I thought it was good until I saw this code. I would say I'm "competent". I've done a lot of python coding for isolated analysis tasks, but not as much on using multiple modules together as is applied here.

@rgieseke
Copy link
Member

MAGICC6 has 19 rows to skip:

&THISFILE_SPECIFICATIONS
THISFILE_DATACOLUMNS = 37,
THISFILE_FIRSTYEAR = 1765,
THISFILE_LASTYEAR = 2100,
THISFILE_ANNUALSTEPS = 1,
THISFILE_FIRSTDATAROW = 21,
THISFILE_UNITS = MISC ,
THISFILE_DATTYPE = CARBONCYCLEDAT
/

rgieseke added a commit that referenced this issue Jul 24, 2018
Not all output files start with `DAT_`.
Closes #84
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