<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">I don't believe there are wrapped version of the type converters. There is always the option of writing a function for it. </div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Here's a quick Wrap version of totype(), you can edit accordingly if you want todouble specifically.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default"><p style="margin:0px"><font face="monospace, monospace">undef("totype_Wrap")</font></p>
<p style="margin:0px"><font face="monospace, monospace">function totype_Wrap(x, type)</font></p>
<p style="margin:0px"><font face="monospace, monospace">local x, type, retval</font></p>
<p style="margin:0px"><font face="monospace, monospace">begin</font></p>
<p style="margin:0px"><font face="monospace, monospace"> retval = totype(x, type)</font></p>
<p style="margin:0px"><font face="monospace, monospace"> copy_VarMeta(x, retval)</font></p>
<p style="margin:0px"><font face="monospace, monospace"> retval@_FillValue = default_fillvalue(type) ; set fillvalue back to default for new type</font></p>
<p style="margin:0px"><font face="monospace, monospace"> return(retval)</font></p>
<p style="margin:0px"><font face="monospace, monospace">end</font></p><p style="margin:0px"><br></p><p style="margin:0px"><br></p><p style="margin:0px"><font face="verdana, sans-serif">then you can just</font></p><p style="margin:0px"><font face="verdana, sans-serif"><br></font></p><p style="margin:0px"><font face="monospace, monospace">oro := totype_Wrap(oro, "double")</font></p><p style="margin:0px"><font face="verdana, sans-serif"><br></font></p><p style="margin:0px"><font face="monospace, monospace"><br></font></p><p style="margin:0px"><font face="monospace, monospace"><br></font></p></div><div class="gmail_default" style="font-family:verdana,sans-serif">Alan. </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 24, 2015 at 12:20 PM, 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>