- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello
I have a problem in my code. Fortran call function is not working. Actually calculation in subroutine is done correctly and can be seen seperately, but the value of the desired variable is displayed as zero in the main code and has no effect in calculation!!! Actually, the problem is in transffering data from subroutine to the main code!!!
You can see the result of the subroutine, call and run in the following file. Pay attention to the result of the run. The value of the variable "surfacelength" is zero in the main code while after I printed this variable with the name "surf" in the subroutine, its value gets visible.
I would be very grateful if some one could help me.
I have a problem in my code. Fortran call function is not working. Actually calculation in subroutine is done correctly and can be seen seperately, but the value of the desired variable is displayed as zero in the main code and has no effect in calculation!!! Actually, the problem is in transffering data from subroutine to the main code!!!
You can see the result of the subroutine, call and run in the following file. Pay attention to the result of the run. The value of the variable "surfacelength" is zero in the main code while after I printed this variable with the name "surf" in the subroutine, its value gets visible.
I would be very grateful if some one could help me.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The screenshot in the PDF file tells us nothing of the declarations of the variables. It may be that you calculate a local variable in the subroutine in question (it is unclear to me which one that is) and then the main program will not know about it. You will have to show more code, at the very least the declarations of the variables.
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