* unformatted data conversion problem
@ 1998-11-02 5:00 jim harsh
1998-11-03 5:00 ` Steve Lionel
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: jim harsh @ 1998-11-02 5:00 UTC (permalink / raw)
I have a large number of data files that were written on VAX/VMS
with fortran as unformatted data, The data is floating point data.
I have tried to use fortran on our alpha platform running DECUnix
to convert the data. I used the convert option for the open
staement and I have tried the convert option during compile.
Neither work. If I do an OD before and after, nothing is changed,
regadless of the option used.
If I try to manually swap the byte order, I can get can get close to
the proper values.
Any ideas concerning the conversion of unformatted floating point data
from a VMS system to Unix floating point data?
TIA
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: unformatted data conversion problem
1998-11-02 5:00 unformatted data conversion problem jim harsh
@ 1998-11-03 5:00 ` Steve Lionel
1998-11-03 5:00 ` Paul Hughett
1998-11-04 5:00 ` jim harsh
2 siblings, 0 replies; 4+ messages in thread
From: Steve Lionel @ 1998-11-03 5:00 UTC (permalink / raw)
jim harsh wrote in message <363DE8DE.A88F6754@lanl.gov>...
>I have a large number of data files that were written on VAX/VMS
>with fortran as unformatted data, The data is floating point data.
>
>I have tried to use fortran on our alpha platform running DECUnix
>to convert the data. I used the convert option for the open
>staement and I have tried the convert option during compile.
>
>Neither work. If I do an OD before and after, nothing is changed,
>regadless of the option used.
>
>If I try to manually swap the byte order, I can get can get close to
>the proper values.
>
>Any ideas concerning the conversion of unformatted floating point data
>from a VMS system to Unix floating point data?
I can't figure out exactly what you tried. CONVERT='VAXD' (or 'VAXG'.
perhaps) should be sufficient to convert the data, as long as your READ
statements specify individual variables or arrays, not RECORDs. If the file
was written UNFORMATTED on VAX it is probably a 'SEGMENTED' file, which CAN
be read on UNIX if special care is taken transferring the data. It is
important that the RMS record lengths be preserved - if you are using UCX, a
PUT/RAW in FTP will do this. Standard methods of copying the files will
lose the data.
I suggest reading http://www.digital.com/fortran/kb/q1022.html - while this
was written from the perspective of DIGITAL Visual Fortran, the same issues
apply to you using DIGITAL UNIX.
Steve Lionel mailto:Steve.Lionel@digital.com
DIGITAL Fortran Development http://www.digital.com/info/slionel.html
Compaq Computer Corporation
110 Spit Brook Road, ZKO2-3/N30
Nashua, NH 03062-2698 "Free advice is worth every cent"
DIGITAL Fortran web site: http://www.digital.com/fortran
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: unformatted data conversion problem
1998-11-02 5:00 unformatted data conversion problem jim harsh
1998-11-03 5:00 ` Steve Lionel
@ 1998-11-03 5:00 ` Paul Hughett
1998-11-04 5:00 ` jim harsh
2 siblings, 0 replies; 4+ messages in thread
From: Paul Hughett @ 1998-11-03 5:00 UTC (permalink / raw)
jim harsh (harsh@lanl.gov) wrote:
: I have a large number of data files that were written on VAX/VMS
: with fortran as unformatted data, The data is floating point data.
: I have tried to use fortran on our alpha platform running DECUnix
: to convert the data. I used the convert option for the open
: staement and I have tried the convert option during compile.
: Neither work. If I do an OD before and after, nothing is changed,
: regadless of the option used.
: If I try to manually swap the byte order, I can get can get close to
: the proper values.
: Any ideas concerning the conversion of unformatted floating point data
: from a VMS system to Unix floating point data?
Yes. The VAX uses its own format(s) for floating point data. So look
up the details of the most likely format, read the data byte by byte,
twiddle the bits as necessary to convert to the native float format on
the machine reading the data, then either use the data or write it
back out in the native format. This could probably be done in FORTRAN
but would be easier in C, once you know the VAX format; you will need
to have a reasonable understanding of machine architecture and
assembly language, although not the ability to actually write
assembler. Better yet, find someone who's already done this and ask
if you can use his code.
If you can't find the VAX floating point formats, let me know; I have
them around here someplace and should be able to make you a copy.
Paul Hughett
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: unformatted data conversion problem
1998-11-02 5:00 unformatted data conversion problem jim harsh
1998-11-03 5:00 ` Steve Lionel
1998-11-03 5:00 ` Paul Hughett
@ 1998-11-04 5:00 ` jim harsh
2 siblings, 0 replies; 4+ messages in thread
From: jim harsh @ 1998-11-04 5:00 UTC (permalink / raw)
jim harsh wrote:
Typically of the way things work for me. I had started this project by
tring to modify another piece of code. once I changed the input buffer
to expect floats rather than char*4's the convert option on the open
statement worked fine,
Thanks for the help,and sorry for the wasted bandwidth.
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1998-11-04 5:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-11-02 5:00 unformatted data conversion problem jim harsh
1998-11-03 5:00 ` Steve Lionel
1998-11-03 5:00 ` Paul Hughett
1998-11-04 5:00 ` jim harsh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox