<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;">That sounds like it could be right, but I guess I don’t understand NetCDF that well. &nbsp;This file contains a year of daily data on air quality, which is a scalar stored in var. &nbsp;So the value of ‘var’ is 1D for each daily time-step, but obviously air + time is 2D. &nbsp;In order to get this to regrid correctly, is there a way I need to express that in my ncl code?&nbsp;<br><div apple-content-edited="true"><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">

</div>
<br><div><div>On Jun 23, 2015, at 6:16 PM, Rick Brownrigg &lt;<a href="mailto:brownrig@ucar.edu">brownrig@ucar.edu</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div><div>Hi Matthew,<br><br></div>I don't know for certain, but tracking down where the error messages are coming from, it looks like perhaps your variable "var" is not of the same dimensions as lat/lon (which are clearly 2D).&nbsp;&nbsp; Is there a time or level dimension perhaps associated with var?<br><br></div>Rick<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 23, 2015 at 3:31 PM, Matthew Shultz <span dir="ltr">&lt;<a href="mailto:matthew.shultz@yale.edu" target="_blank">matthew.shultz@yale.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Here’s the output I get when I run the command.&nbsp; Line 40 in my file is just the call to &nbsp;ESMF_regrid</div><div>Thanks for you assistance</div><div><br></div><div><br></div><div>(0) get_src_grid_info: source lat dims = (277,349)</div><div>(0) get_src_grid_info: source lon dims = (277,349)</div><div>(0) get_src_grid_info: source grid type is 'curvilinear'</div><span class=""><div>fatal:Eq: Dimension size, for dimension number 0, of operands does not match, can't continue</div><div><br></div></span><div>fatal:["Execute.c":8575]:Execute: Error occurred at or near line 1614 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl</div><div><br></div><div>fatal:["Execute.c":8575]:Execute: Error occurred at or near line 3853 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl</div><div><br></div><div>fatal:["Execute.c":8575]:Execute: Error occurred at or near line 3983 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl</div><div><br></div><div>fatal:["Execute.c":8575]:Execute: Error occurred at or near line 40 in file regrid3.ncl</div><div><div class="h5"><div><br></div><div><br></div><div><br>

</div>
<br><div><div>On Jun 23, 2015, at 1:22 PM, Rick Brownrigg &lt;<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>&gt; wrote:</div><br><blockquote type="cite"><div dir="ltr">What line number does the error message refer to?<br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 22, 2015 at 7:42 PM, Matthew Shultz <span dir="ltr">&lt;<a href="mailto:matthew.shultz@yale.edu" target="_blank">matthew.shultz@yale.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Greetings,<div>I am very new to netcdf &nbsp;and need some assistance.&nbsp; I am trying to calculate zonal statistics (sums and averages within watershed shapes) using some tools in ArcGIS for netcdf.&nbsp; The tools require netcdf files to be in a regular grid.&nbsp; My source data is NARR data, which isn't being recognized as a regular grid (I believe it is curvilinear).&nbsp; So I am trying to regrid using templates provided on the ucar website.&nbsp; Attached is the code I am currently using.&nbsp; It gives me the following error.&nbsp; Despite search archives of this list, other responses have not resolved my problem. Help is very much appreciated, clearly there is something I am not understanding.</div><div><br></div><div><br></div><div><br></div><div>fatal:Eq: Dimension size, for dimension number 0, of operands does not match, can't continue</div><div><br></div><div><br></div><div><br></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/esmf/ESMF_regridding.ncl"</div><div><br></div><div>;---Data file containing source grid</div><div>&nbsp; &nbsp; src_file = "<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__air.sfc.2009.nc&amp;d=AwMFaQ&amp;c=-dg2m7zWuuDZ0MUcV7Sdqw&amp;r=uKbh2SXDxGKvLk5QzayNO82syruaWpicjIReiqrlroo&amp;m=in-kyqdBB_SrcaUe8NduEiwvdug6jD8--IAlddvlGUM&amp;s=ig9Wc1p8W1YxsWqkiFqci37YiabzbIhxeiyjz-uUzo0&amp;e=" target="_blank">air.sfc.2009.nc</a>" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;;---Change (likely)</div><div>&nbsp; &nbsp; sfile &nbsp; &nbsp;= addfile(src_file,"r")</div><div><br></div><div>;---Get variable to regrid</div><div>&nbsp; &nbsp; varname = "air" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;;---Change (likely)</div><div>&nbsp; &nbsp; var &nbsp; &nbsp; = sfile-&gt;air</div><div>&nbsp; &nbsp; src_lat = sfile-&gt;lat &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;---Change (maybe)</div><div>&nbsp; &nbsp; src_lon = sfile-&gt;lon &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;---Change (maybe)</div><div><br></div><div>;---Set up regridding options</div><div>&nbsp; &nbsp; Opt &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = True</div><div><br></div><div>;---"bilinear" is the default. "patch" and "conserve" are other options.</div><div>&nbsp; &nbsp; Opt@InterpMethod &nbsp; &nbsp; &nbsp;= "bilinear" &nbsp; &nbsp; &nbsp; &nbsp;;;---Change (maybe)</div><div><br></div><div>&nbsp; &nbsp; Opt@WgtFileName &nbsp; &nbsp; &nbsp; = "<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__curv-5Fto-5F1deg.nc&amp;d=AwMFaQ&amp;c=-dg2m7zWuuDZ0MUcV7Sdqw&amp;r=uKbh2SXDxGKvLk5QzayNO82syruaWpicjIReiqrlroo&amp;m=in-kyqdBB_SrcaUe8NduEiwvdug6jD8--IAlddvlGUM&amp;s=oV6qP_NZtJZUXIOpck3rcmPKZHuyxgh9R9EnWJKtr2Y&amp;e=" target="_blank">curv_to_1deg.nc</a>"</div><div><br></div><div>&nbsp; &nbsp; Opt@SrcGridLat &nbsp; &nbsp; &nbsp; &nbsp;= src_lat &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; source grid</div><div>&nbsp; &nbsp; Opt@SrcGridLon &nbsp; &nbsp; &nbsp; &nbsp;= src_lon</div><div>&nbsp; &nbsp; Opt@SrcRegional &nbsp; &nbsp; &nbsp; = True &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;--Change (maybe)</div><div>&nbsp; &nbsp; Opt@SrcInputFileName &nbsp;= src_file &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; optional, but good idea</div><div>&nbsp; &nbsp; Opt@SrcMask2D &nbsp; &nbsp; &nbsp; &nbsp; = where(.not.ismissing(var),1,0) ; Necessary if has</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; missing values.</div><div><br></div><div>&nbsp; &nbsp; Opt@DstGridType &nbsp; &nbsp; &nbsp; = "0.5x0.5" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Destination grid</div><div>&nbsp; &nbsp; ;Opt@DstLLCorner &nbsp; &nbsp; &nbsp; = (/-89.75d, &nbsp; 0.00d /) &nbsp; ;;--Change (likely)</div><div>&nbsp; &nbsp; ;Opt@DstURCorner &nbsp; &nbsp; &nbsp; = (/ 89.75d, 359.75d /) &nbsp; ;;--Change (likely)</div><div>&nbsp; &nbsp; Opt@DstRegional &nbsp; &nbsp; &nbsp; = True &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;--Change (maybe)</div><div><br></div><div>&nbsp; &nbsp; Opt@ForceOverwrite &nbsp; &nbsp;= True</div><div>&nbsp; &nbsp; Opt@PrintTimings &nbsp; &nbsp; &nbsp;= True</div><div>&nbsp; &nbsp; Opt@Debug &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = True</div></div><div><br></div><div><div>&nbsp; &nbsp; var_regrid = ESMF_regrid(var,Opt) &nbsp; &nbsp; ; Do the regridding</div><div><br></div><div>&nbsp; &nbsp; printVarSummary(var_regrid)</div></div><div><br></div></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.ucar.edu_mailman_listinfo_ncl-2Dtalk&amp;d=AwMFaQ&amp;c=-dg2m7zWuuDZ0MUcV7Sdqw&amp;r=uKbh2SXDxGKvLk5QzayNO82syruaWpicjIReiqrlroo&amp;m=in-kyqdBB_SrcaUe8NduEiwvdug6jD8--IAlddvlGUM&amp;s=DBUC6JC9tObdztE4E4BXvNWNjeDLWWz5Tt8hQQUWF30&amp;e=" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div></div></blockquote></div><br></div>
</blockquote></div><br></body></html>