Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter problem calling subroutine

Status
Not open for further replies.

hmcfortran

Programmer
Jun 7, 2005
3
NL
Hi,

I am a beginner programmer in Fortran, but has to modify some code. It has to do with adding an extra parameter to a subroutine. I thought this had to be easy, but i am overlooking something and i really do not know what.
In the subroutine TNKDAT() i use the following code to call a subroutine TNKUPD():

90 IF (IOP1.NE.16) CALL TNKUPD(VN,WN,FN,SN,LCG,TCG,VCG,FSM,IMFSM,DATE)

IMFSM is the parameter i added.

The definition of the subroutine TNKUPD is as follows:
SUBROUTINE TNKUPD(VN,WN,FN,SN,LCG,TCG,VCG,FSM,TTT,DATE)

I think it has something to do with declaring variables or the type of variables, but it is a wild guess for me...

The code will not compile and gives the following warning:
..\FORALS.NEW\O_MODB.FOR
..\FORALS.NEW\O_MODB.FOR(617) : error F2115: syntax error
..\FORALS.NEW\O_MODB.FOR(646) : warning F4999: CN : variable declared but not used
..\FORALS.NEW\O_MODB.FOR(646) : warning F4999: TRICH : variable declared but not used
..\FORALS.NEW\O_MODB.FOR(646) : error F2837: label 90 : undefined
..\FORALS.NEW\O_MODB.FOR(746) : warning F4999: CN : variable declared but not used
 
See misspellings (dot instead of comma etc). Where is your 617 line (-3..+3 lines too) in the snippet? Obviously, it's not an extra parameter issue...
 
V is next to C on the keyboard. Have you typed CN instead of VN?
 
I solved the problem. It had something to do with the column the statement was in. Did not know Fortran is so sensitive....
 
You're probably using either Fortran IV or 77.

Fortran II, IV and 77 labels in cols 1-5, continuation in col 6, code 7 to 72

Fortran 90, 95 and 2003 are free format.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top