TABLE OF CONTENTS
- 1. /CallStack
- 1.1. CallStack/TRACEBACK
- 1.2. CallStack/SYSTEM_COMMAND
- 1.3. CallStack/getCompiler
/CallStack [ Modules ]
NAME
module CallStack
PURPOSE
This module provides a wrapper around compiler-specific routines.
CallStack/TRACEBACK [ Subroutines ]
[ Top ] [ CallStack ] [ Subroutines ]
NAME
subroutine TRACEBACK(string,user_exit_code)
PURPOSE
Write out the call stack of the program, depending on the compiler. One currently gets a backtrace with the following compilers:
- ifort (via the routine TRACEBACKQQ)
- gfortran 4.7 or higher (via ABORT)
- nvfortran (via ABORT and environment variable NVCOMPILER_TERM)
See also the documentation of these routines in the respective compiler manual.
INPUTS
- character*(*), optional :: string -- header line to write
- integer, optional :: user_exit_code -- code whether return or stop program
- By specifying a user exit code of -1, control returns to the calling program. Specifying a user exit code with a positive value requests that specified value be returned to the operating system. The default value is 0, which causes the application to abort execution.
CallStack/SYSTEM_COMMAND [ Subroutines ]
[ Top ] [ CallStack ] [ Subroutines ]
NAME
subroutine SYSTEM_COMMAND(string)
PURPOSE
Runs a shell command, as given by the argument 'string'.
INPUTS
- character*(*) :: string -- shell command to execute
NOTES
This routine is compiler-dependent. If compiled with ifort, the Intel-specific function SYSTEMQQ is called. Otherwise the F08 intrinsic procedure EXECUTE_COMMAND_LINE is used.
CallStack/getCompiler [ Subroutines ]
[ Top ] [ CallStack ] [ Subroutines ]
NAME
integer function getCompiler()
PURPOSE
return a number indicating the used compiler
OUTPUT
- -1 : unknown
- 1 : ifort
- 2 : gfortran
- 3 : nvfortran
- 4 : ifx