Common block compilation error [message #73686] |
Mon, 22 November 2010 06:00 |
Gray
Messages: 253 Registered: February 2010
|
Senior Member |
|
|
Hi all,
I'm using the NASA IDL astronomy library's MINF_BRACKET and
MINF_PARABOLIC routines to minimize a function. Doing so requires
that I use a common block for some other parameters. The routine that
calls the minimization routines gets passed the parameters and stores
them in the common block. I had thought that I could name the input
parameters for the calling function as the same as the common block
variables, so that they would be automatically stored, but doing so
gives a compilation error, and so I have to name them differently and
assign their values to the common block variables. Is there any
reason why this should be so? It seems an unnecessary extra step...
--Gray
Code (gives error):
FUNCTION m87_scl, scl
common m87scal, img, im0
return, robust_sigma(img*scl-im0,/zero)
end
FUNCTION m87_scale, img, im0
common m87scal
xa = 0.1 & xb = 10.
minf_bracket, xa, xb, xc, func_name='m87_scl'
minf_parabolic, xa, xb, xc, scl, func_name='m87_scl'
return, scl
end
|
|
|