Intel® Fortran Libraries Reference

Intel® Fortran Libraries Reference Intel® Fortran Libraries Reference

h.eng.cam.ac.uk
from h.eng.cam.ac.uk More from this publisher
12.07.2015 Views

2 Intel Fortran Libraries ReferenceFOR_GET_FPERun-time Function: Returns the current settings of floating-point exception flags. This routinecan be called from a C or Fortran program.Module: USE IFCORESyntaxresult = FOR_GET_FPE ( )Results:The result type is INTEGER(4). The return value represents the settings of the currentfloating-point exception flags. The meanings of the bits are defined in the IFQWIN module file.To set floating-point exception flags after program initialization, use “FOR_SET_FPE”.ExampleUSE IFCOREINTEGER*4 FPE_FLAGSFPE_FLAGS = FOR_GET_FPE ( )for_rtl_finish_Run-Time Function: Cleans up the Fortran run-time environment; for example, flushing buffersand closing files. It also issues messages about floating-point exceptions, if any occur.This routine should be called from a C main program; it is invoked by default from a Fortran mainprogram.Syntaxresult = for_rtl_finish_ ( )Results:The result is an I/O status value. For information on these status values, see "Using the IOSTATValue and Fortran Exit Codes" in your user’s guide.To initialize the Fortran run-time environment, use “for_rtl_init_”.ExampleConsider the following C code:int io_status;int for_rtl_finish_ ( );io_status = for_rtl_finish_ ( );2-86

Descriptions of the Library Routines 2for_rtl_init_Run-Time Subroutine: Initializes the Fortran run-time environment. It establishes handlers andfloating-point exception handling, so Fortran subroutines behave the same as when called from aFortran main program.This routine should be called from a C main program; it is invoked by default from a Fortran mainprogram.SyntaxCALL for_rtl_init_ (argcount, actarg)argcountIs a command-line parameter describing the argument count.actargIs a command-line parameter describing the actual arguments.To clean up the Fortran run-time environment, use “for_rtl_finish_”.ExampleConsider the following C code:int argc;char **argv;void for_rtl_init_ (int *, char **);for_rtl_init_ (&argc, argv);FOR_SET_FPERun-time Function: Sets the floating-point exception flags. This routine can be called from a Cor Fortran program.Module: USE IFCORESyntaxresult = FOR_SET_FPE (a)aMust be of type INTEGER(4). It contains bit flags controlling floating-point exception trapping,reporting, and result handling.Results:The result type is INTEGER(4). The return value represents the previous settings of thefloating-point exception flags. The meanings of the bits are defined in the IFCORE module file.2-87

Descriptions of the Library Routines 2for_rtl_init_Run-Time Subroutine: Initializes the <strong>Fortran</strong> run-time environment. It establishes handlers andfloating-point exception handling, so <strong>Fortran</strong> subroutines behave the same as when called from a<strong>Fortran</strong> main program.This routine should be called from a C main program; it is invoked by default from a <strong>Fortran</strong> mainprogram.SyntaxCALL for_rtl_init_ (argcount, actarg)argcountIs a command-line parameter describing the argument count.actargIs a command-line parameter describing the actual arguments.To clean up the <strong>Fortran</strong> run-time environment, use “for_rtl_finish_”.ExampleConsider the following C code:int argc;char **argv;void for_rtl_init_ (int *, char **);for_rtl_init_ (&argc, argv);FOR_SET_FPERun-time Function: Sets the floating-point exception flags. This routine can be called from a Cor <strong>Fortran</strong> program.Module: USE IFCORESyntaxresult = FOR_SET_FPE (a)aMust be of type INTEGER(4). It contains bit flags controlling floating-point exception trapping,reporting, and result handling.Results:The result type is INTEGER(4). The return value represents the previous settings of thefloating-point exception flags. The meanings of the bits are defined in the IFCORE module file.2-87

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

Saved successfully!

Ooh no, something went wrong!