<div dir="ltr">Not really. <div><br></div><div>Adding meta data does add some overhead so computations and built-in functions do not handle meta data (except _FillValue). Further, it can get complicated.<div><br></div><div> A = (X*B/C + sqrt(dim_avg_n(Q,1)*828.11))^2</div><div><br></div><div>Say X, B, C, Q all have meta data. All the variables have different named dimensions, coordinate variables and attributes. Some have 'dimension reduction'. All may have different reference times</div><div>What to do? What are the units after computation? What is the long_name? Which coordinates are appropriate?</div><div><br></div><div>Even trivial T (degC)</div><div><br></div><div> T = T + 273.15 ; same variable but NCL does not know there is a units change</div><div><br></div><div> T@units = "degK" ; user must update</div><div><br></div><div>or a new variable</div><div> TF = T*1.8 + 32<i> </i><span style="font-family:'Times New Roman';font-size:22.3999996185303px;line-height:40.3199996948242px"> </span></div><div><span style="line-height:40.3199996948242px"><font face="arial, helvetica, sans-serif">Is the 'T' long_name still appropriate? What about the units of 'TF'?</font></span></div><div><span style="font-family:arial,helvetica,sans-serif;line-height:40.3199996948242px">==</span></div><div><span style="line-height:40.3199996948242px"><font face="arial, helvetica, sans-serif">Many built in function have a _Wrap equivalent. These handle meta data in a reasonable fashion.</font></span></div><div>==</div><div><br></div><div>I suggest you build your own library ('myLib.ncl') to isolate tasks</div><div><br></div><div>undef("my_todouble")</div><div>function my_todouble(x:numeric)</div><div>local xd</div><div>begin</div><div> xd = todouble(x)</div><div> copy_VarMeta(x, xd)</div><div> return(xd)</div><div>end</div><div><span style="font-family:'Times New Roman';font-size:22.3999996185303px;line-height:40.3199996948242px">====</span></div><div><span style="line-height:40.3199996948242px"><font face="arial, helvetica, sans-serif">Ultimately, why are you converting to double?</font></span></div><div><span style="line-height:40.3199996948242px"><font face="arial, helvetica, sans-serif">All NCL computations are done in double precision.</font></span></div><div><span style="line-height:40.3199996948242px"><font face="arial, helvetica, sans-serif"><br></font></span></div><div><span style="line-height:40.3199996948242px"><font face="arial, helvetica, sans-serif">=======</font></span></div><div><span style="font-family:'Times New Roman';font-size:22.3999996185303px;line-height:40.3199996948242px"><br></span></div><div><br></div><div><br></div><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 24, 2015 at 10:20 AM, Erik J. Schaffernicht <span dir="ltr"><<a href="mailto:eschaffe@uni-koeln.de" target="_blank">eschaffe@uni-koeln.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If I transform a field with todouble() I loose all meta data. Why?<br>
<br>
Do I always have to do it like this or is there a shorter way?:<br>
<br>
t2=todouble(oro)<br>
copy_VarMeta(oro,t2)<br>
oro:=t2<br>
<br>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>