- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the correct way to pass exit codes from a FORTRAN main to the calling shell?
In the past we've used:
call exit(icode) where icode is an integer byte.
call exit() seems to work fine but there is no function I could find in the documentation.
Seems to be a supported extension?
What library is this function in?
EXIT is a reserved word for exiting out of DO loops.
Thanks for any info.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Look for "EXIT Subroutine" in the Intel Fortran documentation.
EXIT Subroutine
Intrinsic Subroutine (Generic): Terminates program execution, closes all files, and returns control to the operating system. Intrinsic subroutines cannot be passed as actual arguments.
Syntax
CALL EXIT [( [status] )]
status (Output; optional) Is an integer argument you can use to specify the image exit-status value.
The exit-status value may not be accessible after program termination in some application environments.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
EXIT is a reserved word for exiting out of DO loops
Fortran does not have reserved keywords. Thus, the following code, while reprehensible, is legal:
Fortran does not have reserved keywords. Thus, the following code, while reprehensible, is legal:
[fortran]logical :: then, if, else, exit integer :: i .. do i=1,5 .. if = then.or.else.and.exit .. if(if)then then=if exit else else=if call exit(3) endif .. end do ..[/fortran]

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page