School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,380 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,526 people online right now. Registration is fast and FREE... Join Now!




error in fortran90

 

error in fortran90

hamedpar

9 Jun, 2009 - 07:28 AM
Post #1

New D.I.C Head
*

Joined: 9 Jun, 2009
Posts: 5

program iso
implicit none
real , dimension(1000) :: St01,St02
integer :: k
real ::X1,X2

X1=0.05 (variable & Changeable)
X2=0.1 (variable & Changeable)

open(1,file='D:\X1\ST01_drift.txt')
open(2,file='D:\X2\ST02_drift.txt')

Do k = 1,1000
read(1,*) st01(k)
end do
Do k = 1,1000
read(2,*) st02(k)
end do
end program iso



X1 and X2 are variables & Changeable and should be defined as.
the problem is that their amount used in the address and it makes errors.
please help me to run this fortran correctly.thanks

User is offlineProfile CardPM
+Quote Post


bsaunders

RE: Error In Fortran90

9 Jun, 2009 - 10:11 AM
Post #2

D.I.C Addict
****

Joined: 18 Jan, 2009
Posts: 554



Thanked: 42 times
My Contributions
What kind of errors?
User is offlineProfile CardPM
+Quote Post

hamedpar

RE: Error In Fortran90

9 Jun, 2009 - 11:44 AM
Post #3

New D.I.C Head
*

Joined: 9 Jun, 2009
Posts: 5

QUOTE(bsaunders @ 9 Jun, 2009 - 10:11 AM) *

What kind of errors?


i should change X1 & X2 to string instead of number beacuse,but i don't know exactly waht to do,if you run it will show problems

This post has been edited by hamedpar: 9 Jun, 2009 - 11:46 AM
User is offlineProfile CardPM
+Quote Post

hamedpar

RE: Error In Fortran90

10 Jun, 2009 - 02:28 AM
Post #4

New D.I.C Head
*

Joined: 9 Jun, 2009
Posts: 5

QUOTE(bsaunders @ 9 Jun, 2009 - 10:11 AM) *

What kind of errors?


can you change number(X1 & X2) to string in fortran?
because they used in address they should be string
User is offlineProfile CardPM
+Quote Post

hamedpar

RE: Error In Fortran90

13 Jun, 2009 - 02:39 AM
Post #5

New D.I.C Head
*

Joined: 9 Jun, 2009
Posts: 5

QUOTE(hamedpar @ 9 Jun, 2009 - 07:28 AM) *

program iso
implicit none
real , dimension(1000) :: St01,St02
integer :: k
real ::X1,X2

X1=0.05 (variable & Changeable)
X2=0.1 (variable & Changeable)

open(1,file='D:\X1\ST01_drift.txt')
open(2,file='D:\X2\ST02_drift.txt')

Do k = 1,1000
read(1,*) st01(k)
end do
Do k = 1,1000
read(2,*) st02(k)
end do
end program iso



X1 and X2 are variables & Changeable and should be defined as.
the problem is that their amount used in the address and it makes errors.
please help me to run this fortran correctly.thanks








I had a problem on my program
this is my program:

program iso
implicit none

real , dimension(1000) :: St01,St02
integer :: k

X1=0.05 (variable & Changeable)
X2=0.1 (variable & Changeable)

open(1,file='D:\X1\ST01_drift.txt')
open(2,file='D:\X2\ST02_drift.txt')

Do k = 1,1000
read(1,*) st01(k)
end do

Do k = 1,1000
read(2,*) st02(k)
end do

end program iso


the problem is that my program can not read ST01_drift.txt and ST02_drift.txt form folders with name 0.05 and 0.1
in other words, folders 0.05 and 0.1 contains ST01_drift.txt and ST02_drift.txt
and in "open" comment, folders 0.05 and 0.1 should be opened with variables X1 and X2.
I don't know what kind of Variable X1 and X2 must be defined.for example REAL or CHARACTER or other things like these.

Sincerely yours
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 09:29PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month