!
! $Header$
!
       SUBROUTINE inter_barxy ( interfd,jnterfd,dlonid,dlatid ,
     ,        champ,imod,jmod,rlonimod,rlatimod, jsort,champint )

c    Auteur :   P. Le Van
c
       INTEGER interfd,jnterfd,imod,jmod
       REAL champ(interfd,jnterfd +1 ),dlonid(interfd),dlatid(jnterfd),
     ,      champint(imod,jsort)
       REAL rlonimod(imod),rlatimod(jmod)

#include "dimensions.h"
#include "paramet.h"
#include "comgeom2.h"

       REAL champx(imod),champy(jnterfd +1,imod),chpn(imod),chps(imod)
       REAL chhpn,chhps
       REAL fmody(jjp1)
c

       DO j = 1, jnterfd + 1
        CALL inter_barx( interfd, dlonid, champ( 1,j ),
     ,                       imod, rlonimod , champx )
         DO i = 1,imod
           champy(j,i) = champx(i)
         ENDDO
       ENDDO

       DO i = 1, imod
        CALL inter_bary( jjm,jnterfd,dlatid,champy(1,i),
     ,                     jmod ,rlatimod,  fmody     )
          DO j = 1, jsort
           champint(i,j) = fmody(j)
          ENDDO
       ENDDO

       IF( jsort.EQ.jjp1)  THEN

c   ....  Valeurs uniques  aux  poles ....
c
         DO i =  1,imod
          chpn(i)  = aire( i,  1   ) * champint( i, 1   )
          chps(i)  = aire( i, jjp1 ) * champint( i,jjp1 )
         ENDDO
          chhpn  = SSUM(imod,chpn,1)/apoln
          chhps  = SSUM(imod,chps,1)/apols

         DO i = 1, imod
          champint( i,  1  ) = chhpn
          champint( i, jjp1) = chhps
         ENDDO
c
       ENDIF

       RETURN
       END

