Function referencing/automatic defintion question. [message #35395] |
Thu, 29 May 2003 08:00 |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
Hello,
IDL> print, !version
{ x86 linux unix linux 5.5a Feb 7 2002 32 32}
I have a file called emiscoeff__define.pro that contains the named structure (EmisCoeff)
definition. **Preceding** the actual definition procedure in the same source file is a
bunch of utility functions that allow me to allocate, assign, and destroy the structure. I
invoke the automatic definition thusly:
EmisCoeff = { EmisCoeff }
which produces the message:
% Compiled module: EMISCOEFF__DEFINE.
Fair enough. The very next statement in my code calls a function in the
emiscoeff__define.pro file that allocates space in the structure:
Result = Allocate_EmisCoeff( n_Wind_Speeds, $
n_Coefficients, $
n_Channels, $
EmisCoeff )
IF ( Result NE SUCCESS ) THEN $
MESSAGE, 'Error allocating EmisCoeff structure', $
/NONAME, /NOPRINT
When this statement os reached I get the message:
% COMPUTE_THETA_COEFFICIENTS: Variable is undefined: ALLOCATE_EMISCOEFF.
where "Compute_Theta_Coefficients" is the name of my calling function.
If I then do a "help":
IDL> help
% At $MAIN$
EMISCOEFF STRUCT = -> EMISCOEFF Array[1]
Compiled Procedures:
$MAIN$ COUNT_EMISCOEFF_SENSORS EMISCOEFF__DEFINE PLOT_EMISSIVITY_FIT_RESIDUALS
THETA_FUNCTION
Compiled Functions:
ALLOCATE_EMISCOEFF ASSIGN_EMISCOEFF
ASSOCIATED_EMISCOEFF CHECK_VECTORS
COMPUTE_EMISSIVITY_COEFFICIENTS COMPUTE_EMISSIVITY_FIT COMPUTE_THETA_COEFFICIENTS
CONVERT_STRING DESTROY_EMISCOEFF IS_NCDF READ_NCDF VALID_STRING
You can see that the function ALLOCATE_EMISCOEFF is in the list of compiled functions.
So my question is: what's the go here? Why doesn't my calling procedure "see" the compiled
functions that precede my structure definition? I thought the whole point of sticking
these routines *before* the procedure in my emiscoeff__define.pro file that actually does
the definition meant that they would be compiled?
Any insights appreciated,
paulv
p.s. When I manually compile the emiscoeff__define.pro file I get the following:
IDL> .run emiscoeff__define
% Compiled module: ASSOCIATED_EMISCOEFF.
% Compiled module: DESTROY_EMISCOEFF.
% Compiled module: ALLOCATE_EMISCOEFF.
% Compiled module: ASSIGN_EMISCOEFF.
% Compiled module: COUNT_EMISCOEFF_SENSORS.
% Compiled module: EMISCOEFF__DEFINE.
How come I don't get this list when I do the automatic compilation via
EmisCoeff = { EmisCoeff }
???
--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
Ph: (301)763-8000 x7748
Fax:(301)763-8545
|
|
|