Re: Fortran exceptions

From: Mehmet Erol Sanliturk <m.e.sanliturk_at_gmail.com>
Date: Sat, 11 Dec 2021 07:30:23 UTC
On Sat, Dec 11, 2021 at 10:10 AM Doug Hardie <bc979@lafn.org> wrote:

> I have a fairly large fortran program that I am trying to run on flang.
> It almost works, but I am sure there are a few typos in it.  I had to enter
> it by hand from a large listing.  When it encounters a STOP, it displays
> several ieee exception messages.  Unfortunately there is no way to identify
> where those occurred.  How can I get the runtime to stop when an exception
> occurs.  This is on FreeBSD 13.0 release with whatever flang is in the
> ports.
>
> -- Doug
>



Did you compile your program with  gfortran  to obtain an alternative view
of your program ?
Such a compilation is the best way of "code review"  by an "expert" , where
expertise of
code reviewers are transmitted to a compiler .

If there are similar messages , it is very likely that your program has
points needing modifications .
If their messages are different , please see  "flang" design modifications

( for example ,
supporting Fortran standards : If they are supporting different standards ,
their messages
may be different . In that case , define a common standard for compilations
by using
command line parameters to define the selected standard . )  .

For the "STOP" : You may erroneously define a variable named as STOP .
In Fortran , there are not any restrictions on use of names as Fortran
statements or variables
( if the new standards did not require such a rule ) .

If there is such a variable definition , it is very likely that the
compiler will see it as
a "trouble point" if you use STOP for the "HALT" .


Mehmet  Erol Sanliturk