public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tim Prince <tcprince@live.com>
To: gcc-help@gcc.gnu.org
Subject: Re: Program on old fortran IV
Date: Wed, 29 Apr 2020 10:24:22 -0400	[thread overview]
Message-ID: <YTOPR0101MB1804A32D5A3776A3B46B5CD6B7AD0@YTOPR0101MB1804.CANPRD01.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <CCFF751B-6479-4CC6-BEC4-C07F4105A632@cern.ch>

On 4/29/2020 9:37 AM, Joao Martins Correia wrote:
> Dear Gcc Helpers
>
> I recovered an old scientific program code written in Fortran IV.
> Still using hollerith assignments - which I think I understand, I can compile it with the many warnings
> regarding essentially 3 things
>
> 1- hollerith
>
> 2- “do" cycles indexed to an active command line instead of “enddo" or “continue”, e.g.
>
> do	10 i=1,n
>  		x=x+1
> 10	y=y+1
>
> 3-“if” of the type
>
>  If (n) 10,20,30
>
> All of this can be cleaned, but I have the feeling that in spite of the warnings the compiler still treats these 3 warnings correctly, since I could test it
> with coherent results.
>
> The program starts running, properly, reads input files and execute some routines, but then gets stuck with strange huge
> numbers that have no apparent reason to be there.
> The problem is in fact that there are no assignment of variable types and there are many commons with different variable names
> that contribute to the confusion when debugging. Setting “implicit none” creates too many errors, since sometimes is not easy
> to assign the type of the variable on a code with 30 routines and more than 5000 lines.
>
> I am considering reviewing it fully, but first would like to know if there is some options that could help emulating
> an older compiler for fortran IV. In the moment the fortran routines have type .f 
>
> Thanks anyway
>
> Cheers
>
> João Correia

Those old programs often made assumptions such as those covered by
gfortran -fno-automatic -finit-local-zero .  There was no portability or
standards checking in most compilers, and chances are your program was
never analyzed for those.  I don't think gfortran carried over the
-fone-trip option from g77, another assumption which many people
considered erroneously to be part of f66 standard.   You may be stuck
with setting implicit none and weeding out errors.


-- 
Tim Prince


  reply	other threads:[~2020-04-29 14:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 13:37 Joao Martins Correia
2020-04-29 14:24 ` Tim Prince [this message]
2020-04-30 14:59 ` Bob Wilkinson
2020-04-30 16:34   ` Joao Martins Correia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YTOPR0101MB1804A32D5A3776A3B46B5CD6B7AD0@YTOPR0101MB1804.CANPRD01.PROD.OUTLOOK.COM \
    --to=tcprince@live.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=tprince@intelretiree.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).