<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Times New Roman;color: #000000;font-size: 12pt;">
Hi Mary,
<div><br>
</div>
<div>Thanks for creating the script, but it showed error message when I ran it:</div>
<div><br>
</div>
<div>
<div><font color="#ff0000">fatal:Could not open ($NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl)</font></div>
<div><font color="#ff0000">fatal:error at line 5 in file regrid.ncl</font></div>
<div><br>
</div>
<div>Do you have any idea about this?</div>
<div><br>
</div>
<div>Thanks again,</div>
<div><br>
</div>
<div>Lifen</div>
<div><br>
</div>
<div>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma">
<div style="font-family:Tahoma">
<div style="font-family:Tahoma">
<div>
<div></div>
<div style="font-size:13px">
<div></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF956059" style="direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b>From:</b> Mary Haley [haley@ucar.edu]<br>
<b>Sent:</b> Tuesday, February 17, 2015 2:52 PM<br>
<b>To:</b> Jiang, Lifen<br>
<b>Cc:</b> ncl-talk@ucar.edu<br>
<b>Subject:</b> Re: [ncl-talk] Missing values are regridded?<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">
<div class="gmail_default" style="font-size:small">Hi,</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">I'm not sure why the area_conserve_remap function is not working. However, the documentation for this function states:</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small"><span style="background-color:rgb(255,255,0)"> "Missing values, designated by the _FillValue attribute, are
<b>not</b> allowed. If any missing <br>
values are encountered, the remap will not be performed for that grid."</span></div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">I take this to mean that it should have returned *all* missing values, which apparently it didn't. I will file a ticket on this. I think, though, you cannot use this routine if you have missing values.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">Meanwhile, you can try <b>ESMF_regrid</b> instead. I've created a new script for you, based on your original script, that uses "bilinear", "conservative", and "nearest neighbor" methods for regridding.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">You need to replace this code:</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="">
<div class="gmail_default" style="font-size:small"><font face="monospace, monospace">regrid = area_conserve_remap_Wrap(t&lon,t&lat,t,newlon,newlat,False)</font></div>
<div style="font-size:small"><br>
</div>
<div style="font-size:small">with this code:</div>
<div style="font-size:small"><br>
</div>
<div style="">
<div style=""><font face="monospace, monospace">opt = True</font></div>
<div style=""><font face="monospace, monospace">opt@DstGridLat = newlat</font></div>
<div style=""><font face="monospace, monospace">opt@DstGridLon = newlon</font></div>
<div style=""><font face="monospace, monospace">opt@ForceOverwrite = True</font></div>
<div style="">
<div><font face="monospace, monospace">opt@InterpMethod = "conserve"</font></div>
<div><font face="monospace, monospace"><br>
</font></div>
<div><font face="monospace, monospace">regrid = ESMF_regrid(t,opt)</font></div>
</div>
</div>
</div>
<font face="arial, helvetica, sans-serif"> </font>
<div>
<div class="gmail_default" style="font-size:small; display:inline"><font face="arial, helvetica, sans-serif">Please see the attached "regrid_and_plot.ncl" script, which uses ESMF_regrid for the three methods, and creates a panel plot.</font></div>
</div>
<div>
<div class="gmail_default" style="font-size:small; display:inline"><font face="arial, helvetica, sans-serif"><br>
</font></div>
</div>
<div><font face="arial, helvetica, sans-serif">
<div class="gmail_default" style="font-size:small; display:inline">--Mary</div>
<br>
</font>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Feb 17, 2015 at 12:50 PM, Jiang, Lifen <span dir="ltr">
<<a href="mailto:lfjiang@ou.edu" target="_blank">lfjiang@ou.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div>
<div style="direction:ltr; font-family:Times New Roman; color:#000000; font-size:12pt">
<div>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma">
<div style="font-family:Tahoma">
<div style="font-family:Tahoma">
<div>
<div></div>
<div style="font-size:13px">
<div></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div>Hello,</div>
<div><br>
</div>
<div>I am regridding "y" (lat, lon) to 1 degree grids. My codes always re-map the missing values as well (-999) as the printed min is -994.176, which should be a positive number. </div>
<div><br>
</div>
<div>My code is enclosed below and my data file is attached.</div>
<div><br>
</div>
<div>Could anybody help me to find why missing function doesn't work? </div>
<div><br>
</div>
<div>Thanks for your time!</div>
<div><br>
</div>
<div>Lifen</div>
<div><br>
</div>
<div>
<div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div>
<div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</div>
<div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" </div>
<div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" </div>
<div><br>
</div>
<div>begin</div>
<div>fili = "2000_MPI-ESM-MR.nc"</div>
<div>a = addfile (fili, "r")</div>
<div>t=a->y</div>
<div><br>
</div>
<div>t@_FillValue = -999.0</div>
<div>t@missing_value = t@_FillValue</div>
<div><br>
</div>
<div>t = lonFlip(t)</div>
<div>printVarSummary(t)</div>
<div><br>
</div>
<div>newlat=fspan(-89.50,89.50,180) ;create a sequence for the new values of lat </div>
<div>newlon=fspan(-179.5,179.5,360) ;create a sequence for the new values of lon</div>
<div><br>
</div>
<div>newlat@units = "degrees_north"</div>
<div>newlon@units = "degrees_east"</div>
<div><br>
</div>
<div>regrid= area_conserve_remap_Wrap(t&lon,t&lat,t,newlon,newlat,False)</div>
<div>printVarSummary(regrid)</div>
<div>print("regrid: min="+min(regrid)+" max="+max(regrid))</div>
<div><br>
</div>
<div>filo = "Regrid."+fili</div>
<div>system("/bin/rm -f "+filo)</div>
<div>fout=addfile(filo,"c")</div>
<div>fout@creation_date = systemfunc("date")</div>
<div>fout@title="Regrid_1*1 of "+fili</div>
<div>fout->regrid=regrid</div>
<div>end</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</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>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>