<div dir="ltr"><div><div>Thank you , my problem has been resolved by:-<br><br>pweek = where(<a href="http://pweek.gt">pweek.gt</a>. 1e25, pweek@_FillValue, pweek)<br><br></div>I am very grateful for the help. <br><br></div>Best Regards<br>Ipshita<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 12, 2014 at 4:27 PM, Ipshita Majhi <span dir="ltr"><<a href="mailto:ipmajhi@alaska.edu" target="_blank">ipmajhi@alaska.edu</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>I will try the above mentioned loop that Dennis suggested and will let you all know the outcome.<br></div>Thank you all for the support<br>Best Regards<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888">Ipshita<br></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 12, 2014 at 4:20 PM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>printVarSummary(x364)<br><br></div>What is the _FillValue ?<br><br>---<br><br>et_default_fillvalue("float", -9999.0)<br>pweek=new((/47,52/),"float") ; pweek@_FillValue<br><br></div><span><div> <br> <br>do i=0,47-1<br>do j=0,357,7<br><br>pweek(i,j/7)=avg(x364(i,j:j+6))<br><br></div></span> if x364 has an _FillValue of 9.92226e+36<br></div> and the result of avg is a missing value,<br></div> the _FillValue of x354 will transfer to pweek<br></div> Also, 9.92226e+36 is the 'printed' value, This is not the<br></div> actual value. Rounding has occurred for printing purposes.<br><br> if x364@_FillValue = 9.92226e+36<br><div> and you prefer -9999.0 then set<br> x364@_FillValue == pweek@_FillValue *before* the loop<br></div> <div><div><div><div><div><span><div><br>; end if<br>end do<br>end do<br><br></div></span><div>I think the above should fix your issue.<br></div><div><br></div><div>The whole loop below could be done much more efficiently<br><br> <br></div><div> pweek = where(<a href="http://pweek.gt" target="_blank">pweek.gt</a>. 1e25, pweek@_FillValue, pweek)<br></div><span><div><br><br>do i=0,47-1<br>do j=0,51<br>print(i)<br>print(j)<br>if (pweek(i,j).eq.9.92226ee+36)then<br>pweek(i,j)=9999.0<br>end if<br>end do<br>end do<br><br></div><div><br></div><br></span></div></div></div></div></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 12, 2014 at 3:10 PM, Ipshita Majhi <span dir="ltr"><<a href="mailto:ipmajhi@alaska.edu" target="_blank">ipmajhi@alaska.edu</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Thank you</div><div><br></div>Yes it is a typo in the code I fixed it yet it still gives max value as 9.6921e+36 , and if I write to substitute it then it gives 9.<font><span style="background-color:rgba(255,255,255,0)">92226e+36 as the max value. <span></span></span></font><div><br></div><div>Best Regards</div><div><span><font color="#888888">Ipshita</font></span><div><div><br><div><br><br>On Friday, December 12, 2014, Gus Correa <<a href="mailto:gus@ldeo.columbia.edu" target="_blank">gus@ldeo.columbia.edu</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Ipshita<br>
<br>
Is this a typo in your email or in the code?<br>
<br>
> if (pweek(i,j).eq.9.92226ee+36)then<br>
<br>
Note the double "ee".<br>
<br>
Gus Correa<br>
<br>
On 12/12/2014 04:29 PM, Ipshita Majhi wrote:<br>
> Dear NCL ,<br>
><br>
> I have written a code to write to convert 365 days into 52 weeks avg.<br>
> I am facing error regarding missing value. I have written statements<br>
> which have substituted missing value as -9999.0<br>
> Yet it gives the maximum value as 9.96921e+36 and when I write to<br>
> substitute that with -9999.0, it gives maximum value as 9.969222e+36.<br>
> Here is the snippet of my code. I am very confused about this. It will<br>
> be great if somebody could help me<br>
><br>
> set_default_fillvalue("float", -9999.0)<br>
><br>
> pweek=new((/47,52/),"float")<br>
><br>
><br>
> do i=0,47-1<br>
> do j=0,357,7<br>
><br>
> pweek(i,j/7)=avg(x364(i,j:j+6))<br>
><br>
> ; end if<br>
> end do<br>
> end do<br>
><br>
><br>
> do i=0,47-1<br>
> do j=0,51<br>
> print(i)<br>
> print(j)<br>
> if (pweek(i,j).eq.9.92226ee+36)then<br>
> pweek(i,j)=9999.0<br>
> end if<br>
> end do<br>
> end do<br>
><br>
> printMinMax(pweek, 0)<br>
><br>
> Thank You<br>
> Best Regards<br>
> Ipshita<br>
><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><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><br>
</blockquote></div></div></div></div>
<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><br>
<br></blockquote></div></div>
</div></div></blockquote></div></div>
</div></div></blockquote></div></div>