fortran syntax question 
Author Message
 fortran syntax question

Hello all,

I'm having a bit of trouble figuring out what wrong with the following
syntax.  I'm declaring allocatable arrays in a module as follows,

     integer,dimension(:),allocatable :: index_list

This statement (and many more like it) compiles just fine with the
portland group f90 compilier I'm using.  However, the intel f95 compiler
returns the following

     integer,dimension(:),allocatable :: index_list
                          ^
Error 24 at (19:gluon_ops/plaq_act_0b_2d.f90) : syntax error

Any thoughts?

                                Matthew Nobes



Sat, 24 Sep 2005 07:18:51 GMT  
 fortran syntax question

Quote:

> Hello all,

> I'm having a bit of trouble figuring out what wrong with the following
> syntax.  I'm declaring allocatable arrays in a module as follows,

>      integer,dimension(:),allocatable :: index_list

> This statement (and many more like it) compiles just fine with the
> portland group f90 compilier I'm using.  However, the intel f95 compiler
> returns the following

>      integer,dimension(:),allocatable :: index_list
>                           ^
> Error 24 at (19:gluon_ops/plaq_act_0b_2d.f90) : syntax error

> Any thoughts?

>                                 Matthew Nobes

This ought to be perfectly legal fortran! Does this occur in
an isolated little program too? Then it must be a bug in the
compiler. If it does not, then I suspect that something else
is upsetting the compiler instead.

Try to reduce the code to as little as possible that will
still produce this error. Maybe that will highlight what is
wrong.

Regards,

Arjen



Sat, 24 Sep 2005 14:25:34 GMT  
 fortran syntax question
Hi Mat,
  might be a very strict compiler... try this instead and let me know.

  integer, allocatable, dimension(:) :: index_list

or

  integer, allocatable :: index_list(:)

Ciao,
Federico


Quote:
> Hello all,

> I'm having a bit of trouble figuring out what wrong with the following
> syntax.  I'm declaring allocatable arrays in a module as follows,

>      integer,dimension(:),allocatable :: index_list



Sun, 25 Sep 2005 13:38:56 GMT  
 fortran syntax question

Quote:


> > I'm having a bit of trouble figuring out what wrong with the following
> > syntax.  I'm declaring allocatable arrays in a module as follows,

> >      integer,dimension(:),allocatable :: index_list

>   might be a very strict compiler... try this instead and let me know.

>   integer, allocatable, dimension(:) :: index_list

> or

>   integer, allocatable :: index_list(:)

While those might work (I haven't tried), I don't know what you mean by
"strict" here.  All three forms are completely standard (I might say strict)
f90 and are equivalent.  If a compiler accepted one, but not the others,
I'd use the term "buggy" instead of "strict".

--
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



Sun, 25 Sep 2005 23:04:02 GMT  
 fortran syntax question

Quote:



>> > I'm having a bit of trouble figuring out what wrong with the following
>> > syntax.  I'm declaring allocatable arrays in a module as follows,

>> >      integer,dimension(:),allocatable :: index_list


>>   might be a very strict compiler... try this instead and let me know.

>>   integer, allocatable, dimension(:) :: index_list

>> or

>>   integer, allocatable :: index_list(:)

> While those might work (I haven't tried), I don't know what you mean by
> "strict" here.  All three forms are completely standard (I might say
> strict)
> f90 and are equivalent.  If a compiler accepted one, but not the others,
> I'd use the term "buggy" instead of "strict".

Compiles fine with my Intel compiler.


Sun, 25 Sep 2005 23:18:57 GMT  
 fortran syntax question

Quote:

> >   might be a very strict compiler... try this instead and let me know.

> >   integer, allocatable, dimension(:) :: index_list

> > or

> >   integer, allocatable :: index_list(:)

> While those might work (I haven't tried), I don't know what you mean by
> "strict" here.  All three forms are completely standard (I might say
strict)
> f90 and are equivalent.  If a compiler accepted one, but not the others,
> I'd use the term "buggy" instead of "strict".

By strict I meant not flexible... that means not open to all syntax
options...

Ciao,
Federico



Mon, 26 Sep 2005 15:00:36 GMT  
 fortran syntax question

Quote:

> Hello all,

> I'm having a bit of trouble figuring out what wrong with the following
> syntax.  I'm declaring allocatable arrays in a module as follows,

>      integer,dimension(:),allocatable :: index_list

> This statement (and many more like it) compiles just fine with the
> portland group f90 compilier I'm using.  However, the intel f95 compiler
> returns the following

>      integer,dimension(:),allocatable :: index_list
>                           ^
> Error 24 at (19:gluon_ops/plaq_act_0b_2d.f90) : syntax error

> Any thoughts?

Yes.  Which compiler are you using here.  So that we know which one *not* to buy :-)


Mon, 26 Sep 2005 18:49:02 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Fortran syntax question (involving **)

2. Fortran 77 syntax question

3. Syntax Questions for a new language with somewhat Smalltalk-like syntax

4. block syntax/def syntax question/suggestion

5. Implementing letrec-syntax using only let-syntax and syntax-rules

6. Fortran syntax

7. paper comparing Fortran 90, C++, Matlab syntax

8. SOFTWARE: ftnchek 2.9 for OS/2 (FORTRAN syntax checker)

9. how did fortran settle on the syntax: string(index1)(index2)

10. where can I find abstract syntax definition of Fortran

11. WITH syntax in Fortran?

12. fortran syntax

 

 
Powered by phpBB® Forum Software