Index: /LMDZ.3.3/trunk/libf/dyn3d/fluxstokenc.F
===================================================================
--- /LMDZ.3.3/trunk/libf/dyn3d/fluxstokenc.F	(revision 183)
+++ /LMDZ.3.3/trunk/libf/dyn3d/fluxstokenc.F	(revision 184)
@@ -1,4 +1,4 @@
       SUBROUTINE fluxstokenc(pbaru,pbarv,masse,teta,phi,phis,
-     . time_step,itau, fluxid, fluxvid,fluxdid )
+     . time_step,itau )
 
        USE IOIPSL
@@ -30,10 +30,7 @@
 
       REAL pbarvst(iip1,jjp1,llm),zistdyn
+	real dtcum
 
-
-      INTEGER iadvtr
-      integer ndex1d(1)
-      integer ndex2d(ip1jmp1)
-      integer ndex3dv(ip1jm*llm),ndex3d(ip1jmp1*llm)
+      INTEGER iadvtr,ndex(1) 
       integer nscal
       real tst(1),ist(1),istp(1)
@@ -53,13 +50,21 @@
      .  time_step,istdyn* time_step,istdyn* time_step,
      . nqmx, fluxid,fluxvid,fluxdid) 
+	
+	ndex(1) = 0
+        call histwrite(fluxid, 'phis', 1, phis, iip1*jjp1, ndex)
+        call histwrite(fluxid, 'aire', 1, aire, iip1*jjp1, ndex)
+	
+	ndex(1) = 0
+        nscal = 1
+        tst(1) = time_step
+        call histwrite(fluxdid, 'dtvr', 1, tst, nscal, ndex)
+        ist(1)=istdyn
+        call histwrite(fluxdid, 'istdyn', 1, ist, nscal, ndex)
+        istp(1)= istphy
+        call histwrite(fluxdid, 'istphy', 1, istp, nscal, ndex)
+	
 	first = .false.
 
       endif
-
-
-      ndex1d = 0
-      ndex2d = 0
-      ndex3dv = 0
-      ndex3d = 0
 
 
@@ -93,5 +98,4 @@
 c   Test pour savoir si on advecte a ce pas de temps
       IF ( iadvtr.EQ.istdyn ) THEN
-
 c    normalisation
       DO l=1,llm
@@ -124,44 +128,23 @@
 
          iadvtr=0
-
-c     write(*,*)'histwrite phis'
-      call histwrite(fluxid, 'phis', 1, phis, iip1*jjp1, ndex2d)
-c     write(*,*)'histwrite aire'
-      call histwrite(fluxid, 'aire', 1, aire, iip1*jjp1, ndex2d)
+	Print*,'ITAU auqel on stoke les fluxmasses',itau
 	
-      nscal = 1
-      tst(1) = time_step
-c     write(*,*)'histwrite dtvr'
-      call histwrite(fluxdid, 'dtvr', 1, tst, nscal, ndex1d)
-      ist(1)=istdyn
-c     write(*,*)'histwrite istdyn'
-      call histwrite(fluxdid, 'istdyn', 1, ist, nscal, ndex1d)
-      istp(1)= istphy
-c     write(*,*)'histwrite istphy'
-      call histwrite(fluxdid, 'istphy', 1, istp, nscal, ndex1d)
-
-c       write(*,*)'histwrite masse'	
-	call histwrite(fluxid, 'masse', itau, masse,
-     .               iip1*jjp1*llm, ndex3d)
+	call histwrite(fluxid, 'masse', itau, massem,
+     .               iip1*jjp1*llm, ndex)
 	
-c       write(*,*)'histwrite pbaru'	
 	call histwrite(fluxid, 'pbaru', itau, pbarug,
-     .               iip1*jjp1*llm, ndex3d)
+     .               iip1*jjp1*llm, ndex)
 	
-c       write(*,*)'histwrite pbarv'	
-	call histwrite(fluxvid, 'pbarv', itau, pbarvst,
-     .               iim*jjp1*llm, ndex3dv)
+	call histwrite(fluxvid, 'pbarv', itau, pbarvg,
+     .               iip1*jjm*llm, ndex)
 	
-c       write(*,*)'histwrite w'	
         call histwrite(fluxid, 'w' ,itau, wg, 
-     .             iip1*jjp1*llm, ndex3d) 
+     .             iip1*jjp1*llm, ndex) 
 	
-c       write(*,*)'histwrite teta'	
 	call histwrite(fluxid, 'teta' ,itau, tetac, 
-     .             iip1*jjp1*llm, ndex3d) 
+     .             iip1*jjp1*llm, ndex) 
 	
-c       write(*,*)'histwrite phi'	
 	call histwrite(fluxid, 'phi' ,itau, phic, 
-     .             iip1*jjp1*llm, ndex3d) 
+     .             iip1*jjp1*llm, ndex) 
 	
 C
