title: ERROR: Installing a Fortran library on Ubuntu 12.04
body: <p>I have been trying to install the library with a Makefile written in Fortran using the latest gfortran version.</p>
  <p>The instructions are:</p>
  <blockquote>
  <p>M-LIB is provided with a very bare-bones makefile, which should be
  modified for your Fortran compiler. To compile, run make in the src
  directory. This creates library lib.a and executable m-lib.</p>
  </blockquote>
  <p>The Makefile is:</p>
  <pre><code>FC = gfortran
  FCFLAGS = -O3 
  AR = ar
  ARFLAGS = -cru
  LDFLAGS = 
  LIBRARY = lib.a
  PROGRAM = m-lib
  PROGOBJECTS = LIBTEST.o EOS.o
  LIBOBJECTS = ADATA.o \
      ADEBY.o \
      AE2PH.o \
      AEHPP.o \
      AEI3.o \
      AZRTR.o
  
  %.o: %.f
      $(FC) -c $(FCFLAGS) $&lt;
  
  default: $(PROGRAM)
  
  $(LIBRARY): $(LIBOBJECTS) 
      rm -f $(LIBRARY)
      $(AR) -cr $(LIBRARY) $(LIBOBJECTS)
  
  $(PROGRAM): $(PROGOBJECTS) $(LIBRARY)
      $(FC) $(FCFLAGS) -o $(PROGRAM) $(PROGOBJECTS) $(LIBRARY)
  
  install:
      cp ../input/q_.input ../example/m-lib.INPUT
      cp ./m-lib ../example/m-lib
  
  clean:
      rm -f $(LIBOBJECTS) $(PROGOBJECTS)
  
  allclean:
      rm -f $(PROGRAM) $(LIBRARY)
      make clean
  </code></pre>
  <p>And I get this error:</p>
  <pre><code>enter codegfortran -c -O3  LIBTEST.f
  LIBTEST.f:36.26:
  
    allocate (character(arglen) :: arg)                               
                        1
  Error: Variable 'arglen' cannot appear in the expression at (1)
  LIBTEST.f:99.72:
  
    DO 10 I=1,NDENS                                                   
                                                                      1
  Warning: DO loop at (1) will be executed zero times
  LIBTEST.f:104.72:
  
    DO 20 J=1,NTEMP                                                   
                                                                      1
  Warning: DO loop at (1) will be executed zero times
  make: *** [LIBTEST.o] Error 1
  </code></pre>
  <p>¿Any idea what is wrong?</p>
  <p>EDIT
  This is source code of EOS.o:</p>
  <pre><code>      SUBROUTINE EOS(TEMP,TEMP0,P,RHO,E,M)
  
        IMPLICIT REAL*8 (A-H,O-Z)
        TEMP=TEMP0
        IT=0
   10   CONTINUE
        IT=IT+1
        IF(IT.GT.50) STOP 'TOO MANY ITERATIONS--EOS'
        CALL ADEBY (TEMP,RHO,P,ETRIAL,S,CV,DPDT,DPDR,FKROS,CS,KPA,M)
        IF (ABS(E-ETRIAL) .LT. 1.0D-9*E) RETURN
        TEMP=TEMP+(E-ETRIAL)/CV
        GOTO 10
        END
  </code></pre>
  <p>This is first lines of the source code of LIBTEST.o:</p>
  <pre><code>      PROGRAM LIBTEST
  
        IMPLICIT DOUBLE PRECISION (A-H,O-Z)
        INTEGER STYLE
        PARAMETER (NDENS=0)
        PARAMETER (NTEMP=0)
        DIMENSION IZETL(21)
        COMMON /FILEOS/ KLST, KINP
        COMMON /ANGELX/ W,Y,ALFA,BETA,DADT,DADR,DBDT,ZZ,ET,
       &amp; SN,CVN,EN,PN,PM,EM,SM,CVM,EC,PC,RHO0,RHO00,ZVIB,
       &amp; SMLT,CVMLT,EMLT,PMLT,H1,H2
        COMMON /ANEEL/ TEVX,RHOX,ABARX,ZBARM,T32X,FNX
       &amp;  ,PE,EE,SE,CVE,DPTE,DPRE
       &amp;  ,NMATSX,IIZX
        COMMON /ANEDIS/ GAMMA,PSI,THETA
        PARAMETER (MATBUF=64)
        COMMON /ANESQT/ SQTS(MATBUF),IPSQTS
        DIMENSION RHO(NDENS),TEMP(NTEMP),HISTDENS(100),HISTPRESS(100)
        DIMENSION HISTDPDR(100)
        DIMENSION TARR(2000)
        DIMENSION DARR(2000)
        DIMENSION PARR(2000,2000)
        DIMENSION SARR(2000,2000)
        DIMENSION EARR(2000,2000)
        DIMENSION CSARR(2000,2000)
        DIMENSION CVARR(2000,2000)
        DIMENSION ZKARR(2000,2000)
  C
  CSTS ADDS --help, --no_table, and file checks
        character(:), allocatable :: arg
        integer arglen, stat
        logical file_exists
        call get_command_argument(number=1, length=arglen)  ! Assume for simplicity success
        allocate (character(arglen) :: arg)
        call get_command_argument(number=1, value=arg, status=stat)
        IF (arg.NE.'--quiet') THEN
           write(*,9020)
           write(*,9021)
           write(*,9022)
           write(*,9023)
  </code></pre>
  <p>(...)</p>