<div dir="ltr">The attached works with the bilinear and patch methods. The conserve method requires &#39;corner&#39; information. NCL&#39;s implementation tries to derive the corner info but is not always successful. I think that is what is happening in your case. This will be looked at more when we get a chance.<br>
<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 21, 2014 at 1:52 PM, Peter Watson <span dir="ltr">&lt;<a href="mailto:watson@atm.ox.ac.uk" target="_blank">watson@atm.ox.ac.uk</a>&gt;</span> wrote:<br>
<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><div>Dear fellow NCL users,<br><br></div>I am trying to do conservative regridding of precipitation data from a reduced Gaussian grid to a lat-lon grid using the ESMF_Regrid function in NCL 6.1.2, but I get an error that I do not understand. My input data is in a NetCDF file, with the precip data and the latitudes and longitudes of the grid points stored as 1D arrays. An ncdump -h of the input file gives:<br>


<br>dimensions:<br>    space = 35718 ;<br>variables:<br>    double data(space) ;<br>    double lon1d(space) ;<br>    double lat1d(space) ;<br><br><br></div>I use the following lines of NCL, based on the example script at <a href="http://www.ncl.ucar.edu/Applications/Templates/ESMF_unstruct_to_0.25deg.ncl" target="_blank">http://www.ncl.ucar.edu/Applications/Templates/ESMF_unstruct_to_0.25deg.ncl</a> :<br>


<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl&quot;<br><br>file_in=addfile(&quot;<a href="http://regrid_cons_irreg.nc" target="_blank">regrid_cons_irreg.nc</a>&quot;,&quot;r&quot;)<br>


data = file_in-&gt;data<br>lats = file_in-&gt;lat1d<br>lons = file_in-&gt;lon1d<br><br>Opt=True<br>Opt@SrcGridLat         = lats<br>Opt@SrcGridLon        = lons<br>Opt@DstGridType      = &quot;5x5&quot;<br>Opt@ForceOverwrite  = True<br>


Opt@InterpMethod     = &quot;conserve&quot;<br>Opt@DstLLCorner      = (/-85.0d, 0.0d /)<br>Opt@DstURCorner     = (/ 85.0d, 355.0d /)<br><br>Opt@Debug            = True<br><br>data_latlon=ESMF_regrid(data,Opt)<br><br></div>


This gives the error:<br><br>(0)    ESMF_regrid_with_weights: retrieving interpolation weights ...<br>(0)    ESMF_regrid_with_weights: error: source data on the description<br>(0)         file does not have proper dimensions.<br>


<br></div>I don&#39;t understand why this fails. Is there something wrong with how I am reading in the data and coordinates? Are there any conditions that need to be satisfied, like the coordinates increasing monotonically (mine do not)? If anyone has a script and NetCDF file for which this sort of regridding succeeds that they could let me see, then that would be very helpful.<br>


<br></div>Thanks very much for any help you can give.<br><br></div>Kind regards,<br><br></div>Peter Watson<br></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>