replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Data Initialization
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 

Data Initialization

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
KL



Joined: 16 Nov 2009
Posts: 155

PostPosted: Mon Dec 20, 2010 3:51 pm    Post subject: Data Initialization Reply with quote

I have the following problem: the statement

DATA (a(i),i= 1,2 )/ 1., 2. /

works well, whereas the statement

DATA (a(1:2) )/ 1., 2. /

fails with the comment:

*** Not enough items after '=' in implied-DO loop
*** Compilation abandoned

Is this correct?

Best regards,

Klaus Lassmann


Code:
      Winapp

      Program Test53

        Implicit None

        Real , Dimension (10) :: a

!       Integer :: i

!       DATA  (a(i),i= 1,2 )/ 1., 2. /
        DATA  (a(1:2)      )/ 1., 2. /

        write (*,*) a(1:2)

      End Program Test53
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2621
Location: Sydney

PostPosted: Tue Dec 21, 2010 1:00 am    Post subject: Reply with quote

The alternatives I have listed appear to work. There is a problem with the extra brackets. I'm not sure why.
Code:
      Program Test53

        Implicit None

        Real , Dimension (10) :: a

!       Integer :: i

!       DATA  (a(i),i= 1,2 )/ 1., 2. /  ! ok
!       DATA  (a(1:2)      )/ 1., 2. /  !   extra brackets fail
        DATA  a(1:2)        / 1., 2. /  ! ok
!       DATA  a(1), a(2)    / 1., 2. /  ! ok

        write (*,*) a(1:2)

      End Program Test53
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Dec 21, 2010 10:09 am    Post subject: Reply with quote

I guess the answer is that it has the form of an implied DO loop but is incomplete.
Back to top
View user's profile Send private message AIM Address
KL



Joined: 16 Nov 2009
Posts: 155

PostPosted: Tue Dec 21, 2010 11:19 am    Post subject: Reply with quote

Paul, thank you very much for your quick reply. The solution helps me a lot.

Klaus
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support 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