Syntax error in call statement in Fortran -
i have written simple test programme seek subroutines , phone call statement in fortran. using gfortran compiler in gnu/linux. have declared 14 parameters numbered accordingly in code. while code works when seek pass 11 of arguments through phone call statement, encounter rather unusual 'syntax error' when seek include 12th argument , seek pass 12 arguments through phone call statement. might problem , how might prepare it? here programme talking
`
programme 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 phone call bins(k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12) end programme subroutine bins(k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12) integer k1, k2, k3, k4, k5 end subroutine `
following error when include k12 in 'call' statement , compile it:
`
siddharth@siddharth-vbox:~/desktop/codes$ gfortran test6.for -o test6.out test6.for:23.72: phone call bins(k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12 1 error: syntax error in argument list @ (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 @ (1) test6.for:2.72: programme test 1 test6.for:31.72: integer k1, k2, k3, k4, k5 2 error: 2 main programs @ (1) , (2)
`
i reiterate don't encounter problems in compiling when include arguments k1 k11 in phone call statement, introduction of 12th argument introduces problem. help appreciated.
files .for or .f extension, convention, treated fixed form source. statements on fixed form lines must go in between columns 7 , 72, inclusive. note column position in error message - end of statement beingness chopped off.
fixed form source not sensitive whitespace. parameter kxxx
assignment statements before phone call statement don't think.
do not utilize fixed form source unless modifying existing legacy code.
do not utilize implicit typing unless modifying existing legacy code (or perhaps engaging in esoteric application of generic programming). implicit none
best friend.
fortran
No comments:
Post a Comment