I'm programming this in Fortran 90.
The overall program follows this format:
The problem is simple. I ask for some input array (X), then call a routine called WALMART. The routine makes use of a subroutine (FUNC). The problem arises because the output (MONEY) of FUNC makes use of the input of my main program. However, I cannot alter the input of WALMART. Without using global (COMMON) variables, how do I 'pass' X into the subroutine?
To be more specific, WALMART is a canned routine (NAG Fortran). It's inputs and outputs are fixed, so I can't simply pass X into WALMART, then pass it again into FUNC!
Help!
The overall program follows this format:
Code:
PROGRAM TEST
Declare variables
X = 2
CALL WALMART(FUNC, ...other stuff...)
END TEST
SUBROUTINE FUNC(MONEY, Y)
MONEY = X*Y
END
The problem is simple. I ask for some input array (X), then call a routine called WALMART. The routine makes use of a subroutine (FUNC). The problem arises because the output (MONEY) of FUNC makes use of the input of my main program. However, I cannot alter the input of WALMART. Without using global (COMMON) variables, how do I 'pass' X into the subroutine?
To be more specific, WALMART is a canned routine (NAG Fortran). It's inputs and outputs are fixed, so I can't simply pass X into WALMART, then pass it again into FUNC!
Help!