<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
Richard,<br><br>Like you said that you have already created gridded binary. All you need do is to create a .ctl file to read the binary and then write out netCDF in GrADS.<br><br>Say your .ctl is exactly like the one on the link you referred to at http://grads.iges.org/grads/gadoc/aboutgriddeddata.html, and you want to write the variable slp to netCDF. After you open the file, all you need do is something like:<br><br>-> set lon 0 360<br>-> set lat 90 90<br>-> set t 1 last<br>-> slp = slp<br>-> set sdfwrite gridded_data_sample.nc <br>-> sdfwrite slp<br><br><br>This will create a new netCDF file named <b><i>sdfwrite gridded_data_sample.nc </i></b>. You read more about "sdfwrite" by looking it up on the GrADS documentation: http://www.iges.org/grads/gadoc/gadocindex.html. <br>******In case you have several variables in one file, I'm not so GrADS can handle them at once. You may have to write them to netCDF one-after-another and then use cdo or nco to concatenate the netCDF files to one.************<br><br>Best,<br><br>Hyacinth <br><br><br><div>> Date: Tue, 13 Sep 2011 15:49:33 +0000<br>> From: "Bantges, Richard J" <r.bantges@imperial.ac.uk><br>> Subject: [gradsusr] Writing GrADS netCDF files with IDL<br>> To: "gradsusr@gradsusr.org" <gradsusr@gradsusr.org><br>> Message-ID:<br>>         <DE4EEC0FA6E54A41A1891FD83EFF85AB0AAF3F62@icexch-m6.ic.ac.uk><br>> Content-Type: text/plain; charset="us-ascii"<br>> <br>> Hi there,<br>> <br>> I'm trying to write a GrADS compatible netCDF file using ITT's IDL software, that can then be read in using GrADS's sdfopen command. Does anyone have an example IDL procedure that does this please?<br>> <br>> I've managed to write out data in a gridded binary data file that is described here http://grads.iges.org/grads/gadoc/aboutgriddeddata.html but ideally I'd like to write these in netCDF format. The main problem is writing the netCDF so that th
e associated control file accurately describes the netCDF file content.<br>> <br>> So, if anyone has a very simple IDL procedure that writes out a netCDF file that can be directly read by GrADS using the sdfopen command that would be fantastic.<br>> <br>> Rich<br>> <br>> -------------- next part --------------<br>> An HTML attachment was scrubbed...<br>> URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110913/96e5969c/attachment.html <br>> <br>> ------------------------------<br>> <br>> _______________________________________________<br>> gradsusr mailing list<br>> gradsusr@gradsusr.org<br>> http://gradsusr.org/mailman/listinfo/gradsusr<br>> <br>> <br>> End of gradsusr Digest, Vol 19, Issue 21<br>> ****************************************<br></div>                                            </div></body>
</html>