From: e p chandler on 5 Jul 2010 16:20 "Felipe Abr�o" <felipeabrao(a)gmail.com> wrote in message news:bf5a29d3-df12-47e5-82bf-951daffefbea(a)u7g2000yqm.googlegroups.com... Please, could somebody explain me what is happening. I simply allocated a matrix called "a", but figured out that the program is inserting some strange values to some of its elements (like 1.057229231618489E-307 or 6.941570408926931E+228), even before I set any value to it! Shouldn't all the values be zero before any desired value setting? Below is my code, but you don't have to read it all. You can check the problem just after line 65, where I wrote a command in order to read the values of matrix "a". The same thing is happening with matrixs "b" and "c". In advance I thank you all! PS: I use Fortran 90 in Windows XP. [program snipped] In addition to my previous comments, I notice the program name is EXERCICIO, or "Exercise" (Portuguese?) so presumably you are a student. If so you may have available at little or no expense a compiler with good diagnostic capabilities. I did not take the time to read your long listing in any detail, but I would suggest using such a compiler and turning on all of its warnings for things such as un-initialized variables, array accesses out of bounds and string access out of bounds. As others have mentioned, for future reference, it's a very good idea to post a minimal program that shows the problem you are having. --- Elliot
From: robin on 5 Jul 2010 22:40
"Felipe Abr�o" <felipeabrao(a)gmail.com> wrote in message news:bf5a29d3-df12-47e5-82bf-951daffefbea(a)u7g2000yqm.googlegroups.com... >Please, could somebody explain me what is happening. I simply >allocated a matrix called "a", but figured out that the program is >inserting some strange values to some of its elements (like >1.057229231618489E-307 or 6.941570408926931E+228), even before I set >any value to it! You need to assign values to the array first, BEFORE you try to read out any values. |