Fortran 90 Error Handling
Contents |
Join INTELLIGENT WORK FORUMSFOR COMPUTER PROFESSIONALS Log In Come Join Us! Are you aComputer / IT professional?Join Tek-Tips Forums! Talk With Other Members Be Notified Of ResponsesTo Your Posts Keyword Search One-Click Access To fortran exception handling YourFavorite Forums Automated SignaturesOn Your Posts Best Of All, It's Free! Join Us!
Fortran If
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting Guidelines Promoting, selling, try catch fortran recruiting, coursework and thesis posting is forbidden.Tek-Tips Posting Policies Jobs Jobs from Indeed What: Where: jobs by Link To This Forum! Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.Just
Fortran Error Handling
copy and paste the BBCode HTML Markdown MediaWiki reStructuredText code below into your site. Fortran Forum at Tek-Tips HomeForumsProgrammersLanguagesFortran Forum Error Handling Techniques thread214-1610750 Forum Search FAQs Links MVPs Error Handling Techniques Error Handling Techniques javijerome (Programmer) (OP) 5 Jul 10 13:15 Does fortran95 have some error handling techniques like the "try" statement of Visual Basic 2008? RE: Error Handling Techniques xwb (Programmer) 5 Jul 10 16:04 fortran break loop Pure Fortran 95 does not have any form of exception handling.There was a proposal in the 1996 X3J3 draft for exception handling but I don't know if it got into 2003.There are some partial 2003 compilers about but I don't know if there are any full 2003 implementations. RE: Error Handling Techniques javijerome (Programmer) (OP) 5 Jul 10 23:40 what's the 1996 X3J3 draft? RE: Error Handling Techniques xwb (Programmer) 6 Jul 10 02:01 X3J3 is the ANSI committee that looks after the Fortran Standards.You can find the 1996 draft in the following linkhttp://www.math.bas.bg/bantchev/place/fortran95.pdf RE: Error Handling Techniques NickFort (TechnicalUser) 6 Jul 10 03:14 xwb, I think I read the other day somewhere that Cray and IBM compilers can handle the full F2003 set now. Slightly off-topic, but interesting nonetheless. --------------------------------------Background: Chemical engineer, familiar mostly with MATLAB, but now branching out into real programming. RE: Error Handling Techniques mikrom (Programmer) 6 Jul 10 04:55 I'm not sure, but I thing, there is no general exception handling concept in Fortran, like in OOP-languages: try..catch (Java), try..except (Python), begin..resccue..end (Ruby)In Fortran you can handle different exceptions at different ways - for example:1. file exeption with iostatCODE...integer stat...! open fileopen (1, file='csv_file.csv', status='old', ios
fact, you have encountered such a technique in Programming Assignment 1 in which a keyword IOSTAT= was used in a READ statement. The following is its
Fortran Not Equal
syntax: INTEGER :: IOstatus READ(*,*,IOSTAT=IOstatus) var1, var2, ..., varn The third component of
Do While Fortran
the above READ is IOSTAT= followed by an INTEGER variable. The meaning of this new form of READ is simple: fortran while loop After executing the above READ statement, the Fortran compiler will put an integer value into the integer variable following IOSTAT=, IOstatus above. Based on the value of IOstatus, we have three different situations: http://www.tek-tips.com/viewthread.cfm?qid=1610750 If the value of IOstatus is zero, the previous READ was executed flawlessly and all variables have received their input values. This is the normal case. If the value of IOstatus is positive, the previous READ has encountered some problem. In general, without knowing the system dependent information, it is impossible to determine what the problem was. However, if hardware and I/O devices are working, a commonly http://www.cs.mtu.edu/~shene/COURSES/cs201/NOTES/chap04/iostatus.html seen problem would be illegal data. For example, supplying a real number to an integer variable. If IOstatus is positive, you cannot trust the values of the variables in the READ statement; they could all contain garbage values, or some of them are fine while the others are garbage. If the value of IOstatus is negative, it means the end of the input has reached. Under this circumstance, some or all of the variables in the READ may not receive input values. What is the end of file? How do we generate it? If you prepare your input using a file, when you save it, the system will generate a special mark, called end-of-file mark, at the end of that file. Therefore, when you read the file and encounter that special end-of-file mark, the system would know there is no input data after this mark. If you try to read passing this mark, it is considered as an error. If you prepare the input using keyboard, hiting the Ctrl-D key would generate the end-of-mark under UNIX. Once you hit Ctrl-D, the system would consider your input stop at there. If your program tries to read passing this poin
LearningModern CodeNetworkingOpen SourceStorageToolsDeveloper TypeEmbedded SystemsGame DevMediaTechnical, Enterprise, HPCWebOSAll ToolsAndroid*HTML5Linux*OS X*Windows*ResourcesCode SamplesContact SupportDocumentationFree SoftwareIntel Registration CenterProduct ForumsSDKsResourcesPartner with IntelAcademic ProgramPartner SpotlightBlack Belt DeveloperDeveloper MeshInnovator ProgramSuccess StoriesLearnBlogBusiness TipsEventsVideosSupportContact SupportDeveloper EvangelistsFAQsForums Search form Search You are hereHome › Forums › Intel® Software Development Products › Intel® https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/506739 Fortran Compiler for Linux* and Mac OS X* FacebookLinkedInTwitterDiggDeliciousGoogle Plus Exceptions Handling Exceptions Handling felix.arnoux Tue, 03/04/2014 - 06:42 Dear all, I'm currently rewritting an old FORTRAN program, and I would like to have a clean exception handling, such as the try {} catch {} in C++. Using my own exceptions, I would be able to generate specific exceptions, such as non-convergence in a mathematical model, error handling and to catch it at a higher level so as to continue program execution. Is there any feature in Intel Fortran Compiler that could help me ? Or is it possible to emulate something ? I have access to IFC version 13.1, and maybe to version 14, and also to C/C++ compilers. Thank you. RSS Top 11 posts / 0 new Last post For more fortran 90 error complete information about compiler optimizations, see our Optimization Notice. FortranFan Tue, 03/04/2014 - 06:47 Fortran is somewhat limited in terms of native capabilities in structured exception handling compared to C++, etc. See an article by Arjen Markus at ACM SIGPLAN Fortran Forum on some ideas on what one can do using Fortran. Top Steve Lionel (Intel) Tue, 03/04/2014 - 07:28 Also, Fortran does have the various IEEE_xxx intrinsic modules that give you some control/visibility into arithmetic operations, but probably not what Felix is looking for. Steve - Intel Developer Support Top felix.arnoux Thu, 03/06/2014 - 05:13 Thank you FortranFan for the paper, I had a look at it but the exception management A. Markus proposes uses alternate returns, which are obsolete in F2003. I plan also to use the IEEE modules, but this feature is limited to floating point exceptions. Do you know if one can throw C++ exceptions from Fortran code, and catch it at a higher level ? Maybe by wrapping the whole code in C++ ? By the way, does anyone knows why Fortran does not provides exceptions ? Thanks, Felix Top FortranFan Thu, 03/06/2014 - 07:35 Quote:felix.arnoux wrote: Thank you Fortr