<div dir="ltr"><div><div><div>Hi Andrew,<br><br></div>How are you opening the file from the fortran side? The docs for fbindirwrite state that the fortran equivalent is a file opened with "'form=unformatted, access=direct, recl= ...'.".<br><br></div>If that doesn't help, I'd be happy to take a look at the file if you are able to send it to me.<br><br></div>Rick<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 23, 2018 at 2:03 PM, Andrew Kren - NOAA Affiliate <span dir="ltr"><<a href="mailto:andrew.kren@noaa.gov" target="_blank">andrew.kren@noaa.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear ncl-talk,<div><br></div><div>I wrote a program to convert grib data to binary format, as needed for a fortran program to track cyclones. I write slp, u at 500, and v at 500 to binary using fbindirwrite. I ran the fortran program, which gave erroneous wind values. So, I checked my binary program again and printed out the wind for a few points and they were erroneous. Is this because the wind is negative at times in direction? Here are some wind values I get when putting into binary:</div><div><br></div><div>
<span></span>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(0)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>-3.98</span></p>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(1)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>-3.98</span></p>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(2)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>-3.98</span></p>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(3)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>-3.99</span></p>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(4)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>-3.95</span></p>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(5)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>-3.96</span></p>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(6)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>-3.96</span></p>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(7)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>-3.96</span></p>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(8)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>-3.96</span></p>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(9)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>-3.96</span></p>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(10)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>-3.95</span></p>
<div><br></div>And here is what I get when I read the binary file back in after created:</div><div><br></div><div>
<span></span>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(0)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>102011.4</span></p>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(1)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>102011.4</span></p>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(2)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>102011.4</span></p>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(3)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>102011.4</span></p>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(4)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>102011.4</span></p>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(5)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>102011.4</span></p>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(6)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>102011.4</span></p>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(7)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>102011.4</span></p>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(8)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>102011.4</span></p>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(9)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>102011.4</span></p>
<p class="m_-8464570325363891816gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8464570325363891816gmail-s1" style="font-variant-ligatures:no-common-ligatures">(10)<span class="m_-8464570325363891816gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>102011.4</span></p>
<div><br></div>Am I missing something. I also attached my code. Any help is much appreciated!</div><div><br></div><div>Thanks,</div><span class="HOEnZb"><font color="#888888"><div><div><br></div>-- <br><div class="m_-8464570325363891816gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div>Andrew Kren<br>Assistant Scientist<br>CIMAS & NOAA/AOML<br>
325 Broadway, Boulder, CO 80305<br>
<a href="tel:%28303%29%20497-5418" value="+13034975847" target="_blank">(303) 497-5418</a><span><font color="#888888"><br>
</font></span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div></font></span></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>