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

unexpected behavior when marbl_in has more than marbl_in_line_cnt lines #202

Closed
mnlevy1981 opened this issue Oct 24, 2017 · 2 comments
Closed
Assignees
Milestone

Comments

@mnlevy1981
Copy link
Collaborator

namelist_split_by_line doesn't do any error checking to ensure that marbl_nl_buffer is a large enough array to contain the full contents of marbl_in; instead it silently truncates the file after marbl_in_line_cnt lines.

At the very least, we need an error check to abort if the full file is not copied into the array. A better option would be for marbl_nl_buffer to be allocatable, and namelist_split_by_line can allocate memory for it after determining how big it is.

@mnlevy1981
Copy link
Collaborator Author

@klindsay28 pointed out that we had previously discussed reading in marbl_in line by line, and immediately broadcasting each line / calling put_setting() -- that would avoid this issue as well, plus it would reduce the memory footprint (at the cost off replacing one broadcast with several hundred during initialization).

@mnlevy1981
Copy link
Collaborator Author

Fixed in marbl_dev_n76

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

No branches or pull requests

1 participant