Topic: Unexpected array reference at (1)

I need help with this error.  I have just started using fortran, I'm a student and they asked us to use fortran 2.0.  The program has to be able to give us the potentcial tempreture using this formula:

ptmp=(tmp(i)((1000/prs(i))**k))


here is the program

      program upperairdata
     
      implicit none
     
      real, dimension(51) :: prs,hgt,tmp,dw,rh,mx,wd,ws
      real :: sum,average,var,var1,var2,variance,stdev,ptmp,ptmp1,k
      real :: AAA,maxim,minim
      integer :: i,count
      integer, parameter :: num=52
      character :: header*1000,space3*3=' '

      open(1,file='G:\WKD\Upperairdata\upperairdata.txt')
c     read data
      read(1,*)header
      do i=2,num
         read(1,*)prs(i),hgt(i),tmp(i),dw(i),rh(i),mx(i),wd(i),ws(i)
      enddo
     
c     print*,header
      print*,prs(2),hgt(2),tmp(2),dw(2)
      print *,prs(num),hgt(num),tmp(num),dw(num)

      sum=0
      do i=2,num
         if(tmp(i).ne.(-99.99)) then
         endif
         sum=sum+tmp(i)
      enddo
     
      average=sum/(num-1)
      print*,'count is=',num,'and the average is',average
     
      maxim=tmp(2)
      minim=tmp(52)
     
      do i=2,num
         if(maxim.lt.tmp(i))maxim=tmp(i)
            if(tmp(i).ne.(-99.99)) then
            if(minim.gt.tmp(i))minim=tmp(i)
            endif
       enddo
      print*,'the maxim is',maxim,'and the minim is', minim
     
      var=0
      do i=2,num
         if(tmp(i).ne.(-99.99)) then
         endif
         var1=(tmp(i)-average)**2
         var2=var+var1
      enddo
      variance=var2/(num-1)
      stdev=(sqrt(variance))
      print*,'the variance is', variance
      print*,'and the standard deviation is',stdev
     
      ptmp1=0
      k=0.286
      do i=2,num
         if(tmp(i).ne.(-99.99)) then
         endif
         ptmp=(tmp(i)((1000/prs(i))**k))
      enddo
     
      print*,"press enter to end"
      read*,AAA
     
      end program upperairdata

Re: Unexpected array reference at (1)

dunno - consider using an operator '*' between the variables?

= tmp(i) * ((1000/prs(i))**k)

Re: Unexpected array reference at (1)

The previous reply is correct, you'll need to explicitly use multiplication signs in Fortran.  Also, I would suggest (although plenty may disagree) that you use decimal points wherever they'd be applicable.  So your equation line should probably be:

ptmp=(tmp(i)*((1000.0/prs(i))**k))

Let us know if you need more help!

Jeff Armstrong
Approximatrix, LLC