- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I would like to return a value from a function and receive it in the main program. It gives two errors. Can you make the following fortran code work?
program trial
real*8 a,b,c
a=1.d0
b=0.d0
call fn(a,b,c)
if (fn.eq.1) write(*,*)
end program trial
function fn(a,b,c)
real*8 a,b,c
if (a.gt.0) return 0
return 1
end function fn
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would suggest you avail yourself of a good Fortran reference or tutorial.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Seyhan Emre,
You posted the same question in an earlier thread: http://software.intel.com/en-us/forums/topic/382162 . Please read the responses that were given in that thread instead of reposting. I second Linda's advice above.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page