Emulating VAX structures 
Author Message
 Emulating VAX structures

VAX structures often map reasonably well to f90 derived types, but it
seems the real feature you want to use has to do with unions.  AFAIK,
unions cannot be implemented in f90 without an extension like VAX
structures with UNION/END UNION and MAP/END MAP.

-John

On Sat, 1 Jul 2000 00:43:09 +0100, "Sarah Dudley"

Quote:

>Using the VAX structure extension I was able to write code of the form

>structure /component/
>    real Al
>    real Fe
>    real Mg
>end structure

>structure /stream/
>    map
>        record /component/ c
>    end map
>    map
>        real comp(SIZE_OF_COMPONENT)
>    end map
>end structure

>and then write code using either
>    ThisStream.c.Al (etc)
>or
>    ThisStream.comp(i)
>or even
>    ThisStream.comp

>whichever was most readable at that point in the program.

>If I drop VAX structures, how do I do this in fortran 90 with types?

>Regards,

>Jeremy Dudley



Wed, 18 Jun 1902 08:00:00 GMT  
 Emulating VAX structures
Using the VAX structure extension I was able to write code of the form

structure /component/
    real Al
    real Fe
    real Mg
end structure

structure /stream/
    map
        record /component/ c
    end map
    map
        real comp(SIZE_OF_COMPONENT)
    end map
end structure

and then write code using either
    ThisStream.c.Al (etc)
or
    ThisStream.comp(i)
or even
    ThisStream.comp

whichever was most readable at that point in the program.

If I drop VAX structures, how do I do this in Fortran 90 with types?

Regards,

Jeremy Dudley



Wed, 18 Jun 1902 08:00:00 GMT  
 Emulating VAX structures
There are two products, KAP from Kuck and Associates
(www.kai.com) and Vast from Pacific-Sierra (www.psrv.com)
which automatically convert MAP and UNION to equivalenced
objects of derived types.

We are looking at a different approach, defining a function
or statement function to read parts of derived types.  The
most common use of MAP and UNION seems to be to define a
string across a complete record or sub-record for I/O, and
this could be done with statement functions to read from
the records and subroutines to write the data to them.

Does anyone know another way of handling this?

Best wishes,

John Collins

* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. how to create or to emulate an array of structures

2. Data structures and porting from VAX to LINUX

3. STRUCTURE/RECORD usage on VAX & SGI

4. Will f2c do VAX structures?

5. VAX Structure Support on IBM RS6K?

6. UNIX and VAX structure implementation similarities

7. Advice on porting to F90 from F77 w/VAX structure record extensions

8. Structure Chart for VAX/VMS F77

9. WANTED : structure chart generator for VAX/VMS

10. VAX FORTRAN Structure vs Common Block Performance

11. vax c to vax ada?

12. Ada digits / VAX Float Types (from INFO-VAX)

 

 
Powered by phpBB® Forum Software