Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Silly Problem with array

Status
Not open for further replies.
Apr 4, 2006
1
US
i'm doing a cfd project in fortran for a class and i am having the silliest problem. I use salford's F95 compiler with Plato IDE. I declare a matrix with:

real uold(nx,nx),unew(nx,nx)

and i have to initialize it with certain values at the "boundaries" however if i put in a number bigger that 100 it stores a garbage number for some reason so when i print it to a file i get ****** in the place of the number.

heres how i'm trying to assign a value


do j=1,22
uold(i,j)= 300.
unew(i,j)= 300.
end do
end do

i've tried everything i know with no avail. Please Help
 
Where is do i loop header? Print (check up) nx value and arrays extents before initialization.
 
try like this

do j=1,22
do i=1, somevalue
uold(i,j)=300
unew(i,j)=300
end do
end do
Take care of the format when you print it.
Print(fileno,*)...default printing....or if it integer of size 3 you can use Print(fileno,100I3)...hope you have not more than 100 rows.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top