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!

Fortran 90/95 stack fault problem

Status
Not open for further replies.

daveask

Programmer
Aug 11, 2004
108
GB
Hi,

How this very simple program can cause error
"floating point stack fault"
It will work fine if I use internal function.

program AddFunc
integer :: n1=23, n2=46
print *, add2f(n1, n2)
end program AddFunc

!contains

integer function add2f(n1, n2)
integer n1, n2
add2f = n1 + n2
end function add2f

!end program AddFunc
 
You need to declare add2f as external in the program otherwise it takes it as an array.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top