Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.

How to make a general return from the code without stop

Mykola_M_
Beginner
398 Views

Hallo all experts,

for my code written in fortran also the web-service is developed. The problem is that any stop-command (if error appears) kills the web-service. What I need now is to replace all my "stops" by the fortran-command which makes exit (say, with flag), but not terminates the head-subroutine. I believe that the command like that is already exists. Otherwise, I'm forced to write the set of the commands for returning to the head-subroutine. The point of such return is not clear.

With thanks,

Mykola.

0 Kudos
1 Solution
jimdempseyatthecove
Honored Contributor III
398 Views

Is your application multi-threaded?
Does your code reside in a DLL (or shared library)?

The cleanest way is for all (most) of your subroutines and functions return a status. You define the status values, and then if any CALL/function returns an error status, you propagate it up the returns.

Lahey has a Fortran for .NET that supports: try/catch/finally/throw

Modifying your code for that, is on the order of modifying your code to pass a STATUS variable.

Jim Dempsey

View solution in original post

0 Kudos
1 Reply
jimdempseyatthecove
Honored Contributor III
399 Views

Is your application multi-threaded?
Does your code reside in a DLL (or shared library)?

The cleanest way is for all (most) of your subroutines and functions return a status. You define the status values, and then if any CALL/function returns an error status, you propagate it up the returns.

Lahey has a Fortran for .NET that supports: try/catch/finally/throw

Modifying your code for that, is on the order of modifying your code to pass a STATUS variable.

Jim Dempsey

0 Kudos
Reply