Print

Print


On Wed, 16 Jul 2008, Tim Jenness wrote:

> On Wed, Jul 16, 2008 at 7:03 AM, Gavin Ramsay <[log in to unmask]> wrote:
>
> > hi
> >
> > i've found what appears to be a bug in daophot in the 'sort' routine.
> > i get:
> >
> >                                 Which do you want? 4
> >                                   Input file name: stars.ap
> >              Output file name (default stars.srt):
> >                  Do you want the stars renumbered? y
> >
> >                      STAR      X        Y    MAG.(1)
> > At line 198 of file sort.f
> > Traceback: not available, compile with -ftrace=frame or -ftrace=full
> > Fortran runtime error: Expected CHARACTER for item 1 in formatted transfer,
> > got REAL.  If you want to make character descriptors typeless, compile with
> > -fsloppy-char
> > (33A4)
> >    ^
> >
> > this is on a linux 32-bit machine running fedora. i also get the same error
> > on my mac intel processor.
> >
> > any idea? i get the same using different images.
> >
>
> This is g95 being picky (and since we use the same compiler on Mac and Linux
> you get the same run time error). The lines in question are:
>
>     198       READ (TEXT(2:N),66) (WORK(J), J=LOW(I),NLO)
>     199    66 FORMAT (33A4)
>
> WORK is a _REAL but it is being formatted as A4 so it looks like a real bug
> to me.

Or a bit of old dodgy Fortran. It's an old trick for using an array of any
type for storing a string (in this case all the lines from the file to be
sorted, which are then re-addressed using an indexing vector). The only
thing to do is recompile using the -fsloppy-char flag. I'll need to work
out how to do this in the configure script.

Peter.