<div dir="ltr">Follow-up: I had my lat and lon arrays switched. Fixed that. But the error still persists.<div><br></div><div>It seems to be a Catch 22. Right now, I have</div><div><br></div><div><div><font face="monospace, monospace"> locSW = wrf_user_ij_to_ll(a,1.,1.,True) ; SW corner of domain for lat and lon minima. Func is fortran-based so 1 not 0</font></div><div><font face="monospace, monospace"> lon_west = locSW(0)</font></div><div><font face="monospace, monospace"> lat_south = locSW(1)</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">; Use any variable that spans the entire grid to get maxima of i,j</font></div><div><font face="monospace, monospace">; which will then be used to get lat, lon of upper right (NE) corner</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"> grid_size = dimsizes(tc) ; z is 0th index, lat 1st, lon 2nd</font></div><div><font face="monospace, monospace"> jMax = grid_size(1)</font></div><div><font face="monospace, monospace"> iMax = grid_size(2)</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"> locNE = wrf_user_ij_to_ll(a,iMax,jMax,True) ; NE corner of domain for lat and lon maxima. Func is fortran-based so max not max-1</font></div><div><font face="monospace, monospace"> lon_east = locNE(0)</font></div><div><font face="monospace, monospace"> lat_north = locNE(1)</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"> n = dimsizes(lat)</font></div><div><font face="monospace, monospace"> m = dimsizes(lon)</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"> nlat = n(0)</font></div><div><font face="monospace, monospace"> mlon = m(1)</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"> dst_lat = fspan(lat_south,lat_north,nlat)</font></div><div><font face="monospace, monospace"> dst_lon = fspan(lon_west,lon_east,mlon)</font></div></div><div><br></div><div>which means that element (2) of fspan has 1 dimension. Therefore, in the output, I see:</div><div><br></div><div><div><font face="monospace, monospace">(0)<span class="" style="white-space:pre">        </span>write_grid_description: source lat dims = (281,353)</font></div><div><font face="monospace, monospace">(0)<span class="" style="white-space:pre">        </span>write_grid_description: source lon dims = (281,353)</font></div><div><font face="monospace, monospace">(0)<span class="" style="white-space:pre">        </span>write_grid_description: source grid type is 'curvilinear'</font></div></div><div><font face="monospace, monospace">(...)</font></div><div><div><font face="monospace, monospace">(0)<span class="" style="white-space:pre">        </span>write_grid_description: destination lat dims = (281)</font></div><div><font face="monospace, monospace">(0)<span class="" style="white-space:pre">        </span>write_grid_description: destination lon dims = (353)</font></div><div><font face="monospace, monospace">(0)<span class="" style="white-space:pre">        </span>write_grid_description: destination grid type is 'rectilinear'</font></div></div><div><br></div><div>which seems like it should not be. Shouldn't I want(need) the dimensions of the source and destination grid to match?</div><div><br></div><div>So then, in fspan, I switch nlat to src_lat and mlon to src_lon, making that element two-dimensional instead of one-dimensional: </div><div><br></div><div><div><font face="monospace, monospace"> dst_lat = fspan(lat_south,lat_north,src_lat)</font></div><div><font face="monospace, monospace"> dst_lon = fspan(lon_west,lon_east,src_lon)</font></div></div><div><br></div><div>Yet when I run with that change, I get:<font face="monospace, monospace"> fatal:Number of dimensions in parameter (2) of (fspan) is (2), (1) dimensions were expected </font></div><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">How can NCL simultaneously be expecting a one- and two-dimension array? I'm very confused here.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Ryan</font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 26, 2016 at 2:16 PM, Ryan Connelly <span dir="ltr"><<a href="mailto:rconne01@gmail.com" target="_blank">rconne01@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I'm using ESMF_WRF_to_rect.ncl to regrid (<a href="https://www.ncl.ucar.edu/Applications/Templates/ESMF_WRF_to_rect.ncl" target="_blank">https://www.ncl.ucar.edu/Applications/Templates/ESMF_WRF_to_rect.ncl</a>). Regridding completes fine, but then when i try to interpolate the regridded variable to an isobaric plane using wrf_user_intrp3d I get:</div><div><br></div><div><font face="monospace, monospace">fatal:Dimension size mismatch, dimension (1) of left hand side reference does not have the same size as the right hand side reference after subscripting.</font></div><div><br></div><div>This is a pretty literal error message and one that I've fixed before, but this time it has me stumped. I haven't even declared the variable on the left hand side until this particular line (and I've double checked that by issuing a printVarSummary and having it throw a variable undefined error) so how can the dimension sizes not match if this is a blank new variable?</div><div><br></div><div>I then decided to be extra super literal and declare a new array with the right dimensions before calling wrf_user_intrp3d, but the error persists:</div><div><br></div><div><font face="monospace, monospace">(...)</font></div><div><font face="monospace, monospace">tc_rect = ESMF_regrid(tc,Opt) ; Do the regridding</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">; Interpolate to isobaric planes</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"> pressure = 850.</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"> newdim = (dimsizes(tc_rect))</font></div><div><font face="monospace, monospace"> print(newdim)</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"> tc_rect_plane = new((/newdim(0),newdim(1),newdim(2)/),typeof(tc_rect))</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"> tc_rect_plane = wrf_user_intrp3d(tc_rect,p,"h",pressure,0.,False)</font></div><div><font face="monospace, monospace">(...)</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">I'm out of ideas here.</font></div><span class="HOEnZb"><font color="#888888"><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Ryan<br clear="all"></font><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><font size="1">Ryan Connelly</font></div><div dir="ltr"><div dir="ltr" style="font-size:12.8px"><font color="#000000"><font size="1">M.S. Student in Atmospheric Sciences, </font><span style="font-size:x-small">Stony Brook University</span><br></font></div><div dir="ltr" style="font-size:12.8px"><div><font color="#000000"><font size="1">B.S. in Meteorology with Minors in Mathematics and GIS, </font><span style="font-size:x-small">Valparaiso University</span></font></div></div><div><a href="mailto:rconne01@gmail.com" style="font-size:x-small" target="_blank">rconne01@gmail.com</a><br></div><div><font size="1"><a href="mailto:ryan.connelly@stonybrook.edu" target="_blank">ryan.connelly@stonybrook.edu</a></font></div></div></div></div></div></div></div></div></div></div>
</div></font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><font size="1">Ryan Connelly</font></div><div dir="ltr"><div dir="ltr" style="font-size:12.8000001907349px"><font color="#000000"><font size="1">M.S. Student in Atmospheric Sciences, </font><span style="font-size:x-small">Stony Brook University</span><br></font></div><div dir="ltr" style="font-size:12.8000001907349px"><div><font color="#000000"><font size="1">B.S. in Meteorology with Minors in Mathematics and GIS, </font><span style="font-size:x-small">Valparaiso University</span></font></div></div><div><a href="mailto:rconne01@gmail.com" style="font-size:x-small" target="_blank">rconne01@gmail.com</a><br></div><div><font size="1"><a href="mailto:ryan.connelly@stonybrook.edu" target="_blank">ryan.connelly@stonybrook.edu</a></font></div></div></div></div></div></div></div></div></div></div>
</div>