[2407] in Athena Bugs

home help back first fref pref prev next nref lref last post

f77 compiler for RT

daemon@ATHENA.MIT.EDU (oliver@ATHENA.MIT.EDU)
Mon Jun 19 05:53:47 1989

From: <oliver@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU
Date: Mon, 19 Jun 89 05:53:16 EDT

This is a second addendum for a bug report of 16 June 89 submitted by
drmorris@athena.mit.edu.  As far as the problems with the RT compiler goes,
I have localized the bug to some sort of difference in the following two
basically similar subroutines.  The first subroutine, chisqcalc, is
successfully compiled using the f77 -c -O command.  The second subroutine,
chisqcalc1, returns the message:

chisqcalc1.f, line 45: compiler error: Non-float 027 (arg 0) to build_arg

compiler error.

Compilation exited abnormally with code 1 at Mon Jun 19 05:50:59


CHISQCALC:
*****************************************************************
C     FUNCTION TO CALCULATE CHI-SQUARED VALUES FROM PARAMETER VECTOR
      double precision function chisqcalc(bbb)
      implicit double precision(a-h,o-z), integer(i-n)
      
      parameter(nparamsmax=20,ndatamax=4000)
      character*2 ft,fluidtype(ndatamax)
      dimension bbb(nparamsmax), b(nparamsmax)     
      common/block/hct(ndatamax),ef(ndatamax),fluidtype
      common/funcblock/x(ndatamax),y(ndatamax),sig(ndatamax),
     $     firstguess(nparamsmax),lista(nparamsmax),nparams,nparamsfit,
     $     ndata
      
      do 10 i=1,nparamsfit
         b(lista(i))=bbb(i)
 10   continue
      do 20 i=nparamsfit+1,nparams
         b(lista(i))=firstguess(lista(i))
 20   continue
      
      chisq=0.d0
      Adef=b(6) 
      Aag=b(7)
      f=b(8)
      
      do 40 i=1,ndata
         gamma=x(i)
         etaf=ef(i)
         h=hct(i)
         ft=fluidtype(i)
         if (ft .eq. 'es') then	
            etacel=b(1)
            expz1=b(2)
            expz2=b(14)
            expk=b(3)
            alpha=b(4)
            beta=b(5) 
         else 
            etacel=b(9)
            expz1=b(10)
            expz2=b(15)
            expk=b(11)
            alpha=b(12)
            beta=b(13)
         endif
         
         p=etacel/etaf
         T=(p+0.4d0)/(p+1.d0)
         expz=expz1 + expz2*h
         etainf=etaf*(1.d0-h*T)**(expz)
         eta0=etaf*dexp(expk*h)
         
         gammac=alpha*h*dexp(beta*(1.d0-h))
         
         over=gamma/gammac
         del=eta0-etainf
         hdel1=h-0.45d0
         hdel2=h-0.05d0
         
         if (hdel2 .le. 0.d0) then
            tauy=0.d0
            goto 30
         endif
         
         tauag=Aag*hdel2**3.d0	
         if (hdel1 .le. 0.d0) then
            if (ft .eq. 'es') then
               tauy=0.d0
            elseif (ft .eq. 'wb') then
               tauy=tauag
            else
               pause 'incorrect fluid type'
               stop 999
            endif
         else
            taudef=Adef*hdel1**3.d0
            if (ft .eq. 'es') then
               tauy=taudef
            elseif (ft .eq. 'wb') then
               tauy=tauag + taudef*f
            else
               pause 'incorrect fluid type'
               stop 1000
            endif
         endif
         
 30      eta= tauy/gamma +etainf + del/(1.d0 + over)
         sig21=1.d0/(sig(i)*sig(i))
         dy=y(i)-eta
         chisq=chisq+dy*dy*sig21
 40   continue
      
      chisqcalc=chisq
      return
      end



CHISQCALC1:
*****************************************************************
C     FUNCTION TO CALCULATE CHI-SQUARED VALUES FROM PARAMETER VECTOR
C     ALL PARAMETERS EQUAL
      double precision function chisqcalc1(bbb)
      implicit double precision(a-h,o-z), integer(i-n)
      
      parameter(nparamsmax=20,ndatamax=4000)
      character*2 ft,fluidtype(ndatamax)    
      dimension bbb(nparamsmax), b(nparamsmax) 
      common/block/hct(ndatamax),ef(ndatamax),fluidtype
      common/funcblock/x(ndatamax),y(ndatamax),sig(ndatamax),
     $     firstguess(nparamsmax),lista(nparamsmax),nparams,nparamsfit,
     $     ndata
      
      do 10 i=1,nparamsfit
         b(lista(i))=bbb(i)
 10   continue
      do 20 i=nparamsfit+1,nparams
         b(lista(i))=firstguess(lista(i))
 20   continue
      
      chisq=0.d0
      Adef=b(6) 
      Aag=b(7)
      f=b(8)
      etacel=b(1)
      expz=b(2)
      expk=b(3)
      alpha=b(4)
      beta=b(5) 
      
      do 40 i=1,ndata
         gamma=x(i)
         etaf=ef(i)
         h=hct(i)
         ft=fluidtype(i)       
         p=etacel/etaf
         T=(p+0.4d0)/(p+1.d0)
         etainf=etaf*(1.d0-h*T)**(expz)
         eta0=etaf*dexp(expk*h)
         
         gammac=alpha*h*dexp(beta*(1.d0-h))
         
         over=gamma/gammac
         del=eta0-etainf
         hdel1=h-0.45d0
         hdel2=h-0.05d0
         
         if (hdel2 .le. 0.d0) then
            tauy=0.d0
            goto 30
         endif
         
         tauag=Aag*hdel2**3.d0	
         if (hdel1 .le. 0.d0) then
            if (ft .eq. 'es') then
               tauy=0.d0
            elseif (ft .eq. 'wb') then
               tauy=tauag
            else
               pause 'incorrect fluid type'
               stop 999
            endif
         else
            taudef=Adef*hdel1**3.d0
            if (ft .eq. 'es') then
               tauy=taudef
            elseif (ft .eq. 'wb') then
               tauy=tauag + taudef*f
            else
               pause 'incorrect fluid type'
               stop 1000
            endif
         endif
         
 30      eta= tauy/gamma +etainf + del/(1.d0 + over)
         sig21=1.d0/(sig(i)*sig(i))
         dy=y(i)-eta
         chisq=chisq+dy*dy*sig21
 40   continue
      
      chisqcalc1=chisq
      return
      end


			     Jim Oliver

home help back first fref pref prev next nref lref last post