<?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 Convert REAL*8 Unformatted Sequential file in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771975#M23050</link>
    <description>&lt;P&gt;Ok,Maybe I need to find another way to solve this problems&lt;/P&gt;</description>
    <pubDate>Wed, 28 Jul 2010 15:07:28 GMT</pubDate>
    <dc:creator>daweiwan</dc:creator>
    <dc:date>2010-07-28T15:07:28Z</dc:date>
    <item>
      <title>Convert REAL*8 Unformatted Sequential file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771973#M23048</link>
      <description>Hello, I am working on porting a Fortran program from a VAX to PC. The program needs to read data from an &lt;BR /&gt;&lt;BR /&gt;Unformatted Sequential file as follows:&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;IMPLICIT REAL*8(A-H,O-Z) &lt;/P&gt;&lt;P&gt;DIMENSION R(4,80,6,46) &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;OPEN (UNIT=11, ERR=998, STATUS='OLD', &lt;/P&gt;&lt;P&gt;ACCESS='SEQUENTIAL', FORM='UNFORMATTED', IOSTAT=IERRA, FILE='water') &lt;/P&gt;&lt;P&gt;READ(UNIT=11, IOSTAT=IERRA) R &lt;BR /&gt;.........&lt;BR /&gt;&lt;BR /&gt;According to this post's illustration, &lt;A href="http://origin-software.intel.com/en-us/forums/showthread.php?t=45634" target="_blank"&gt;http://origin-software.intel.com/en-us/forums/showthread.php?t=45634&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I am modify this program as follows: &lt;/P&gt;&lt;P&gt;IMPLICIT REAL*8(A-H,O-Z) &lt;/P&gt;&lt;P&gt;DIMENSION R(4,80,6,46) &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;IPRNT = 4&lt;BR /&gt;&lt;BR /&gt;OPEN(UNIT=11,ERR=998,STATUS='OLD',ACCESS='SEQUENTIAL', &lt;/P&gt;&lt;P&gt;FORM='binary',convert='VAXD',FILE='water') &lt;/P&gt;&lt;P&gt;open(unit=iprnt,ERR=998, status='replace',IOSTAT=IERRA,file='wdise.TXT')!&lt;/P&gt;&lt;P&gt;READ(UNIT=11, IOSTAT=IERRA) R &lt;/P&gt;&lt;P&gt;.........&lt;BR /&gt;&lt;BR /&gt;I meta problem when Idebug the program ,the prolem is:"forrtl: info(95) floating point conversion failed".&lt;BR /&gt;&lt;BR /&gt;So confused I am, Would you please give me some advice to solve this problem ,Thanks. &lt;BR /&gt;&lt;BR /&gt;David.wan&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2010 13:12:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771973#M23048</guid>
      <dc:creator>daweiwan</dc:creator>
      <dc:date>2010-07-28T13:12:28Z</dc:date>
    </item>
    <item>
      <title>Convert REAL*8 Unformatted Sequential file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771974#M23049</link>
      <description>Can you attach the data file, or at least a hex dump of the first 100 bytes or so? Did the file come from a VAX or an Alpha? It's possible that the REAL*8 data is G_float meaning you'd need 'VAXD'.&lt;BR /&gt;&lt;BR /&gt;Does the program read any of the data correctly?</description>
      <pubDate>Wed, 28 Jul 2010 13:45:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771974#M23049</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2010-07-28T13:45:45Z</dc:date>
    </item>
    <item>
      <title>Convert REAL*8 Unformatted Sequential file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771975#M23050</link>
      <description>&lt;P&gt;Ok,Maybe I need to find another way to solve this problems&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2010 15:07:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771975#M23050</guid>
      <dc:creator>daweiwan</dc:creator>
      <dc:date>2010-07-28T15:07:28Z</dc:date>
    </item>
    <item>
      <title>Convert REAL*8 Unformatted Sequential file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771976#M23051</link>
      <description>How did you transfer the data file from the VAX system? It looks to me as if the record lengths have been lost.&lt;BR /&gt;&lt;BR /&gt;Here's an article I wrote on this many years ago, and I've attached the programs it mentions. Perhaps this will be helpful to you.&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;Description: Unlike FORMATTED files, Fortran SEQUENTIAL UNFORMATTED 
                    files vary in data layout among various compiler vendors and 
                    platforms. This article summarizes how to read UNFORMATTED 
                    files from various combinations of compilers and platforms.&lt;/P&gt;
                  &lt;P&gt;The Visual Fortran SEQUENTIAL UNFORMATTED file layout is 
                    one that is very common on UNIX systems, including DIGITAL 
                    UNIX. Each Fortran "record" is preceded and 
                    followed by a 32-bit integer containing the record length 
                    (the integer is stored in the "little-endian" layout, 
                    with the least-significant bit in the lowest addressed byte.) 
                    This record length is required to apply Fortran record semantics, 
                    including the ability to use BACKSPACE. Unfortunately, 
                    this is not correctly documented in the Programmer's Guide 
                    - the layout described there is actually that of Microsoft 
                    Fortran PowerStation. This will be corrected in future 
                    editions.&lt;/P&gt;
                  &lt;P&gt;DIRECT UNFORMATTED files do not typically have embedded record 
                    length information and can usually be read/written without 
                    special actions. 
                  &lt;/P&gt;&lt;DL&gt;&lt;DT&gt;Microsoft Fortran (including Fortran PowerStation and 
                      Fortran 5.x for DOS)&lt;/DT&gt;&lt;DD&gt;These files can be read (and written) directly by enabling 
                      the /fpscomp:ioformat switch (Compatibility..PowerStation..I/O 
                      Format setting). Note that this is the default if 
                      you use the FL32 command from a command prompt.&lt;/DD&gt;&lt;DT&gt;DIGITAL Fortran for DIGITAL UNIX&lt;/DT&gt;&lt;DD&gt;These files can be read and written directly with no special 
                      actions.&lt;/DD&gt;&lt;DT&gt;Other UNIX systems&lt;/DT&gt;&lt;DD&gt;For HP, IBM, Sun, SGI and other big-endian UNIX systems, 
                      open the file with the CONVERT='BIG_ENDIAN' option. 
                      For little-endian UNIX systems (such as Linux on X86 processors), 
                      no special action is typically needed.&lt;/DD&gt;&lt;DT&gt;DIGITAL Fortran for OpenVMS&lt;/DT&gt;&lt;DD&gt;The default SEQUENTIAL UNFORMATTED file layout on OpenVMS 
                      is called 'SEGMENTED'. A logical record may be split 
                      across multiple physical records - each has a 16-bit prefix 
                      of flags indicating whether that physical record is the 
                      first, last middle or only in the logical record. 
                      While Visual Fortran CAN read these, if the file is opened 
                      with RECORDTYPE='SEGMENTED', in practice this is difficult 
                      because you must transfer the data in such a way as to preserve 
                      the file system's record lengths, and typical methods such 
                      as FTP remove this information. 
                      &lt;P&gt;One way is to use a program on the OpenVMS system to 
                        convert the file to a format which can be easily transferred 
                        and read by Visual Fortran. To convert an OpenVMS 
                        'SEGMENTED' file to a form which can be read by Visual 
                        Fortran, use segmented_to_unix.for 
                        (note that the Visual Fortran layout is the same as is 
                        used by UNIX systems). To convert a Visual Fortran 
                        file so that it may be read by Fortran on OpenVMS, use 
                        unix_to_segmented.for.&lt;/P&gt;
                      &lt;P&gt;Another way is to prepare a SEGMENTED file for transfer 
                        by changing the file's recordtype to be fixed-length, 
                        512 byte records, using the command:&lt;/P&gt;
                        &lt;P&gt;
                        $ SET FILE /ATTRIBUTES=(RFM=FIX,LRL=512) file.dat&lt;/P&gt;
                    
                      &lt;P&gt;This file can then be copied to the Windows system using 
                        normal FTP in binary mode. On the Windows system, open 
                        the file using RECORDTYPE='SEGMENTED'. This method cannot 
                        be used for files that were opened with RECORDTYPE='VARIABLE' 
                        explicitly specified.&lt;/P&gt;
                    
                      &lt;P&gt;If the file contains floating data and was written on 
                        a VAX or on an Alpha system with the default VAX floating 
                        types, you will need to specify CONVERT='VAXD' or 'VAXG' 
                        (as appropriate) when opening the file using Visual Fortran. 
                        This will automatically convert the data in scalars and 
                        arrays (though not in RECORD structures or derived types.)&lt;/P&gt;
                    &lt;/DD&gt;&lt;/DL&gt;</description>
      <pubDate>Wed, 28 Jul 2010 15:50:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771976#M23051</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2010-07-28T15:50:22Z</dc:date>
    </item>
    <item>
      <title>Convert REAL*8 Unformatted Sequential file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771977#M23052</link>
      <description>If all the records are the same length, you can recover by opening the file with RECL=176640, RECORDTYPE='FIXED'.</description>
      <pubDate>Wed, 28 Jul 2010 17:37:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771977#M23052</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2010-07-28T17:37:27Z</dc:date>
    </item>
    <item>
      <title>Convert REAL*8 Unformatted Sequential file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771978#M23053</link>
      <description>I noticed something curious about the binary data file. &lt;BR /&gt;&lt;BR /&gt;To hold the contents of the array R, with the declared dimensions of (4,80,6,46) would require (4 X 80 X 6 X 46)numbers X 8 bytes/number = 706560 bytes, plus any record length and header bytes. The data file "water" that you attached contains 584252 bytes, which amounts to not even 7 bytes per double precision real.&lt;BR /&gt;&lt;BR /&gt;There is something inconsistent here.&lt;BR /&gt;&lt;BR /&gt;Secondly, until one gets things to work properly, in cases like this it would be better not to include ERR= and IOSTAT= options in READ statements -- let the system tell you the errors it runs into while trying to read the file.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Jul 2010 17:51:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771978#M23053</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2010-07-28T17:51:55Z</dc:date>
    </item>
    <item>
      <title>Convert REAL*8 Unformatted Sequential file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771979#M23054</link>
      <description>&lt;P&gt;Steve,Thanks for your help. I compiletheprogram (segmented_to_unix.for) using Compaq Visual Fortran 6.60 on my PC ,but it occuringa lot of problem.Therefore,Ihave a question. Whether the program must be run in the VAX computer ? not in PC, and how to use the command in CVF, '$ SET FILE /ATTRIBUTES=(RFM=FIX,LRL=512) file.dat', thanks. &lt;BR /&gt;Anyway,we can't find the vax computer easily, so other solutions could befound ?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2010 02:40:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771979#M23054</guid>
      <dc:creator>daweiwan</dc:creator>
      <dc:date>2010-07-29T02:40:47Z</dc:date>
    </item>
    <item>
      <title>Convert REAL*8 Unformatted Sequential file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771980#M23055</link>
      <description>The segmented_to_unix program, as well as the SET FILE command, must be run on the VAX. If you no longer have access to the VAX, consider my suggestion of using RECORDTYPE='FIXED', but also look at the issue of the file size.</description>
      <pubDate>Thu, 29 Jul 2010 17:10:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771980#M23055</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2010-07-29T17:10:48Z</dc:date>
    </item>
    <item>
      <title>Convert REAL*8 Unformatted Sequential file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771981#M23056</link>
      <description>&lt;P&gt;Oh,bad luck, and I am using RECORDTYPE='FIXED' to convertthe file ,however, itcan'tberead.&lt;BR /&gt;&lt;BR /&gt;So, how I can solve this problem? Does some onein the same situation ? Thanks all the same ,steve.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jul 2010 10:59:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771981#M23056</guid>
      <dc:creator>daweiwan</dc:creator>
      <dc:date>2010-07-30T10:59:30Z</dc:date>
    </item>
    <item>
      <title>Convert REAL*8 Unformatted Sequential file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771982#M23057</link>
      <description>Addressing mecej4's objection regarding the inconsistency between the length of the binary data in the file that you attached and the number of bytes required to store the number of REALs each 8 bytes long in the array R - Clearly you have attached a truncated file.&lt;BR /&gt;&lt;BR /&gt;The array you are reading is a REAL*8 dimensioned (4,80,6,46). Taking the first two dimensions and multiplying, you get 4*80*8=2560 bytes. dividing by 16 gives 160 decimal, or A0 hexadecimal. If you open the file as binary (i.e. not auto) in the VS editor, you will soon see that the following repeats every 160 lines (or A0 hex), assuming 16 bytes per line displayed:&lt;BR /&gt;&lt;BR /&gt; 00 00 00 00 00 00 00 00 00 00 00 00 00&lt;BR /&gt;00 00 80 40 00 00 00 00 00 00 00 00 00 00 00 00&lt;BR /&gt;00 00 80 40 00 00 00 00 00 00 00 00 00 00 00 00&lt;BR /&gt;00 00 7F 40&lt;BR /&gt;&lt;BR /&gt;Using this flag, you can at least isolate groups of 320 real values. Clearly there should be 6*46 = 276 such groups. This indicates that the array was almost certainly written in column major order starting with the first index and writing the data as sets of 2-dimensional arrays.&lt;BR /&gt;&lt;BR /&gt;Within each group, the first index should vary fastest, so there should be natural groups of 4*8 bytes (possibly with spacer bytes).&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Jul 2010 15:49:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771982#M23057</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2010-07-30T15:49:56Z</dc:date>
    </item>
    <item>
      <title>Convert REAL*8 Unformatted Sequential file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771983#M23058</link>
      <description>Hi,anthonyrichards.Thanks for yourenthusiastic help. And I learn it carefully,But my knowledge for CVF is limited.&lt;BR /&gt;&lt;BR /&gt;Especially, "Within each group, the first index should vary fastest",how can I realize this function?&lt;BR /&gt;&lt;BR /&gt;So, Could you pleaseprovideme some specificsolutions?And I can obtain this data accurately . Thank you. &lt;BR /&gt;&lt;BR /&gt;Best wishes to you.</description>
      <pubDate>Mon, 02 Aug 2010 13:51:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771983#M23058</guid>
      <dc:creator>daweiwan</dc:creator>
      <dc:date>2010-08-02T13:51:34Z</dc:date>
    </item>
    <item>
      <title>Convert REAL*8 Unformatted Sequential file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771984#M23059</link>
      <description>Allow me to suggest an altogether different direction. Given that the file from the VAX is truncated or mutilated, of uncertain format/type, and my have lost some content during transfer by FTP ftom an RMS file system to a byte-stream type file system (e.g., Unix, Windows), it is justifiable to ask: "What is supposed to be in the file 'water'"? &lt;BR /&gt;&lt;BR /&gt;If, as the file name suggests. it contains some properties of water, it should be easy to recreate it &lt;I&gt;ab initio&lt;/I&gt; . Software for calculating these properties is widely available.</description>
      <pubDate>Mon, 02 Aug 2010 14:34:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771984#M23059</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2010-08-02T14:34:31Z</dc:date>
    </item>
    <item>
      <title>Convert REAL*8 Unformatted Sequential file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771985#M23060</link>
      <description>Your original attachment is clearly truncated and covers only part of the REAl*8 (4,80,6,46) array. However, examination of the file in the VS editor shows a regular 2044 byte block structure, with each block having two bytes padding as the first two bytes (apart from the first, which has 4 bytes of padding). Within this regular block structure can be perceived a 2560-byte repeat pattern, corresponding to 4*80*8 bytes, which matches what you would expect if the file contains data for an array of REAL8* arrays each of dimension (4,80).&lt;BR /&gt;&lt;BR /&gt;I attach a small program which I have written to process the 2044 blocks to create a new binary file with 2042-byte records. This new binary file is then read to recreate the REAL*8 array. The program does no conversion of the data. It assumes that the ASCII code used in the file matches that used by windows and that the byte data are arranged MSB first, LSB last, i.e. if a number starts at byte N, byte N is assumed to be the MSB and byte N+7 is assumed to be the LSB. In a data record, byte N is to the left of byte N+1 and subsequent bytes.&lt;BR /&gt;&lt;BR /&gt;The program should be run in debug mode so that you can examine the content of the Real array R when the program reaches the PAUSE, to see if they make sense to you (assuming you have some idea of what magnitudes the numbers should be). Note that there is only enough data in the file to create an array of values of dimension (4,80,6,37). &lt;BR /&gt;&lt;BR /&gt;I attach the program for you to do with as you wish.</description>
      <pubDate>Mon, 02 Aug 2010 15:56:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771985#M23060</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2010-08-02T15:56:06Z</dc:date>
    </item>
    <item>
      <title>Convert REAL*8 Unformatted Sequential file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771986#M23061</link>
      <description>Thanks so much to Anthonyrichards and Steve, and others. I got much help from yours, Friends. Now, I find the &lt;BR /&gt;&lt;BR /&gt;solution for this problem.</description>
      <pubDate>Tue, 03 Aug 2010 12:52:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Convert-REAL-8-Unformatted-Sequential-file/m-p/771986#M23061</guid>
      <dc:creator>daweiwan</dc:creator>
      <dc:date>2010-08-03T12:52:43Z</dc:date>
    </item>
  </channel>
</rss>

