编译三个文件fortran 77“Line too long”

时间:2015-06-21 22:07:42

标签: compiler-errors fortran fortran77 g77

我正在尝试使用g77编译三个文件。 其中一个文件是主文件的子例程,返回

Jades-MacBook-Pro:Jade jadecheclair$ g77 -c atmsetup.for 
Line too long as of (?) [info -f g77 M LEX]

我对fortran很新,在网上找不到任何解释。另外两个文件工作并创建.o文件,其中一个(也是一个子例程)看起来与此文件完全相同。

任何人都知道这意味着什么以及如何解决它?

由于它不让我知道哪条线路造成了麻烦,我在这里附上代码:

      SUBROUTINE ATMSETUP(NLEVEL,Z,RHCH4,FH2,FARGON,TEMP,PRESS,DEN,XMU,
     & CH4,H2,XN2,AR,IPRINT)
C THIS IS THE NEW ONE WITH THE BWC EQ OF STATE
      PARAMETER (NMAX=201)
C THIS SUBROUTINE SETS UP THE INTITAL ATMOSPHERIC PROFILE FOR TITAN
C BASED ON THE LINDAL ET AL DATA.  THE ROUTINE STARTS WITH INPUTS
C INPUTS:  
C NLEVEL:   NUMBER OF ALTITUDE LEVELS, J=1 IS AT THE TOP
C Z         ALTITUDE GRID IN KM
C RHCH4     RELATIVE HUMIDITY OF METHANE AT Z=0.
C FH2       MIXING RATIO BY NUMBER OF H2
C FARGON    ARGON FLAG 0 = NO ARGON IN ATMSOPHERE 
C                     -Y = ADJUST AR TO GIVE MEAN WEIGHT=Y
C                     +X = MIXING RATIO OF ARGON = X
C OUTPUTS: AT EACH LEVEL (NOT LAYER AVERAGES)
C TEMP (K), PRESS(BARS), DEN(CM-3), XMU = MEAN MOLECUALR WEIGHT
C CH4, H2, XN2, AR ARE THE NUMBER MIXING RATIOS OF THE GASES
C INTERNAL VARIABLES
C TLINAL, DLINAL, PLINAL : THE LINDAL INGRESS VALUES ON THE Z GRID
C
C NOTES: METHANE FOLLOWS CONSTANT MIXING RATIO UNLESS SATUARTION
C        VALUE IS LOWER.
C
      DIMENSION Z(NLEVEL),TEMP(NLEVEL),PRESS(NLEVEL),DEN(1),XMU(1) 
      DIMENSION CH4(1),H2(1),XN2(1),AR(1)

      DIMENSION TLINAL(NMAX),DLINAL(NMAX),PLINAL(NMAX)
C
C FIRST SET UP THE LINDAL PURE N2 VALUES
      CALL LINDAL(NLEVEL,Z,TLINAL,DLINAL,PLINAL)
C LOAD THE LINDAL VALUES INTO THE ARRAYS
      DO J=1,NLEVEL
      TEMP(J)= TLINAL(J)
      DEN(J)=  DLINAL(J)
      PRESS(J)=PLINAL(J)
      ENDDO
C
      DO 1000 ITS =1,20
C
C NOW COMPUTE THE MEAN MOLECULAR WEIGHT AT EACH LEVEL
C NOW SET UP THE MIXING RATIOS OF THE GASSES BASED ON SATURATION
C CURVE OF CH4 AND SPECIFIED MEAN MOLECULAR WEIGHT AND H2 CONSTANT
      CH4(NLEVEL)=PCH4(TEMP(NLEVEL))*RHCH4/PRESS(NLEVEL)
      DO 134 J=NLEVEL-1,1,-1
      CH4SAT=PCH4(TEMP(J))/PRESS(J)
      CH4(J)=AMIN1(CH4SAT,CH4(NLEVEL),CH4(J+1))
 134  CONTINUE
      DO 20 J=1,NLEVEL
      H2(J)=FH2  
      IF (FARGON .LT. 0.) THEN
C WE DECIDED TO KEEP CONSTANT MIXING RATIO = -FARGON
      AR(J)=(-FARGON-28.0134+25.8554*H2(J)+11.9708*CH4(J))/11.9346
      ELSE 
                    IF (FARGON .EQ. 0.) THEN
C                       WE DECIDED TO DROP THE ARGON...
                    AR(J)=0.0
                        ELSE
C                       ARGON GIVEN BY A CONSTANT MIXING RATIO
                            AR(J)=FARGON
                    ENDIF
      ENDIF
      XN2(J)=1.0 - H2(J) - CH4(J) -AR(J)
      XMU(J)=28.0134*XN2(J)+2.158*H2(J)+16.0426*CH4(J)+39.948*AR(J)
 20   CONTINUE
C AT THIS POINT WE HAVE THE TEMP, PRESS, DEN AND XMU VALUES.
C ADJUST THE DEN BY THE FACTOR DUE TO THE MEAN REFRACTIVITY
C NOW LETS INTERGRATE THE DENSITY WITH ALTITUDE TO GET THE PRESS
       SUMT=PLINAL(1)*6.02E23/10.
       SUMB=SUMT
      TLAST=TEMP(NLEVEL)
      DO J=2,NLEVEL
C DENSITY ADJUSTMENT BASED ON REFRACTIVITIES ... SEE NOTES
      DENF=294.1/(XN2(J)*294.1 + CH4(J)*410. + H2(J)*136. + AR(J)*277.8)
      DEN(J) = DLINAL(J)*DENF
C PERFORM THE INTEGRALS LISTED IN NOTES
C SUMT IS ACTUAL PRESSURE 
      ADEN=(DEN(J)-DEN(J-1))/ALOG(DEN(J)/DEN(J-1))
      SUMT=SUMT+(EFFG(Z(J))*ADEN)*( Z(J-1)-Z(J))*XMU(J)
      ADEN=(DLINAL(J)-DLINAL(J-1))/ALOG(DLINAL(J)/DLINAL(J-1))
      SUMB=SUMB+(EFFG(Z(J))*ADEN)*( Z(J-1)-Z(J))*28.01340
C
C NON IDEAL GAS CORRECTION IS 3.5% TIMES DT = 0.03% :NEGLECTED
      PRESS(J)=PLINAL(J)*SUMT/SUMB
      TEMP(J) =TLINAL(J)*(SUMT/SUMB)*(1./DENF)
C
      ENDDO
  30  CONTINUE
C
C HOW WELL WE DO ON CONVERGENCE
      DT= ABS(TEMP(NLEVEL)-TLAST)
      IF (DT .LT. 0.001) GO TO 1001
 1000 CONTINUE      
 1001 IF (IPRINT .LT. 0) RETURN
         WRITE (6,139)RHCH4,FH2,FARGON,DT
         DO 135 J=1,NLEVEL-1
         WRITE(6,140)J,Z(J),PRESS(J),DEN(J),TEMP(J),
     &          CH4(J)*PRESS(J)/PCH4(TEMP(J))
     &         ,CH4(J)*100.,XN2(J)*100.,H2(J)*100.,AR(J)*100.,XMU(J)
     &         ,(TEMP(J+1)-TEMP(J))/(Z(J+1)-Z(J))
  135    CONTINUE
         J=NLEVEL
         WRITE(6,140)J,Z(J),PRESS(J),DEN(J),TEMP(J),
     &    CH4(J)*PRESS(J)/PCH4(TEMP(J))
     &    ,CH4(J)*100.,XN2(J)*100.,H2(J)*100.,AR(J)*100.,XMU(J)
  139 FORMAT(///'   BACKGROUNG ATMOSPHERE AT LEVELS'/
     & ' SURFACE HUMIDITY OF CH4:',F5.3,'  H2 MIXING RATIO:',F6.4,
     & ' ARGON SETTING:',F8.4/'  FINAL CONVERGENCE ON TEMP:',F10.5
     &  '   LINDAL ET AL SCALING'/
     &' LVL ALTITUDE  P(BARS)  DEN(CM-3) TEMP RH-CH4'
     & , ' %CH4  %N2   %H2  %AR   MU   DT/DZ'  )
  140 FORMAT(1X,I3,F8.3,1P2E10.3,0PF7.2,F5.2,2F6.2,2F5.2,4F6.2)
C END INTITAL BACKGROUND ATMOSPHERE SETUP FOR TITAN
      RETURN
      END

2 个答案:

答案 0 :(得分:0)

我将您的代码复制并粘贴到文本编辑器中并查看它。你的第二行,第1行的SUBROUTINE语句的延续似乎在错误的列中延续了它的行继续。它应该是第6列。

-Eric

答案 1 :(得分:0)

通过在vim中打开文件可以看到问题。即使程序在Xcode中看起来很好,所有的线都在一起。

刚刚在textedit中打开文件并重新格式化。然后它奏效了!