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 

run time error 112, undefined element

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





PostPosted: Mon Dec 05, 2005 10:24 am    Post subject: run time error 112, undefined element Reply with quote

When I compile/build/run the code, it gives an error with code:
112, undefined array elements. When I use debug, I found that during the transfer of an array
to the subroutine, some of the elements are mysteriously undefined, where the data
array was all defined in the routine that calls this sub-routine.

When I run the same program with much less array size, it will go
through.

Any suggestion on this,
Thanks!



Yan
Back to top
PaulLaidler
Site Admin


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

PostPosted: Mon Dec 05, 2005 2:07 pm    Post subject: run time error 112, undefined element Reply with quote

Yan

If you can post a short working program that illustrates the problem, we will try to fix it for you.

Paul
Back to top
View user's profile Send private message AIM Address
Anonymous
Guest





PostPosted: Wed Dec 07, 2005 4:38 pm    Post subject: run time error 112, undefined element Reply with quote

The problem is that in the iteration (Rectangular_exec), the first, say 20 iterations are OK, when coming to 21, this error jumps out and some array element is not defined in my subroutine. This is wierd, because it just repeat the previous process.

I post this program, which is cut from my original program. (My original program is very long), However when I run this small version program, it is OK, the error is not shown. For my original program the problem occures when FOUR1 is called. again error code 112. Could you point out anything from this short version, which again runs OK.

program MainPulse

implicit none

integer maxtaupts,maxxpts,maxypts
integer maxptval
parameter (maxtaupts=256)
parameter (maxxpts=150)
parameter (maxypts=150)
parameter (maxptval=max(maxTauPts,maxxPts,maxyPts))

real c0, alpha, n_ab, fc, freqband, fs, df
real fdy, ZrayX
real Xmax, Ymax
integer numtaupts,numxpts,numypts, xppts,yppts
real dsigib, dsigcn, ibfdsigrange, sigmax
real taumin, dtau
real Gy,fxy, dx, dy
integer mexpo, cycles, Ynorm

c workspaces
real pr(0:maxtaupts,0:maxxpts,0:maxypts)
real tau(0:maxtaupts)
real Pdata(1:maxTaupts)


call rectangular_input (numTaupts,dTau,Taumin,
+ numXpts,numYpts,Xmax,Ymax,xppts,yppts,dx,dy,
+ Gy, fxy, Ynorm, fdy, ZrayX,
+ dsigib,dsigcn,sigmax,ibfdsigrange,
+ c0,alpha,n_ab,fc,df,freqband,cycles,mexpo)

call Rectangular_initialize (numtaupts,numxpts,
+ numypts,dtau,taumin,dx,dy,Gy,fxy,xppts, yppts,
+ Ynorm, cycles, mexpo, pr, tau)

call Rectangular_exec (numTaupts,dTau,
+ numXpts,numYpts, Xmax,Ymax,
+ xppts,yppts,dx,dy,Gy,fxy, Ynorm,
+ dsigib,dsigcn,sigmax,ibfdsigrange,
+ c0,alpha,n_ab,fc,df,freqband,cycles,mexpo,
+ fdy,ZrayX,pr,tau,Pdata)


stop
end

c ============================================================

subroutine rectangular_input (numTaupts,dTau,Taumin,
+ numXpts,numYpts,Xmax,Ymax,xppts,yppts,dx,dy,
+ Gy, fxy, Ynorm, fdy, ZrayX,
+ dsigib,dsigcn,sigmax,ibfdsigrange,
+ c0,alpha,n_ab,fc,df,freqband,cycles,mexpo)

implicit none
c subroutine's output arguments
integer numTauPts,numXpts,numYpts,xppts,yppts
real Xmax, Ymax, dx, dy, Gy, fxy
real fdy, ZrayX, dTau, Taumin
real dsigib, dsigcn, sigmax, ibfdsigrange
real c0, alpha, n_ab, fc, freqband, fs, df
integer cycles, mexpo, Ynorm
c internal variables
real dt, Taumax, Tauwindowc, pi, rtmp1
real sigma, length, width
integer N, i, j

C {BEGIN}
pi = acos(-1.0)

c0=2440
alpha=3
n_ab=2
cycles=3
mexpo=1
fc=5000000
freqband=1
length=0.015
width=0.005
fxy = length/width
Ynorm = 1
ZrayX=pi*fc/c0*(length/2)**2
fdy=0.01
Gy = pi*fc/c0*(width/2)**2/fdy

xppts=10
dx = 1.0/float(xppts)
yppts=1/((2/Gy)/20)
dy = 1.0/float(yppts)
rtmp1 = cycles*pi*(log(1000.0))**(1.0/(2.0*mexpo))
taumax = (rtmp1+ 24.0*pi) / (2.0*pi)
taumin=(-(Gy+rtmp1+6.0*pi))/(2.0*pi)
tauwindowc = taumax - taumin
taumax = taumax * 2.0 * pi
taumin = taumin * 2.0 * pi
numTauPts = 256
dtau = (taumax-taumin)/float(numtaupts)
fs = 1/(dtau/(2*pi*fc))
dt = 1/fs
df = fs/float(numTaupts)
xmax = 10
ymax = 3
numxpts = nint( xmax* float(xppts))
numypts = nint( ymax* float(yppts))

sigmax=2
ibfdsigrange=0.1
dsigib=0.0005
dsigcn=0.002

RETURN
END

c ============================================================
subroutine rectangular
Back to top
PaulLaidler
Site Admin


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

PostPosted: Thu Dec 08, 2005 12:56 am    Post subject: run time error 112, undefined element Reply with quote

Yan

Thanks for this but the only way we can offer to help you is if you can post a small program that shows the problem.

Paul
Back to top
View user's profile Send private message AIM Address
Anonymous
Guest





PostPosted: Mon Dec 12, 2005 8:53 am    Post subject: run time error 112, undefined element Reply with quote

Paul:

It is hard for me to post a small program to illustrate the problem, because it disappear if I cut the program to a ashort version. It seems associated with the problem of defination of REAL. In the calculation if the result exceeds the limit say: +-1.7e-38, and it is output to a REAL element, was it going to appear as undefined ?

Thanks!
Back to top
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