Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28741 Discussions

Fortran call function is not working

Jalalian
Beginner
710 Views
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.
Labels (3)
0 Kudos
1 Reply
Arjen_Markus
Honored Contributor I
701 Views

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.

0 Kudos
Reply