View previous topic :: View next topic |
Author |
Message |
StamK
Joined: 12 Oct 2016 Posts: 159
|
Posted: Wed Jun 14, 2017 1:36 pm Post subject: Allocatable character strings |
|
|
The following program (about allocatable character strings) works fine under Gfortran, but in Silverfrost it complains about " Colon found where not expected".
Code: |
PROGRAM test
IMPLICIT NONE
CHARACTER(len=:), allocatable :: CH
ALLOCATE(character(len=32) :: CH)
CH='HELLO'
print*,"ch=",CH
END PROGRAM test
| [/quote] |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1886
|
Posted: Wed Jun 14, 2017 3:18 pm Post subject: |
|
|
Your program uses a Fortran 2003 feature that FTN95, being mostly a Fortran 95 compiler, does not support.
Code: | $ gfortran -std=f95 ach.f90
ach.f90:5:15:
CHARACTER(len=:), allocatable :: CH
1
Error: Fortran 2003: deferred type parameter at (1)
ach.f90:8:9:
ALLOCATE(character(len=32) :: CH)
1
Error: Fortran 2003: typespec in ALLOCATE at (1)
ach.f90:9:2:
CH='HELLO'
1
Error: Symbol 'ch' at (1) has no IMPLICIT type
|
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Mon Feb 25, 2019 8:29 am Post subject: |
|
|
This Fortran 2003 feature has now been added to FTN95 for its next release. |
|
Back to top |
|
|
|