[prog] compiling (or failing to) old fortran on linux

Conor Daly conor.daly at oceanfree.net
Tue Sep 7 23:57:32 EST 2004


On Tue, Sep 07, 2004 at 04:52:48PM -0400 or so it is rumoured hereabouts, 
Shirrell thought:
> Conor Daly wrote:
> 
> >          if((ans.eq.'n').or.(ans.eq.'N')) then
> >                 1   2
> >Equality operator at (1) must operate on two scalar (not array)
> >subexpressions, two function invocations returning arithmetic or character
> >scalars, or a combination of both -- but the subexpression at (2) is an
> >array
> >
> How is ans declared -- this looks ok if it is something like   
> character*n ans

None of the vars are declared.  There is an

implicit integer(a-y)

at the top of the code and the only declarations are for vars that must be
predeclared to the sql preprocessor.
 
> >            if (zwdif.lt.0) signw = '-'
> >                            1       2
> >Type disagreement between expressions at (1) and (2)
> >
> Again, how is signw declared: If it is character*n it should be ok on 
> g77. 

With the help of our resident fortran expert (I know only enough fortran
to try to translate to C), I changed the 'type' to 'print', changed
solitary 'x' to '1x' and declared ans, signw etc and it all compiled
happily.  The only trouble is that there are about 100 of these programs
and it'll be a pain cleaning each one up.  There are some that are so old
that they have 'encode' and 'decode' statements!!

OTOH, this may be the time to bite the bullet and rewrite the programs
(especially the older ones...)

Thanks,

Conor
-- 
Conor Daly <conor.daly at oceanfree.net>

Domestic Sysadmin :-)
---------------------
Faenor.cod.ie
 11:51pm  up 11 days,  3:44,  0 users,  load average: 0.01, 0.06, 0.09
Hobbiton.cod.ie
 23:50:33  up 1 day, 16:32,  1 user,  load average: 0.06, 0.09, 0.03


More information about the Programming mailing list