Fortran Error; forrtl: severe (408): fort(2) -
i can build project fine (ia-32 os, windows 7. intel visual fortran 11.1.048 integrated microsoft visual studio 2008). when run .exe file gives following error:
forrtl: severe (408): fort(2): subscript #1 of array dproductidev has value 5 greater upper bound of 4 it says error happening in function clcmata when calculating clcmata in final lines (i have marked see below). function code is:
function clcmata(cstress,d,i_dev,dtime,props,ndi,ntens) implicit none integer :: ndi,ntens real*8 :: z(2,ntens), dproductidev(ntens,ntens), & clcmata(ntens,ntens),d(ntens,ntens),i_dev(ntens,ntens),& cstress(ntens),dproductsigmadev2(ntens,ntens),& sigmadevdyadicproduct(ntens,ntens),identity(ntens,ntens),& sigmadev(ntens),props(5),alpha, beta,dtime,coeff_1,coeff_2,coeff_3 call identitymatrix(identity,ntens) if (normm(cstress,ntens)==0) clcmata = identity else alpha = expvalvolume/(2*expvaldstran) beta = (6*expvalvolume/(pi*expvalpstran))**(1/props(4))*props(3) sigmadev = dev(cstress,i_dev,ntens) dproductidev = matmul(d,i_dev) i=1,ntens j=1,ntens sigmadevdyadicproduct(i,j)= sigmadev(j)*sigmadev(i) end end dproductsigmadev2 = matmul(d,sigmadevdyadicproduct) call zvals(z,sigmadev,props,ntens) i=1,ntens j=1,ntens clcmata(i,j) = identity(i,j) + dtime*( (alpha+beta* & normm(sigmadev,ntens)**(1./props(4)-1.))*dproductidev(i,j) + & ! line causing error beta*(1./props(4)-1.)*normm(sigmadev,ntens)**(1./props(4)-3.)* & dproductsigmadev2(i,j) ) end end end if end function variables i,j,expvalvolume,expvaldstran , expvalpstran defined in module in function clcmata, dev, identitymatrix , normm contained.
ntens value, upper bound of subscripts, passed on function value of 4. checked in break mode , checks out. replaced ntens 4!!! in calculating clcmata got same error.
i printed parameters passed function , came accross weird. d should symmetric matrix , have following components:
d: 174999994368.000 74999996416.0000 74999996416.0000 0.000000000000000e+000 74999996416.0000 174999994368.000 74999996416.0000 0.000000000000000e+000 74999996416.0000 74999996416.0000 174999994368.000 0.000000000000000e+000 0.000000000000000e+000 0.000000000000000e+000 0.000000000000000e+000 49999998976.0000 d: 174999994368.000 74999996416.0000 74999996416.0000 1.853911331209891e-307 74999996416.0000 174999994368.000 74999996416.0000 2.228101728310706e-312 74999996416.0000 74999996416.0000 174999994368.000 7.115376174740906e-307 1.879376978297863e-307 0.000000000000000e+000 0.000000000000000e+000 49999998976.0000 so changed d should be, got same error again.
(i have use type of variable because function called indirectly commercial finite element software (abaqus) , type of exchanged variables should match. tried real(8), yet nothing changed.)
i don't know happeining there. idea?
summary: variables should local declared module variables. leads of using same variables in different scopes use module (use association) or inside module (host association).
variables, independent particular scope (e.g. procedure) should declared in particular scope. otherwise different procedure called can inadvertently change value used in calling scope.
Comments
Post a Comment