On Tue, Nov 8, 2011 at 12:13 PM, Jennifer Adams <span dir="ltr"><<a href="mailto:jma@cola.iges.org">jma@cola.iges.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><br><div><div class="im"><div>On Nov 7, 2011, at 2:46 PM, Arlindo da Silva wrote:</div><br><blockquote type="cite">On Mon, Nov 7, 2011 at 10:11 AM, Arlindo Meque <span dir="ltr"><<a href="mailto:mequitomz@yahoo.com.br" target="_blank">mequitomz@yahoo.com.br</a>></span> wrote:<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div style="color:#000;background-color:#fff;font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family:times new roman, new york, times, serif;font-size:12pt">
<div> Dear all,<br><br><br>1. I have a forecast file (1.875X1.25) with 192 points in x-direction and 145 points in y-direction. I am trying to regrid the file to match the observation (2.5X2.5) with 144 points in x-direction and 72 points on y-direction<br>
<br><br>2. I am able to create the regridded file, the problem is that the dimensions of the regridded file do not much those of the observation file, so I am not able to make the diffidence between the forecast and the observation.<br>
<br>3. Please find attached the forecast and observed file along with the regriding script.<br><br></div></div></div></div></div></blockquote><div><br></div><div>This more of a question for Jeniffer as I am not sure how sdfwrite figures out the coordinate variables of the output file (does it use the coordinates of the default file?).</div>
</div></blockquote></div><div>The sdfwrite copies the coordinate information from the default file at the time the 'define' command was invoked. </div><div>I have no idea what the re() function does when it returns the new grid. If you used lterp instead, you would have the right coordinate info because it's attached to the destination grid expression. </div>
<div><br></div></div></div></blockquote><div><br></div><div>Function re() works the same way as sdfwrite: the new coordinate information (the one the data has been interpolated to) is also returned. The main difference is that re() allows you to specify the coordinates of the destination gridded field without the need to have an open file that matches that destination grid. (I should include a gsUDF to implement an interface similar to lterp, I like its convenience.)</div>
<div><br></div><div>Since lats4d derives the coordinates of the destination file from the default file this can lead to trouble if one is not careful. In such cases, the user must provide a "dimension environment" file (option is "-de filename") with a valid file with the destination coordinates. The data file does not actually have to exist, it is sufficient to created a templated ctl, no need to have any actual data file created. (However, if you do have a file on that destination grid, just specify it with the -de option).</div>
<div><br></div><div>For convenience I have build a number of options in lats4d to perform regridding to a number of popular grids (like from MERRA, ERA and NCEP reanalyses, GPCP, etc). These options create the "dimension environment" ctl on the fly for you. You can see what is available with </div>
<div><br></div><div>% lats4d.sh -h</div><div><br></div><div>from the OS command line or with</div><div><br></div><div>ga-> lats4d -h</div><div><br></div><div>from the grads command line. This "manual page" also has a section on REGRIDDING that gives more information on how to do regridding with lats4d.</div>
<div><br></div><div> Arlindo</div><div><br></div><div><br></div><div> </div></div>-- <br>Arlindo da Silva<br><a href="mailto:dasilva@alum.mit.edu">dasilva@alum.mit.edu</a><br>