
        subroutine ced_ij(RLAT,RLON,XPTS,YPTS,KGDS)
!==========================================================================c
!                                                                          c
!    transform the coordinate from lat-lon to sea-mask file coordinate     c
!                                                                          c
!     --> rlat,rlon     latitude,longitude of the point                    c
!     <-- xpts,ypts     coordinate in the sea-mask file system             c
!     --> kgds          gds information                                    c
!                                                                          c
!--------------------------------------------------------------------------c

        implicit none
	real::rlat,rlon,xpts,ypts,rlat1,rlon1,rlat2,rlon2,dlon,dlat 
        integer,dimension(200):: kgds
	integer::ixm,jxm

        IXM=KGDS(2)
        JXM=KGDS(3)
        RLAT1=KGDS(4)*1.E-3
        RLON1=KGDS(5)*1.E-3
        RLAT2=KGDS(7)*1.E-3
        RLON2=KGDS(8)*1.E-3

        DLON=(MOD((RLON2-RLON1)-1+3600,360.)+1)/(IXM-1)
        DLAT=(RLAT2-RLAT1)/(JXM-1)

        XPTS=1.5+MOD((RLON-RLON1)+3600,360.)/DLON
        YPTS=1.5+(RLAT-RLAT1)/DLAT

	if (XPTS .ge. ixm+1) then
	XPTS=XPTS-ixm
	endif

	if (XPTS .lt. 1) then
	XPTS=XPTS+ixm
	endif

              if(ypts.ge.jxm+1) ypts=jxm
              if(ypts.lt.1) ypts=1

        return
        end

