      Parameter (ii=360,  jj=180)
      Real  outf(360,180,12)
      Real  outf3(360,180,24)
      integer i,j
      
      open(10,file='/scratchin/grupos/eta/home/etaclim/sazonal/worketa/data/grib/sstoi200711a200711p.1x1_Eta',access='sequential',form='unformatted',convert='big_endian')
      open(12,file='sstgrb',form='unformatted',status='unknown',convert='big_endian')
      
      do k=1,12
        read(10)((outf(i,181-j,k),i=1,ii),j=1,jj)
      enddo
      
      do k=1,12 
         do i=1,ii
	   do j= 1,jj
              outf3(i,181-j,k)=outf(i,181-j,k)
	   enddo
	 enddo     
      enddo
      
      k2=1
      do k=13,24  
         do i=1,ii
	   do j= 1,jj
              outf3(i,181-j,k)=outf(i,181-j,k2)
	   enddo
	 enddo
	 k2=k2+1
      enddo
      
      do k=1,24
         write(12)((outf3(i,181-j,k),i=1,ii),j=1,jj)  
      enddo
!      print*, outf(1,1,1)

      stop
      end
