      program set
      implicit none
      include 'grib_api_f77.h'
      integer err
      integer len,  size
      integer infile,outfile, igrib,iret
      character*256 error

      infile=15
      outfile=16
 
      call grib_check(grib_open_file(infile,'uv500.grb','r'))
      call grib_check(grib_open_file(outfile,'out.grib','w'))
      call grib_check(grib_new_from_file(infile,igrib))

      call grib_check(grib_write(igrib,outfile)) ! kiiras
      call grib_check(grib_release(igrib))
      call grib_check(grib_close_file(infile))
      call grib_check(grib_close_file(outfile))
      stop
      end