      subroutine cnintpco(ppll,cind,cintp,hlat,hlon,k,im,jm)

      implicit none
      integer,parameter::nm=6
      integer::k,im,jm
      real,dimension(0:im+1,0:jm+1,nm)::hlat,hlon
      real,dimension(k,k,nm,4,4,2)::ppll
      integer,dimension(k,k,4,4,3)::cind
      real,dimension(k,k,4,4,4,4)::cintp
      integer::i,j,n,c1,c2,i1,j1,n1
      real::xp,yp
      real,dimension(4,4)::x,y

      n=1
      do i=1,k
      do j=1,k
      do c1=1,4
      do c2=1,4
        i1=cind(i,j,c1,c2,1)
        j1=cind(i,j,c1,c2,2)
        n1=cind(i,j,c1,c2,3)
	x=hlon(i1:i1+3,j1:j1+3,n1)
	y=hlat(i1:i1+3,j1:j1+3,n1)

	xp=ppll(i,j,n,c1,c2,1)
	yp=ppll(i,j,n,c1,c2,2)
        call interpCoeff16(x,y,xp,yp,cintp(i,j,c1,c2,:,:))
      enddo
      enddo
      enddo
      enddo

      cintp(1,1,1,1,:,:)=0.
      cintp(1,1,1,4,:,:)=0.
      cintp(k,1,2,2,:,:)=0.
      cintp(k,1,2,3,:,:)=0.
      cintp(1,k,3,3,:,:)=0.
      cintp(1,k,3,2,:,:)=0.
      cintp(k,k,4,4,:,:)=0.
      cintp(k,k,4,1,:,:)=0.

      cintp(1,1,1,1,2,2)=1.
      cintp(1,1,1,4,2,2)=1.
      cintp(k,1,2,2,3,2)=1.
      cintp(k,1,2,3,3,2)=1.
      cintp(1,k,3,3,2,3)=1.
      cintp(1,k,3,2,2,3)=1.
      cintp(k,k,4,4,3,3)=1.
      cintp(k,k,4,1,3,3)=1.

      end subroutine cnintpco
