       program writeveg
       REAL*4 FPAR1(2500,1250)
       INTEGER KPDS(200),KGDS(200),JPDS(200),JGDS(200),KF,KNUM
       INTEGER i
       LOGICAL BITMAP(2500,1250)
       
       CALL BAOPEN(38,'veg.eta.grb',IERR)
       JPDS = -1
       
       WRITE(6,*) KPDS
       
       OPEN(80,file='VEG_12.bin',form='unformatted',
     &        status='unknown')
     
       do i=1,12
       CALL GETGB(38,0,2500*1250,i-1,JPDS,JGDS,KF,KNUM,
     &    KPDS,KGDS,BITMAP,FPAR1,IERR)
     
       WRITE(6,*) i, KPDS, KGDS, JGDS, KF, KNUM
C       WRITE(80,*) 'AFTER GETGB FOR MONTH ', i,' IRET=', IERR
       WRITE(80)  FPAR1
       enddo
       
       END
