Index: LMDZ4/branches/V3_test/libf/dyn3dpar/leapfrog_p.F
===================================================================
--- LMDZ4/branches/V3_test/libf/dyn3dpar/leapfrog_p.F	(revision 743)
+++ LMDZ4/branches/V3_test/libf/dyn3dpar/leapfrog_p.F	(revision 753)
@@ -6,5 +6,5 @@
 #define IO_DEBUG
 
-#undef CPP_IOIPSL
+!#undef CPP_IOIPSL
 
       SUBROUTINE leapfrog_p(ucov,vcov,teta,ps,masse,phis,nq,q,clesphy0,
@@ -231,5 +231,5 @@
 #ifdef CPP_IOIPSL
       if (ok_guide.and.(itaufin-itau-1)*dtvr.gt.21600) then
-        call guide(itau,ucov,vcov,teta,q,masse,ps)
+        call guide_pp(itau,ucov,vcov,teta,q,masse,ps)
       else
         IF(prt_level>9)WRITE(*,*)'attention on ne guide pas les ',
@@ -552,5 +552,5 @@
        IF (offline) THEN
 Cmaf stokage du flux de masse pour traceurs OFF-LINE
-
+#undef CPP_IOIPSL
 #ifdef CPP_IOIPSL
            CALL fluxstokenc(pbaru,pbarv,masse,teta,phi,phis,
Index: LMDZ4/branches/V3_test/libf/dyn3dpar/massbar.F
===================================================================
--- LMDZ4/branches/V3_test/libf/dyn3dpar/massbar.F	(revision 753)
+++ LMDZ4/branches/V3_test/libf/dyn3dpar/massbar.F	(revision 753)
@@ -0,0 +1,100 @@
+!
+! $Header$
+!
+      SUBROUTINE massbar(  masse, massebx, masseby )
+c
+c **********************************************************************
+c
+c  Calcule les moyennes en x et  y de la masse d'air dans chaque maille.
+c **********************************************************************
+c    Auteurs : P. Le Van , Fr. Hourdin  .
+c   ..........
+c
+c  ..  masse                 est  un argum. d'entree  pour le s-pg ...
+c  ..  massebx,masseby      sont des argum. de sortie pour le s-pg ...
+c     
+c
+c     IMPLICIT NONE
+c
+#include "dimensions.h"
+#include "paramet.h"
+#include "comconst.h"
+#include "comgeom.h"
+c
+      REAL    masse( ip1jmp1,llm ), massebx( ip1jmp1,llm )  ,
+     *      masseby(   ip1jm,llm )
+c
+c
+c   Methode pour calculer massebx et masseby .
+c   ----------------------------------------
+c
+c    A chaque point scalaire P (i,j) est affecte 4 coefficients d'aires
+c       alpha1(i,j)  calcule  au point ( i+1/4,j-1/4 )
+c       alpha2(i,j)  calcule  au point ( i+1/4,j+1/4 )
+c       alpha3(i,j)  calcule  au point ( i-1/4,j+1/4 )
+c       alpha4(i,j)  calcule  au point ( i-1/4,j-1/4 )
+c
+c    Avec  alpha1(i,j) = aire(i+1/4,j-1/4)/ aire(i,j)        
+c
+c    N.B .  Pour plus de details, voir s-pg  ...  iniconst ...
+c
+c
+c
+c   alpha4 .         . alpha1    . alpha4
+c    (i,j)             (i,j)       (i+1,j)
+c
+c             P .        U .          . P
+c           (i,j)       (i,j)         (i+1,j)
+c
+c   alpha3 .         . alpha2    .alpha3 
+c    (i,j)              (i,j)     (i+1,j)
+c
+c             V .        Z .          . V
+c           (i,j)
+c
+c   alpha4 .         . alpha1    .alpha4
+c   (i,j+1)            (i,j+1)   (i+1,j+1) 
+c
+c             P .        U .          . P
+c          (i,j+1)                    (i+1,j+1)
+c
+c
+c
+c                       On  a :
+c
+c    massebx(i,j) = masse(i  ,j) * ( alpha1(i  ,j) + alpha2(i,j))   +
+c                   masse(i+1,j) * ( alpha3(i+1,j) + alpha4(i+1,j) )
+c     localise  au point  ... U (i,j) ...
+c
+c    masseby(i,j) = masse(i,j  ) * ( alpha2(i,j  ) + alpha3(i,j  )  +
+c                   masse(i,j+1) * ( alpha1(i,j+1) + alpha4(i,j+1)  
+c     localise  au point  ... V (i,j) ...
+c
+c
+c=======================================================================
+
+      DO   100    l = 1 , llm
+c
+        DO  ij = 1, ip1jmp1 - 1
+         massebx(ij,l) =  masse( ij, l) * alpha1p2( ij  )     + 
+     *                   masse(ij+1, l) * alpha3p4(ij+1 )
+        ENDDO
+
+c    .... correction pour massebx( iip1,j) .....
+c    ...    massebx(iip1,j)= massebx(1,j) ...
+c
+CDIR$ IVDEP
+        DO  ij = iip1, ip1jmp1, iip1
+         massebx( ij,l ) = massebx( ij - iim,l )
+        ENDDO
+
+
+         DO  ij = 1,ip1jm
+         masseby( ij,l ) = masse(  ij   , l ) * alpha2p3(   ij    )  +
+     *                     masse(ij+iip1, l ) * alpha1p4( ij+iip1 )
+         ENDDO
+
+100   CONTINUE
+c
+      RETURN
+      END
Index: LMDZ4/branches/V3_test/libf/dyn3dpar/read_reanalyse.F
===================================================================
--- LMDZ4/branches/V3_test/libf/dyn3dpar/read_reanalyse.F	(revision 743)
+++ LMDZ4/branches/V3_test/libf/dyn3dpar/read_reanalyse.F	(revision 753)
@@ -10,4 +10,5 @@
 c   mode=1 variabels GCM
 
+       USE parallel
 c -----------------------------------------------------------------
 c   Declarations
@@ -42,5 +43,5 @@
       integer ncidpl
       integer varidpl,ncidQ,varidQ
-      save ncidu,varidu,ncidv,varidv,ncidt,varidt,ncidps,varidps
+      save ncidpl,ncidu,varidu,ncidv,varidv,ncidt,varidt,ncidps,varidps
       save varidpl,ncidQ,varidQ
 
@@ -55,4 +56,5 @@
       logical first
       save first
+      INTEGER ierr
 
       data first/.true./
@@ -69,41 +71,42 @@
 c Vent zonal
             if (guide_u) then
-            ncidu=NCOPN('u.nc',NCNOWRIT,rcode)
-            varidu=NCVID(ncidu,'UWND',rcode)
-            print*,'ncidu,varidu',ncidu,varidu
-            if (ncidpl.eq.-99) ncidpl=ncidu
+               ncidu=NCOPN('u.nc',NCNOWRIT,rcode)
+               varidu=NCVID(ncidu,'UWND',rcode)
+               print*,'ncidu,varidu',ncidu,varidu
+               if (ncidpl.eq.-99) ncidpl=ncidu
             endif
 
 c Vent meridien
             if (guide_v) then
-            ncidv=NCOPN('v.nc',NCNOWRIT,rcode)
-            varidv=NCVID(ncidv,'VWND',rcode)
-            print*,'ncidv,varidv',ncidv,varidv
-            if (ncidpl.eq.-99) ncidpl=ncidu
-            endif
+               ncidv=NCOPN('v.nc',NCNOWRIT,rcode)
+               varidv=NCVID(ncidv,'VWND',rcode)
+               print*,'ncidv,varidv',ncidv,varidv
+               if (ncidpl.eq.-99) ncidpl=ncidu
+            endif
+           
 
 c Temperature
             if (guide_T) then
-            ncidt=NCOPN('T.nc',NCNOWRIT,rcode)
-            varidt=NCVID(ncidt,'AIR',rcode)
-            print*,'ncidt,varidt',ncidt,varidt
-            if (ncidpl.eq.-99) ncidpl=ncidu
-            endif
-
+               ncidt=NCOPN('T.nc',NCNOWRIT,rcode)
+               varidt=NCVID(ncidt,'AIR',rcode)
+               print*,'ncidt,varidt',ncidt,varidt
+               if (ncidpl.eq.-99) ncidpl=ncidu
+            endif
+            
 c Humidite
             if (guide_Q) then
-            ncidQ=NCOPN('hur.nc',NCNOWRIT,rcode)
-            varidQ=NCVID(ncidQ,'RH',rcode)
-            print*,'ncidQ,varidQ',ncidQ,varidQ
-            if (ncidpl.eq.-99) ncidpl=ncidu
-            endif
-
+               ncidQ=NCOPN('hur.nc',NCNOWRIT,rcode)
+               varidQ=NCVID(ncidQ,'RH',rcode)
+               print*,'ncidQ,varidQ',ncidQ,varidQ
+               if (ncidpl.eq.-99) ncidpl=ncidu
+            endif
+            
 c Pression de surface
             if (guide_P) then
-            ncidps=NCOPN('ps.nc',NCNOWRIT,rcode)
-            varidps=NCVID(ncidps,'SP',rcode)
-            print*,'ncidps,varidps',ncidps,varidps
-            endif
-
+               ncidps=NCOPN('ps.nc',NCNOWRIT,rcode)
+               varidps=NCVID(ncidps,'SP',rcode)
+               print*,'ncidps,varidps',ncidps,varidps
+            endif
+            
 c Coordonnee vertcale
             if (ncep) then
@@ -134,4 +137,5 @@
       status=NF_GET_VARA_REAL(ncidpl,varidpl,1,nlevnc,pl)
 #endif
+     
 c  passage en pascal
       pl(:)=100.*pl(:)
@@ -160,20 +164,29 @@
       count(4)=1
 
+
+c mise a zero des tableaux 
+c ------------------------
+       unc(:,:,:)=0.
+       vnc(:,:,:)=0.
+       tnc(:,:,:)=0.
+       Qnc(:,:,:)=0.
+
 c  Vent zonal
 c  ----------
 
       if (guide_u) then
-      print*,'avant la lecture de UNCEP nd de niv:',nlevnc
+         print*,'avant la lecture de UNCEP nd de niv:',nlevnc
+
 #ifdef NC_DOUBLE
-      status=NF_GET_VARA_DOUBLE(ncidu,varidu,start,count,unc)
+         status=NF_GET_VARA_DOUBLE(ncidu,varidu,start,count,unc)
 #else
-      status=NF_GET_VARA_REAL(ncidu,varidu,start,count,unc)
+         status=NF_GET_VARA_REAL(ncidu,varidu,start,count,unc)
 #endif
 c     call dump2d(iip1,jjp1,unc,'VENT NCEP   ')
 c     call dump2d(iip1,40,unc(1,1,nlevnc),'VENT NCEP   ')
-      print*,'WARNING!!! Correction bidon pour palier a un '
-      print*,'probleme dans la creation des fichiers nc'
-      call correctbid(iim,jjp1*nlevnc,unc)
-      call dump2d(iip1,jjp1,unc,'UNC COUCHE 1 ')
+         print*,'WARNING!!! Correction bidon pour palier a un '
+         print*,'probleme dans la creation des fichiers nc'
+         call correctbid(iim,jjp1*nlevnc,unc)
+         call dump2d(iip1,jjp1,unc,'UNC COUCHE 1 ')
       endif
 
@@ -185,11 +198,11 @@
       if (guide_T) then
 #ifdef NC_DOUBLE
-      status=NF_GET_VARA_DOUBLE(ncidt,varidt,start,count,tnc)
+         status=NF_GET_VARA_DOUBLE(ncidt,varidt,start,count,tnc)
 #else
-      status=NF_GET_VARA_REAL(ncidt,varidt,start,count,tnc)
+         status=NF_GET_VARA_REAL(ncidt,varidt,start,count,tnc)
 #endif
-      call dump2d(iip1,jjp1,tnc,'TNC COUCHE 1 AAA ')
-      call correctbid(iim,jjp1*nlevnc,tnc)
-      call dump2d(iip1,jjp1,tnc,'TNC COUCHE 1 BBB ')
+         call dump2d(iip1,jjp1,tnc,'TNC COUCHE 1 AAA ')
+         call correctbid(iim,jjp1*nlevnc,tnc)
+         call dump2d(iip1,jjp1,tnc,'TNC COUCHE 1 BBB ')
       endif
 
@@ -199,10 +212,10 @@
       if (guide_Q) then
 #ifdef NC_DOUBLE
-      status=NF_GET_VARA_DOUBLE(ncidQ,varidQ,start,count,Qnc)
+         status=NF_GET_VARA_DOUBLE(ncidQ,varidQ,start,count,Qnc)
 #else
-      status=NF_GET_VARA_REAL(ncidQ,varidQ,start,count,Qnc)
+         status=NF_GET_VARA_REAL(ncidQ,varidQ,start,count,Qnc)
 #endif
-      call correctbid(iim,jjp1*nlevnc,Qnc)
-      call dump2d(iip1,jjp1,Qnc,'QNC COUCHE 1 ')
+         call correctbid(iim,jjp1*nlevnc,Qnc)
+         call dump2d(iip1,jjp1,Qnc,'QNC COUCHE 1 ')
       endif
 
@@ -213,10 +226,10 @@
       if (guide_v) then
 #ifdef NC_DOUBLE
-      status=NF_GET_VARA_DOUBLE(ncidv,varidv,start,count,vnc)
+         status=NF_GET_VARA_DOUBLE(ncidv,varidv,start,count,vnc)
 #else
-      status=NF_GET_VARA_REAL(ncidv,varidv,start,count,vnc)
+         status=NF_GET_VARA_REAL(ncidv,varidv,start,count,vnc)
 #endif
-      call correctbid(iim,jjm*nlevnc,vnc)
-      call dump2d(iip1,jjm,vnc,'VNC COUCHE 1 ')
+         call correctbid(iim,jjm*nlevnc,vnc)
+         call dump2d(iip1,jjm,vnc,'VNC COUCHE 1 ')
       endif
 
@@ -232,10 +245,10 @@
       if (guide_P) then
 #ifdef NC_DOUBLE
-      status=NF_GET_VARA_DOUBLE(ncidps,varidps,start,count,psnc)
+         status=NF_GET_VARA_DOUBLE(ncidps,varidps,start,count,psnc)
 #else
-      status=NF_GET_VARA_REAL(ncidps,varidps,start,count,psnc)
+         status=NF_GET_VARA_REAL(ncidps,varidps,start,count,psnc)
 #endif
-      call dump2d(iip1,jjp1,psnc,'PSNC COUCHE 1 ')
-      call correctbid(iim,jjp1,psnc)
+         call dump2d(iip1,jjp1,psnc,'PSNC COUCHE 1 ')
+         call correctbid(iim,jjp1,psnc)
       endif
 
