<div dir="ltr"><div class="gmail_default" style="font-size:small">If you are getting an error &quot;moment not found&quot;, then this sounds like you might be referencing &quot;moment&quot; before you calculate it.  </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">For example, if I wrote a script that had just one line in it:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">  print(moment)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I will get this error, because &quot;moment&quot; hasn&#39;t been set yet:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default">  fatal:Variable (moment) is undefined</div><div><br></div></div><div class="gmail_default" style="font-size:small">Is this what you&#39;re getting?  It would help if you could include the exact error message, and the code that produces this error.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 3, 2014 at 8:57 AM, jbuzan <span dir="ltr">&lt;<a href="mailto:jbuzan@purdue.edu" target="_blank">jbuzan@purdue.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">That’s what was confusing me.  It was saying something on the order of ‘moment not found’, and when I looked at the code:<div> moment   = dim_stat4( work )</div><div><br></div><div>So I figure something is wrong with moment.  I commented out all instances related to moment.</div><div><br></div><div>-Jonathan</div><div><div class="h5"><div><br><div><br></div><div><br><div><div>On Dec 3, 2014, at 10:49 AM, Mary Haley &lt;<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>&gt; wrote:</div><br><blockquote type="cite"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Jonathan,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">When you say dim_stat4 bombed, what exactly was the error message?  This is a built-in function, so you don&#39;t need to load any NCL scripts to use it.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 29, 2014 at 3:47 PM, jbuzan <span dir="ltr">&lt;<a href="mailto:jbuzan@purdue.edu" target="_blank">jbuzan@purdue.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Mary,<div><br></div><div>Sorry for the delayed response!</div><div><br></div><div>I realized there was a two problems:</div><div>1) I had an error in the original dataset.</div><div>2) I figured out how to use IND to feed only non-missing values to the exceedance (the original issue).  </div><div><br></div><div>I did have a problem with dim_stat4.   When it was trying to calculate kurtosis and skewness for stat_dispersion (dim_stat4 2,3), the contributed file would blow up saying it cannot find dim_stat4.  I turned it off, but I can’t seem to figure out why dim_stat4 bombed.</div><div><br></div><div>-Jonathan</div><div><div><div><br></div><div><br></div><div><br></div><div><br><div><div>On Oct 9, 2014, at 6:38 PM, Mary Haley &lt;<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>&gt; wrote:</div><br><blockquote type="cite"><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div dir="ltr"><div class="gmail_default" style="font-size:small">Jonathan,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Did anybody ever respond to this one?  </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If not, the code is quite complex, and it would be useful if you could provide a full script and data.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 26, 2014 at 3:30 PM, jbuzan<span> </span><span dir="ltr">&lt;<a href="mailto:jbuzan@purdue.edu" target="_blank">jbuzan@purdue.edu</a>&gt;</span><span> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I am having some issues with stat_dispersion.<br>Perhaps my code ‘fixes’ cause the issue.  I am not sure.<br><br>I have 2 datasets:<br>time: 1460 lat: 192, lon 288<br>time: 2920 lat: 192, lon 288<br>I have added a second year to the original year (both 1460 time steps).  The stat_dispersion, in theory, should have the same minimum and maximum values.<br><br>The data is partitioned by Temperature and by a difference field.<br>Here is a snippet of the code that does the partitioning:<br>do k = 0, dimsizes(numvar)-1<br>;do k = 16, 16<br>   thresholdstart = k*5.d + 200.d<br>   print(thresholdstart)<br>   thresholdend = k*5.d + 205.d<br>   print(thresholdend)<br>;   location = ind(temperature1d.lt.thresholdend)<br>   location = ind(temperature1d.lt.thresholdend.and.temperature1d.ge.thresholdstart)<br>;   printVarSummary(location)<br>;   print(location)<br>   if(.not.all(ismissing(location)))<br>       <span> </span>tbin = wetbulb1d(location)<br>       <span> </span>else<br>       <span> </span>tbin = value<br>       <span> </span>tbin@_FillValue = value<br>   end if<br> ;  print(tbin)<br><br>   if(.not.all(ismissing(tbin)))<br>       <span> </span>tbin@_FillValue = -999.d<br>       <span> </span>delete(tbin@_FillValue)<br>       <span> </span>numarray(:,k) = stat_dispersion(tbin,opt)<br>       <span> </span>else<br>       <span> </span>numarray(:,k) = value<br>   end if<br>   delete(tbin)<br>   delete(location)<br> <span> </span>; print(numarray)<br>end do<br>numarray = where(numarray.eq.-999.d,value,numarray)<br><br>replace_ieeenan (numarray, value, 0)<br>numarray@_FillValue = value<br>numarray@missing_value = numarray@_FillValue<br>numarray!0 = &quot;stat&quot;<br>numarray!1 = &quot;bin&quot;<br>numarray&amp;bin = numvar<br>printVarSummary(numarray)<br><br>Here is a snippet of the code that grabs the values:<br>box_var = numvar<br>box_var@long_name = longnamea<br>box_var@units = unitsa<br>;box_var(:,0) = field1c(22,:)<br>box_var(:,0) = field1c(2,:)<br>box_var(:,1) = field1c(24,:)<br>box_var(:,2) = field1c(8,:)<br>box_var(:,3) = field1c(25,:)<br>box_var(:,4) = field1c(14,:)<br>;box_var(:,4) = field1c(26,:)<br><br>field1c of 14 and 2 are the maximum and minimums from Stat_Dispersion.<br>I think the issue is that stat_dispersion field becomes too large, and drops something.  It might be how I characterize the missing values.<br><br>Any help would be appreciated.<br><br>-Jonathan<br><br><br>_______________________________________________<br>ncl-talk mailing list<br>List instructions, subscriber options, unsubscribe:<br><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div></div></div></blockquote></div><br></div></div></div></div></blockquote></div><br></div>
</blockquote></div><br></div></div></div></div></div></blockquote></div><br></div>