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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

runtime problem with module

Status
Not open for further replies.

daveheart

Programmer
Dec 2, 2009
2
DE
Hi,

I have a question about modules.

I have to call many subroutines in my program and many arrays are passed to these Routines(up to 20):

PROGRAM main
CALL Sub1(a,b,c,d,e,f,g,h,i)
CALL Sub2(a,b,c,d,e,f,g,h,i)
CALL Sub3(a,b,c,d,e,f,g,h,i)
END PROGRAM

So i made a module, which contains all these arrays, so that the code gets readable:
MODULE variables
DOUBLE PRECISION :: a:)),b:)),c:)),d:)),e:)),f:)),g:)),h:)),i:))
END MODULE

PROGRAM main
USE variables
CALL Sub1
CALL Sub2
CALL Sub3
END PROGRAM

But now i have a problem with the runtime of the program. It's running twice as slow as before. Can anyone explain that to me and is there a way to keep the code readable and fast?

Thanks in advance





 
Hm, no idea, but what you can try is to take away the USE statement in your main program and place a reduced one in your subroutines.

SUBROUTINE Sub1
USE variables, ONLY: a
etc..

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top