<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">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">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>