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

Fixed line length nml fix #179

Merged
merged 3 commits into from
Aug 4, 2020
Merged

Conversation

sit23
Copy link
Contributor

@sit23 sit23 commented Aug 4, 2020

The latest version of f90nml available on pip, v1.2, enforces fixed-column widths for string variables when writing out nml files. The default line width is 72 characters. The default is the same in previous versions of f90nml, but did not seem to be enforced. This has the effect of splitting some variables across multiple lines in input.nml, causing the model to fail when these are read. An example case is socrates_rad_nml with the lw_spectral_filename parameter pointing to a directory that is generally longer than 72 characters. I have modified the python front end to allow for a maximum width of 350. This is longer than the 256 characters this namelist parameter has as its own maximum, therefore leaving room for long variable names too.

…olumn widths for string variables when writing out nml files. The default line width is 72 characters. The default is the same in previous versions of f90nml, but did not seem to be enforced. This has the effect of splitting some variables across multiple lines in input.nml, causing the model to fail when these are read. An example case is socrates_rad_nml with the lw_spectral_filename parameter pointing to a directory that is generally longer than 72 characters. I have modified the python front end to allow for a maximum width of 350. This is longer than the 256 characters this namelist parameter has as its own maximum, therefore leaving room for long variable names too.
@sit23 sit23 added bug infrastructure Isca infrastructure: installation, CI, HPC setups labels Aug 4, 2020
@dennissergeev dennissergeev added the python Isca's python wrappers label Aug 4, 2020
Copy link
Member

@dennissergeev dennissergeev left a comment

Choose a reason for hiding this comment

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

Thanks for finding this bug and submitting a PR!

It looks ok, but I decided this might be a good start to get cleaning up Isca's Python interface. I know I am just being intentionally picky, but let's start adhering to PEP8 guidelines.

src/extra/python/isca/experiment.py Outdated Show resolved Hide resolved
src/extra/python/isca/experiment.py Outdated Show resolved Hide resolved
@sit23
Copy link
Contributor Author

sit23 commented Aug 4, 2020

Thanks for the review @dennissergeev - and you're right that it'd be good to get us conforming to these standards. Hopefully the changes I've just made look alright.

@sit23
Copy link
Contributor Author

sit23 commented Aug 4, 2020

Looks like the build has passed OK, so I'll merge this in now.

@sit23 sit23 merged commit 1474197 into ExeClim:master Aug 4, 2020
@sit23 sit23 deleted the fixed_line_length_nml_fix branch August 4, 2020 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug infrastructure Isca infrastructure: installation, CI, HPC setups python Isca's python wrappers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants