<div dir="ltr"><div>Dear sir </div><div><br></div><div>Thank you for this help. One last query, if in case my WRF grid is from 90 to 120 degree long and -20 to 10 degree lat. However the TRMM grids are from 89.125 to 120.875 degree long and -20.875,9.875 nlat what is the precaution I should take if I need to subtract the WRF grid from TRMM grid. </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 17, 2016 at 1:57 AM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</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">I have no idea why you are doing what you did!<br><br> diri = "./"<br> fili = "wrfout_...nc"<br> f = addfile(diri+fili,"r")<br> r = f->RAINC<br> printVarSummary(r) ; ***LOOK AT YOUR DATA***<br> printMinMax(r,1) ; *** KNOW YOUR DATA***<br><br> lat2d = f->XLAT(0,:,:)<br> lon2d = f->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 = "lat"<br> lat@units = "degrees_north"<br><br> lon = fspan(-179.875, 179.875, nlat)<br> lon!0 = "lon"<br> lon@units = "degrees_east"<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"><div><div class="h5">On Wed, Apr 13, 2016 at 1:01 PM, Saurabh Singh <span dir="ltr"><<a href="mailto:saurabhsingh123op@gmail.com" target="_blank">saurabhsingh123op@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><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 ("/Users/saurabh/Downloads/wrfout_d01_2000-01-24_12:00:<a href="http://00.nc" target="_blank">00.nc</a>","r") </div><div>Rain = a->RAINC </div><div>rainfall = a->RAINC </div><div>printVarSummary(rainfall) ; look at the variable </div><div>printMinMax(rainfall, True ) ; contributed.ncl </div><div>rainfall!0 = "time" </div><div>rainfall!1 = "lat" </div><div>rainfall!2 = "lon" </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->XLAT(0,:,:) </div><div> lon2d = a->XLONG(0,:,:) </div><div> lat2d_at_units = "degrees_north" ; not required for interpolation </div><div> lon2d_at_units = "degrees_east" </div><div> printVarSummary(lat2d) </div><div> printVarSummary(lon2d) </div><div>;Your 'target' (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= "lon" </div><div> lon_at_units = "degrees_east" </div><div> print(mlon) </div><div> nlat = 14 ; however many points you want </div><div> lat = fspan (latS,latN, nlat) </div><div> lat!0= "lat" </div><div> lat_at_units = "degrees_north" </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:["Execute.c":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:["Execute.c":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><font color="#888888">-- <br><div><div dir="ltr"><font size="2" style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif"><span>With regards</span><span></span></font><font size="2" style="font-family:arial,helvetica,sans-serif"><span style="color:rgb(0,0,0)"><span><br></span></span></font><font size="2" style="font-family:arial,helvetica,sans-serif"><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 size="1" style="color:rgb(102,102,102)"> <b><i><span lang="EN-GB" style="font-family:Webdings">P</span></i></b><b><i><span lang="EN-GB" style="font-family:Tahoma,sans-serif"> : </span></i></b><b><i><span lang="EN-GB" style="font-family:Arial,sans-serif"> </span></i></b><b><i><span lang="EN-GB" style="font-family:Tahoma,sans-serif">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></div></div>_______________________________________________<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="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank" rel="noreferrer">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><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>
</div>