<div dir="ltr">I have no idea why you are doing what you did!<br><br> diri  = &quot;./&quot;<br>  fili  = &quot;wrfout_...nc&quot;<br>  f     = addfile(diri+fili,&quot;r&quot;)<br>  r     = f-&gt;RAINC<br>  printVarSummary(r)    ; ***LOOK AT YOUR DATA***<br>  printMinMax(r,1)         ; *** KNOW YOUR DATA***<br><br>  lat2d = f-&gt;XLAT(0,:,:)<br>  lon2d = f-&gt;XLONG(0,:,:)<br><br>  dimr  = dimsizes(r)<br>  ntim  = dimr(0)<br><br>; Global TRMM grid .... Change for the WRF region<br><br>  nlat      =  400<br>  mlon      = 1400<br><br>  lat       = fspan(-48.875, 48.875, nlat)<br>  lat!0     = &quot;lat&quot;<br>  lat@units = &quot;degrees_north&quot;<br><br>  lon       = fspan(-179.875, 179.875, nlat)<br>  lon!0     = &quot;lon&quot;<br>  lon@units = &quot;degrees_east&quot;<br><br>; regrid (bilinear)<br><br>  rTRMM = rcm2rgrid_Wrap(lat2d,lon2d,r,lat,lon,0)<br>  printVarSummary(rTRMM)<br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 13, 2016 at 1:01 PM, Saurabh Singh <span dir="ltr">&lt;<a href="mailto:saurabhsingh123op@gmail.com" target="_blank">saurabhsingh123op@gmail.com</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><br></div>Dear Mam/Sir <div><br></div><div>NCL 6.3.0</div><div>OS Ubuntu</div><div><br></div><div>I am trying to regard WRF precipitation data from curvilinear grid to rectilinear grid ignorer to take its difference from TRMM data. i am using the code :</div><div><br></div><div><div>a = addfile (&quot;/Users/saurabh/Downloads/wrfout_d01_2000-01-24_12:00:<a href="http://00.nc" target="_blank">00.nc</a>&quot;,&quot;r&quot;) </div><div>Rain = a-&gt;RAINC </div><div>rainfall = a-&gt;RAINC </div><div>printVarSummary(rainfall) ; look at the variable </div><div>printMinMax(rainfall, True ) ; contributed.ncl </div><div>rainfall!0 = &quot;time&quot; </div><div>rainfall!1 = &quot;lat&quot; </div><div>rainfall!2 = &quot;lon&quot; </div><div>printVarSummary(rainfall) </div><div>rearrange_rain = rainfall(time|:,lon|:,lat|:) </div><div>; reorder coordinates for next step </div><div>; Average all lats as a function of lon for Time vs. Longitude plot </div><div>;(Hovmueller diagram) </div><div>rain=dim_avg(rearrange_rain) ; avg rightmost dimension with center dimension </div><div>copy_VarMeta(rearrange_rain, rain) </div><div>printVarSummary(rain) </div><div>printMinMax(rain) </div><div>;WRF XLAT/XLONG are (Time,south_north,west_east) </div><div>;Generally, they do not change with time. </div><div>;Hence, read then as 2D arrays </div><div>                          ; These are [*][*] (two dimensional) </div><div> lat2d = a-&gt;XLAT(0,:,:) </div><div> lon2d = a-&gt;XLONG(0,:,:) </div><div> lat2d_at_units = &quot;degrees_north&quot; ; not required for interpolation </div><div> lon2d_at_units = &quot;degrees_east&quot; </div><div> printVarSummary(lat2d) </div><div> printVarSummary(lon2d) </div><div>;Your &#39;target&#39; (rectilinear) grid is lat[*],lon[*]. </div><div>;This could be from some other model </div><div>;or you could manually create via </div><div> latS = 5 ; regular grid output </div><div> latN = 11 </div><div> lonL = -30 </div><div> lonR = -20 </div><div> mlon = 22 ; however many points you want, here 22 </div><div> ;because 0.5 degree </div><div> lon = fspan (lonL, lonR, mlon) </div><div> lon!0= &quot;lon&quot; </div><div> lon_at_units = &quot;degrees_east&quot; </div><div> print(mlon) </div><div> nlat = 14 ; however many points you want </div><div> lat = fspan (latS,latN, nlat) </div><div> lat!0= &quot;lat&quot; </div><div> lat_at_units = &quot;degrees_north&quot; </div><div> print(nlat) </div><div>raingrd = rcm2rgrid(lat2d,lon2d,rain,lat,lon,0) </div><div>printVarSummary(ringed) </div></div><div><br></div><div>but the regrinding does not happen, i get the following error:</div><div><br></div><div><br></div><div><br></div><div><div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(246,253,255)"><span>fatal:rcm2rgrid: The rightmost dimensions of fi must be nlat2d x nlon2d, where nlat2d and nlon2d are the dimensions of the lat2d/lon2d arrays</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(246,253,255)"><span>fatal:[&quot;Execute.c&quot;:8575]:Execute: Error occurred at or near line 46 in file regrid.ncl</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(246,253,255);min-height:13px"><span></span><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(246,253,255)"><span>fatal:Variable (raingrd) is undefined</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(246,253,255)"><span>fatal:[&quot;Execute.c&quot;:8575]:Execute: Error occurred at or near line 47 in file regrid.ncl</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(246,253,255)"><span><br></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(246,253,255)"><span>Kindly help me to solve this problem.</span></p></div><span class="HOEnZb"><font color="#888888">-- <br><div><div dir="ltr"><font style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif" size="2"><span>With regards</span><span></span></font><font style="font-family:arial,helvetica,sans-serif" size="2"><span style="color:rgb(0,0,0)"><span><br></span></span></font><font style="font-family:arial,helvetica,sans-serif" size="2"><span style="color:rgb(0,0,0)"><span>Saurabh Kumar singh</span><span></span>
</span></font><br style="color:rgb(51,204,0)"><br><font style="color:rgb(102,102,102)" size="1"> <b><i><span style="font-family:Webdings" lang="EN-GB">P</span></i></b><b><i><span style="font-family:Tahoma,sans-serif" lang="EN-GB"> : </span></i></b><b><i><span style="font-family:Arial,sans-serif" lang="EN-GB"> </span></i></b><b><i><span style="font-family:Tahoma,sans-serif" lang="EN-GB">Please consider the environment before printing this e-mail</span></i></b> </font><br style="color:rgb(102,102,102)"><br><br><br></div></div>
</font></span></div></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>