Re: PV-Wave, Fortran & Windows NT [message #11490] |
Thu, 02 April 1998 00:00 |
Ferdinando Iavarone
Messages: 10 Registered: October 1997
|
Junior Member |
|
|
Dave Greenwood ha scritto:
> open(13, file='intdat.dat, form='unformatted')
Hi,
I write IDL unformatted data and I read it with
VF 90 using open(.......,form='binary').
Please send me notice.
Good work.
--
Nando Iavarone
Gruppo Telerilevamento
Dipartimento Interateneo di Fisica
Via Amendola, 173
70126 BARI
ITALY
Tel.: +39 80 5443166
Fax.: +39 80 5443165
e_mail: iavarone@axpba0.ba.infn.it
|
|
|
Re: PV-Wave, Fortran & Windows NT [message #11492 is a reply to message #11490] |
Thu, 02 April 1998 00:00  |
wmc
Messages: 117 Registered: February 1995
|
Senior Member |
|
|
In article 16450809@feda01.fed.ornl.gov, greenwoodde@feda01.fed.ornl.gov (Dave Greenwood) writes:
> I apologize for posting such a trivial question, but I don't have access
> to a system with PV-Wave and I'm trying to help a friend who claims to
> have only limited programming skills at best. My friend has a file
> written from PV-Wave (v6.1) on a Windows NT system and wants to read
> that file using a Fortran (Digital Visual Fortran 5.0) program.
Fortran puts (when writing, and expects, when reading) a word containing the
length of the record at the start and end of each unformatted record (at least,
is does on unix). Running IDL (/PVWAVE) on unix you use "/f77" on the openw
command (tell your friend to read the manual for "open") but the manual *claims*
this is a unix-only command, though why its not available on windows I'm not sure.
You could explicitly write the length info that fortran expects, though this is
messy. Another problem you may have is: why do you expect binary compatibility
between windows and unix?
All in all, you're probably better off writing out the data formatted, unless there
is really huge amounts of it.
- William
---
William M Connolley | wmc@bas.ac.uk | http://www.nbs.ac.uk/public/icd/wmc/
Climate Modeller, British Antarctic Survey | Disclaimer: I speak for myself
|
|
|
Re: PV-Wave, Fortran & Windows NT [message #11497 is a reply to message #11490] |
Wed, 01 April 1998 00:00  |
Martin Schultz
Messages: 515 Registered: August 1997
|
Senior Member |
|
|
Dave Greenwood wrote:
>
> I apologize for posting such a trivial question, but I don't have access
> to a system with PV-Wave and I'm trying to help a friend who claims to
> have only limited programming skills at best. My friend has a file
> written from PV-Wave (v6.1) on a Windows NT system and wants to read
> that file using a Fortran (Digital Visual Fortran 5.0) program.
>
> The test PV-Wave program is
>
> openw, 10, 'intdat.dat'
> writeu, 10, indgen(11,1)
> close, 10
>
> I would expect that the following Fortran program would read that file:
>
> integer idata(11)
> open(13, file='intdat.dat, form='unformatted')
> read(13) idata
> close(13)
>
> Is there any reason that Fortran program shouldn't read the PV-Wave
> file? My friend claims it doesn't work but as yet he hasn't given me
> the exact error messages he gets (he's halfway 'round the world so it
> takes forever to get the things tried exactly as I'd like them.)
>
Here is what the IDL online help has to say about this:
(OPENW; keywords)
F77_UNFORMATTED
Unformatted variable-length record files produced by Unix FORTRAN
programs contain extra information along with the data in order to allow
the data to be properly recovered. This method is necessary because
FORTRAN input/output is based on record-oriented files, while Unix files
are simple byte streams that do not impose any record structure. Set the
F77_UNFORMATTED keyword to read and write this extra information in the
same manner as f77(1), so that data to be processed by both IDL and
FORTRAN. See "UNIX-Specific Information" on page 199 of BuildingIDL
Applications for further details.
This keyword is only valid on Unix platforms though.
Hope it helps,
Martin
------------------------------------------------------------ -------
Dr. Martin Schultz
Department for Earth&Planetary Sciences, Harvard University
186 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA
phone: (617)-496-8318
fax : (617)-495-4551
e-mail: mgs@io.harvard.edu
IDL-homepage: http://www-as.harvard.edu/people/staff/mgs/idl/
------------------------------------------------------------ -------
|
|
|