<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Thanks Dennis,<div><br></div><div>I’ll try to get this to work! </div><div><br></div><div>-Jonathan</div><div><br></div><div><br><div><div>On Sep 15, 2014, at 8:29 PM, Dennis Shea <<a href="mailto:shea@ucar.edu">shea@ucar.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>[1] Tk has _FillValue=1d36 ... you do not need 'where', just<br><br></div><div> tk@_FillValue = -999.0d0 ; change _FillValue [all 1d39 => -999.0]<br><br></div><div> Under the hood, the above basically does<br><br> Tk = where(ismissing(Tk),-999.d,Tk)</div><div><br>[2]<br>I'd do the whole thing in fortran ... (here f77) ... maybe som<br><br></div><div> tc = new( (/ntim,nlat,mlon/), typeof(tk), valuec)<br></div><div><br></div>NCLFORTSTART<br></div> subroutine spitoutx(ntim,nlat,mlon,valuek,tk,valuec,tc)<br></div> implicit none<br></div><div>C ! INPUT<br></div> integer ntim,nlat,mlon<br></div> double precision tk(mlon,nlat,ntim), valuek, valuec<br></div>C ! OUTPUT<br></div> double precision tc(mlon,nlat,ntim)<br></div>C ! LOCAL<br></div> integer nt, nl, ml<br><br></div> do nt=0,ntim-1<br></div><div> do nl=0,nlat-1<br></div><div> do ml=0,mlon-1<br><br></div><div> tc(ml,nl,ny) = valuec<br></div> if (tk.ne.valuek) then<br></div><div> call spitout(tk(ml,nl,nt), tc(ml,nl,nt), ) <br> end if<br><br></div></div> end do<br></div> end do<br></div> end do<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 15, 2014 at 12:54 PM, jbuzan <span dir="ltr"><<a href="mailto:jbuzan@purdue.edu" target="_blank">jbuzan@purdue.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi ncl-talk,<br>
<br>
I am working a lot with WRAPIT, and the datasets that I am using have a lot of _FillValues. I am jumping through hoops and it is really slowing my through put down.<br>
The Fortran Code is designed for single grid cells, so I am using ncl loops and an IF THEN statement.<br>
<br>
for example:<br>
value = 1d36<br>
delete(Tk@_FillValue)<br>
Tk = where(Tk.eq.1d36,-999.d,Tk)<br>
…<br>
do k = 0, dimsizes(timet)-1<br>
if (Tk(k,i,j).eq.-999.d) then<br>
Tc(k,i,j) = value<br>
else<br>
SPITITOUT::spitout(Tk(k,i,j), Tc(k,i,j))<br>
end if<br>
end do<br>
…<br>
Tc@_FillValue = value<br>
<br>
<br>
Is there a better way to deal with _FillValues?<br>
<br>
Thanks,<br>
<br>
-Jonathan<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><br></div>
</blockquote></div><br></div></body></html>