<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I am not a grads user, just responding to the FORTRAN/C issue.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>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.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>If you don’t want these EOR markers you could write the file out as direct access files in Fortran.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hope this helps.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>--Raghu<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> gradsusr-bounces@gradsusr.org [mailto:gradsusr-bounces@gradsusr.org] <b>On Behalf Of </b>Thomas Robinson<br><b>Sent:</b> Wednesday, May 09, 2012 11:36 PM<br><b>To:</b> GrADS Users Forum<br><b>Subject:</b> [gradsusr] fwrite gridding issue<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:.5in'>Aloha, <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. <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! <br>-Tom<br><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<o:p></o:p></p></div></body></html>