This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: CREAD buggy?


      I am happy to report that xplor-nih, built with today's gcc 4.0
branch gfortran compiler (plus the cray patches), now passes its complete
testsuite! Nice.
        The hack I had to apply was...

--- coorio.f.org        2005-07-30 13:28:46.000000000 -0400
+++ coorio.f    2005-07-30 20:44:46.000000000 -0400
@@ -265,6 +265,7 @@
       DOUBLE PRECISION XIN, YIN, ZIN, WIN, QIN
       CHARACTER*4 SID, RID, RID2, REN, IUP
       CHARACTER*5 A
+      CHARACTER*132 JACKSTR
       INTEGER NUMBER, IJ
 C parameter
       INTEGER MARK
@@ -287,6 +288,7 @@
 C ==================================================
 C this section reads the Brookhaven atom coordinates
 C ==================================================
+            READ(COMLYN,'(A)') JACKSTR
             READ(COMLYN,'(12X,A4,1X,A4,1X,A5,3X,3F8.3,F6.2,F6.2,6X,A4)',
      &           ERR=8888) IUP,REN,A,XIN,YIN,ZIN,QIN,WIN,SID
 C     

I found that a WRITE statement in front of the offending READ statement
didn't help...only a READ of the string seemed to clear the i/o to allow
the following read to pass. Again without the additional READ in front,
the second READ has an error condition which causes it to jump to the
8888 label which is...

C-ERROR-LABEL
      GOTO 7777
8888  ERROR=.TRUE.
      WRITE(6,'(A)') ' %COOR-ERR: ERROR during reading coordinates'
7777  CONTINUE

Unfortunately at this point the i/o is so mangled that it segfaults
whenever you attempt to print anything. If anyone has any suggestions
of other things to try in front of the offending READ statement to see
if they also clear the error condition (and perhaps gives more of a
clue to the origin of the bug), I'll be happy to try it.
                Jack
ps Tomorrow I'll try a gcc-4.1 branch build of xplor-nih (I already have
the compiler packages built with the cray patches) and see what sort
of performance gain we get going from 4.0 to 4.1.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]