      SUBROUTINE UNGRID(rlat,rlon,j,i,grid)

C     UNGRID CONVERTS FROM GRID NUMBER TO LAT,LON

      parameter (idim1=360,jdim1=180)

c     get geographic dimensional variables
      idim=idim1/grid
      jdim=jdim1/grid

      gridinv=1./grid
      grid2=grid/2.
      idim2=idim/2
      yjdim2=jdim1/2
      xidim1=idim1

      yj=j
      xi=i
      rlat=((yj/gridinv)-grid2)-(yjdim2)
      rlon=((xi/gridinv)-grid2)
      if ( i .gt. idim2 ) rlon=rlon-xidim1

      return
      end

