With ncap2 4.3.1, I find that:
ncap2 -s 'x *= 3.;'
drops all of the variable attributes in the output file (except _FillValue),
ncap2 -s 'x = x * 3.;'
carries them through.
Dr. Christopher Lynnes NASA/GSFC, Code 610.2 phone: 301-614-5185
"The future is already here--it's just not very evenly distributed." Wm. Gibson
Thanks for pointing this out, Chris.
The behavior you posted for ncap2 -s 'x = 3.;' is incorrect.
It appears to be a case where attribute inheritance from the input file is over-ridden by attribute propagation from the RHS (which has no attributes).
ncap2 -s 'x = x * 3.;' works as intended, presumably because now the propagation mechanism sees the x on the RHS. My guess is that the attribute inheritance
for all unary operators (+=, =, /=, ...) is similarly wrong. It's just something we never noticed before.
Henry, is this something you're willing and able to fix?
hi Chris and Charlie -
Am aware of this .
So what you saying is that all lValues should get inherited attributes.
Ill have a look at the code and see if this is feasible
More precisely, lvalues that are in the input file should
inherit their attributes from the input file. lvalues that are not in the
input file should get their attributes from the RHS via attribute propagation.
I think that is the most intuitive from the user's perspective.
Basically "x=3' and 'x=x3' should yield the same results.
i.e., if the variable already has attributes, keep them.
There is a situation where a user redefines a a variable in input ?
redines a var in output
Sorry, I think the sourceforge formatting destroyed my syntax because it contained asterisks, apparently if i indent it then the reformatting goes away. so the line from my previous message should read
Basically 'x*=3' and 'x=x*3' should yield the same results.
is it clear now what behavior we want ncap2 to produce?
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.