I have written a simple test program to try subroutines and the call statement in Fortran. I am using gfortran compiler in GNU/Linux. I have declared 14 parameters which are numbered accordingly in my code. While my code works PERFECTLY WELL when I try to pass 11 of those arguments through the call statement, I encounter a rather strange 'SYNTAX ERROR' when I try to include a 12th argument and I try to pass 12 arguments through the call statement. What might the problem be and how might I fix it? Here is the program I am talking about
`
program test
IMPLICIT REAL*4(A-B,D-H,O-Z)
IMPLICIT COMPLEX(C)
COMPLEX*16 CQC,CQV
parameter k1=2
parameter k2=2
parameter k3=2
parameter k4=2
parameter k5=2
parameter k6=2
parameter k7=2
parameter k8=2
parameter k9=2
parameter k10=2
parameter k11=2
parameter k12=2
parameter k13=2
parameter k14=2
call bins(k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12)
end program
subroutine bins(k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12)
integer k1, k2, k3, k4, k5
end subroutine `
Following is the error that I get when I include k12 in the 'call' statement and then compile it:
`
siddharth@siddharth-VBox:~/Desktop/Codes$ gfortran test6.for -o test6.out
test6.for:23.72:
call bins(k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12
1
Error: Syntax error in argument list at (1)
test6.for:29.72:
subroutine bins(k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k1
1
Error: Unexpected junk in formal argument list at (1)
test6.for:2.72:
program test
1
test6.for:31.72:
integer k1, k2, k3, k4, k5
2
Error: Two main PROGRAMs at (1) and (2)
`
I reiterate that I don't encounter any problems in compiling when I include the arguments k1 to k11 in the call statement, its just the introduction of a 12th argument that introduces the problem. Any help will be appreciated.
-ffree-formas an option to gfortran to tell it to use free form regardless of filename extension. - steabert