forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Allocatable character strings

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit
View previous topic :: View next topic  
Author Message
StamK



Joined: 12 Oct 2016
Posts: 159

PostPosted: Wed Jun 14, 2017 1:36 pm    Post subject: Allocatable character strings Reply with quote

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
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1884

PostPosted: Wed Jun 14, 2017 3:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7912
Location: Salford, UK

PostPosted: Mon Feb 25, 2019 8:29 am    Post subject: Reply with quote

This Fortran 2003 feature has now been added to FTN95 for its next release.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group