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

break a program in subroutine: problem in data transfer

roddur
Beginner
640 Views
Dear friends, I am trying to write a code, where i am useing a old packaged routine written in f77(lm.f) and I have splitted it into two subroutine (lm-lib.f90 and lm-lib-end.f90) which is to be used in main.F90.
The problem is even after much work, I have not managed to transfer the data from lm-lib to lm-lib-end successfully. the work of main.F90 is not much here, it just reads some file created by lm-lib and then create another file which will be read by lm-lib-end.
the argument list is growing more than impressive and with no solution. May I try to declare the declarations in module or what is the best way to transfer data?
The lm-lib* is actually a part of a package and the whole package is used as a library.
Plz suggest something.
0 Kudos
1 Reply
jpapp
Beginner
640 Views
If what I think you are saying is the problem (data going at the subroutine call is not equal to data within the subroutine being called), then the problem may be because you don't have an interface block. If you call lm-lib from lm-lib-end.f90, then you need to add an interface block for subroutine lm-lib inside lm-lib-end.f90. The compiler will not flag that you are missing an interface block but the problem may show up as garbled data transfers.

John
0 Kudos
Reply