-
Notifications
You must be signed in to change notification settings - Fork 79
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
Check if keyword is valid #534
Labels
Comments
There are various ways to check if a variable is in the file. The if (.not. ('x0' .in. f)) error stop 'x0 not found' Some of the other routines have a To check if a variable is there but not recognized, I think you'd just have to iterate over all the keys and compare them to the list and flag the ones not recognized. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We are using json-fortran as an input file reader for one of our libraries. Perhaps this is outside the scope of your project, but is it possible to check if a keyword is invalid/unrecognised, or would this have to be done separately? E.g. check if data present in the json was not read by the program.
I guess this would involve reading each keyword present in the json and comparing it to all possible keywords (which would be done outside json-fortran, or given as input), and failing if not.
I just want some error checking, e.g. say
x0
has a default value of0
if it is not found, but the user erroneously inputs"z0": 5
. At the moment, the code would simply ignorez0
(and setx0=0
which is not what the user actually wanted), but I would like it tostop
.The text was updated successfully, but these errors were encountered: