<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Read Binary Header  in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-Binary-Header/m-p/812729#M43685</link>
    <description>Dear all&lt;BR /&gt;&lt;BR /&gt;I am reading a binary file that have a header. I need extract the this header a information for process the data.&lt;BR /&gt;&lt;BR /&gt;My piece of code is:&lt;BR /&gt;&lt;BR /&gt; byte head(512)&lt;BR /&gt; real*4 dopdata(512)&lt;BR /&gt; integer*4 a&lt;BR /&gt; character cfile*11,chdata(512)&lt;BR /&gt;&lt;BR /&gt; cfile='20050460000' ! binary file&lt;BR /&gt;&lt;BR /&gt; open(10,file=cfile,form='binary',status='old')&lt;BR /&gt; read(10,end=999) head(1:512)&lt;BR /&gt; &lt;BR /&gt; DO I=1,512&lt;BR /&gt; chdata(I:I) = CHAR(head(I))&lt;BR /&gt; END DO&lt;BR /&gt;&lt;BR /&gt; READ(UNIT=chdata(2), FMT='(I4)') a&lt;BR /&gt; write(6,*) a&lt;BR /&gt;&lt;BR /&gt;The fist part of header is:&lt;BR /&gt;2048 SAMPLES 15-FEB-05 00:00 LOC Cangrejo FMSPEC FREQUENZ 16.300MHZ YEAR&lt;BR /&gt; 2005 RANGE: 1.5000 KM,TRUENORTH:210 GRAD,RATE:0.260000S,NRRANGES: 80 &lt;BR /&gt;&lt;BR /&gt;I need (for example) extract the number 2048, but when I "write(6,*) a" the result is only "2". Anybody have a idea why this happend?&lt;BR /&gt;&lt;BR /&gt;I appreciate a lot your help.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 04 Oct 2010 08:50:08 GMT</pubDate>
    <dc:creator>vgtoro</dc:creator>
    <dc:date>2010-10-04T08:50:08Z</dc:date>
    <item>
      <title>Read Binary Header</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-Binary-Header/m-p/812729#M43685</link>
      <description>Dear all&lt;BR /&gt;&lt;BR /&gt;I am reading a binary file that have a header. I need extract the this header a information for process the data.&lt;BR /&gt;&lt;BR /&gt;My piece of code is:&lt;BR /&gt;&lt;BR /&gt; byte head(512)&lt;BR /&gt; real*4 dopdata(512)&lt;BR /&gt; integer*4 a&lt;BR /&gt; character cfile*11,chdata(512)&lt;BR /&gt;&lt;BR /&gt; cfile='20050460000' ! binary file&lt;BR /&gt;&lt;BR /&gt; open(10,file=cfile,form='binary',status='old')&lt;BR /&gt; read(10,end=999) head(1:512)&lt;BR /&gt; &lt;BR /&gt; DO I=1,512&lt;BR /&gt; chdata(I:I) = CHAR(head(I))&lt;BR /&gt; END DO&lt;BR /&gt;&lt;BR /&gt; READ(UNIT=chdata(2), FMT='(I4)') a&lt;BR /&gt; write(6,*) a&lt;BR /&gt;&lt;BR /&gt;The fist part of header is:&lt;BR /&gt;2048 SAMPLES 15-FEB-05 00:00 LOC Cangrejo FMSPEC FREQUENZ 16.300MHZ YEAR&lt;BR /&gt; 2005 RANGE: 1.5000 KM,TRUENORTH:210 GRAD,RATE:0.260000S,NRRANGES: 80 &lt;BR /&gt;&lt;BR /&gt;I need (for example) extract the number 2048, but when I "write(6,*) a" the result is only "2". Anybody have a idea why this happend?&lt;BR /&gt;&lt;BR /&gt;I appreciate a lot your help.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 04 Oct 2010 08:50:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-Binary-Header/m-p/812729#M43685</guid>
      <dc:creator>vgtoro</dc:creator>
      <dc:date>2010-10-04T08:50:08Z</dc:date>
    </item>
    <item>
      <title>Read Binary Header</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-Binary-Header/m-p/812730#M43686</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I'm moving this to the Intel Fortran Compiler forum, since the question is not related to the Intel Manycore Testing Lab. You are more likely to get an answer there.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;==&lt;BR /&gt;Aubrey W.&lt;BR /&gt;Intel Software Network Support</description>
      <pubDate>Mon, 11 Oct 2010 22:53:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-Binary-Header/m-p/812730#M43686</guid>
      <dc:creator>Aubrey_W_</dc:creator>
      <dc:date>2010-10-11T22:53:45Z</dc:date>
    </item>
    <item>
      <title>Read Binary Header</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-Binary-Header/m-p/812731#M43687</link>
      <description>You probably meant to declare &lt;BR /&gt;&lt;BR /&gt; chdata*512&lt;BR /&gt;&lt;BR /&gt;instead of&lt;BR /&gt;&lt;BR /&gt; chdata(512)&lt;BR /&gt;&lt;BR /&gt;and to change the read statement to&lt;BR /&gt;&lt;BR /&gt; READ(UNIT=CHDATA(2:5),FMT='(I4)')A&lt;BR /&gt;&lt;BR /&gt;With your declaration, the length of each element of the array &lt;I&gt;chdata&lt;/I&gt; is one character, so the READ statement processes just one character, which is why you got 2 instead of the expected 2048.&lt;BR /&gt;</description>
      <pubDate>Mon, 11 Oct 2010 23:21:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-Binary-Header/m-p/812731#M43687</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2010-10-11T23:21:23Z</dc:date>
    </item>
    <item>
      <title>Read Binary Header</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-Binary-Header/m-p/812732#M43688</link>
      <description>Thanks a lot !!!!&lt;BR /&gt;&lt;BR /&gt;Actually had an error in the statement of my variable (chdata). On the other hand solves the problem by reading the header "word for word" and assigning the appropriate variable:&lt;BR /&gt;&lt;BR /&gt; 7994 real*8 mdoppler(40,50,512)&lt;BR /&gt;7995 real*4 dopdata(512),freq,rnge,rate,lat,lon,dgt&lt;BR /&gt;7996 *&lt;BR /&gt;7997 integer nyear, nmonth,nday,nhour,nmin,samples,tnorth,nrrange&lt;BR /&gt;7998 integer ntl,nftl,nx,ny,res&lt;BR /&gt;7999 *&lt;BR /&gt;8000 character cfile11*20,chdata(128)*4&lt;BR /&gt;8001 character station*9,cfreq*6,crnge*6,crate*8&lt;BR /&gt;8002 character claenge*9,cwbreite*8,clat*9,clon*10,cdgt*9&lt;BR /&gt;8003 character t1*11,t2*5,t3*21,t4*26,t5*14,t6*11,t7*12,t8*16,t9*10&lt;BR /&gt;8004 character t10*10,t11*7,t12*5,t13*5,t14*6,t15*7&lt;BR /&gt;8005 character*4 csamples&lt;BR /&gt;8006 character*3 cmonth,ca3,cnftl,ctnorth&lt;BR /&gt;8007 character*2 cday,cyear,chour,cmin,cnrrange,cntl,cnx,cny&lt;BR /&gt;8008 character*1 ca,cb,cc,cd,ce,cf,cg,ch,ci&lt;BR /&gt;8009 *----------------------------------------------------------------------&lt;BR /&gt;8010 open(10,file=cfile11,form='binary',status='old')&lt;BR /&gt;8011 read(10,end=999) csamples,t1&lt;BR /&gt;8012 * write(6,*) csamples&lt;BR /&gt;8013 read(10,end=999) cday,cg,cmonth,ca,cyear&lt;BR /&gt;8014 * write(6,*) cday,cmonth,cyear&lt;BR /&gt;8015 read(10,end=999) cb,chour,cc,cmin,t2,station&lt;BR /&gt;8016 * write(6,*) chour,cmin,station ....&lt;BR /&gt;&lt;BR /&gt;Thanks again</description>
      <pubDate>Wed, 13 Oct 2010 00:56:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-Binary-Header/m-p/812732#M43688</guid>
      <dc:creator>vgtoro</dc:creator>
      <dc:date>2010-10-13T00:56:33Z</dc:date>
    </item>
    <item>
      <title>Read Binary Header</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-Binary-Header/m-p/812733#M43689</link>
      <description>Consider using the F2003 standard ACCESS='STREAM' in place of FORM='BINARY'. You can probably just change the OPEN and leave the rest of the code as-is.</description>
      <pubDate>Wed, 13 Oct 2010 01:35:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-Binary-Header/m-p/812733#M43689</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2010-10-13T01:35:25Z</dc:date>
    </item>
  </channel>
</rss>

