Search code examples
fortranubuntu-9.10g77

Fortran compile error


I tried to compile a fortran program for soil-plant-atmosphere model, but I can't compile it under Ubuntu, it keeps giving me the error message like this:

f77 -c -o o/cupin2.o  src/cupin2.f
src/cupin2.f: In subroutine `reflt':
src/cupin2.f:742: 
         dimension tairgl,eairgl,windgl,psisgl,hsoil,ecpy,hcpy
                         ^
Invalid form for DIMENSION statement at (^)
make: *** 
[o/cupin2.o] Error 1

Can anyone help me with this. Thanks. Complete source code is here:Source Code


Solution

  • The DIMENSION statement is used to dimension arrays - so you have to specify the array dimensions. For example:

    dimension tairgl(100),eairgl(20,50), ...
    

    You don't actually need the DIMENSION statement, however, you could also say something like:

    real tairgl(100)
    integer eairgl(20,50)