[comp.lang.fortran] Variable changing values entering a subroutine

oliver@athena.mit.edu (James D. Oliver III) (08/08/90)

I am running a program compiled under the UNIX f77 compiler.  The program
is a large one, but the pertinent lines are below:

-------------------------------start--------------------------------------
      program coilmodel
      parameter(ntracermax=50,nsolutemax=ntracermax+3,nconmax=4,
     $     nparamsmax=11,nnn=3,ntmax=50,ndimphimax=3,ndimcmax=3,
     $     ndimKmax=2,ndimlagmax=2)

      common/solute/rs(nsolutemax),D(nsolutemax),z(nsolutemax),
     $     H(nsolutemax),W(nsolutemax),caff(nsolutemax),Qinitial,
     $     nsolute,sngfr,cproaff,cproeff,snff,pia
      common/intvalues/yinitial,yfinal,nvar,eps,h1,hmin
				     .
				     .
				     .
				     .
      nvar=nsolute
      call clrancecalc
				     .
				     .
      stop
      end
***********************************************************************
      subroutine clrancecalc
      parameter(one=1.d0,eta=7.d-3,nparamsmax=11,
     $     ntracermax=50,nsolutemax=ntracermax+3,nnn=3)

      common/solute/rs(nsolutemax),D(nsolutemax),z(nsolutemax),
     $     H(nsolutemax),W(nsolutemax),caff(nsolutemax),Qinitial,
     $     nsolute,sngfr,cproaff,cproeff,snff,pia
      common/intvalues/yinitial,yfinal,nvar,eps,h1,hmin

C     INTEGRATE MASS BALANCE EQUATIONS OVER CAPILLARY LENGTH
      flow(nvar)=Qinitial/60.d0/1.d6
				     .
				     .
				     .
				     .
--------------------------end-------------------------------------



I am having a problem that I have traced using the dbx debugger to the
first line in clrancecalc.  The value "nsolute" changes upon entering the
subroutine:


----------------------------dbx output------------------------------
(dbx) run
[9] stopped in MAIN at line 212 in file "coilmodel.f"
  212         call clrancecalc
(dbx) print nvar,nsolute
26 26
(dbx) cont
[12] stopped in clrancecalc at line 307 in file "coilmodel.f"
  307         flow(nvar)=Qinitial/60.d0/1.d6
(dbx) print nvar,nsolute
26 -581903024
------------------------end dbx output--------------------------------

Is this a problem with memory?  Thanks in advance for any assistance.

____________________________
	Jim Oliver   
	oliver@athena.mit.edu /	joliver@hstbme.mit.edu
	oliver%mitwccf.BITNET@MITVMA.MIT.EDU