<div dir="ltr"><div>Greetings,<br><br></div>I am using the lterp function in GrADS 2.0.2. While attempting to regrid data from a 360 x 181 to a 144 x 73 grid and write to a new file I get incorrect data values. When repeating the steps in interactive mode the regridding works fine. I have tried specifying the x and y dimensions (both using lat/lon and x/y), x only dimensions as per the users index, and no specification, before each fwrite. None works. I am doing the regridding in a loop for several timesteps and several variables. Please note in the older regrid2 udf I had no problem. Here is a sample of the code with just one variable: <br clear="all">
<div><div><br>'open prsDly$iy$mn$id$ih.$mm.ctl'<br>'open regrid.dummyfile.to.2.5x2.5.ctl'<br><br> 'set gxout fwrite'<br> 'set fwrite Dly$iy$mn$id$ih$mm.cfsv2.PRS.data'<br> <br> <br>
countt=1<br> while(countt<=45)<br> 'set t 'countt<br> <br> 'set lev 500'<br> 'set lon 0 360'<br></div><div> 'set lat -90 90<br></div><div>* 'set x 1 144'<br>
</div><div>* 'set y 1 73'<br></div><div><br></div><div> 'd lterp(hgtprs.1,hgt500mb.2,bilin)'<br> <br> countt=countt+1<br> endwhile<br><br>'disable fwrite'<br><br><br><br></div><div>Thanks for any help.<br>
</div><div><br></div><div>Scott<br></div><div><br><br>-- <br><div dir="ltr">Scott J. Weaver<br>Research Meteorologist<br>NOAA Climate Prediction Center<br>301-683-3434<br><a href="http://www.cpc.ncep.noaa.gov/" target="_blank">http://www.cpc.ncep.noaa.gov/</a></div>
</div></div></div>