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

f90nml 1.3 #325

Open
znicholls opened this issue May 25, 2021 · 6 comments
Open

f90nml 1.3 #325

znicholls opened this issue May 25, 2021 · 6 comments
Labels

Comments

@znicholls
Copy link
Collaborator

Describe the bug

f90nml 1.3's string splitting (https://github.com/marshallward/f90nml/pull/120/files) can cause MAGICC running to break if you try to write a long list of string arrays. For example, f90nml will now write output like the below, which can't be parsed by MAGICC (because the commas are in the wrong place).

out_dynamic_vars = 'DAT_SURFACE_TEMP', 'DAT_SURFACE_MIXEDLAYERTEMP',
'DAT_TOTAL_INCLVOLCANIC_ERF', 'DAT_TOTAER_DIR_ERF', 'DAT_CO2_ERF', 'DAT_,  # this line is wrong
CO2PF_EMIS', 'DAT_CH4PF_EMIS'

Failing Test

TBD

Expected behaviour

The output should be like the below

out_dynamic_vars = 'DAT_SURFACE_TEMP', 'DAT_SURFACE_MIXEDLAYERTEMP',
'DAT_TOTAL_INCLVOLCANIC_ERF', 'DAT_TOTAER_DIR_ERF', 'DAT_CO2_ERF', 
'DAT_CO2PF_EMIS', 'DAT_CH4PF_EMIS'

Screenshots

If applicable, add screenshots to help explain your problem.

System (please complete the following information):

  • OS: Linux
  • Python and Pymagicc version Python 3.7, Pymagicc 2.0

Additional context

It's unclear to me if this is a pymagicc bug or an f90nml bug. One for further investigation.

@znicholls znicholls added the bug label May 25, 2021
@znicholls
Copy link
Collaborator Author

znicholls commented May 25, 2021

@lewisjared and @rgieseke fyi, workaround is just pin f90nml==1.2

@lewisjared
Copy link
Collaborator

lewisjared commented May 26, 2021

I opened marshallward/f90nml#131 the other day and a fix is in the works. I've been pinning 1.2 locally to resolve this

@znicholls
Copy link
Collaborator Author

Legend

@marshallward
Copy link

marshallward commented May 26, 2021

I've updated PyPI to 1.3.1 which fixes the errant comma and also defaults back to the old behaviour. I've also added an array string test so this should be detected in the future.

@rgieseke
Copy link
Member

Thank you so much for your work! :-)
Used by NASA and in IPCC climate model pipelines ... quite a userbase!

@znicholls
Copy link
Collaborator Author

Legend thanks @marshallward !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants