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

Warning / Error handling #12

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

Warning / Error handling #12

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

Comments

@mnlevy1981
Copy link
Contributor

We've talked via email about adding an error code as an optional argument (to allow modules to handle errors on their own rather than getting a stop call which is sure to cause issues with MPI). There would also be a cvmix_error module in src/ to handle the errors for the stand-alone drivers... likely just printing a statement followed by a stop call.

On the same note, we should put some thought into handling warnings - I think we should print warnings in a variety of cases (over-writing existing parameters, using cvmix_put to write a scalar into an array, etc)... but there should be an easy way to suppress the warnings. I'm leaning towards a namelist option that sets the global variable lwarn, but I'm open to other ideas - a namelist variable stored somewhere else? Copious ifdefs along with a compile-time setting? Going with the namelist option, I'm picturing a cvmix_warn routine that takes a string as an argument and prints "WARNING: " // warn_string... with the check against lwarn or whatever in the cvmix_warn routine. Maybe something like

module cvmix_warn

public :: cvmix_warn
public :: cvmix_set_lwarn

logical, private, save :: lwarn = .true.

...

end module cvmix_warn

So by default we print all warnings, but the user can call cvmix_set_lwarn(.false.) to suppress them (and then later call cvmix_set_lwarn(.true.) to turn them back on).

@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