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

Error checking in put / get statements #13

Open
mnlevy1981 opened this issue Feb 9, 2014 · 0 comments
Open

Error checking in put / get statements #13

mnlevy1981 opened this issue Feb 9, 2014 · 0 comments
Assignees

Comments

@mnlevy1981
Copy link
Contributor

We should make sure the shape of any arrays being stored via cvmix_put are the same shape as the data type attribute they are being stored in.

Example:

  1. This is good, because zt should be size nlev

allocate(depth(5))
cvmix_put(CVMix_vars, 'nlev', 5)
cvmix_put(CVMix_vars, 'zt', depth)

  1. This is bad, but results in a seg-fault instead of a clean error

allocate(depth(8))
cvmix_put(CVMix_vars, 'nlev', 5)
cvmix_put(CVMix_vars, 'zt', depth)

  1. This is also bad, and I think will also seg-fault... at the very least it will do something unexpected

allocate(depth(5))
cvmix_put(CVMix_vars, 'nlev', 8)
cvmix_put(CVMix_vars, 'zt', depth)

@mnlevy1981 mnlevy1981 added this to the First public release milestone Feb 9, 2014
@mnlevy1981 mnlevy1981 self-assigned this Feb 9, 2014
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