<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I'm no fortran expert, but I think "direct" means the 4-byte headers and footers for each record are not written, so you should remove 'options sequential'. According to your descriptor, your data file (chi_33yr.dat) should be 144*73*48212*4 bytes large. Is it? What is 'files'? <div>--Jennifer</div><div><br><div><br><div><div>On May 10, 2012, at 1:44 PM, Thomas Robinson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Here is my code that opens and writes out the data:<br><br> open (unit=291,file="chi_33yr.dat", access="direct",<br> & status="unknown",recl=4*nx*ny*nt*files)<br> write (291, rec=1) chi<br>
<br>The variable chi has dimensions nx,ny,nt*files . <br><br>I added options sequential to the descriptor file and the same thing is happening. Here is my descriptor file:<br><br>dset ^chi_33yr.dat<br>title Velocity Potential<br>
options sequential <br>undef 9.999e+20<br>xdef 144 linear 0 2.5<br>ydef 73 linear -90 2.5<br>zdef 1 levels 200<br>tdef 48212 linear 00Z01JAN1979 360mn<br>vars 1<br>chi 0 x,y,t 1 ** velocity potential<br>endvars<br><br>All of your input is very much appreciated. <br>
<br>-Tom<br> <br><br><div class="gmail_quote">On Fri, May 11, 2012 at 3:16 AM, Jennifer Adams <span dir="ltr"><<a href="mailto:jma@cola.iges.org" target="_blank">jma@cola.iges.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Tom, Did you include 'options sequential' in your descriptor file for your new binary file? --Jennifer<div><br><div><br><div><div><div class="h5"><div>On May 10, 2012, at 8:49 AM, Raghu Reddy wrote:</div>
<br></div></div><blockquote type="cite"><span style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><div link="blue" vlink="purple" lang="EN-US">
<div><div class="h5"><div><div style="margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">I am not a grads user, just responding to the FORTRAN/C issue.<u></u><u></u></span></div>
<div style="margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></div>
<div style="margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">If you do a normal sequential FORTRAN write, it writes an end-of-record marker at the beginning *<b>and</b>* at the end of *<b>every</b>* write. Since you mentioned that the data is skewed, I assume you wrote all the 48,000 values with one write statement, and that would result in one EOR marker at the beginning and one EOR marker at the end.<u></u><u></u></span></div>
<div style="margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></div>
<div style="margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">If you don’t want these EOR markers you could write the file out as direct access files in Fortran.<u></u><u></u></span></div>
<div style="margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></div>
<div style="margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Hope this helps.<u></u><u></u></span></div>
<div style="margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></div>
<div style="margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Thanks,<u></u><u></u></span></div>
<div style="margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></div>
<div style="margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">--Raghu<u></u><u></u></span></div>
<div style="margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></div>
<div style="margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></div>
<div style="margin-top:0in;margin-right:0in;margin-left:0in;margin-bottom:0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></div>
<div style="margin-top:0in;margin-right:0in;margin-left:0.5in;margin-bottom:0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><b><span style="font-size:10pt;font-family:Tahoma,sans-serif">From:</span></b><span style="font-size:10pt;font-family:Tahoma,sans-serif"><span> </span><a href="mailto:gradsusr-bounces@gradsusr.org" style="color:blue;text-decoration:underline" target="_blank">gradsusr-bounces@gradsusr.org</a><span> </span>[mailto:<a href="mailto:gradsusr-bounces@gradsusr.org" target="_blank">gradsusr-bounces@gradsusr.org</a>]<span> </span><b>On Behalf Of<span> </span></b>Thomas Robinson<br>
<b>Sent:</b><span> </span>Wednesday, May 09, 2012 11:36 PM<br><b>To:</b><span> </span>GrADS Users Forum<br><b>Subject:</b><span> </span>[gradsusr] fwrite gridding issue<u></u><u></u></span></div><div style="margin-top:0in;margin-right:0in;margin-left:0.5in;margin-bottom:0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">
<u></u> <u></u></div><p class="MsoNormal" style="margin-top:0in;margin-right:0in;margin-left:0.5in;margin-bottom:12pt;font-size:12pt;font-family:'Times New Roman',serif">Aloha,<span> </span><br><br>I used fwrite to write out to a binary file in order to create a large file with about 48000 time steps for global data (because I am crazy). I noticed that when I use fortran to create a new data file that has all 48000, it doesn't match with what the original data plotted, instead it seems skewed. No manipulations were done to the data, it was just read it all in and write it out. When I tried to loop the data, I further noticed that the northern border looped around the south and then moved upwards back to the north. It just keeps looping around and it's odd because the top boundary of the map isn't continuous with the bottom boundary (unlike the side boundaries which are continuous). Anyways, I am wondering why this happened and what I can do to make it work out correctly. <span> </span><br>
<br>Here is my fwrite code. it is the first time step, nt is the last time step, chi is the velocity potential that was calculated using 'define chi = fish_chi(UGRDprs,VGRDprs)' :<br clear="all">*# set up global domain<br>
'set lev 200 '<br>'set lat -90 90'<br>'set lon 0 360'<br>*#**************************************************************<br>say 'write data out to binary file called CHI.200hPa'filenum'.dat'<br>
'set fwrite -le -sq -cl CHI_200hPa_'filenum'.dat'<br>'set gxout fwrite'<br>while (it <= nt)<br> 'set t 'it<br> 'display chi'<br>it=it+1<br>endwhile<br>'disable fwrite'<br>
<br>Mahalo for your help!<span> </span><br>-Tom<br><br>--<span> </span><br>Tom Robinson<br>President Graduate Student Organization<span> </span><br>Student Caucus Representative for the Graduate Student Organization<br>Graduate Student - Department of Meteorology<br>
<a href="tel:732-718-2323" value="+17327182323" target="_blank">732-718-2323</a><u></u><u></u></p></div></div></div>_______________________________________________<div class="im"><br>gradsusr mailing list<br><a href="mailto:gradsusr@gradsusr.org" style="color:blue;text-decoration:underline" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" style="color:blue;text-decoration:underline" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br></div></div></span></blockquote></div><br><div>
<span style="border-spacing:0px 0px;text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:12px;white-space:normal;font-family:Helvetica;word-spacing:0px"><span style="border-spacing:0px 0px;text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:12px;white-space:normal;font-family:Helvetica;word-spacing:0px"><span style="border-spacing:0px 0px;text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:12px;white-space:normal;font-family:Helvetica;word-spacing:0px"><div>
--</div><div>Jennifer M. Adams</div><div>IGES/COLA</div><div class="im"><div>4041 Powder Mill Road, Suite 302</div><div>Calverton, MD 20705</div></div><div><a href="mailto:jma@cola.iges.org" target="_blank">jma@cola.iges.org</a></div>
<div><br></div><br></span></span></span>
</div>
<br></div></div></div><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>Tom Robinson<br>President Graduate Student Organization <br>Student Caucus Representative for the Graduate Student Organization<br>Graduate Student - Department of Meteorology<br>
732-718-2323<br><br>
_______________________________________________<br>gradsusr mailing list<br><a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>http://gradsusr.org/mailman/listinfo/gradsusr<br></blockquote></div><br><div apple-content-edited="true">
<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></div></div></body></html>