Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Compaq Visual Fortran 6.6 to read UNIX unformatted file
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Chien-hui Liu  
View profile  
 More options Sep 16 2002, 9:53 pm
Newsgroups: comp.lang.fortran
From: ch...@tit.edu.tw (Chien-hui Liu)
Date: 16 Sep 2002 18:53:47 -0700
Local: Mon, Sep 16 2002 9:53 pm
Subject: Compaq Visual Fortran 6.6 to read UNIX unformatted file
Hi,

1. I ran the following file on IBM AIX.  

program xxx

real*4 a(13)

.......processing

do j=1,20
write(10)(a(i),i=1,13)
end do

stop
end

2. Then I transfer back to Windows 2000. Try to use Compaq Visual
Fortran 6.6 to read it with the following file:

program xxx

real*4 a(13)

open(11,file='fort.10',status='old',form='unformatted')
do j=1,20
write(10)(a(i),i=1,13)
end do

stop
end

Then error message shows "illegal structure for unformatted".
I've noticed the file size is 1200bytes on IBM AIX.
If I ran the same program in Windows 2000 by Compaq VF6.6, then the
output file size is 1082bytes.  If there's no extra data, it should be
4*13*20=1040bytes.
How come there's difference between the outputs of UNIX and Windows
2000?

How to read the unformatted file ran by UNIX by using visual fortran?
Could someone do me a favor?
Thank you very much.

Chien-hui Liu


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jan C. Vorbrüggen  
View profile  
 More options Sep 17 2002, 3:49 am
Newsgroups: comp.lang.fortran
From: Jan C. Vorbrüggen <jvorbrueg...@mediasec.de>
Date: Tue, 17 Sep 2002 09:49:36 +0200
Local: Tues, Sep 17 2002 3:49 am
Subject: Re: Compaq Visual Fortran 6.6 to read UNIX unformatted file
- How did you transfer the file?
- I know Wintel is little-endian, I suspect the AIX machine is big-endian.

        Jan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob James  
View profile  
 More options Sep 17 2002, 7:35 am
Newsgroups: comp.lang.fortran
From: Rob James <rbja...@sympatico.ca>
Date: Tue, 17 Sep 2002 07:26:50 -0400
Local: Tues, Sep 17 2002 7:26 am
Subject: Re: Compaq Visual Fortran 6.6 to read UNIX unformatted file

Jan C. Vorbrüggen wrote:
> - I know Wintel is little-endian, I suspect the AIX machine is big-endian.

Yes, they have opposite endianness, alright.  Most of us who have dealt
with both have run into that realization at some point.  And don't
expect those record markers to be the same between CVF and XLF for
unformatted record files, either (not that I know for sure that they are
different).  That would account for the file size discrepancy, and the
error message about the structure of the file not being valid for CVF.

--
Rob James


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Van Buskirk  
View profile  
 More options Sep 17 2002, 3:55 pm
Newsgroups: comp.lang.fortran
From: "James Van Buskirk" <not_va...@attbi.com>
Date: Tue, 17 Sep 2002 18:57:58 GMT
Local: Tues, Sep 17 2002 2:57 pm
Subject: Re: Compaq Visual Fortran 6.6 to read UNIX unformatted file

"Chien-hui Liu" <ch...@tit.edu.tw> wrote in message

news:5e084a37.0209161753.5db571fa@posting.google.com...

> Then error message shows "illegal structure for unformatted".
> I've noticed the file size is 1200bytes on IBM AIX.
> If I ran the same program in Windows 2000 by Compaq VF6.6, then the
> output file size is 1082bytes.  If there's no extra data, it should be
> 4*13*20=1040bytes.
> How come there's difference between the outputs of UNIX and Windows
> 2000?

It is most certainly possible to read the file in CVF, but
it will likely take some effort to do so.  The court of last
appeal would be to open the file with FORM='BINARY' and
CONVERT='BIG_ENDIAN' in CVF which would allow you to read
the file if you can figure out what the extra data does so
that you could throw it out as it is read.  You might find
things to be easier if you could change the kind of file you
write in AIX.  If possible, I would look at the documentation
for the OPEN statement on both compilers to see if I could
find some extensions that make the two more compatible.  As
alluded to above, the CONVERT and FORM specifiers are what
I would look at on the CVF side; hopefully you can find
something that makes sense on the AIX side.  Would be nice
if both sides read and wrote IEEE-754 floating point...

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »