      program set
      implicit none
      include 'grib_api_f77.h'
      integer err
      integer*4 centre, int_value
      character*10 string_value
      integer infile,outfile, igrib,iret
      character*256 error

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

      call grib_check(grib_get_int(igrib,'centre',int_value))
      call grib_check(grib_get_string(igrib,'centre',string_value))
      write(*,*) int_value, string_value

      centre=80
      call grib_check(grib_set_int(igrib,'centre',centre))
 
      call grib_check(grib_get_int(igrib,'centre',int_value))
      call grib_check(grib_get_string(igrib,'centre',string_value))
      write(*,*) int_value, string_value
 
      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))
      end