12.07.2015 Views

Intel® Fortran Libraries Reference

Intel® Fortran Libraries Reference

Intel® Fortran Libraries Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Descriptions of the Library Routines 2Certain I/O errors cause the system to display an error prompt. For example, attempting to write toa disk drive with the drive door open generates an "Abort, Retry, Ignore" message. When thesystem starts up, system error prompting is enabled by default (pmode = .TRUE.). You can alsoenable system error prompts by calling SETERRORMODEQQ with pmode set toERR$HARDPROMPT (defined in IFPORT.F90).If prompt mode is turned off, critical errors that normally cause a system prompt are silent. Errorsin I/O statements such as OPEN, READ, and WRITE fail immediately instead of being interruptedwith prompts. This gives you more direct control over what happens when an error occurs. Forexample, you can use the ERR= specifier to designate an executable statement to branch to forerror handling. You can also take a different action than that requested by the system prompt, suchas opening a temporary file, giving a more informative error message, or exiting.You can turn off prompt mode by setting pmode to .FALSE. or to the constant ERR$HARDFAIL(defined in IFPORT.F90).SETERRORMODEQQ affects only errors that generate a system prompt. It does not affect otherI/O errors, such as writing to a nonexistent file or attempting to open a nonexistent file withSTATUS='OLD'.CompatibilityCONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIBExample!PROGRAM 1! DRIVE B door openOPEN (10, FILE = 'B:\NOFILE.DAT', ERR = 100)! Generates a system prompt error here and waits for the user! to respond to the prompt before continuing100 WRITE(*,*) ' Continuing'END! PROGRAM 2! DRIVE B door openUSE IFPORTCALL SETERRORMODEQQ(.FALSE.)OPEN (10, FILE = 'B:\NOFILE.DAT', ERR = 100)! Causes the statement at label 100 to execute! without system prompt100 WRITE(*,*) ' Drive B: not available, opening &&alternative drive.'OPEN (10, FILE = 'C:\NOFILE.DAT')END2-399

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!