Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

No error control parsing boolean values #9

Closed
victorsndvg opened this issue Apr 7, 2015 · 3 comments
Closed

No error control parsing boolean values #9

victorsndvg opened this issue Apr 7, 2015 · 3 comments

Comments

@victorsndvg
Copy link

Hello Stefano,

I was checking some features of FLAP and it's a great tool, i'm sure that will be useful for us :)

Through flap_test, I have seen that in some lines when a logical is expected by FLAP there is no error handling. For example if you runl flap_test with the following arguments an error arises:

$ flap_test/FLAP_TEST -s 'asdf' --boolean_val 0
+--> flap_test, a testing program for FLAP library
+--> Parsing Command Line Arguments
forrtl: severe (59): list-directed I/O syntax error, unit -5, file Internal List-Directed Read
...
FLAP_TEST 0000000000411D54 data_type_command 289 ...
...

The error references the following line:
https://github.com/szaghi/FLAP/blob/master/src/Data_Type_Command_Line_Interface.f90#L289

A proposal to handle this error might be to replace that line with:

   read(cla%val,*,iostat=error)val
   if(error) write(stderr,'(A)')prefd//' Error: cannot convert "'// &
                  trim(adjustl(cla%val))//'" of CLA "'//cla%switch//'" to boolean.'

Maybe you will find this change useful.

Best regards,
Víctor.

@szaghi
Copy link
Owner

szaghi commented Apr 7, 2015

Dear Victor,

you are right. The error trapping algorithm is presently very trivial and there is big room for improving this algorithm.

Feel free to fork FLAP repo, do your great enhancements and commit a pull request. I will very happy to accept your pull requests.

For this specific patch I add it very soon, I hope before tonight. Maybe, I can try to improve the casting of also other types (numbers should be already handled by IR_Precision, but I am not sure).

Thank you for your help.

@victorsndvg
Copy link
Author

Dear Stefano,

If I keep working with FLAP, I will be happy to collaborate with the project, but at the moment I'm testing the tool, and I can't promise anything ;)

Thanks 👍
Víctor

@szaghi
Copy link
Owner

szaghi commented Apr 7, 2015

Dear Victor,

your new release has been uploaded (0.0.3).

Note that with respect the older one, many things have been changed:

  • flap_test is now Test_Driver for make my life easy (all my other GNU codes use a generic Test_Driver);
  • also numbers casting has been improved;
  • IR_Precision.f90 module has been also changed.

I have added you to the list of contributors.

See you soon.

@szaghi szaghi closed this as completed Apr 7, 2015
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants