Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Character

Intel_C_Intel
Employee
508 Views
Two easy questions
First one:
Is there a difference between the following two character declarations
character :: text*80
character(len=80) :: text

second one:
can I declare a character also as allocatable ?

Thanks

0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
508 Views
1. There's no difference

2. Yes and no. You can declare an array of character(LEN=fixed_len) to be allocatable, but in F95 characters cannot have allocatable length. Allocatable-length characters will be part of Fortran 2003 (draft is available here). Intel plans are to add F2003 features gradually -- Steve could perhaps tell you better when is this one "scheduled".

Currently, in F95, character(1), allocatable:: can do for certain purposes, but its semantics is different and they're far less useful than real strings, and future character(len=:) feature.

There are also several implementations of ISO_VARYING_STRINGS module on the net -- Google 'em.

Jugoslav
0 Kudos
Reply