<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<br><div><div>On Mar 17, 2008, at 1:58 PM, Matt Alonso wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi Jennifer,<br><br><div class="gmail_quote"><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style=""><div><div>Did you build GrADS from source on this machine? </div> </div></div></blockquote><div><br>Yes <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style=""><div><div></div><div><div class="Ih2E3d"> <br></div>Looks like you have converted grib2 into netcdf -- one file per forecast time. Is that right? </div></div></div></blockquote><div><br>Yes, I created one netcdf file per grib2 forecast run (ie <a href="http://01.nc">01.nc</a> would contain all 61 time periods from the 12z WW3 run); see more thorough description below.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style=""><div><div></div><div><div class="Ih2E3d"><br></div>There are some bugs in the gancgrid() routine in 2.0.a1 that I believe have been fixed for the next release. The gancgrid() routine is designed for speeding up the I/O from OPeNDAP servers, but it can work for non-pdef non-templated local netcdf files too. The non-templated condition for calling gancgrid() is what's missing in 2.0.a1 plus some other bug fixes in the subroutine itself. </div> <div><br></div><div>You can bypass the gancgrid() routine by changing one line of code in gaio.c (lines 212-216) and re-compiling:</div><div><br></div><div><div> /* if (!strncmp(pgrid->pfile->name,"http://",7)) { */</div> <div> if ((!strncmp(pgrid->pfile->name,"http://",7)) || ((pfi->ncflg==1) && (pfi->ppflag==0))) {</div><div> rc = gancgrid(gr,gru,id,jd,d,dx);</div><div> return (rc);</div><div> }</div> <div><br></div><div>If you un-comment out the first line and comment out the second -- i.e., call gancgrid only for opendap data sets -- then the I/O should work. </div><div><br></div><div>However, it sounds like you are also making a mistake in the way you are templating your netcdf files. If you have one file per forecast time, you can aggregate them into one data set (with XDFOPEN and OPTIONS TEMPLATE) so there's no need to have each time step be in a separate data set. Also, when you call the smth9() function, which dimensions are varying? </div> </div></div></div></blockquote><div><br>I will modify the src accordingly and see if that helps. </div></div></blockquote>It should do the trick, since you'll be using the 'dtype netcdf' code path from 1.9, which is more robust. </div><div> <br><blockquote type="cite"><div class="gmail_quote"><div>I think I may have misspoke initially when describing the setup of the various files or perhaps I am just misunderstanding. As I attempted to clarify above each netcdf file has the exact same contents as the original grib2 file on NCEP's FTP site (<a href="ftp://ftpprd.ncep.noaa.gov/pub/data/nccf/com/wave/prod/wave.20080317">ftp://ftpprd.ncep.noaa.gov/pub/data/nccf/com/wave/prod/wave.20080317</a>). <br> <br>I want to show how the model is trending by using an "ensemble" of the previous 7 runs. When my script is executed it inserts the newest runs data into <a href="http://00.nc">00.nc</a> and "bumps" the previous runs down. If the newest run is the 12Z run for today (20080317) the netcdf files would contain the data for the various runs as follows:<br> <br><a href="http://00.nc">00.nc</a> -> 12Z 20080317<br><a href="http://01.nc">01.nc</a> -> 06Z 20080317<br><a href="http://02.nc">02.nc</a> -> 00Z 20080317<br><a href="http://03.nc">03.nc</a> -> 18Z 20080316<br> ...</div></div></blockquote><div><br class="webkit-block-placeholder"></div>This is a GREAT example for using the E dimension to simplify your analysis! Here are excerpts from your 5D descriptor file: </div><div><br class="webkit-block-placeholder"></div><div>dset ^%e.nc</div><div>options template</div><div>tdef 67 linear 00z16mar2008 6hr</div><div>edef 7</div><div>00 61 12z17mar2008</div><div>01 61 06z17mar2008</div><div>02 61 00z17mar2008</div><div>03 61 18z16mar2008</div><div>04 61 12z16mar2008</div><div>05 61 06z16mar2008</div><div>06 61 00z16mar2008</div><div>endedef</div><div><br></div><div>The tdef statement describes a single time axis that spans all 7 ensembles (which are reallly forecasts with different initial times). </div><div><br class="webkit-block-placeholder"></div><div>An additional simplification might be to skip the conversion to NetCDF -- you can read the grib2 files directly, templating over T and E. Once you've done the conversion, though, I/O will be faster with NetCDF, especially if X and Y don't vary. But definitely use EDEF instead of 'set dfile 'n. There's a lot more analysis you can do when your ensembles are not separate data sets. </div><div><br class="webkit-block-placeholder"></div><div>Jennifer</div><div><br></div><div><br><blockquote type="cite"><div class="gmail_quote"><div><br><br>And so on until there are 8 netcdf files. Would your templating example still apply and help me display data in the manner I describe above? I attached a sample image which is being generated by this same script but is running in GrADS 1.8S11.<br> <br>Thanks as always.<br><br>Cheers,<br>Matt<br> </div></div><br></blockquote></div><br><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>--</div><div>Jennifer M. Adams</div><div>IGES/COLA</div><div>4041 Powder Mill Road, Suite 302</div><div>Calverton, MD 20705</div><div><a href="mailto:jma@cola.iges.org">jma@cola.iges.org</a></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></span></span> </div><br></body></html>