Pointers and dynamic data structures in Fortran 90/95  
Author Message
Michael Metcalf





PostPosted: 2006-5-19 5:46:02 Top

fortran, Pointers and dynamic data structures in Fortran 90/95
"deltaquattro" <email***@***.com> wrote in message
news:email***@***.com...
> Mr. Metcalf, I would like to get your book: on
>Amazon UK I see found two entries for "Fortran 90/95 Explained", one
>priced at ?15 and the other at ?217. Is it the same book?

Wow, I wish we got a cut of that incredible price! Seriously, all previous
versions are out of print and out of date. "Fortran 95/2003 Explained" is
the only one that we can recommend.

Regards,

Mike Metcalf


 
Michael Metcalf





PostPosted: 2006-5-19 5:46:00 Top

fortran >> Pointers and dynamic data structures in Fortran 90/95
"deltaquattro" <deltaquattro@hotmail.it> wrote in message
news:1147957764.491233.117100@u72g2000cwu.googlegroups.com...
> Mr. Metcalf, I would like to get your book: on
>Amazon UK I see found two entries for "Fortran 90/95 Explained", one
>priced at ?15 and the other at ?217. Is it the same book?

Wow, I wish we got a cut of that incredible price! Seriously, all previous
versions are out of print and out of date. "Fortran 95/2003 Explained" is
the only one that we can recommend.

Regards,

Mike Metcalf


 
David Flower





PostPosted: 2006-5-19 17:16:00 Top

fortran >> Pointers and dynamic data structures in Fortran 90/95
deltaquattro wrote:
> Hi,
>
> I am an engineer and for my job I need learn how to use pointers and
> dynamic data structures in Fortran 90/95. I know Fortran 77 and I have
> a good reference for Fortran 90/95, "Fortran 90/95 for Scientists and
> Engineers" by Stephen J. Chapman, 2nd ed. 2004. However, my problem is
> not the language itself, but the fact that I never programmed with
> pointers. I need some references which teaches how to do this, either
> using Fortran 90, or at least from a generic point of view, without
> referring to any particular languages. Instead, almost everything I
> found uses C or C++, and I'd rather not learn yet another language,
> since I already have to learn Fortran 90/95. Can you indicate something
> useful? Thank you very much,
>
> Greetings,
>
> Sergio Rossi

As a programmer with over 40 years of experience in FORTRAN, I have
only just found the need to use pointers.

It enables me to, effectively, set up two derived type variables which
share some of their components

Dave Flower

 
 
kus





PostPosted: 2006-5-19 21:43:00 Top

fortran >> Pointers and dynamic data structures in Fortran 90/95 >Allocatable Arrays are not
>allowed inside derived types. I think this omission has been fixed in F2003.
>Using pointers for aliasing array sub-objects and deeply embedded elements
>in data structures (which can have very long names) can be useful useful if
>used carefully - a bit like using EQUIVALENCE in F77, but more flexible.

I have "varied" expirience w/translation of the fololowing F90
construction:

TYPE mytype
INTEGER, DIMENSION(:), ALLOCATEABLE :: A
ENDTYPE


CVF 6.1, ifc 7.1 (Linux) says about synax error.
ifc 8.1(Linux), 9.0 (Windows) translates normally,and at least under
8.1 the executable program works. Modern CVF (6.5 ?) version was
translated by
my friend also successfully.

F90 standard supports here POINTER attribute (instead of ALLOCATEABLE),

but what is about ALLOCATEABLE itself ? May be it'll some new (in
comparison w/F95) extension for F2003?

BTW,sorry for previous erroneous sending of this message to separate
thread here.
Yours
Mikhail Kuzminsky
Zelinsky Institute of Organic Chemistry
Moscow

 
 
Michael Metcalf





PostPosted: 2006-5-19 22:10:00 Top

fortran >> Pointers and dynamic data structures in Fortran 90/95
<kus@free.net> wrote in message
news:1148046182.770459.183640@g10g2000cwb.googlegroups.com...
>
> TYPE mytype
> INTEGER, DIMENSION(:), ALLOCATEABLE :: A
> ENDTYPE
>
>
> CVF 6.1, ifc 7.1 (Linux) says about synax error.

You should update to CVF 6.6C, which is much better than that old
version, and allows the construct you're interested in. The update is free.

>
> F90 standard supports here POINTER attribute (instead of ALLOCATEABLE),
>
> but what is about ALLOCATEABLE itself ? May be it'll some new (in
> comparison w/F95) extension for F2003?
>

This feature is a standardized extension to Fortran 95 and is accepted by
virtually all recent compilers. It is part of Fortran 2003 (see "Fortran
95/2003 Explained", Ch. 12).

Regards,
Mike Metcalf


 
 
Jan Vorbr黦gen





PostPosted: 2006-5-19 22:42:00 Top

fortran >> Pointers and dynamic data structures in Fortran 90/95 >>CVF 6.1, ifc 7.1 (Linux) says about synax error.
> You should update to CVF 6.6C, which is much better than that old
> version, and allows the construct you're interested in. The update is free.

I believe I had to nicely ask Steve L. to give me a license to CVF 6.5 so
I could update to that version - from then on, the updates are free. Steve?

Jan
 
 
Steve Lionel





PostPosted: 2006-5-19 23:04:00 Top

fortran >> Pointers and dynamic data structures in Fortran 90/95 Jan Vorbr黦gen wrote:
> >>CVF 6.1, ifc 7.1 (Linux) says about synax error.
> > You should update to CVF 6.6C, which is much better than that old
> > version, and allows the construct you're interested in. The update is free.
>
> I believe I had to nicely ask Steve L. to give me a license to CVF 6.5 so
> I could update to that version - from then on, the updates are free. Steve?

The update from 6.1 to 6.5 was not free - if you're at 6.1, there is no
free upgrade to 6.6. I'm not sure under what circumstances I may have
helped Jan, and that had to be while I was still working for Compaq,
but whatever they were, I'm not able to do anything like that now.

The current version of Intel Fortran (9.1) fully supports this feature
and has fixed many bugs that relating to it that were present in CVF
6.6C.

Steve Lionel
Developer Products Division
Intel Corporation
Nashua, NH

User communities for Intel Software Development Products
http://softwareforums.intel.com/
Intel Fortran Support
http://developer.intel.com/software/products/support/

 
 
nospam





PostPosted: 2006-5-20 0:33:00 Top

fortran >> Pointers and dynamic data structures in Fortran 90/95 David Flower <DavJFlower@AOL.COM> wrote:

> As a programmer with over 40 years of experience in FORTRAN, I have
> only just found the need to use pointers.
>
> It enables me to, effectively, set up two derived type variables which
> share some of their components

It might or might not be relevant to your application, but this sounds
like exactly the kind of thing that type extension addresses. At least
in some code I have, I look forward to replacing some pretty messy hacks
with type extension when f2003 compilers are sufficiently widespread.

THat code of mine was what was in my mind when the light went on for me
as I was listening to John Cuthbertson's pitch on adding object-oriented
stuff to Fortran several years ago (must have been close to a decade ago
by now I suppose). Before that, I had not really been able to understand
why I would care about all that OOP stuff. But when I listened to John
explain it, my first sudden insight was that I had been doing some of
that stuff for a long time without knowing the buzzwords. My imediately
following thought was "you mean the compiler can help me with that stuff
instead of fighting me all the way?"

--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain