[comp.unix.questions] Converting a FORTRAN program

rkirk@oasys.dt.navy.mil (Randy Kirk) (06/17/91)

To: Anyone who can help


	I am trying to convert a FORTRAN program from VMS to ultrix.  The
problem is that the program has an error handler that uses VMS's runtime
library and system service routines.  These routines (lib$signal,
lib$establish, sys$unwind) are use to establish an error handler that
unwinds the procedure stack to a previous routine.  The error handler
is invoked by lib$signal.  If anyone has any suggestions they would be
greatly appreciated.  The section of the program that needs to be converted
follows.

							Thank You
							Randy Kirk

cBULLXX                                                                  1000000
        subroutine bullxx (n)                                            1000100
        external ihndl                                                   1000200
c   check if this the first call to bullxx  (n = 3)                      1000300
        if (n .eq. 3) go to 10                                           1000400
c                                                                        1000500
c   this is not the first call so signal the condition                   1000600
        call lib$signal (%VAL(331))                                      1000700
        return                                                           1000800
c                                                                        1000900
c   set up the condition handler                                         1001000
 10     call lib$establish (ihndl)                                       1001100
c                                                                        1001200
c   continue with the program as usual                                   1001300
        call readyx                                                      1001400
        return                                                           1001500
        end                                                              1001600
        INTEGER*4 FUNCTION IHNDL(SIGS,MECHS)                             1001700
C                                                                        1001800
        INTEGER*4 SIGS(4), MECHS(5)                                      1001900
c                                                                        1002000
c   unwind all frames off the stack to the frame saved when              1002100
c   the condition was established.                                       1002200
C                                                                        1002300
C    CHECK TO SEE IF THE CONDITION WHICH CALLED THE HANDLER              1002400
C   IS THE RIGHT ONE FOR BULLXX.                                         1002500
        IF(SIGS(2) .EQ. 331) call sys$unwind (%val(0),%val(0))           1002600
        IHNDL = SS$_RESIGNAL                                             1002700
        return                                                           1002800
        END                                                              1002900