*-----------------------------------------------------------------------
      subroutine nxvgnc(ncdfid,cvname,istart,icount,cvalue)

      include   '/usr/local/include/netcdf.inc'

      integer   istart(*),icount(*)
      character cvname*(*),cvalue*(*)

      integer   ivdims(MAXVDIMS)
      character cvtemp*(MAXNCNAM)


      nvarid=ncvid(ncdfid,cvname,ircode)
      if (ircode.ne.0) call msgdmp('e','nxvgnc','error in ncvid.')

      call ncvinq(ncdfid,nvarid,cvtemp,ivtype,nvdims,ivdims,nvarat,
     +     ircode)
      if (ircode.ne.0) call msgdmp('e','nxvgnc','error in ncvinq.')

      lencvl=1
      do 10 n=1,nvdims
        lencvl=lencvl*icount(n)
   10 continue

      call ncvgtc(ncdfid,nvarid,istart,icount,cvalue,lencvl,ircode)
      if (ircode.ne.0) call msgdmp('e','nxvgnc','error in ncvgtc.')

      end
