Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Problem compiling FORTRAN code

  1. Feb 27, 2013 #1
    Hello, I received some very old cold, and I don't even know for which FORTRAN standard it was originally written, only that it has existed since at least 1993. I'm trying to compile it in gfortran, and I get the following error:

    'Error: Expected a right parenthesis in expression at (1)'
    1 / 1H( ,1H1 ,1HX ,1H, ,1H ,1H ,1HA ,1H ,1H ,1H) /
    1

    The code is shown below, and the line indicated in the error message is the fourth line of the code shown here. Anyone know why I am getting this issue?

    INTEGER F(10),G(14),LUN(5)
    DIMENSION MESSG(NMESSG)
    DATA F(1),F(2),F(3),F(4),F(5),F(6),F(7),F(8),F(9),F(10)
    1 / 1H( ,1H1 ,1HX ,1H, ,1H ,1H ,1HA ,1H ,1H ,1H) /
    DATA G(1),G(2),G(3),G(4),G(5),G(6),G(7),G(8),G(9),G(10)
    1 / 1H( ,1H1 ,1HX ,1H ,1H ,1H ,1H ,1H ,1H ,1H /
    DATA G(11),G(12),G(13),G(14)
    1 / 1H ,1H ,1H ,1H) /
    DATA LA/1HA/,LCOM/1H,/,LBLANK/1H /
    C PREPARE FORMAT FOR WHOLE LINES
    C***FIRST EXECUTABLE STATEMENT XERPRT
    NCHAR = I1MACH(6)
    NFIELD = 72/NCHAR
    CALL S88FMT(2,NFIELD,F(5))
    CALL S88FMT(2,NCHAR,F(8))
    C PREPARE FORMAT FOR LAST, PARTIAL LINE, IF NEEDED
    NCHARL = NFIELD*NCHAR
    NLINES = NMESSG/NCHARL
    NWORD = NLINES*NFIELD
    NCHREM = NMESSG - NLINES*NCHARL
    IF (NCHREM.LE.0) GO TO 40
    DO 10 I=4,13
    10 G(I) = LBLANK
    NFIELD = NCHREM/NCHAR
    IF (NFIELD.LE.0) GO TO 20
    C PREPARE WHOLE WORD FIELDS
    G(4) = LCOM
    CALL S88FMT(2,NFIELD,G(5))
    G(7) = LA
    CALL S88FMT(2,NCHAR,G(8))
    20 CONTINUE
    NCHLST = MOD(NCHREM,NCHAR)
    IF (NCHLST.LE.0) GO TO 30
    C PREPARE PARTIAL WORD FIELD
    G(10) = LCOM
    G(11) = LA
    CALL S88FMT(2,NCHLST,G(12))
    30 CONTINUE
    40 CONTINUE
    C PRINT THE MESSAGE
    NWORD1 = NWORD+1
    NWORD2 = (NMESSG+NCHAR-1)/NCHAR
    CALL XGETUA(LUN,NUNIT)
    DO 50 KUNIT = 1,NUNIT
    IUNIT = LUN(KUNIT)
    IF (IUNIT.EQ.0) IUNIT = I1MACH(4)
    IF (NWORD.GT.0) WRITE (IUNIT,F) (MESSG(I),I=1,NWORD)
    IF (NCHREM.GT.0) WRITE (IUNIT,G) (MESSG(I),I=NWORD1,NWORD2)
    50 CONTINUE
    RETURN
    END
     
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted



Similar Discussions: Problem compiling FORTRAN code
Loading...