Index: LMDZ.3.3/branches/rel-LF/libf/dyn3d/create_etat0_limit.F
===================================================================
--- LMDZ.3.3/branches/rel-LF/libf/dyn3d/create_etat0_limit.F	(revision 319)
+++ LMDZ.3.3/branches/rel-LF/libf/dyn3d/create_etat0_limit.F	(revision 320)
@@ -13,10 +13,15 @@
 c     oldice   = .T. si l'on veut garder les anciennes glaces , obtenues
 c     par  grille_m  ( grid_atob ) .
-
+c
+c     on cree le masque dans etat0 que l'on passe ensuite dans limit pour 
+c     garder les cohérences
 
       LOGICAL interbar, extrap , oldice
       PARAMETER ( interbar = .TRUE. , extrap = .FALSE. , oldice=.TRUE.)
+#include "dimensions.h"
+#include "paramet.h"
+      REAL :: masque(iip1,jjp1)
 
-      CALL etat0_netcdf ( interbar )
+      CALL etat0_netcdf ( interbar, masque )
 c
       WRITE(6,1)
@@ -26,5 +31,5 @@
       WRITE(6,1)
 c
-      CALL  limit_netcdf ( interbar, extrap , oldice )
+      CALL  limit_netcdf ( interbar, extrap , oldice, masque )
 
 1     FORMAT(//)
Index: LMDZ.3.3/branches/rel-LF/libf/dyn3d/etat0_netcdf.F
===================================================================
--- LMDZ.3.3/branches/rel-LF/libf/dyn3d/etat0_netcdf.F	(revision 319)
+++ LMDZ.3.3/branches/rel-LF/libf/dyn3d/etat0_netcdf.F	(revision 320)
@@ -1,3 +1,6 @@
-      SUBROUTINE etat0_netcdf
+c
+c $Header$
+c
+      SUBROUTINE etat0_netcdf (interbar, masque)
     
       USE startvar
@@ -11,6 +14,6 @@
       !
       !
-c      INTEGER, PARAMETER :: KIDIA=1, KFDIA=iim*(jjm-1)+2, 
-c     .KLON=KFDIA-KIDIA+1,KLEV=llm
+!      INTEGER, PARAMETER :: KIDIA=1, KFDIA=iim*(jjm-1)+2, 
+!     .KLON=KFDIA-KIDIA+1,KLEV=llm
       !
 #include "comgeom2.h"
@@ -21,4 +24,5 @@
 #include "dimsoil.h"
       !
+      LOGICAL interbar
       REAL :: latfi(klon), lonfi(klon)
       REAL :: orog(iip1,jjp1), rugo(iip1,jjp1), masque(iip1,jjp1),
@@ -56,5 +60,5 @@
       CHARACTER*80 :: varname
       !
-      INTEGER :: i,j, ig, l, ji
+      INTEGER :: i,j, ig, l, ji,ii1,ii2
       REAL :: xpi
       !
@@ -87,4 +91,5 @@
       REAL ::phystep,co2_ppm,solaire
       INTEGER :: radpas
+       real zrel(iip1*jjp1),chmin,chmax
 
       CHARACTER*80 :: visu_file
@@ -156,5 +161,6 @@
       ! This line needs to be replaced by a call to restget to get the values in the restart file
       orog(:,:) = 0.0
-       CALL startget(varname, iip1, jjp1, rlonv, rlatu, orog, 0.0)
+       CALL startget(varname, iip1, jjp1, rlonv, rlatu, orog, 0.0 ,
+     , jjm ,rlonu,rlatv , interbar )
       !
       WRITE(*,*) 'OUT OF GET VARIABLE : Relief'
@@ -164,5 +170,6 @@
       ! This line needs to be replaced by a call to restget to get the values in the restart file
       rugo(:,:) = 0.0
-       CALL startget(varname, iip1, jjp1, rlonv, rlatu, rugo, 0.0)
+       CALL startget(varname, iip1, jjp1, rlonv, rlatu, rugo, 0.0 ,
+     , jjm, rlonu,rlatv , interbar )
       !
       WRITE(*,*) 'OUT OF GET VARIABLE : Rugosite' 
@@ -172,5 +179,6 @@
       ! This line needs to be replaced by a call to restget to get the values in the restart file
       masque(:,:) = 0.0
-       CALL startget(varname, iip1, jjp1, rlonv, rlatu, masque, 0.0)
+       CALL startget(varname, iip1, jjp1, rlonv, rlatu, masque, 0.0,
+     , jjm ,rlonu,rlatv , interbar )
       !
       WRITE(*,*) 'MASQUE construit : Masque'
@@ -187,5 +195,6 @@
       varname = 'zmasq'
       zmasq(:) = 0.
-      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zmasq,0.0)
+      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zmasq,0.0,
+     , jjm ,rlonu,rlatv , interbar )
       WHERE (zmasq(1 : klon) .LT. EPSFRA)
           zmasq(1 : klon) = 0.
@@ -201,5 +210,6 @@
       varname = 'psol'
       psol(:,:) = 0.0
-      CALL startget(varname, iip1, jjp1, rlonv, rlatu, psol, 0.0)
+      CALL startget(varname, iip1, jjp1, rlonv, rlatu, psol, 0.0 ,
+     , jjm ,rlonu,rlatv , interbar )
       !
       !  Compute here the pressure on the intermediate levels. One would expect that this is available in the GCM 
@@ -229,22 +239,21 @@
       varname = 'surfgeo'
       phis(:,:) = 0.0
-      CALL startget(varname, iip1, jjp1, rlonv, rlatu, phis, 0.0)
-      write(*,*) 'Phis = '
-      write(*,*)phis
+      CALL startget(varname, iip1, jjp1, rlonv, rlatu, phis, 0.0 ,
+     , jjm ,rlonu,rlatv, interbar )
       !
       varname = 'u'
       uvent(:,:,:) = 0.0
       CALL startget(varname, iip1, jjp1, rlonu, rlatu, llm, pls,
-     . workvar, uvent, 0.0)
+     . workvar, uvent, 0.0, jjm ,rlonv, rlatv, interbar )
       !  
       varname = 'v'
       vvent(:,:,:) = 0.0
       CALL startget(varname, iip1, jjm, rlonv, rlatv, llm, pls,
-     . workvar, vvent, 0.0)
+     . workvar, vvent, 0.0, jjp1, rlonu, rlatu, interbar )
       !
       varname = 't'
       t3d(:,:,:) = 0.0
       CALL startget(varname, iip1, jjp1, rlonv, rlatu, llm, pls,
-     . workvar, t3d, 0.0)
+     . workvar, t3d, 0.0 , jjm, rlonu, rlatv , interbar )
       !
       WRITE(*,*) 'T3D min,max:',minval(t3d(:,:,:)),
@@ -253,5 +262,5 @@
       tpot(:,:,:) = 0.0
       CALL startget(varname, iip1, jjp1, rlonv, rlatu, llm, pls,
-     . pk, tpot, 0.0)
+     . pk, tpot, 0.0 , jjm, rlonu, rlatv , interbar )
       !
       WRITE(*,*) 'T3D min,max:',minval(t3d(:,:,:)),
@@ -273,5 +282,4 @@
       !
       varname = 'q'
-      q3d(:,:,:,:) = 0.0
       qd(:,:,:) = 0.0
       q3d(:,:,:,:) = 0.0
@@ -279,5 +287,5 @@
      .                           maxval(qsat(:,:,:))
       CALL startget(varname, iip1, jjp1, rlonv, rlatu, llm, pls,
-     . qsat, qd, 0.0)
+     . qsat, qd, 0.0, jjm, rlonu, rlatv , interbar )
       q3d(:,:,:,1) = qd(:,:,:)
       !
@@ -285,5 +293,6 @@
       ! This line needs to be replaced by a call to restget to get the values in the restart file
       tsol(:) = 0.0
-      CALL startget(varname, iip1, jjp1, rlonv, rlatu, klon, tsol,0.0)
+      CALL startget(varname, iip1, jjp1, rlonv, rlatu, klon, tsol, 0.0,
+     .    jjm, rlonu, rlatv , interbar )
       !
       WRITE(*,*) 'TSOL construit :'
@@ -292,49 +301,68 @@
       varname = 'qsol'
       qsol(:) = 0.0
-      CALL startget(varname, iip1, jjp1, rlonv, rlatu, klon, qsol,0.0)
+      CALL startget(varname, iip1, jjp1, rlonv, rlatu, klon, qsol, 0.0,
+     .   jjm, rlonu, rlatv , interbar )
       !
       varname = 'snow'
       sn(:) = 0.0
-      CALL startget(varname, iip1, jjp1, rlonv, rlatu, klon, sn,0.0)
+      CALL startget(varname, iip1, jjp1, rlonv, rlatu, klon, sn, 0.0,
+     .    jjm, rlonu, rlatv , interbar )
       !
       varname = 'rads'
       radsol(:) = 0.0
-      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,radsol,0.0)
+      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,radsol,0.0,
+     .    jjm, rlonu, rlatv , interbar )
       !
       varname = 'deltat'
       deltat(:) = 0.0
-      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,deltat,0.0)
+      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,deltat,0.0,
+     .     jjm, rlonu, rlatv , interbar )
       !
       varname = 'rugmer'
       rugmer(:) = 0.0
-      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,rugmer,0.0)
+      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,rugmer,0.0,
+     .     jjm, rlonu, rlatv , interbar )
       !
       varname = 'agsno'
       agesno(:) = 0.0
-      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,agesno,0.0)
+      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,agesno,0.0,
+     .     jjm, rlonu, rlatv , interbar )
 
       varname = 'zmea'
       zmea(:) = 0.0
-      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zmea,0.0)
+      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zmea,0.0,
+     .     jjm, rlonu, rlatv , interbar )
+
       varname = 'zstd'
       zstd(:) = 0.0
-      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zstd,0.0)
+      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zstd,0.0,
+     .     jjm, rlonu, rlatv , interbar )
       varname = 'zsig'
       zsig(:) = 0.0
-      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zsig,0.0)
+      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zsig,0.0,
+     .     jjm, rlonu, rlatv , interbar )
       varname = 'zgam'
       zgam(:) = 0.0
-      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zgam,0.0)
+      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zgam,0.0,
+     .     jjm, rlonu, rlatv , interbar )
       varname = 'zthe'
       zthe(:) = 0.0
-      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zthe,0.0)
+      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zthe,0.0,
+     .     jjm, rlonu, rlatv , interbar )
       varname = 'zpic'
       zpic(:) = 0.0
-      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zpic,0.0)
+      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zpic,0.0,
+     .     jjm, rlonu, rlatv , interbar )
       varname = 'zval'
       zval(:) = 0.0
-      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zval,0.0)
+      CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zval,0.0,
+     .     jjm, rlonu, rlatv , interbar )
+c
       rugsrel(:) = 0.0
-
+      IF(ok_orodr)  THEN
+        DO i = 1, iip1* jjp1
+         rugsrel(i) = MAX( 1.e-05, zstd(i)* zsig(i) /2. )
+        ENDDO
+      ENDIF
 C
 C En cas de simulation couplee, lecture du masque ocean issu du modele ocean
Index: LMDZ.3.3/branches/rel-LF/libf/dyn3d/limit_netcdf.F
===================================================================
--- LMDZ.3.3/branches/rel-LF/libf/dyn3d/limit_netcdf.F	(revision 319)
+++ LMDZ.3.3/branches/rel-LF/libf/dyn3d/limit_netcdf.F	(revision 320)
@@ -2,5 +2,5 @@
 C $Header$
 C
-      SUBROUTINE limit_netcdf ( interbar, extrap, oldice )
+      SUBROUTINE limit_netcdf ( interbar, extrap, oldice, masque )
 c
       IMPLICIT none
@@ -28,4 +28,5 @@
 #include "comgeom2.h"
 #include "comconst.h"
+#include "dimphy.h"
 c
 c-----------------------------------------------------------------------
@@ -33,6 +34,4 @@
 
       INTEGER KIDIA, KFDIA, KLON, KLEV
-      PARAMETER (KIDIA=1,KFDIA=iim*(jjm-1)+2,
-     .           KLON=KFDIA-KIDIA+1,KLEV=llm)
 c-----------------------------------------------------------------------
       REAL phy_nat(klon,360), phy_nat0(klon)
@@ -195,9 +194,9 @@
       CALL mask_c_o(imdep, jmdep, dlon_msk, dlat_msk,champ_msk,
      .             iim, jjp1, rlonv, rlatu, champint)
-      CALL gr_int_dyn(champint, masque, iim, jjp1)
-      DO i = 1, iim
-         masque(i,1) = FLOAT(NINT(masque(i,1)))
-         masque(i,jjp1) = FLOAT(NINT(masque(i,jjp1)))
-      ENDDO
+c      CALL gr_int_dyn(champint, masque, iim, jjp1)
+c      DO i = 1, iim
+c         masque(i,1) = FLOAT(NINT(masque(i,1)))
+c         masque(i,jjp1) = FLOAT(NINT(masque(i,jjp1)))
+c      ENDDO
       DO i = 1, iim
       DO j = 1, jjp1
@@ -205,5 +204,5 @@
       ENDDO
       ENDDO
-      CALL gr_dyn_fi(1, iip1, jjp1, klon, masque, phy_nat0)
+c      CALL gr_dyn_fi(1, iip1, jjp1, klon, masque, phy_nat0)
       ierr = NF_CLOSE(ncid)
 c
@@ -591,7 +590,7 @@
      .                  champan(1,1,k), phy_ice(1,k))
          DO i = 1, klon
-            phy_nat(i,k) = phy_nat0(i)
+            phy_nat(i,k) = zmasq(i)
             IF ( (phy_ice(i,k) - 0.5).GE.1.e-5 ) THEN
-               IF (NINT(phy_nat0(i)).EQ.0) THEN
+               IF (NINT(zmasq(i)).EQ.0) THEN
                   phy_nat(i,k) = 3.0
                ELSE
Index: LMDZ.3.3/branches/rel-LF/libf/dyn3d/startvar.F
===================================================================
--- LMDZ.3.3/branches/rel-LF/libf/dyn3d/startvar.F	(revision 319)
+++ LMDZ.3.3/branches/rel-LF/libf/dyn3d/startvar.F	(revision 320)
@@ -1,3 +1,5 @@
-! $Header$
+C
+C $Header$
+C
       MODULE startvar
     !
@@ -11,13 +13,12 @@
     !
     !        - A 2D variable on the dynamical grid :
-    !           CALL startget(varname, iml, jml, lon_in, lat_in, champ, val_ex)
-    !            
+    !           CALL startget(varname, iml, jml, lon_in, lat_in, champ, val_ex, jml2, lon_in2, lat_in2, interbar )             
     !
     !        - A 1D variable on the physical grid :
-    !            CALL startget(varname, iml, jml, lon_in, lat_in, nbindex, champ, val_exp)
+    !            CALL startget(varname, iml, jml, lon_in, lat_in, nbindex, champ, val_exp, jml2, lon_in2, lat_in2, interbar )
     !
     !
     !         - A 3D variable on the dynamical grid :
-    !            CALL startget(varname, iml, jml, lon_in, lat_in, lml, pls, workvar, champ, val_exp)
+    !            CALL startget(varname, iml, jml, lon_in, lat_in, lml, pls, workvar, champ, val_exp, jml2, lon_in2, lat_in2, interbar )
     !
     !
@@ -58,5 +59,5 @@
       REAL, ALLOCATABLE, SAVE, DIMENSION (:,:)  :: lat_phys, lat_rug,
      . lat_alb, lat_rel, lat_dyn
-      REAL, ALLOCATABLE, SAVE, DIMENSION (:)  :: lev_dyn
+      REAL, ALLOCATABLE, SAVE, DIMENSION (:)  :: levdyn_ini
       REAL, ALLOCATABLE, SAVE, DIMENSION (:,:)  :: relief, zstd, zsig,
      . zgam, zthe, zpic, zval
@@ -71,5 +72,5 @@
     !
       SUBROUTINE startget_phys2d(varname, iml, jml, lon_in, lat_in,
-     . champ, val_exp)
+     . champ, val_exp, jml2, lon_in2, lat_in2 , interbar )
     !
     !    There is a big mess with the size in logitude, should it be iml or iml+1.
@@ -80,8 +81,10 @@
     !
       CHARACTER*(*), INTENT(in) :: varname
-      INTEGER, INTENT(in) :: iml, jml
+      INTEGER, INTENT(in) :: iml, jml ,jml2
       REAL, INTENT(in) :: lon_in(iml), lat_in(jml)
+      REAL, INTENT(in) :: lon_in2(iml), lat_in2(jml2)
       REAL, INTENT(inout) :: champ(iml,jml)
       REAL, INTENT(in) :: val_exp
+      LOGICAL interbar
     !
     !   This routine only works if the variable does not exist or is constant
@@ -98,5 +101,6 @@
                   IF ( .NOT.ALLOCATED(relief)) THEN
                       !
-                      CALL start_init_orog( iml, jml, lon_in, lat_in)
+                      CALL start_init_orog( iml, jml, lon_in, lat_in,
+     .                    jml2,lon_in2,lat_in2, interbar )
                       !
                   ENDIF
@@ -118,5 +122,6 @@
                   IF ( .NOT.ALLOCATED(rugo)) THEN
                       !
-                      CALL start_init_orog( iml, jml, lon_in, lat_in)
+                      CALL start_init_orog( iml, jml, lon_in, lat_in,
+     .                    jml2,lon_in2,lat_in2 , interbar )
                       !
                   ENDIF
@@ -138,5 +143,6 @@
                   IF ( .NOT.ALLOCATED(masque)) THEN
                       !
-                      CALL start_init_orog( iml, jml, lon_in, lat_in)
+                      CALL start_init_orog( iml, jml, lon_in, lat_in,
+     .                     jml2,lon_in2,lat_in2 , interbar )
                       !
                   ENDIF
@@ -158,5 +164,6 @@
                   IF ( .NOT.ALLOCATED(phis)) THEN
                       !
-                      CALL start_init_orog( iml, jml, lon_in, lat_in)
+                      CALL start_init_orog( iml, jml, lon_in, lat_in,
+     .                   jml2,lon_in2, lat_in2 , interbar )
                       !
                   ENDIF
@@ -178,5 +185,6 @@
                   IF ( .NOT.ALLOCATED(psol_dyn)) THEN
                       !
-                      CALL start_init_dyn( iml, jml, lon_in, lat_in)
+                      CALL start_init_dyn( iml, jml, lon_in, lat_in,
+     .                   jml2,lon_in2, lat_in2 , interbar )
                       !
                   ENDIF
@@ -232,18 +240,24 @@
     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     !
-      SUBROUTINE start_init_orog( iml, jml, lon_in, lat_in)
-    !
-      INTEGER, INTENT(in) :: iml, jml
+      SUBROUTINE start_init_orog ( iml,jml,lon_in, lat_in,jml2,lon_in2 ,
+     ,   lat_in2 , interbar )
+    !
+      INTEGER, INTENT(in) :: iml, jml, jml2
       REAL, INTENT(in) :: lon_in(iml), lat_in(jml)
+      REAL, INTENT(in) :: lon_in2(iml), lat_in2(jml2)
+      LOGICAL interbar
     !
     !  LOCAL
     !
-      REAL :: lev(1), date, dt
+      LOGICAL interbar2
+      REAL :: lev(1), date, dt,chmin,chmax
       INTEGER :: itau(1), fid
       INTEGER ::  llm_tmp, ttm_tmp
       INTEGER :: i, j
       INTEGER :: iret
+      CHARACTER*25 title
       REAL, ALLOCATABLE :: relief_hi(:,:)
       REAL, ALLOCATABLE :: lon_rad(:), lat_rad(:)
+      REAL, ALLOCATABLE :: lon_ini(:), lat_ini(:)
       REAL, ALLOCATABLE :: tmp_var(:,:)
       INTEGER, ALLOCATABLE :: tmp_int(:,:)
@@ -275,17 +289,29 @@
     !
       ALLOCATE(lon_rad(iml_rel))
+      ALLOCATE(lon_ini(iml_rel))
+
       IF ( MAXVAL(lon_rel(:,:)) .GT. 2.0 * ASIN(1.0) ) THEN
-          lon_rad(:) = lon_rel(:,1) * 2.0 * ASIN(1.0) / 180.0
-      ELSE
-          lon_rad(:) = lon_rel(:,1) 
-      ENDIF
+          lon_ini(:) = lon_rel(:,1) * 2.0 * ASIN(1.0) / 180.0
+      ELSE
+          lon_ini(:) = lon_rel(:,1) 
+      ENDIF
+
       ALLOCATE(lat_rad(jml_rel))
+      ALLOCATE(lat_ini(jml_rel))
+
       IF ( MAXVAL(lat_rel(:,:)) .GT. 2.0 * ASIN(1.0) ) THEN
-          lat_rad(:) = lat_rel(1,:) * 2.0 * ASIN(1.0) / 180.0
-      ELSE
-          lat_rad(:) = lat_rel(1,:) 
-      ENDIF
-    !
-    !
+          lat_ini(:) = lat_rel(1,:) * 2.0 * ASIN(1.0) / 180.0
+      ELSE
+          lat_ini(:) = lat_rel(1,:) 
+      ENDIF
+    !
+    !
+
+      title='RELIEF'
+
+      interbar2 = .FALSE.
+      CALL conf_dat2d(title,iml_rel, jml_rel, lon_ini, lat_ini,
+     . lon_rad, lat_rad, relief_hi , interbar2  )
+
       IF ( check ) WRITE(*,*) 'Computes all the parameters needed',
      .' for the gravity wave drag code'
@@ -315,14 +341,9 @@
     !
       CALL grid_noro(iml_rel, jml_rel, lon_rad, lat_rad, relief_hi,
-     $    iml-1, jml, lon_in, lat_in, 
-    !     . phis, relief, zstd, zsig, zgam, zthe, zpic, zval, tmp_int)
-    ! PB masque avec % terre mai 2000
-     $    phis, relief, zstd, zsig, zgam, zthe, zpic, zval, masque)
+     . iml-1, jml, lon_in, lat_in, 
+     . phis, relief, zstd, zsig, zgam, zthe, zpic, zval, tmp_int)
       phis = phis * 9.81
-!      write(*,*)'phis sortie grid_noro'
-!      write(*,*)phis
-    !
-    !PB supression ligne suivant pour masque avec % terre
-    !     masque(:,:) = FLOAT(tmp_int(:,:))
+    !
+      masque(:,:) = FLOAT(tmp_int(:,:))
     !
     !  Compute surface roughness
@@ -343,4 +364,6 @@
         rugo(iml,j) = tmp_var(1,j)
       ENDDO
+c
+cc   ***   rugo  n'est pas utilise pour l'instant  ******
     !
     !   Build land-sea mask
@@ -354,11 +377,13 @@
     !
       SUBROUTINE startget_phys1d(varname, iml, jml, lon_in, 
-     .lat_in, nbindex, champ, val_exp)
+     .lat_in, nbindex, champ, val_exp ,jml2, lon_in2, lat_in2,interbar)
     !
       CHARACTER*(*), INTENT(in) :: varname
-      INTEGER, INTENT(in) :: iml, jml, nbindex
+      INTEGER, INTENT(in) :: iml, jml, nbindex, jml2
       REAL, INTENT(in) :: lon_in(iml), lat_in(jml)
+      REAL, INTENT(in) :: lon_in2(iml), lat_in2(jml2)
       REAL, INTENT(inout) :: champ(nbindex)
       REAL, INTENT(in) :: val_exp
+      LOGICAL interbar
     !
     !
@@ -370,5 +395,6 @@
             CASE ('tsol')
               IF ( .NOT.ALLOCATED(tsol)) THEN
-                CALL start_init_phys( iml, jml, lon_in, lat_in)
+                CALL start_init_phys( iml, jml, lon_in, lat_in,
+     .              jml2, lon_in2, lat_in2, interbar )
               ENDIF
               IF ( SIZE(tsol) .NE. SIZE(lon_in)*SIZE(lat_in) ) THEN
@@ -380,5 +406,6 @@
             CASE ('qsol')
               IF ( .NOT.ALLOCATED(qsol)) THEN
-                CALL start_init_phys( iml, jml, lon_in, lat_in)
+                CALL start_init_phys( iml, jml, lon_in, lat_in,
+     .              jml2, lon_in2,lat_in2 , interbar )
               ENDIF
               IF ( SIZE(qsol) .NE. SIZE(lon_in)*SIZE(lat_in) ) THEN
@@ -390,5 +417,6 @@
             CASE ('psol')
               IF ( .NOT.ALLOCATED(psol_dyn)) THEN
-                CALL start_init_dyn( iml, jml, lon_in, lat_in)
+                CALL start_init_dyn( iml, jml, lon_in, lat_in,
+     .              jml2, lon_in2,lat_in2 , interbar )
               ENDIF
               IF (SIZE(psol_dyn) .NE. SIZE(lon_in)*SIZE(lat_in)) THEN
@@ -401,5 +429,6 @@
           CASE ('zmasq')
               IF (.NOT. ALLOCATED(masque) ) THEN
-                  CALL start_init_orog ( iml, jml,lon_in, lat_in)
+                  CALL start_init_orog ( iml, jml,lon_in, lat_in,
+     .              jml2, lon_in2,lat_in2 , interbar )
               ENDIF
               IF ( SIZE(masque) .NE. SIZE(lon_in)*SIZE(lat_in) ) THEN
@@ -411,5 +440,6 @@
             CASE ('zmea')
               IF ( .NOT.ALLOCATED(relief)) THEN
-                CALL start_init_orog( iml, jml, lon_in, lat_in)
+                CALL start_init_orog( iml, jml, lon_in, lat_in,
+     .            jml2, lon_in2,lat_in2 , interbar )
               ENDIF
               IF ( SIZE(relief) .NE. SIZE(lon_in)*SIZE(lat_in) ) THEN
@@ -421,5 +451,6 @@
             CASE ('zstd')
               IF ( .NOT.ALLOCATED(zstd)) THEN
-                CALL start_init_orog( iml, jml, lon_in, lat_in)
+                CALL start_init_orog( iml, jml, lon_in, lat_in,
+     .              jml2, lon_in2,lat_in2 , interbar )
               ENDIF
               IF ( SIZE(zstd) .NE. SIZE(lon_in)*SIZE(lat_in) ) THEN
@@ -431,5 +462,6 @@
             CASE ('zsig')
               IF ( .NOT.ALLOCATED(zsig)) THEN
-                CALL start_init_orog( iml, jml, lon_in, lat_in)
+                CALL start_init_orog( iml, jml, lon_in, lat_in,
+     .               jml2, lon_in2,lat_in2 , interbar )
               ENDIF
               IF ( SIZE(zsig) .NE. SIZE(lon_in)*SIZE(lat_in) ) THEN
@@ -441,5 +473,6 @@
             CASE ('zgam')
               IF ( .NOT.ALLOCATED(zgam)) THEN
-                CALL start_init_orog( iml, jml, lon_in, lat_in)
+                CALL start_init_orog( iml, jml, lon_in, lat_in,
+     .            jml2, lon_in2,lat_in2 , interbar )
               ENDIF
               IF ( SIZE(zgam) .NE. SIZE(lon_in)*SIZE(lat_in) ) THEN
@@ -451,5 +484,6 @@
             CASE ('zthe')
               IF ( .NOT.ALLOCATED(zthe)) THEN
-                CALL start_init_orog( iml, jml, lon_in, lat_in)
+                CALL start_init_orog( iml, jml, lon_in, lat_in,
+     .            jml2, lon_in2,lat_in2 , interbar )
               ENDIF
               IF ( SIZE(zthe) .NE. SIZE(lon_in)*SIZE(lat_in) ) THEN
@@ -461,5 +495,6 @@
             CASE ('zpic')
               IF ( .NOT.ALLOCATED(zpic)) THEN
-                CALL start_init_orog( iml, jml, lon_in, lat_in)
+                CALL start_init_orog( iml, jml, lon_in, lat_in,
+     .            jml2, lon_in2,lat_in2 , interbar )
               ENDIF
               IF ( SIZE(zpic) .NE. SIZE(lon_in)*SIZE(lat_in) ) THEN
@@ -471,5 +506,6 @@
             CASE ('zval')
               IF ( .NOT.ALLOCATED(zval)) THEN
-                CALL start_init_orog( iml, jml, lon_in, lat_in)
+                CALL start_init_orog( iml, jml, lon_in, lat_in,
+     .            jml2, lon_in2,lat_in2 , interbar )
               ENDIF
               IF ( SIZE(zval) .NE. SIZE(lon_in)*SIZE(lat_in) ) THEN
@@ -479,5 +515,5 @@
               ENDIF
               CALL gr_dyn_fi(1, iml, jml, nbindex,zval, champ)
-             CASE ('rads')
+            CASE ('rads')
                   champ(:) = 0.0
             CASE ('snow')
@@ -510,8 +546,11 @@
     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     !
-      SUBROUTINE start_init_phys( iml, jml, lon_in, lat_in)
-    !
-      INTEGER, INTENT(in) :: iml, jml
+      SUBROUTINE start_init_phys( iml, jml, lon_in, lat_in, jml2,
+     .                 lon_in2, lat_in2 , interbar )
+    !
+      INTEGER, INTENT(in) :: iml, jml ,jml2
       REAL, INTENT(in) :: lon_in(iml), lat_in(jml)
+      REAL, INTENT(in) :: lon_in2(iml), lat_in2(jml2)
+      LOGICAL interbar
     !
     !  LOCAL
@@ -522,8 +561,10 @@
       INTEGER :: i, j
     !
+      CHARACTER*25 title
       CHARACTER*120 :: physfname
       LOGICAL :: check=.TRUE.
     !
       REAL, ALLOCATABLE :: lon_rad(:), lat_rad(:)
+      REAL, ALLOCATABLE :: lon_ini(:), lat_ini(:)
       REAL, ALLOCATABLE :: var_ana(:,:), tmp_var(:,:)
     !
@@ -549,16 +590,25 @@
     !   In case we have a file which is in degrees we do the transformation
     !
+      DEALLOCATE (lon_rad)
       ALLOCATE(lon_rad(iml_phys))
+      DEALLOCATE (lon_ini)
+      ALLOCATE(lon_ini(iml_phys))
+
       IF ( MAXVAL(lon_phys(:,:)) .GT. 2.0 * ASIN(1.0) ) THEN
-          lon_rad(:) = lon_phys(:,1) * 2.0 * ASIN(1.0) / 180.0
-      ELSE
-          lon_rad(:) = lon_phys(:,1) 
-      ENDIF
+          lon_ini(:) = lon_phys(:,1) * 2.0 * ASIN(1.0) / 180.0
+      ELSE
+          lon_ini(:) = lon_phys(:,1) 
+      ENDIF
+
       ALLOCATE(lat_rad(jml_phys))
+      ALLOCATE(lat_ini(jml_phys))
+
       IF ( MAXVAL(lat_phys(:,:)) .GT. 2.0 * ASIN(1.0) ) THEN
-          lat_rad(:) = lat_phys(1,:) * 2.0 * ASIN(1.0) / 180.0
-      ELSE
-          lat_rad(:) = lat_phys(1,:) 
-      ENDIF
+          lat_ini(:) = lat_phys(1,:) * 2.0 * ASIN(1.0) / 180.0
+      ELSE
+          lat_ini(:) = lat_phys(1,:) 
+      ENDIF
+
+
     !
     !   We get the two standard varibales
@@ -569,8 +619,26 @@
     !
     !
+
       CALL flinget(fid_phys, 'ST', iml_phys, jml_phys, 
      .llm_tmp, ttm_tmp, 1, 1, var_ana)
-      CALL grille_m(iml_phys, jml_phys, lon_rad, lat_rad,
-     . var_ana, iml-1, jml, lon_in, lat_in, tmp_var)
+
+      title='ST'
+      CALL conf_dat2d(title,iml_phys, jml_phys, lon_ini, lat_ini,
+     . lon_rad, lat_rad, var_ana , interbar  )
+
+      IF ( interbar )   THEN
+        WRITE(6,*) '-------------------------------------------------',
+     ,'--------------'
+        WRITE(6,*) '$$$ Utilisation de l interpolation barycentrique ',
+     , ' pour  ST $$$ '
+        WRITE(6,*) '-------------------------------------------------',
+     ,'--------------'
+        CALL inter_barxy ( iml_phys,jml_phys -1,lon_rad,lat_rad ,
+     ,   var_ana, iml-1, jml-1, lon_in2, lat_in2, jml, tmp_var   ) 
+      ELSE
+        CALL grille_m(iml_phys, jml_phys, lon_rad, lat_rad,
+     .    var_ana, iml-1, jml, lon_in, lat_in, tmp_var     )
+      ENDIF
+
       CALL gr_int_dyn(tmp_var, tsol, iml-1, jml)
     !
@@ -580,10 +648,31 @@
       CALL flinget(fid_phys, 'CDSW', iml_phys, jml_phys,
      . llm_tmp, ttm_tmp, 1, 1, var_ana)
-      CALL grille_m(iml_phys, jml_phys, lon_rad, lat_rad,
-     . var_ana, iml-1, jml, lon_in, lat_in, tmp_var)
-      CALL gr_int_dyn(tmp_var, qsol, iml-1, jml)
-    !
-      CALL flinclo(fid_phys)
-    !
+
+      title='CDSW'
+      CALL conf_dat2d(title,iml_phys, jml_phys, lon_ini, lat_ini,
+     . lon_rad, lat_rad, var_ana, interbar  )
+
+      IF ( interbar )   THEN
+        WRITE(6,*) '-------------------------------------------------',
+     ,'--------------'
+        WRITE(6,*) '$$$ Utilisation de l interpolation barycentrique ',
+     , ' pour  CDSW $$$ '
+        WRITE(6,*) '-------------------------------------------------',
+     ,'--------------'
+        CALL inter_barxy ( iml_phys,jml_phys -1,lon_rad,lat_rad ,
+     ,   var_ana, iml-1, jml-1, lon_in2, lat_in2, jml, tmp_var  )
+      ELSE
+        CALL grille_m(iml_phys, jml_phys, lon_rad, lat_rad,
+     .    var_ana, iml-1, jml, lon_in, lat_in, tmp_var     )
+      ENDIF
+c
+        CALL gr_int_dyn(tmp_var, qsol, iml-1, jml)
+    !
+       CALL flinclo(fid_phys)
+    !
+      DEALLOCATE (lon_rad)
+      DEALLOCATE (lon_ini)
+      DEALLOCATE (lat_rad)
+      DEALLOCATE (lat_ini)
       END SUBROUTINE start_init_phys
     !
@@ -593,15 +682,18 @@
     !
       SUBROUTINE startget_dyn(varname, iml, jml, lon_in, lat_in,
-     . lml, pls, workvar, champ, val_exp)
+     . lml, pls, workvar, champ, val_exp,jml2, lon_in2, lat_in2 ,
+     ,  interbar )
     !
     !   ARGUMENTS
     !
       CHARACTER*(*), INTENT(in) :: varname
-      INTEGER, INTENT(in) :: iml, jml, lml
+      INTEGER, INTENT(in) :: iml, jml, lml, jml2
       REAL, INTENT(in) :: lon_in(iml), lat_in(jml)
+      REAL, INTENT(in) :: lon_in2(iml), lat_in2(jml2)
       REAL, INTENT(in) :: pls(iml, jml, lml)
       REAL, INTENT(in) :: workvar(iml, jml, lml)
       REAL, INTENT(inout) :: champ(iml, jml, lml)
       REAL, INTENT(in) :: val_exp
+      LOGICAL interbar
     !
     !    LOCAL
@@ -609,7 +701,4 @@
       INTEGER :: il, ij, ii
       REAL :: xppn, xpps
-    !
-    !   C'est vraiment une galere de devoir rajouter tant de commons just pour avoir les aires.
-    !   Il faudrait mettre une structure plus flexible et moins dangereuse.
     !
 #include "dimensions.h"
@@ -626,8 +715,9 @@
           CASE ('u')
             IF ( .NOT.ALLOCATED(psol_dyn)) THEN
-              CALL start_init_dyn( iml, jml, lon_in, lat_in)
+              CALL start_init_dyn( iml, jml, lon_in, lat_in, jml2 ,
+     .          lon_in2,lat_in2 , interbar )
             ENDIF
             CALL start_inter_3d('U', iml, jml, lml, lon_in,
-     .                           lat_in, pls, champ)
+     .       lat_in, jml2, lon_in2, lat_in2,  pls, champ,interbar )
             DO il=1,lml
               DO ij=1,jml
@@ -640,8 +730,9 @@
           CASE ('v')
             IF ( .NOT.ALLOCATED(psol_dyn)) THEN
-              CALL start_init_dyn( iml, jml, lon_in, lat_in)
+              CALL start_init_dyn( iml, jml, lon_in, lat_in , jml2, 
+     .           lon_in2, lat_in2 , interbar )
             ENDIF
-            CALL start_inter_3d('V', iml, jml, lml, lon_in,
-     .                          lat_in, pls, champ)
+            CALL start_inter_3d('V', iml, jml, lml, lon_in, 
+     .       lat_in, jml2, lon_in2, lat_in2,  pls, champ, interbar )
             DO il=1,lml
               DO ij=1,jml
@@ -654,15 +745,17 @@
           CASE ('t')
             IF ( .NOT.ALLOCATED(psol_dyn)) THEN
-              CALL start_init_dyn( iml, jml, lon_in, lat_in)
+              CALL start_init_dyn( iml, jml, lon_in, lat_in, jml2 ,
+     .           lon_in2, lat_in2 ,interbar )
             ENDIF
             CALL start_inter_3d('TEMP', iml, jml, lml, lon_in,
-     .                           lat_in, pls, champ)
+     .       lat_in, jml2, lon_in2, lat_in2,  pls, champ, interbar )
  
           CASE ('tpot')
             IF ( .NOT.ALLOCATED(psol_dyn)) THEN
-              CALL start_init_dyn( iml, jml, lon_in, lat_in)
+              CALL start_init_dyn( iml, jml, lon_in, lat_in , jml2 ,
+     .            lon_in2, lat_in2 , interbar )
             ENDIF
             CALL start_inter_3d('TEMP', iml, jml, lml, lon_in,
-     .                           lat_in, pls, champ)
+     .       lat_in, jml2, lon_in2, lat_in2,  pls, champ, interbar )
             IF ( MINVAL(workvar(:,:,:)) .NE. MAXVAL(workvar(:,:,:)) )
      .                                    THEN
@@ -689,8 +782,9 @@
           CASE ('q')
             IF ( .NOT.ALLOCATED(psol_dyn)) THEN
-              CALL start_init_dyn( iml, jml, lon_in, lat_in)
+              CALL start_init_dyn( iml, jml, lon_in, lat_in, jml2 ,
+     .           lon_in2, lat_in2 , interbar )
             ENDIF
             CALL start_inter_3d('R', iml, jml, lml, lon_in, lat_in,
-     .                           pls, champ)
+     .        jml2, lon_in2, lat_in2,  pls, champ, interbar )
             IF ( MINVAL(workvar(:,:,:)) .NE. MAXVAL(workvar(:,:,:)) ) 
      .                                     THEN
@@ -727,8 +821,11 @@
     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     !
-      SUBROUTINE start_init_dyn( iml, jml, lon_in, lat_in)
-    !
-      INTEGER, INTENT(in) :: iml, jml
+      SUBROUTINE start_init_dyn( iml, jml, lon_in, lat_in,jml2,lon_in2 ,
+     ,             lat_in2 , interbar )
+    !
+      INTEGER, INTENT(in) :: iml, jml, jml2
       REAL, INTENT(in) :: lon_in(iml), lat_in(jml)
+      REAL, INTENT(in) :: lon_in2(iml), lat_in2(jml2)
+      LOGICAL interbar
     !
     !  LOCAL
@@ -743,13 +840,16 @@
     !
       REAL, ALLOCATABLE :: lon_rad(:), lat_rad(:)
+      REAL, ALLOCATABLE :: lon_ini(:), lat_ini(:)
       REAL, ALLOCATABLE :: var_ana(:,:), tmp_var(:,:), z(:,:)
       REAL, ALLOCATABLE :: xppn(:), xpps(:)
       LOGICAL :: allo
     !
-    !   Ce n'est pas tres pratique d'avoir a charger 3 include pour avoir la grille du modele
     !
 #include "dimensions.h"
 #include "paramet.h"
 #include "comgeom2.h"
+
+      CHARACTER*25 title
+
     !
       physfname = 'ECDYN.nc'
@@ -764,8 +864,8 @@
       ALLOCATE (lat_dyn(iml_dyn,jml_dyn), stat=iret)
       ALLOCATE (lon_dyn(iml_dyn,jml_dyn), stat=iret)
-      ALLOCATE (lev_dyn(llm_dyn), stat=iret)
+      ALLOCATE (levdyn_ini(llm_dyn), stat=iret)
     !
       CALL flinopen(physfname, .FALSE., iml_dyn, jml_dyn, llm_dyn,
-     . lon_dyn, lat_dyn, lev_dyn, ttm_dyn, 
+     . lon_dyn, lat_dyn, levdyn_ini, ttm_dyn, 
      . itau, date, dt, fid_dyn)
     !
@@ -781,18 +881,25 @@
         DEALLOCATE(lon_rad, stat=iret)
       endif
-        ALLOCATE(lon_rad(iml_dyn), stat=iret)
+
+      ALLOCATE(lon_rad(iml_dyn), stat=iret)
+      ALLOCATE(lon_ini(iml_dyn))
        
       IF ( MAXVAL(lon_dyn(:,:)) .GT. 2.0 * ASIN(1.0) ) THEN
-          lon_rad(:) = lon_dyn(:,1) * 2.0 * ASIN(1.0) / 180.0
-      ELSE
-          lon_rad(:) = lon_dyn(:,1) 
-      ENDIF
+          lon_ini(:) = lon_dyn(:,1) * 2.0 * ASIN(1.0) / 180.0
+      ELSE
+          lon_ini(:) = lon_dyn(:,1) 
+      ENDIF
+
       ALLOCATE(lat_rad(jml_dyn))
+      ALLOCATE(lat_ini(jml_dyn))
+
       IF ( MAXVAL(lat_dyn(:,:)) .GT. 2.0 * ASIN(1.0) ) THEN
-          lat_rad(:) = lat_dyn(1,:) * 2.0 * ASIN(1.0) / 180.0
-      ELSE
-          lat_rad(:) = lat_dyn(1,:) 
-      ENDIF
-    !
+          lat_ini(:) = lat_dyn(1,:) * 2.0 * ASIN(1.0) / 180.0
+      ELSE
+          lat_ini(:) = lat_dyn(1,:) 
+      ENDIF
+    !
+
+
       ALLOCATE(z(iml, jml))
       ALLOCATE(tmp_var(iml-1,jml))
@@ -800,6 +907,23 @@
       CALL flinget(fid_dyn, 'Z', iml_dyn, jml_dyn, 0, ttm_dyn,
      .              1, 1, var_ana)
-      CALL grille_m(iml_dyn, jml_dyn , lon_rad, lat_rad, var_ana,
+c
+      title='Z'
+      CALL conf_dat2d( title,iml_dyn, jml_dyn,lon_ini, lat_ini,
+     . lon_rad, lat_rad, var_ana, interbar  )
+c
+      IF ( interbar )   THEN
+        WRITE(6,*) '-------------------------------------------------',
+     ,'--------------'
+        WRITE(6,*) '$$$ Utilisation de l interpolation barycentrique ',
+     , ' pour  Z  $$$ '
+        WRITE(6,*) '-------------------------------------------------',
+     ,'--------------'
+        CALL inter_barxy ( iml_dyn,jml_dyn -1,lon_rad,lat_rad ,
+     ,    var_ana, iml-1, jml-1, lon_in2, lat_in2, jml, tmp_var) 
+      ELSE
+        CALL grille_m(iml_dyn, jml_dyn , lon_rad, lat_rad, var_ana,
      .               iml-1, jml, lon_in, lat_in, tmp_var)
+      ENDIF
+
       CALL gr_int_dyn(tmp_var, z, iml-1, jml)
     !
@@ -808,6 +932,23 @@
       CALL flinget(fid_dyn, 'SP', iml_dyn, jml_dyn, 0, ttm_dyn,
      .              1, 1, var_ana)
-      CALL grille_m(iml_dyn, jml_dyn , lon_rad, lat_rad, var_ana,
-     .               iml-1, jml, lon_in, lat_in, tmp_var)
+
+       title='SP'
+      CALL conf_dat2d( title,iml_dyn, jml_dyn,lon_ini, lat_ini,
+     . lon_rad, lat_rad, var_ana, interbar  )
+
+      IF ( interbar )   THEN
+        WRITE(6,*) '-------------------------------------------------',
+     ,'--------------'
+        WRITE(6,*) '$$$ Utilisation de l interpolation barycentrique ',
+     , ' pour  SP  $$$ '
+        WRITE(6,*) '-------------------------------------------------',
+     ,'--------------'
+        CALL inter_barxy ( iml_dyn,jml_dyn -1,lon_rad,lat_rad ,
+     ,    var_ana, iml-1, jml-1, lon_in2, lat_in2, jml, tmp_var) 
+      ELSE
+        CALL grille_m(iml_dyn, jml_dyn , lon_rad, lat_rad, var_ana,
+     .             iml-1, jml, lon_in, lat_in, tmp_var  )
+      ENDIF
+
       CALL gr_int_dyn(tmp_var, psol_dyn, iml-1, jml)
     !
@@ -817,5 +958,6 @@
     !   coming out of the restart file. In case we dor have it we will initialize it.
     !
-        CALL start_init_phys( iml, jml, lon_in, lat_in)
+        CALL start_init_phys( iml, jml, lon_in, lat_in,jml2,lon_in2,
+     .                 lat_in2 , interbar )
       ELSE
         IF ( SIZE(tsol) .NE. SIZE(psol_dyn) ) THEN
@@ -831,5 +973,6 @@
             !     coming out of the restart file. In case we dor have it we will initialize it.
             !
-          CALL start_init_orog( iml, jml, lon_in, lat_in)
+        CALL start_init_orog( iml, jml, lon_in, lat_in, jml2, lon_in2 ,
+     .      lat_in2 , interbar )
             !
       ELSE
@@ -877,5 +1020,5 @@
     !
       SUBROUTINE start_inter_3d(varname, iml, jml, lml, lon_in,
-     .                           lat_in, pls_in, var3d)
+     .      lat_in, jml2, lon_in2, lat_in2, pls_in, var3d, interbar )
     !
     !    This subroutine gets a variables from a 3D file and does the interpolations needed
@@ -885,15 +1028,21 @@
     !
       CHARACTER*(*) :: varname
-      INTEGER :: iml, jml, lml
+      INTEGER :: iml, jml, lml, jml2
       REAL :: lon_in(iml), lat_in(jml), pls_in(iml, jml, lml)
+      REAL :: lon_in2(iml) , lat_in2(jml2)
       REAL :: var3d(iml, jml, lml)
+      LOGICAL interbar
+      real chmin,chmax
     !
     !  LOCAL
     !
-      INTEGER :: ii, ij, il
+      CHARACTER*25 title
+      INTEGER :: ii, ij, il, jsort,i,j,l
       REAL :: bx, by
       REAL, ALLOCATABLE :: lon_rad(:), lat_rad(:)
+      REAL, ALLOCATABLE :: lon_ini(:), lat_ini(:) , lev_dyn(:)
       REAL, ALLOCATABLE :: var_tmp2d(:,:), var_tmp3d(:,:,:)
       REAL, ALLOCATABLE :: ax(:), ay(:), yder(:)
+       REAL, ALLOCATABLE :: varrr(:,:,:)
       INTEGER, ALLOCATABLE :: lind(:)
     !
@@ -903,4 +1052,5 @@
           ALLOCATE(var_ana3d(iml_dyn, jml_dyn, llm_dyn))
       ENDIF
+          ALLOCATE(varrr(iml_dyn, jml_dyn, llm_dyn))
     !
     !
@@ -917,16 +1067,28 @@
     !
       ALLOCATE(lon_rad(iml_dyn))
+      ALLOCATE(lon_ini(iml_dyn))
+
       IF ( MAXVAL(lon_dyn(:,:)) .GT. 2.0 * ASIN(1.0) ) THEN
-          lon_rad(:) = lon_dyn(:,1) * 2.0 * ASIN(1.0) / 180.0
-      ELSE
-          lon_rad(:) = lon_dyn(:,1) 
-      ENDIF
+          lon_ini(:) = lon_dyn(:,1) * 2.0 * ASIN(1.0) / 180.0
+      ELSE
+          lon_ini(:) = lon_dyn(:,1) 
+      ENDIF
+
       ALLOCATE(lat_rad(jml_dyn))
+      ALLOCATE(lat_ini(jml_dyn))
+
+      ALLOCATE(lev_dyn(llm_dyn))
+
       IF ( MAXVAL(lat_dyn(:,:)) .GT. 2.0 * ASIN(1.0) ) THEN
-          lat_rad(:) = lat_dyn(1,:) * 2.0 * ASIN(1.0) / 180.0
-      ELSE
-          lat_rad(:) = lat_dyn(1,:) 
-      ENDIF
-    !
+          lat_ini(:) = lat_dyn(1,:) * 2.0 * ASIN(1.0) / 180.0
+      ELSE
+          lat_ini(:) = lat_dyn(1,:) 
+      ENDIF
+    !
+
+      CALL conf_dat3d ( varname,iml_dyn, jml_dyn, llm_dyn, lon_ini, 
+     . lat_ini, levdyn_ini, lon_rad, lat_rad, lev_dyn, var_ana3d  ,
+     ,  interbar                                                   )
+
       ALLOCATE(var_tmp2d(iml-1, jml))
       ALLOCATE(var_tmp3d(iml, jml, llm_dyn))
@@ -936,8 +1098,22 @@
       ALLOCATE(lind(llm_dyn))
     !
+ 
       DO il=1,llm_dyn
         !
-        CALL grille_m(iml_dyn, jml_dyn, lon_rad, lat_rad, 
-     .var_ana3d(:,:,il), iml-1, jml, lon_in, lat_in, var_tmp2d)
+      IF( interbar )  THEN
+       IF( il.EQ.1 )  THEN
+        WRITE(6,*) '-------------------------------------------------',
+     ,'--------------'
+        WRITE(6,*) '$$$ Utilisation de l interpolation barycentrique ',
+     , ' pour ', varname
+        WRITE(6,*) '-------------------------------------------------',
+     ,'--------------'
+       ENDIF
+       CALL inter_barxy ( iml_dyn, jml_dyn -1,lon_rad, lat_rad, 
+     , var_ana3d(:,:,il),iml-1, jml2, lon_in2, lat_in2,jml,var_tmp2d ) 
+      ELSE
+       CALL grille_m(iml_dyn, jml_dyn, lon_rad, lat_rad, 
+     .  var_ana3d(:,:,il), iml-1, jml, lon_in, lat_in, var_tmp2d )
+      ENDIF
         !
         CALL gr_int_dyn(var_tmp2d, var_tmp3d(:,:,il), iml-1, jml)
@@ -945,23 +1121,19 @@
        ENDDO
        !
-       !  IF needed we return the vertical axis. The spline interpolation
-       !  Requires the coordinate to be in increasing order.
-    !
-      IF ( lev_dyn(1) .LT. lev_dyn(llm_dyn)) THEN
-          DO il=1,llm_dyn
-            lind(il) = il
-          ENDDO        
-      ELSE
           DO il=1,llm_dyn
             lind(il) = llm_dyn-il+1
           ENDDO
-      ENDIF
-    !
+    !
+c
+c  ... Pour l'interpolation verticale ,on interpole du haut de l'atmosphere
+c                    vers  le  sol  ...
+c
       DO ij=1,jml
         DO ii=1,iml-1
           !
-          ax(:) = lev_dyn(lind(:)) * 100
+          ax(:) = lev_dyn(lind(:)) 
           ay(:) = var_tmp3d(ii, ij, lind(:))
           !
+         
           CALL SPLINE(ax, ay, llm_dyn, 1.e30, 1.e30, yder)
           !
@@ -976,4 +1148,18 @@
       ENDDO
 
+      do il=1,lml
+        call minmax(iml*jml,var3d(1,1,il),chmin,chmax)
+      SELECTCASE(varname)
+       CASE('U')
+          WRITE(*,*) ' U  min max l ',il,chmin,chmax
+       CASE('V')
+          WRITE(*,*) ' V  min max l ',il,chmin,chmax
+       CASE('TEMP')
+          WRITE(*,*) ' TEMP  min max l ',il,chmin,chmax
+       CASE('R')
+          WRITE(*,*) ' R  min max l ',il,chmin,chmax
+      END SELECT
+           enddo
+
       DEALLOCATE(lon_rad)
       DEALLOCATE(lat_rad)
