If by .dat you mean the gridded binary that is standard for grid files, then yes you need to convert. Some netCDF files need full descriptor files to read, while some can be read using the sdfopen business. So they probably are not the same. To convert, you'll have to extract the values from the netcdf file, then use Fortran to write out the values to the binary file. I have recently begun doing something similar myself, so it's fresh in my mind. You need to open the file using these parameters:<br>
<br>OPEN(17,file=file_name,STATUS="unknown",form="unformatted",access="direct",recl=4*I_size*J_size)<br> WRITE(17,rec=1) ((field(i,j), j = row_min, row_max), i = col_min, col_max)<br><br>Where I_size and J_size in this example are the number of x and y points in your array that you want to write. The WRITE statement writes the values to the file, but you have to be specific about the rec= part. I think you use successive record numbers for each vertical level, time level, and ensemble member (if you are using those dimensions). Otherwise each horizontal cross section works as just one record. Also, as far as I know, this example only writes one array to a file. To write additional arrays I think you'd have to increase the recl value and increment the rec number in the WRITE statement.<br>
<br>Jeff<br><br><div class="gmail_quote">On Tue, Jul 24, 2012 at 1:07 PM, Kishore Babu <span dir="ltr"><<a href="mailto:kishoreragi@gmail.com" target="_blank">kishoreragi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear Jeff,<br> <br> Yes, we can open .nc file with sdfopen in GrADS. But, I need .dat file in other applications. Do you think .nc file and .dat files are same? netcdf file is self-described and .dat file needs descriptor file. Is it?<br>
<br>Kishore<br><br><div class="gmail_quote">On Tue, Jul 24, 2012 at 11:26 PM, Jeff Duda <span dir="ltr"><<a href="mailto:jeffduda319@gmail.com" target="_blank">jeffduda319@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You don't need to convert. You can use SDFOPEN or write a control file to open the netcdf file directly. See this page for more information and instructions: <a href="http://www.iges.org/grads/gadoc/SDFdescriptorfile.html" target="_blank">http://www.iges.org/grads/gadoc/SDFdescriptorfile.html</a><br>
<br>Jeff Duda<br><br><div class="gmail_quote"><div><div>On Tue, Jul 24, 2012 at 12:40 PM, Kishore Babu <span dir="ltr"><<a href="mailto:kishoreragi@gmail.com" target="_blank">kishoreragi@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>
Dear GrADS user,<br><br> I am quit new in data handling. I have netcdf files and I need to convert to .dat files. Could anyone please provide me a command to convert .nc to .dat files? <br><br>Thank you in advance,<br>
<br>
yours sincerely,<br><br>Kishore<br>
<br></div></div>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><span><font color="#888888"><br><br clear="all"><span class="HOEnZb"><font color="#888888"><br>-- <br>Jeff Duda<br>Graduate research assistant<br>University of Oklahoma School of Meteorology<br>Center for Analysis and Prediction of Storms<br>
<br>
</font></span></font></span><span class="HOEnZb"><font color="#888888"><br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></font></span></blockquote></div><br>
<br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Jeff Duda<br>Graduate research assistant<br>University of Oklahoma School of Meteorology<br>Center for Analysis and Prediction of Storms<br><br>