Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28435 Discussions

"...unspecified error..." during execution

BillAvery
Beginner
433 Views

I am getting an "unspecified error...." message from the valueEps and valueMod arrays in the subroutine below. The code compiled with no errors. The attached file has the output from the "Locals" window in Visual Studio. I am wondering if anybody has seen anything like this before. I can't figure it out.

 

subroutine Egen(N,IMAT,Emat,YIELD,alpha,ROexp)
implicit real*8(A-H,O-Z)
COMMON/ROGEN/valueEps(100,4),valueMOD(100,4)
Dimension stress(100)
write(7,100)
valueEps(1,IMAT) = 0.0
valueMOD(1,IMAT) = Emat
stress(1)=1000.0
Do 10 i=2,N
stress(i)=Float(i)*1000.
val1=stress(i)/Emat
val2=alpha*(stress(i)/YIELD)**ROexp
val3=val1+val2
valueEps(i,IMAT) = val3
valueMOD(i,IMAT) = (stress(i)-stress(i-1))/(valueEps(i,IMAT)
& -valueEps(i-1,IMAT))
write(7,200) i,stress,valueEps(i,IMAT),valueMOD(i,IMAT)
10 continue
return
100 format(5x,"I",5x,"Stress",5x,"valEps",5x,"valMOD")
200 format(1x,I4,5x,F7.0,2(5x,e12.5))
end

 

 

 

0 Kudos
3 Replies
mecej4
Honored Contributor III
421 Views

You should probably replace

 

write(7,200) i,stress,valueEps(i,IMAT),valueMOD(i,IMAT)

 

by

 

write(7,200) i,stress(i),valueEps(i,IMAT),valueMOD(i,IMAT)

 

When you next post some source code, please use the code button "</>" . If you do not do so, and post into the body of your message, the code can be corrupted and difficult to read. As you can see from your post, if someone wants to run the compiler on your code, they will have to restore all the formatting (six leading  blanks in most lines, continuation marks in column 6, etc.) before they can try compiling the code.

The behavior of the code in a subroutine may depend on the values of the arguments. Your subroutine, for example, would abort with a runtime error if the value of YIELD happens to be zero or negative. That is why it is important for you to provide information that is as complete as possible and reasonable to enable the program to be run and the errors reproduced.

BillAvery
Beginner
391 Views

Thank you for that catch. I was paying so much attention to those arrays that I did not see the mistake with stress(i). I am kind of surprised that the compiler did not flag that as an error. I fixed that and the code gave me the correct result, even though the unspecified error still showed up.  Go figure....

I did not know about that flag for inputting code. Thanks. 

0 Kudos
andrew_4619
Honored Contributor II
384 Views

It is not a compile error the array without the element number just outputs all of the array. The error is at run time if the format does not match the i/o list.

0 Kudos
Reply