Index: LMDZ4/trunk/libf/phylmd/YOECUMF.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/YOECUMF.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/YOECUMF.h	(revision 776)
@@ -14,4 +14,5 @@
       REAL ENTRPEN, ENTRSCV, ENTRMID, ENTRDD
       REAL CMFCTOP, CMFCMAX, CMFCMIN, CMFDEPS, RHCDD, CPRCON
+c$OMP THREADPRIVATE(/YOECUMF/)
 C
 *if (DOC,declared) <> 'UNKNOWN'
Index: LMDZ4/trunk/libf/phylmd/YOEGWD.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/YOEGWD.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/YOEGWD.h	(revision 776)
@@ -11,4 +11,5 @@
       COMMON/YOEGWD/ GFRCRIT,GKWAKE,GRCRIT,GVCRIT,GKDRAG,GKLIFT
      *        ,GHMAX,GRAHILO,GSIGCR,NKTOPG,NSTRA,GSSEC,GTSEC,GVSEC
+c$OMP THREADPRIVATE(/YOEGWD/)
 C
 
Index: LMDZ4/trunk/libf/phylmd/YOETHF.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/YOETHF.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/YOETHF.h	(revision 776)
@@ -14,2 +14,3 @@
       COMMON /YOETHF/R2ES, R3LES, R3IES, R4LES, R4IES, R5LES, R5IES,
      .               RVTMP2, RHOH2O
+!$OMP THREADPRIVATE(/YOETHF/)
Index: LMDZ4/trunk/libf/phylmd/YOETHF.inc
===================================================================
--- LMDZ4/trunk/libf/phylmd/YOETHF.inc	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/YOETHF.inc	(revision 776)
@@ -14,2 +14,3 @@
       COMMON /YOETHF/R2ES, R3LES, R3IES, R4LES, R4IES, R5LES, R5IES, &
      &               RVTMP2, RHOH2O
+!$OMP THREADPRIVATE(/YOETHF/)
Index: LMDZ4/trunk/libf/phylmd/YOMCST.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/YOMCST.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/YOMCST.h	(revision 776)
@@ -37,2 +37,3 @@
      S      ,RALPD ,RBETD ,RGAMD
 !    ------------------------------------------------------------------
+!$OMP THREADPRIVATE(/YOMCST/)
Index: LMDZ4/trunk/libf/phylmd/atm2geo.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/atm2geo.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/atm2geo.F	(revision 776)
@@ -5,4 +5,5 @@
       SUBROUTINE atm2geo ( im, jm, pte, ptn, plon, plat, pxx, pyy, pzz )
       USE dimphy
+      USE mod_phys_lmdz_para
       IMPLICIT NONE
       include 'dimensions90.h'
@@ -26,4 +27,6 @@
       LOGICAL, SAVE :: linit = .FALSE.
 c$OMP THREADPRIVATE(linit)
+
+cym utilise pour le couple, ne fonctionne que en MPI seul
 c
 cxxx      IF ( .NOT. linit ) THEN 
@@ -41,5 +44,5 @@
 c
 c Value at North Pole
-      IF (jjphy_begin==1) THEN
+      IF (is_north_pole) THEN
         pxx ( :,  1) = - ptn ( 1, 1)
         pyy ( :,  1) = - pte ( 1, 1)
@@ -48,5 +51,5 @@
 c Value at South Pole
       
-      IF (jjphy_end==jjm+1) THEN
+      IF (is_south_pole) THEN
         pxx ( :, jm) = + ptn ( 1, jm)
         pyy ( :, jm) = + pte ( 1, jm)
Index: LMDZ4/trunk/libf/phylmd/calcul_divers.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/calcul_divers.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/calcul_divers.h	(revision 776)
@@ -5,5 +5,5 @@
 c initialisations diverses au "debut" du mois
 c
-      IF(MOD(itap,ecrit_mth).EQ.1) THEN
+      IF(MOD(itap,INT(ecrit_mth)).EQ.1) THEN
          DO i=1, klon
           nday_rain(i)=0.
@@ -17,7 +17,7 @@
        ENDDO
 c
-      ENDIF !MOD(itap,ecrit_mth).EQ.1
+      ENDIF !MOD(itap,INT(ecrit_mth)).EQ.1
 c
-      IF(MOD(itap,ecrit_day).EQ.0) THEN
+      IF(MOD(itap,INT(ecrit_day)).EQ.0) THEN
 c
 cIM calcul total_rain, nday_rain
Index: LMDZ4/trunk/libf/phylmd/comgeomphy.F90
===================================================================
--- LMDZ4/trunk/libf/phylmd/comgeomphy.F90	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/comgeomphy.F90	(revision 776)
@@ -9,5 +9,5 @@
   
   subroutine InitComgeomphy
-  use dimphy
+  USE mod_phys_lmdz_para
   implicit none
     
Index: LMDZ4/trunk/libf/phylmd/compbl.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/compbl.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/compbl.h	(revision 776)
@@ -1,2 +1,5 @@
+      !
+      ! $Header$
+      !
       integer iflag_pbl
       common/compbl/iflag_pbl
Index: LMDZ4/trunk/libf/phylmd/condsurf.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/condsurf.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/condsurf.F	(revision 776)
@@ -3,4 +3,6 @@
       SUBROUTINE condsurf( jour, jourvrai, lmt_bils )
       USE dimphy
+      USE mod_grid_phy_lmdz
+      USE mod_phys_lmdz_para
       IMPLICIT none
 c
@@ -39,9 +41,6 @@
       CHARACTER*20 fich
       
-      REAL :: lmt_bils_glo(klon2)
-      REAL,ALLOCATABLE,SAVE :: lmt_bils_mpi(:)
+      REAL :: lmt_bils_glo(klon_glo)
       
-      LOGICAL,SAVE :: first
-c$OMP THREADPRIVATE(first)
 cc
 cc   .....................................................................
@@ -53,7 +52,4 @@
 c
 c
-      IF (first) THEN
-        ALLOCATE(lmt_bils_mpi(klon_mpi))
-      ENDIF
       
       IF (jour.LT.0 .OR. jour.GT.(360-1)) THEN
@@ -92,5 +88,5 @@
 c
 c$OMP MASTER
-      IF (phy_rank==0) THEN
+      IF (is_mpi_root) THEN
       ierr = NF_OPEN (fich, NF_NOWRITE,nid)
       IF (ierr.NE.NF_NOERR) THEN
@@ -106,7 +102,6 @@
       debut(1) = 1
       debut(2) = jourvrai
-      epais(1) = klon2
+      epais(1) = klon_glo
       epais(2) = 1
-c
 c Bilan flux de chaleur au sol:
 c
@@ -132,10 +127,8 @@
       ierr = NF_CLOSE(nid)
       
-      ENDIF ! phyrank==0
+      ENDIF ! is_mpi_root==0
 
-      CALL scatterField(lmt_bils_glo,lmt_bils_mpi,1)
 c$OMP END MASTER
-c$OMP BARRIER
-      CALL scatterField_omp(lmt_bils_mpi,lmt_bils,1)
+      CALL scatter(lmt_bils_glo,lmt_bils)
             
 c
Index: LMDZ4/trunk/libf/phylmd/cv3_routines.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/cv3_routines.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/cv3_routines.F	(revision 776)
@@ -1204,5 +1204,5 @@
 	enddo
       enddo
-
+      
       do 600 k=minorig+1,nl
         do 590 i=1,ncum
@@ -1868,5 +1868,5 @@
         delti = 1./delt
         tinv=1./3.
-        
+
         mp(:,:)=0.
 
Index: LMDZ4/trunk/libf/phylmd/dimphy.F90
===================================================================
--- LMDZ4/trunk/libf/phylmd/dimphy.F90	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/dimphy.F90	(revision 776)
@@ -1,4 +1,43 @@
-module dimphy
-  USE mod_phys_mpi
-  USE mod_phys_openmp
-end module dimphy
+MODULE dimphy
+  
+  INTEGER,SAVE :: klon
+  INTEGER,SAVE :: kdlon
+  INTEGER,SAVE :: kfdia
+  INTEGER,SAVE :: kidia
+  INTEGER,SAVE :: nbtr 
+  INTEGER,SAVE :: klev
+  INTEGER,SAVE :: klevp1
+  INTEGER,SAVE :: klevm1
+  INTEGER,SAVE :: kflev
+
+!$OMP THREADPRIVATE(klon,kfdia,kidia,kdlon)
+  REAL,save,allocatable,dimension(:) :: zmasq
+!$OMP THREADPRIVATE(zmasq)   
+
+CONTAINS
+  
+  SUBROUTINE Init_dimphy(klon0,klev0,nbtr0)
+  IMPLICIT NONE
+  
+    INTEGER, INTENT(in) :: klon0
+    INTEGER, INTENT(in) :: klev0
+    INTEGER, INTENT(in) :: nbtr0
+    
+    klon=klon0
+    
+    kdlon=klon
+    kidia=1
+    kfdia=klon
+!$OMP MASTER 
+    klev=klev0
+    nbtr=nbtr0
+    klevp1=klev+1
+    klevm1=klev-1
+    kflev=klev
+!$OMP END MASTER    
+    ALLOCATE(zmasq(klon))    
+    
+  END SUBROUTINE Init_dimphy
+
+  
+END MODULE dimphy
Index: LMDZ4/trunk/libf/phylmd/hbtm.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/hbtm.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/hbtm.F	(revision 776)
@@ -1,2 +1,6 @@
+!
+! $Header$
+!
+
       SUBROUTINE HBTM(knon, paprs, pplay,
      .                t2m,t10m,q2m,q10m,ustar,
Index: LMDZ4/trunk/libf/phylmd/ini_histISCCP.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/ini_histISCCP.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/ini_histISCCP.h	(revision 776)
@@ -130,5 +130,5 @@
           CALL histdef(nid_isccp, "cldISCCP_"//taulev(k)//typinout(n),
      .                "LMDZ ISCCP cld", "%",
-     .                iim, jjphy_nb,nhori,lmaxm1,1,lmaxm1,nvert,32,
+     .                iim, jj_nb,nhori,lmaxm1,1,lmaxm1,nvert,32,
      .                "ave(X)", zcals(n),zout_isccp(n))
          ENDDO
@@ -136,5 +136,5 @@
          CALL histdef(nid_isccp, "nsunlit"//typinout(n),
      .                "Nb of calls with sunlit ", "%",
-     .                iim, jjphy_nb,nhori,1,1,1,-99,32,
+     .                iim, jj_nb,nhori,1,1,1,-99,32,
      .                "ave(X)", zcals(n),zout_isccp(n))
 c
@@ -152,5 +152,5 @@
            CALL histdef(nid_isccp, pclev(l)//taulev(k)//typinout(n),
      .                "LMDZ ISCCP cld "//cnameisccp(l,k), "%",
-     .                iim, jjphy_nb,nhori,1,1,1,-99,32,
+     .                iim, jj_nb,nhori,1,1,1,-99,32,
      .                "ave(X)", zcals(n),zout_isccp(n))
 c
@@ -161,5 +161,5 @@
           CALL histdef(nid_isccp, "nsunlit"//typinout(n),
      .                "Nb of calls with sunlit ", "%",
-     .                iim, jjphy_nb,nhori,1,1,1,-99,32,
+     .                iim, jj_nb,nhori,1,1,1,-99,32,
      .                "ave(X)", zcals(n),zout_isccp(n))
 c
@@ -167,45 +167,45 @@
           CALL histdef(nid_isccp, "cirr",
      .                "Cirrus lk ISCCP-D2", "%",
-     .                iim, jjphy_nb,nhori,1,1,1,-99,32,
+     .                iim, jj_nb,nhori,1,1,1,-99,32,
      .                "ave(X)", zcals(n),zout_isccp(n))
 c
           CALL histdef(nid_isccp, "cist",
      .                "CiSt lk ISCCP-D2", "%",
-     .                iim, jjphy_nb,nhori,1,1,1,-99,32,
+     .                iim, jj_nb,nhori,1,1,1,-99,32,
      .                "ave(X)", zcals(n),zout_isccp(n))
 c
           CALL histdef(nid_isccp, "deep",
      .                "Deep lk ISCCP-D2", "%",
-     .                iim, jjphy_nb,nhori,1,1,1,-99,32,
+     .                iim, jj_nb,nhori,1,1,1,-99,32,
      .                "ave(X)", zcals(n),zout_isccp(n))
 c
           CALL histdef(nid_isccp, "alcu",
      .                "AlCu lk ISCCP-D2", "%",
-     .                iim, jjphy_nb,nhori,1,1,1,-99,32,
+     .                iim, jj_nb,nhori,1,1,1,-99,32,
      .                "ave(X)", zcals(n),zout_isccp(n))
 c
           CALL histdef(nid_isccp, "alst",
      .                "AlSt lk ISCCP-D2", "%",
-     .                iim, jjphy_nb,nhori,1,1,1,-99,32,
+     .                iim, jj_nb,nhori,1,1,1,-99,32,
      .                "ave(X)", zcals(n),zout_isccp(n))
 c
           CALL histdef(nid_isccp, "nist",
      .                "NiSt lk ISCCP-D2", "%",
-     .                iim, jjphy_nb,nhori,1,1,1,-99,32,
+     .                iim, jj_nb,nhori,1,1,1,-99,32,
      .                "ave(X)", zcals(n),zout_isccp(n))
 c
           CALL histdef(nid_isccp, "cumu",
      .                "Cumu lk ISCCP-D2", "%",
-     .                iim, jjphy_nb,nhori,1,1,1,-99,32,
+     .                iim, jj_nb,nhori,1,1,1,-99,32,
      .                "ave(X)", zcals(n),zout_isccp(n))
 c
           CALL histdef(nid_isccp, "stcu",
      .                "StCu lk ISCCP-D2", "%",
-     .                iim, jjphy_nb,nhori,1,1,1,-99,32,
+     .                iim, jj_nb,nhori,1,1,1,-99,32,
      .                "ave(X)", zcals(n),zout_isccp(n))
 c
           CALL histdef(nid_isccp, "stra",
      .                "Stra lk ISCCP-D2", "%",
-     .                iim, jjphy_nb,nhori,1,1,1,-99,32,
+     .                iim, jj_nb,nhori,1,1,1,-99,32,
      .                "ave(X)", zcals(n),zout_isccp(n))
 c
@@ -213,15 +213,15 @@
           CALL histdef(nid_isccp, "thin",
      .                "Opt. thin ISCCP-D2 like clouds", "%",
-     .                iim, jjphy_nb,nhori,lmax3,1,lmax3,nvert3,32,
+     .                iim, jj_nb,nhori,lmax3,1,lmax3,nvert3,32,
      .                "ave(X)", zcals(n),zout_isccp(n))
 c
           CALL histdef(nid_isccp, "mid",
      .                "Opt. intermediate ISCCP-D2 like clouds", "%",
-     .                iim, jjphy_nb,nhori,lmax3,1,lmax3,nvert3,32,
+     .                iim, jj_nb,nhori,lmax3,1,lmax3,nvert3,32,
      .                "ave(X)", zcals(n),zout_isccp(n))
 c
           CALL histdef(nid_isccp, "thick",
      .                "Opt. thick ISCCP-D2 like clouds", "%",
-     .                iim, jjphy_nb,nhori,lmax3,1,lmax3,nvert3,32,
+     .                iim, jj_nb,nhori,lmax3,1,lmax3,nvert3,32,
      .                "ave(X)", zcals(n),zout_isccp(n))
 c
@@ -236,5 +236,5 @@
           CALL histdef(nid_isccp,"boxptop"//verticaxe(n),
      .                "Boxptop axe"//verticaxe(n), "mb",
-     .                iim, jjphy_nb,nhori,
+     .                iim, jj_nb,nhori,
      .                ncol(n),1,ncol(n),nvlev(n),32,
 cIM  .                ncolmx,1,ncolmx,nvlev,32,
@@ -249,5 +249,5 @@
           CALL histdef(nid_isccp, "seed"//verticaxe(n),
      .                "seed axe"//verticaxe(n), "-",
-     .                iim, jjphy_nb,nhori,1,1,1,-99,32,
+     .                iim, jj_nb,nhori,1,1,1,-99,32,
 cIM  .                "inst(X)", dtime,dtime)
      .                "ave(X)", zcals(n),zout_isccp(n))
Index: LMDZ4/trunk/libf/phylmd/ini_histREGDYN.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/ini_histREGDYN.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/ini_histREGDYN.h	(revision 776)
@@ -5,5 +5,5 @@
       IF (ok_regdyn) THEN
       
-        if (monocpu) then
+        if (is_sequential) then
 c
 cIM      PRINT*, 'La frequence de sortie REGDYN est de ', ecrit_mth
@@ -123,5 +123,5 @@
          CALL histend(nid_regdyn)
 	 
-	 endif ! monocpu
+	 endif ! is_sequential
 
       endif ! ok_regdyn
Index: LMDZ4/trunk/libf/phylmd/ini_histday.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/ini_histday.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/ini_histday.h	(revision 776)
@@ -36,17 +36,17 @@
 c
          CALL histdef(nid_day, "phis", "Surface geop. height", "m2/s2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "once", zstophy,zout)
 c
          CALL histdef(nid_day, "aire", "Grid area", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "once", zstophy,zout)
 c
          CALL histdef(nid_day, "contfracATM","% sfce ter+lic ","-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "once", zstophy,zout)
 c
          CALL histdef(nid_day, "contfracOR","% sfce terre OR", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "once", zstophy,zout)
 c
@@ -54,9 +54,9 @@
 c
          CALL histdef(nid_day, "tsol", "Surface Temperature", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "t2m", "Temperature 2m", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
@@ -66,25 +66,25 @@
          CALL histdef(nid_day, "t2m_min", "Temp. 2m min.",
      .                "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                t2mincels, zstophy,zout)
 c
          CALL histdef(nid_day, "t2m_max", "Temp. 2m max.",
      .                "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                t2maxcels, zstophy,zout)
 c
          CALL histdef(nid_day, "plul", "Large-scale Precip.",
      .   "kg/(s*m2)",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "pluc", "Convective Precip.",
      .   "kg/(s*m2)",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "snowl", "Solid Large-scale Precip.",
      .   "kg/(m2*s)",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
@@ -92,102 +92,102 @@
          CALL histdef(nid_day, "snowc", "Solid Convective Precip.",
      .   "kg/(m2*s)",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
          ENDIF !snowc=0.
 c
          CALL histdef(nid_day, "flat", "Latent heat flux", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "sicf", "Sea-ice fraction", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zstoday,zout)
 c
          CALL histdef(nid_day, "q2m", "Specific humidity", "kg/kg",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "u10m", "Vent zonal 10m", "m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "v10m", "Vent meridien 10m", "m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "wind10m","10-m wind speed","m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "wind10max", "10-m wind speed max.",
      .                "m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                t2maxcels, zstophy,zout)
 c
          CALL histdef(nid_day, "psol", "Surface Pressure", "Pa",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "precip","Precipitation Totale liq+sol"
      .                , "kg/(s*m2)",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "snowf", "Snow fall", "kg/(m2*s)",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
 c        CALL histdef(nid_day, "snow_mass", "Snow Mass", "kg/m2",
-c    .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+c    .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
 c    .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "evap", "Evaporation", "kg/(m2*s)",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "tops", "Solar rad. at TOA", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "topl", "IR rad. at TOA", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "sols", "Net Solar rad. at surf.", 
      .                "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "soll", "Net IR rad. at surface", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "radsol", "Rayonnement au sol", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "cldl", "Low-level cloudiness", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "cldm", "Mid-level cloudiness", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "cldh", "High-level cloudiness", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "cldt", "Total cloudiness", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "cldq", "Cloud liquid water path", 
      .                "kg/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "prw", "Precipitable water", "kg/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
@@ -210,10 +210,10 @@
           CALL histdef(nid_day, "u"//bb2,
      .                 "Zonal wind "//bb2//"mb","m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zout,zout)
 c
           CALL histdef(nid_day, "v"//bb2,
      .                 "Meridional wind "//bb2//"mb","m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zout,zout)
 c
@@ -224,10 +224,10 @@
          CALL histdef(nid_day, "w"//bb2, "Vertical wind "//bb2//"mb",
      .                "m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zout,zout)
 c
          CALL histdef(nid_day,"phi"//bb2, "Geopotential "//bb2//"mb",
      .                "m",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zout,zout)
 c
@@ -237,22 +237,22 @@
 c
          CALL histdef(nid_day, "slp", "Sea Level Pressure", "Pa",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "cape_max", "CAPE max.",
      .                "J/kg",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                capemaxcels, zstophy,zout)
 c
          CALL histdef(nid_day, "solldown", "Down. IR rad. at surface", 
-     .                "W/m2", iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                "W/m2", iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "sens", "Sensible heat flux", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "SWdnSFC", "SWdn at surface","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
@@ -264,5 +264,5 @@
           CALL histdef(nid_day, "lmt_bils", 
      .         "Bilan au sol atmosphere forcee", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
@@ -271,17 +271,17 @@
           CALL histdef(nid_day, "slab_bils",
      .                "Bilan au sol slab", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
           CALL histdef(nid_day, "tslab", "Slab SST ", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
           CALL histdef(nid_day, "seaice", "Slab seaice", "kg/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
           CALL histdef(nid_day, "siceh", "Slab seaice height", "m",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
@@ -290,10 +290,10 @@
          CALL histdef(nid_day, "fluxo",
      .                "Flux turbulents ocean-atmosphere", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "fluxg",
      .                "Flux ocean-glace de mer", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
@@ -303,9 +303,9 @@
 c
          CALL histdef(nid_day, "bils", "Surf. total heat flux", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "fder", "Heat flux derivation", "W/m2/K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
@@ -321,29 +321,29 @@
 c
          CALL histdef(nid_day, "temp", "Air temperature", "K",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "ovap", "Specific humidity", "kg/kg",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "geop", "Geopotential height", "m2/s2",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "vitu", "Zonal wind", "m/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "vitv", "Meridional wind", "m/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "vitw", "Vertical wind", "m/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "pres", "Air pressure", "Pa",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
@@ -361,33 +361,33 @@
 c
          CALL histdef(nid_day, "SWupTOA", "SWup at TOA","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "SWupSFC", "SWup at surface","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "SWdnTOA", "SWdn at TOA","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "SWupTOAclr",
      .                "SWup clear sky at TOA","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 
          CALL histdef(nid_day, "SWupSFCclr",
      .                "SWup clear sky at surface","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 
          CALL histdef(nid_day, "SWdnTOAclr",
      .                "SWdn clear sky at TOA","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 
          CALL histdef(nid_day, "SWdnSFCclr",
      .                "SWdn clear sky at surface","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
@@ -395,10 +395,10 @@
          CALL histdef(nid_day, "LWdnSFC",
      .                "LW down at surface","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "LWupSFC",
      .                "LW down at surface","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
@@ -407,5 +407,5 @@
 c    .                "Cld top pressure","mb",
      .                "Cld top pressure (cf ISCCP simulator)","Pa",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 cIM     ENDIF !(iflag_con.GE.3) THEN 
@@ -418,75 +418,75 @@
 c
          CALL histdef(nid_day, "tter", "Surface Temperature ter", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "tlic", "Surface Temperature lic", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "toce", "Surface Temperature oce", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "tsic", "Surface Temperature sic", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "t2mter", "Temp.tere 2m", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "t2mlic", "Temp.lic 2m", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "t2moce", "Temp.oce 2m", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "t2msic", "Temp.sic 2m", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "t2mter_min", "Temp.terre 2m min.",
      .                "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                t2mincels, zstophy,zout)
 c
          CALL histdef(nid_day, "t2mter_max", "Temp.terre 2m max.",
      .                "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                t2maxcels, zstophy,zout)
 c
          CALL histdef(nid_day, "u10mter", "Vent zonal ter 10m", "m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "u10mlic", "Vent zonal lic 10m", "m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "u10moce", "Vent zonal oce 10m", "m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "u10msic", "Vent zonal sic 10m",
-     .                 "m/s",iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                 "m/s",iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "v10mter", "Vent meridien ter 10m", 
-     .                "m/s", iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                "m/s", iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "v10mlic", "Vent meridien lic 10m",
-     .                 "m/s",iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                 "m/s",iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "v10moce", "Vent meridien oce 10m",
-     .                 "m/s",iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                 "m/s",iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "v10msic", "Vent meridien sic 10m",
-     .                 "m/s",iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                 "m/s",iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
@@ -495,45 +495,45 @@
            call histdef(nid_day, "pourc_"//clnsurf(nsrf), 
      $         "% "//clnsurf(nsrf), "%",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
            call histdef(nid_day, "fract_"//clnsurf(nsrf), 
      $         "Fraction "//clnsurf(nsrf), "1",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
            call histdef(nid_day, "tsol_"//clnsurf(nsrf), 
      $         "Temperature "//clnsurf(nsrf), "K",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
            call histdef(nid_day, "sens_"//clnsurf(nsrf), 
      $         "Sensible heat flux "//clnsurf(nsrf), "W/m2",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 c
            call histdef(nid_day, "lat_"//clnsurf(nsrf), 
      $         "Latent heat flux "//clnsurf(nsrf), "W/m2",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
            call histdef(nid_day, "taux_"//clnsurf(nsrf), 
      $         "Zonal wind stress "//clnsurf(nsrf),"Pa",
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 
            call histdef(nid_day, "tauy_"//clnsurf(nsrf), 
      $         "Meridional wind stress "//clnsurf(nsrf), "Pa",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
            call histdef(nid_day, "albe_"//clnsurf(nsrf), 
      $         "Albedo surf. "//clnsurf(nsrf), "-",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
            call histdef(nid_day, "rugs_"//clnsurf(nsrf), 
      $         "Rugosite "//clnsurf(nsrf), "m",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
@@ -552,59 +552,59 @@
          CALL histdef(nid_day, "tops0", "CS Solar rad. at TOA", 
      .                "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "topl0", "CS IR rad. at TOA", 
      .                "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "sols0", "CS Net Solar rad. at surf.", 
      .                "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "soll0", "CS Net IR rad. at surface", 
      .                "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "rneb", "Cloud fraction", "-",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "rnebcon", "Convective Cloud Fraction"
      .                , "-",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day,"lwcon","Cloud liquid water content",
      .                "kg/kg",
-     .                iim,jjphy_nb,nhori, klev,1,klev, nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev, nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
         CALL histdef(nid_day,"iwcon","Cloud ice water content","kg/kg",
-     .                iim,jjphy_nb,nhori, klev,1,klev, nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev, nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day,"lwp","Cloud water path","kg/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day,"iwp","Cloud ice water path","kg/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
         CALL histdef(nid_day,"meantaucld",
      .                "ISCCP mean cloud optical thickness","1",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
         CALL histdef(nid_day,"cldtau","Cloud optical thickness","1",
-     .                iim,jjphy_nb,nhori, klev,1,klev, nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev, nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
         CALL histdef(nid_day,"cldemi","Cloud optical emissivity","1",
-     .                iim,jjphy_nb,nhori, klev,1,klev, nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev, nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
@@ -612,27 +612,27 @@
 c
          CALL histdef(nid_day, "dtcon", "Convection dT", "K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "dqcon", "Convection dQ", "(kg/kg)/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "rh2m", "Relative humidity at 2m", "%",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "qsat2m", "Saturant humidity at 2m", "%",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "tpot", 
      .                "Surface air potential temperature", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_day, "tpote", 
      .        "Surface air equivalent potential temperature", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
Index: LMDZ4/trunk/libf/phylmd/ini_histday_seri.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/ini_histday_seri.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/ini_histday_seri.h	(revision 776)
@@ -3,5 +3,5 @@
 c
 cym Ne fonctionnera pas en mode parallele
-      IF (monocpu) THEN
+      IF (is_sequential) THEN
       
       IF (type_run.EQ."AMIP") THEN
@@ -129,3 +129,3 @@
       ENDIF ! fin de test sur type_run.EQ.AMIP
       
-      ENDIF ! monocpu
+      ENDIF ! is_sequential
Index: LMDZ4/trunk/libf/phylmd/ini_histhf.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/ini_histhf.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/ini_histhf.h	(revision 776)
@@ -40,13 +40,13 @@
 c
          CALL histdef(nid_hf, "aireTER","Grid area CONT","-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "once", zstohf,zout)
 c
          CALL histdef(nid_hf, "contfracATM","% sfce ter+lic ","-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "once", zstohf,zout)
 c
          CALL histdef(nid_hf, "contfracOR","% sfce terre OR", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "once", zstohf,zout)
 c
@@ -54,38 +54,38 @@
 c
          CALL histdef(nid_hf, "t2m", "Temperature 2m", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zstohf,zout)
 c
          CALL histdef(nid_hf, "q2m", "Specific humidity", "kg/kg",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zstohf,zout)
 c
          CALL histdef(nid_hf, "psol", "Surface Pressure", "Pa",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zstohf,zout)
 c
          CALL histdef(nid_hf, "precip", "Precipitation", "kg/(s*m2)",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
 cIM ENSEMBLES BEG
          CALL histdef(nid_hf, "tsol", "Surface Temperature", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zstohf,zout)
 c
          CALL histdef(nid_hf, "slp", "Sea Level Pressure", "Pa",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zstohf,zout)
 c
          CALL histdef(nid_hf, "u10m", "Vent zonal 10m", "m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zstohf,zout)
 c
          CALL histdef(nid_hf, "v10m", "Vent meridien 10m", "m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zstohf,zout)
 c
          CALL histdef(nid_hf, "wind10m","10-m wind speed","m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zstohf,zout)
 c
@@ -105,5 +105,5 @@
           CALL histdef(nid_hf, "phi"//bb2,
      .                "Geopotential "//bb2//"mb", "m",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zstohf,zout)
           ENDIF !bb2.EQ."500"
@@ -115,20 +115,20 @@
 c
          CALL histdef(nid_hf, "cldt", "Total cloudiness", "%",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_hf, "SWnetOR",
      .                "Sfce net SW radiation OR", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_hf, "SWdownOR",
      .                "Sfce incident SW radiation OR", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_hf, "LWdownOR",
      .                "Sfce incident LW radiation OR", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
       ENDIF !lev_histhf.GE.2
@@ -154,5 +154,5 @@
           CALL histdef(nid_hf, "t"//bb2,
      .                 "Temperature "//bb2//"mb","K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zstohf,zout)
 c
@@ -160,5 +160,5 @@
           CALL histdef(nid_hf, "phi"//bb2, 
      .                "Geopotential "//bb2//"mb", "m",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zstohf,zout)
           ENDIF
@@ -166,15 +166,15 @@
           CALL histdef(nid_hf, "q"//bb2,
      .                 "Specific humidity "//bb2//"mb","kg/kg",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zstohf,zout)
 c
           CALL histdef(nid_hf, "u"//bb2,
      .                 "Zonal wind "//bb2//"mb","m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zstohf,zout)
 c
           CALL histdef(nid_hf, "v"//bb2,
      .                 "Meridional wind "//bb2//"mb","m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zstohf,zout)
 c
@@ -216,10 +216,10 @@
           CALL histdef(nid_hf, "u"//bb2,
      .                 "Zonal wind "//bb2//"mb","m/s",
-     .         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .         iim,jj_nb,nhori, 1,1,1, -99, 32,
      .         "inst(X)", zstohf,zstohf)
 c
           CALL histdef(nid_hf, "v"//bb2,
      .                 "Meridional wind "//bb2//"mb","m/s",
-     .         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .         iim,jj_nb,nhori, 1,1,1, -99, 32,
      .         "inst(X)", zstohf,zstohf)
 c
@@ -229,14 +229,14 @@
         CALL histdef(nid_hf, "topl", 
      .       "Outgoing longwave radiation", "W/m2",
-     .       iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .       iim,jj_nb,nhori, 1,1,1, -99, 32,
      .       "ave(X)", zstophy,zout)
 c
         CALL histdef(nid_hf, "precip","Total precipitation rate",
-     .       "kg/(s*m2)",iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .       "kg/(s*m2)",iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .       "ave(X)", zstophy,zout)
 c
         CALL histdef(nid_hf, "slp", 
      .       "Mean sea-level pressure", "Pa",
-     .       iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .       iim,jj_nb,nhori, 1,1,1, -99, 32,
      .       "inst(X)", zstohf,zout)
 c
@@ -261,10 +261,10 @@
           CALL histdef(nid_hf, "t"//bb2,
      .                 "Temperature "//bb2//"mb","K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zstohf,zstohf)
 c
           CALL histdef(nid_hf, "q"//bb2,
      .                 "Specific humidity "//bb2//"mb","kg/kg",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zstohf,zstohf)
 c
@@ -275,10 +275,10 @@
           CALL histdef(nid_hf, "phi"//bb2,
      .                "Geopotential "//bb2//"mb", "m",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zstohf,zstohf)
 c
           CALL histdef(nid_hf, "w"//bb2,
      .                 "Vertical motion "//bb2//"mb","Pa/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zstohf,zstohf)
          ENDIF !bb2.EQ."500"
@@ -288,15 +288,15 @@
           CALL histdef(nid_hf, "t"//bb3,
      .                 "Temperature "//bb3//"mb","K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zstohf,zstohf)
 c
           CALL histdef(nid_hf, "u"//bb3,
      .                 "Zonal wind "//bb3//"mb","m/s",
-     .         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .         iim,jj_nb,nhori, 1,1,1, -99, 32,
      .         "inst(X)", zstohf,zstohf)
 c
           CALL histdef(nid_hf, "v"//bb3,
      .                 "Meridional wind "//bb3//"mb","m/s",
-     .         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .         iim,jj_nb,nhori, 1,1,1, -99, 32,
      .         "inst(X)", zstohf,zstohf)
 c
@@ -306,77 +306,77 @@
 c
         CALL histdef(nid_hf, "u10m", "Vent zonal 10m", "m/s",
-     .               iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .               iim,jj_nb,nhori, 1,1,1, -99, 32,
      .               "inst(X)", zstohf,zout)
 c
         CALL histdef(nid_hf, "v10m", "Vent meridien 10m", "m/s",
-     .               iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .               iim,jj_nb,nhori, 1,1,1, -99, 32,
      .               "inst(X)", zstohf,zout)
 c
         CALL histdef(nid_hf, "t2m", "Temperature 2m", "K",
-     .               iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .               iim,jj_nb,nhori, 1,1,1, -99, 32,
      .               "inst(X)", zstohf,zout)
 c
         CALL histdef(nid_hf, "q2m", "Specific humidity", "kg/kg",
-     .               iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .               iim,jj_nb,nhori, 1,1,1, -99, 32,
      .               "inst(X)", zstohf,zout)
 c
         CALL histdef(nid_hf, "psol", "Surface Pressure", "Pa",
-     .               iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .               iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .               "inst(X)", zstohf,zout)
 c
         CALL histdef(nid_hf, "cldt", "Total cloudiness", "%",
-     .               iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .               iim,jj_nb,nhori, 1,1,1, -99, 32,
      .               "ave(X)", zstohf,zout)
 c
         CALL histdef(nid_hf, "taux",
      $         "Zonal wind stress","Pa",
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstohf,zout)
 c
         CALL histdef(nid_hf, "tauy",
      $         "Meridional wind stress ", "Pa",
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstohf,zout)
 c
         CALL histdef(nid_hf, "prw", "Precipitable water", "kg/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
 cIM 090904  .                "ave(X)", zstohf,zout)
      .                "ave(X)", zstophy,zout)
 c
         CALL histdef(nid_hf, "sens", "Sensible heat flux", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
 cIM 090904  .                "ave(X)", zstohf,zout)
      .                "ave(X)", zstophy,zout)
 c
         CALL histdef(nid_hf, "flat", "Latent heat flux", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstohf,zout)
 c
 c       CALL histdef(nid_hf, "snow_mass", "Snow Mass", "kg/m2",
-c    .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+c    .                iim,jj_nb,nhori, 1,1,1, -99, 32,
 c    .                "ave(X)", zstohf,zout)
 c
         CALL histdef(nid_hf, "SWdnSFC", "SWdn at surface","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstohf,zout)
 c
         CALL histdef(nid_hf, "SWupSFC", "SWup at surface","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstohf,zout)
 c
         CALL histdef(nid_hf,"LWdnSFC","Down. IR rad. at surface",
-     .                "W/m2", iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                "W/m2", iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstohf,zout)
 c
         CALL histdef(nid_hf,"LWupSFC","Upwd. IR rad. at surface",
-     .                "W/m2", iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                "W/m2", iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstohf,zout)
 c
         CALL histdef(nid_hf, "SWdnTOA", "SWdn at TOA","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstohf,zout)
 c
         CALL histdef(nid_hf, "SWupTOA", "SWup at TOA","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstohf,zout)
 c
@@ -384,5 +384,5 @@
          CALL histdef(nid_hf, "PV"//ctetaSTD(k),
      $               "Vorticite potentielle "//ctetaSTD(k)//"K",
-     $               "1/(Pa*s)",iim,jjphy_nb,nhori, 1,1,1, -99,
+     $               "1/(Pa*s)",iim,jj_nb,nhori, 1,1,1, -99,
      $                 32, "inst(X)", zstohf,zout) 
         ENDDO !k=1, nbteta
Index: LMDZ4/trunk/libf/phylmd/ini_histhf3d.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/ini_histhf3d.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/ini_histhf3d.h	(revision 776)
@@ -33,18 +33,18 @@
 c
         CALL histdef(nid_hf3d, "temp", "Air temperature", "K",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
-     .                "inst(X)", zstohf,zout)
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
+     .                "ave(X)", zstohf,zout)
 c
         CALL histdef(nid_hf3d, "ovap", "Specific humidity", "kg/kg",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
-     .                "inst(X)", zstohf,zout)
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
+     .                "ave(X)", zstohf,zout)
 c
         CALL histdef(nid_hf3d, "vitu", "Zonal wind", "m/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
-     .                "inst(X)", zstohf,zout)
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
+     .                "ave(X)", zstohf,zout)
 c
         CALL histdef(nid_hf3d, "vitv", "Meridional wind", "m/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
-     .                "inst(X)", zstohf,zout)
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
+     .                "ave(X)", zstohf,zout)
 c
         CALL histend(nid_hf3d)
Index: LMDZ4/trunk/libf/phylmd/ini_histins.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/ini_histins.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/ini_histins.h	(revision 776)
@@ -34,9 +34,9 @@
 c
          CALL histdef(nid_ins, "phis", "Surface geop. height", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "once", zsto,zout)
 c
          CALL histdef(nid_ins, "aire", "Grid area", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "once", zsto,zout)
 c
@@ -44,50 +44,50 @@
 c
         CALL histdef(nid_ins, "tsol", "Surface Temperature", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "t2m", "Temperature 2m", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "q2m", "Specific humidity 2m", "Kg/Kg",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "u10m", "Vent zonal 10m", "m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "v10m", "Vent meridien 10m", "m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zsto,zout)
 c
         CALL histdef(nid_ins, "psol", "Surface Pressure", "Pa",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "plul", "Large-scale Precip.", "mm/day",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "pluc", "Convective Precip.", "mm/day",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "cdrm", "Momentum drag coef.", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "cdrh", "Heat drag coef.", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "precip", "Precipitation Totale liq+sol", 
      .                "kg/(s*m2)",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "snow", "Snow fall", "kg/(s*m2)",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zsto,zout)
 c
@@ -97,49 +97,49 @@
 c
          CALL histdef(nid_ins, "topl", "OLR", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "evap", "Evaporation", "kg/(s*m2)",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "sols", "Solar rad. at surf.", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "soll", "IR rad. at surface", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "solldown", "Down. IR rad. at surface", 
-     .                "W/m2", iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                "W/m2", iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "bils", "Surf. total heat flux", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "sens", "Sensible heat flux", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "fder", "Heat flux derivation", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zsto,zout)
 c
       CALL histdef(nid_ins, "dtsvdfo", "Boundary-layer dTs(o)", "K/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zsto,zout)
 c
       CALL histdef(nid_ins, "dtsvdft", "Boundary-layer dTs(t)", "K/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zsto,zout)
 c
       CALL histdef(nid_ins, "dtsvdfg", "Boundary-layer dTs(g)", "K/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zsto,zout)
 c
       CALL histdef(nid_ins, "dtsvdfi", "Boundary-layer dTs(g)", "K/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zsto,zout)
 
@@ -148,58 +148,58 @@
            call histdef(nid_ins, "pourc_"//clnsurf(nsrf), 
      $         "% "//clnsurf(nsrf), "%",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "inst(X)", zsto,zout)
 
            call histdef(nid_ins, "fract_"//clnsurf(nsrf), 
      $         "Fraction "//clnsurf(nsrf), "1",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "inst(X)", zsto,zout)
 
            call histdef(nid_ins, "sens_"//clnsurf(nsrf), 
      $         "Sensible heat flux "//clnsurf(nsrf), "W/m2",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "inst(X)", zsto,zout)
 c
            call histdef(nid_ins, "tsol_"//clnsurf(nsrf), 
      $         "Surface Temperature"//clnsurf(nsrf), "W/m2",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "inst(X)", zsto,zout)
 c
            call histdef(nid_ins, "lat_"//clnsurf(nsrf), 
      $         "Latent heat flux "//clnsurf(nsrf), "W/m2",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "inst(X)", zsto,zout)
 C
            call histdef(nid_ins, "taux_"//clnsurf(nsrf), 
      $         "Zonal wind stress"//clnsurf(nsrf),"Pa",
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "inst(X)", zsto,zout)
 
            call histdef(nid_ins, "tauy_"//clnsurf(nsrf), 
      $         "Meridional xind stress "//clnsurf(nsrf), "Pa",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "inst(X)", zsto,zout)
 c
            call histdef(nid_ins, "albe_"//clnsurf(nsrf), 
      $         "Albedo "//clnsurf(nsrf), "-",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "inst(X)", zsto,zout)
 c
            call histdef(nid_ins, "rugs_"//clnsurf(nsrf), 
      $         "rugosite "//clnsurf(nsrf), "-",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "inst(X)", zsto,zout)
 CXXX
          END DO 
          CALL histdef(nid_ins, "rugs", "rugosity", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zsto,zout)
 
 c
          CALL histdef(nid_ins, "albs", "Surface albedo", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zsto,zout)
          CALL histdef(nid_ins, "albslw", "Surface albedo LW", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zsto,zout)
 c
@@ -208,44 +208,44 @@
 c HBTM2
          CALL histdef(nid_ins, "s_pblh", "Boundary Layer Height", "m",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "s_pblt", "T at Boundary Layer Height", 
      .                "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "s_lcl", "Condensation level", "m",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "s_capCL", "Conv avlbl pot ener for 
      .                ABL", "J/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "s_oliqCL", "Liq Water in BL", "kg/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "s_cteiCL", "Instability criteria 
      .                (ABL)", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "s_therm", "Exces du thermique", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "s_trmb1", "deep_cape(HBTM2)", "J/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "s_trmb2", "inhibition (HBTM2)", "J/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "s_trmb3", "Point Omega (HBTM2)", "m",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zsto,zout)
 c
@@ -255,29 +255,29 @@
 c
          CALL histdef(nid_ins, "temp", "Temperature", "K",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "vitu", "Zonal wind", "m/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "vitv", "Merid wind", "m/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "geop", "Geopotential height", "m",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "pres", "Air pressure", "Pa",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "dtvdf", "Boundary-layer dT", "K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "inst(X)", zsto,zout)
 c
          CALL histdef(nid_ins, "dqvdf", "Boundary-layer dQ", "Kg/Kg/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "inst(X)", zsto,zout)
 c
Index: LMDZ4/trunk/libf/phylmd/ini_histmth.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/ini_histmth.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/ini_histmth.h	(revision 776)
@@ -40,19 +40,19 @@
          CALL histdef(nid_mth, "phis", 
      .                "Surface geop. height", "m2/s2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "once",  zstophy,zout)
 c
          CALL histdef(nid_mth, "aire", "Grid area", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "once",  zstophy,zout)
 c
          CALL histdef(nid_mth, "pourc_"//clnsurf(is_ter), 
      .         "% "//clnsurf(is_ter), "%",  
-     .         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .         iim,jj_nb,nhori, 1,1,1, -99, 32,
      .         "once", zstophy,zout)
 c
          CALL histdef(nid_mth, "fract_"//clnsurf(is_ter), 
      .         "Fraction "//clnsurf(is_ter), "1",  
-     .         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .         iim,jj_nb,nhori, 1,1,1, -99, 32,
      .         "once", zstophy,zout)
 c
@@ -60,13 +60,13 @@
 c
          CALL histdef(nid_mth, "slp", "Sea Level Pressure", "Pa",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "tsol", "Surface Temperature", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "t2m", "Temperature 2m", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
@@ -74,49 +74,49 @@
          CALL histdef(nid_mth, "t2m_min", "Temp. 2m min.",
      .                "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                t2mincels, zstophy,zout)
 c
          CALL histdef(nid_mth, "t2m_max", "Temp. 2m max.",
      .                "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                t2maxcels, zstophy,zout)
 c
 c        CALL histdef(nid_mth, "tsoil", "Sfce soil Temperature",
 c    .                "K",
-c    .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+c    .                iim,jj_nb,nhori, 1,1,1, -99, 32,
 c    .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "wind10m","10-m wind speed","m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "sicf", "Sea-ice fraction", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
 c ENSEMBLES END
          CALL histdef(nid_mth, "q2m", "Specific humidity 2m", "kg/kg",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "u10m", "Vent zonal 10m", "m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "v10m", "Vent meridien 10m", "m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "psol", "Surface Pressure", "Pa",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "qsurf", "Surface Air humidity", "kg/kg",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
       if (.not. ok_veget) then
          CALL histdef(nid_mth, "qsol", "Soil watter content", "mm",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
       endif
@@ -124,162 +124,162 @@
          CALL histdef(nid_mth, "ndayrain", 
      .                "Number of day with rain (liq+sol)", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zstomth,zout)
 c
          CALL histdef(nid_mth, "precip", "Precipitation Totale liq+sol", 
      .                "kg/(s*m2)",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "plul", "Large-scale Precip.", 
      .   "kg/(s*m2)",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "pluc", "Convective Precip.", 
      .   "kg/(s*m2)",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "snow", "Snow fall", "kg/(s*m2)",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
 c        CALL histdef(nid_mth, "snow_mass", "Snow Mass", "kg/m2",
-c    .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+c    .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
 c    .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "evap", "Evaporation", "kg/(s*m2)",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "tops", "Solar rad. at TOA", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "tops0", "CS Solar rad. at TOA", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "topl", "IR rad. at TOA", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "topl0", "IR rad. at TOA", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWupTOA", "SWup at TOA","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWupTOAclr", 
      .                "SWup clear sky at TOA","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWdnTOA", "SWdn at TOA","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWdnTOAclr", 
      .                "SWdn clear sky at TOA","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWup200", "SWup at 200mb","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWup200clr", 
      .                "SWup clear sky at 200mb","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWdn200", "SWdn at 200mb","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWdn200clr", 
      .                "SWdn clear sky at 200mb","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "LWup200", "LWup at 200mb","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "LWup200clr", 
      .                "LWup clear sky at 200mb","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "LWdn200", "LWdn at 200mb","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "LWdn200clr", 
      .                "LWdn clear sky at 200mb","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "sols", "Solar rad. at surf.", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "sols0", "Solar rad. at surf.", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "soll", "IR rad. at surface", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "radsol", "Rayonnement au sol", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "soll0", "IR rad. at surface", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWupSFC", "SWup at surface","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWupSFCclr", 
      .                "SWup clear sky at surface","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWdnSFC", "SWdn at surface","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWdnSFCclr", 
      .                "SWdn clear sky at surface","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth,"LWupSFC","Upwd. IR rad. at surface", 
-     .                "W/m2", iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                "W/m2", iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth,"LWdnSFC","Down. IR rad. at surface", 
-     .                "W/m2", iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                "W/m2", iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth,"LWupSFCclr",
      .                "CS Upwd. IR rad. at surface", 
-     .                "W/m2", iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                "W/m2", iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth,"LWdnSFCclr",
      .                "Down. CS IR rad. at surface", 
-     .                "W/m2", iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                "W/m2", iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "bils", "Surf. total heat flux", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
@@ -289,25 +289,25 @@
 c
          CALL histdef(nid_mth, "fder", "Heat flux derivation", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
 c          CALL histdef(nid_mth, "frtu", "Zonal wind stress", "Pa",
-c    .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+c    .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
 c    .                "ave(X)", zstophy,zout)
 c
 c        CALL histdef(nid_mth, "frtv", "Meridional wind stress", "Pa",
-c    .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+c    .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
 c    .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "ffonte","Thermal flux for snow melting",
-     .                "W/m2",iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                "W/m2",iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "fqcalving","Ice Calving",
-     .                "kg/m2/s",iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                "kg/m2/s",iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "fqfonte","Land ice melt",
-     .                "kg/m2/s",iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                "kg/m2/s",iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zsto,zout)
 
@@ -315,10 +315,10 @@
            call histdef(nid_mth, "taux_"//clnsurf(nsrf), 
      $         "Zonal wind stress"//clnsurf(nsrf), "Pa",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 
            call histdef(nid_mth, "tauy_"//clnsurf(nsrf), 
      $         "Meridional wind stress "//clnsurf(nsrf), "Pa",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
          ENDDO
@@ -329,10 +329,10 @@
            call histdef(nid_mth, "pourc_"//clnsurf(nsrf), 
      $         "% "//clnsurf(nsrf), "%",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 c
            call histdef(nid_mth, "fract_"//clnsurf(nsrf), 
      $         "Fraction "//clnsurf(nsrf), "1",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
           ENDIF !nsrf.GT.2
@@ -340,35 +340,35 @@
            call histdef(nid_mth, "tsol_"//clnsurf(nsrf), 
      $         "Temperature "//clnsurf(nsrf), "K",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
            call histdef(nid_mth, "sens_"//clnsurf(nsrf), 
      $         "Sensible heat flux "//clnsurf(nsrf), "W/m2",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 c
            call histdef(nid_mth, "lat_"//clnsurf(nsrf), 
      $         "Latent heat flux "//clnsurf(nsrf), "W/m2",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
            call histdef(nid_mth, "flw_"//clnsurf(nsrf),
      $         "LW "//clnsurf(nsrf), "W/m2",
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 c
            call histdef(nid_mth, "fsw_"//clnsurf(nsrf),
      $         "SW "//clnsurf(nsrf), "W/m2",
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
            call histdef(nid_mth, "wbils_"//clnsurf(nsrf),
      $         "Bilan sol "//clnsurf(nsrf), "W/m2",
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
            call histdef(nid_mth, "wbilo_"//clnsurf(nsrf),
      $         "Bilan eau "//clnsurf(nsrf), "kg/(m2*s)",
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
@@ -378,10 +378,10 @@
            call histdef(nid_mth, "evapour_"//clnsurf(nsrf),
      $         "Evap*pourc "//clnsurf(nsrf), "kg/(s*m2)",
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
            call histdef(nid_mth, "prepour_"//clnsurf(nsrf),
      $         "Precip*pourc "//clnsurf(nsrf), "kg/(s*m2)",
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
@@ -392,53 +392,53 @@
 c
          CALL histdef(nid_mth, "cdrm", "Momentum drag coef.", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "cdrh", "Heat drag coef.", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "cldl", "Low-level cloudiness", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "cldm", "Mid-level cloudiness", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "cldh", "High-level cloudiness", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "cldt", "Total cloudiness", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth,"cldq","Cloud liquid water path","kg/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth,"lwp","Cloud water path","kg/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth,"iwp","Cloud ice water path","kg/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "ue", "Zonal energy transport", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "ve", "Merid energy transport", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "uq", "Zonal humidity transport", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "vq", "Merid humidity transport", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 cKE43
@@ -446,21 +446,21 @@
 c
          CALL histdef(nid_mth, "cape", "Conv avlbl pot ener", "J/kg",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "pbase", "Cld base pressure", "mb",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "ptop", "Cld top pressure", "mb",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "fbase", "Cld base mass flux", "kg/m2/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "prw", "Precipitable water", "kg/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
@@ -471,35 +471,35 @@
 c HBTM2
          CALL histdef(nid_mth, "s_pblh", "Boundary Layer Height", "m",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
          CALL histdef(nid_mth, "s_pblt", "t at Boundary Layer Height",
      .                "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
          CALL histdef(nid_mth, "s_lcl", "Condensation level", "m",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
          CALL histdef(nid_mth, "s_capCL", "Conv avlbl pot ener 
      .                for ABL", "J/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
          CALL histdef(nid_mth, "s_oliqCL", "Liq Water in BL", "kg/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
          CALL histdef(nid_mth, "s_cteiCL", "Instability criteria 
      .                (ABL)", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
          CALL histdef(nid_mth, "s_therm", "Exces du thermique", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
          CALL histdef(nid_mth, "s_trmb1", "deep_cape(HBTM2)", "J/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
          CALL histdef(nid_mth, "s_trmb2", "inhibition (HBTM2)", "J/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
          CALL histdef(nid_mth, "s_trmb3", "Point Omega (HBTM2)", "m",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
@@ -523,20 +523,20 @@
           CALL histdef(nid_mth, "u"//bb2,
      .                 "Zonal wind "//bb2//"mb","m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zout,zout)
 c
           CALL histdef(nid_mth, "v"//bb2,
      .                 "Meridional wind "//bb2//"mb","m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zout,zout)
 c
           CALL histdef(nid_mth, "w"//bb2,
      .                 "Vertical wind "//bb2//"mb","m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zout,zout)
 c
           CALL histdef(nid_mth, "phi"//bb2,
      .                 "Geopotential "//bb2//"mb","m",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zout,zout)
 c
@@ -549,15 +549,15 @@
        CALL histdef(nid_mth, "fluxo",
      .              "Flux turbulents ocean-atmosphere", "W/m2",
-     .              iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .              iim,jj_nb,nhori, 1,1,1, -99, 32,
      .              "ave(X)", zstophy,zout)
 c
        CALL histdef(nid_mth, "fluxg",
      .              "Flux turbulents ocean-glace de mer","W/m2",
-     .              iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .              iim,jj_nb,nhori, 1,1,1, -99, 32,
      .              "ave(X)", zstophy,zout)
 c
        CALL histdef(nid_mth, "t_oce_sic",
      .              "Temp. mixte oce-sic","K",
-     .              iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .              iim,jj_nb,nhori, 1,1,1, -99, 32,
      .              "ave(X)", zstophy,zout)
 c
@@ -566,5 +566,5 @@
         CALL histdef(nid_mth, "lmt_bils",
      .       "Bilan au sol atmosphere forcee", "W/m2",
-     .              iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .              iim,jj_nb,nhori, 1,1,1, -99, 32,
      .              "ave(X)", zstophy,zout)
 c
@@ -573,17 +573,17 @@
         CALL histdef(nid_mth, "slab_bils",
      .       "Bilan au sol Slab", "W/m2",
-     .              iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .              iim,jj_nb,nhori, 1,1,1, -99, 32,
      .              "ave(X)", zstophy,zout)
 c
         CALL histdef(nid_mth, "tslab", "Slab SST ", "K",
-     .              iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .              iim,jj_nb,nhori, 1,1,1, -99, 32,
      .              "ave(X)", zstophy,zout)
 c
         CALL histdef(nid_mth, "seaice", "Slab seaice", "kg/m2",
-     .              iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .              iim,jj_nb,nhori, 1,1,1, -99, 32,
      .              "ave(X)", zstophy,zout)
 c
         CALL histdef(nid_mth, "siceh", "Slab seaice height", "m",
-     .              iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .              iim,jj_nb,nhori, 1,1,1, -99, 32,
      .              "ave(X)", zstophy,zout)
 c
@@ -599,70 +599,70 @@
          CALL histdef(nid_mth,"lwcon","Cloud liquid water content",
      .                "kg/kg",
-     .                iim,jjphy_nb,nhori, klev,1,klev, nvert, 32, 
+     .                iim,jj_nb,nhori, klev,1,klev, nvert, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth,"iwcon","Cloud ice water content","kg/kg",
-     .                iim,jjphy_nb,nhori, klev,1,klev, nvert, 32, 
+     .                iim,jj_nb,nhori, klev,1,klev, nvert, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "temp", "Air temperature", "K",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "ovap", "Specific humidity", "kg/kg",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
 c        CALL histdef(nid_mth,"wvap","Water vapor mixing ratio","kg/kg",
-c    .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+c    .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
 c    .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "geop", "Geopotential height", "m2/s2",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "vitu", "Zonal wind", "m/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "vitv", "Meridional wind", "m/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "vitw", "Vertical wind", "m/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "pres", "Air pressure", "Pa",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
         CALL histdef(nid_mth, "rneb", "Cloud fraction", "-",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "rnebcon", "Convective Cloud Fraction"
      .                , "-",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "rhum", "Relative humidity", "-",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "ozone", "Ozone concentration", "ppmv",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "upwd", "saturated updraft", "kg/m2/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dtphy", "Physics dT", "K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dqphy", "Physics dQ", "(kg/kg)/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
@@ -675,14 +675,14 @@
            call histdef(nid_mth, "albe_"//clnsurf(nsrf), 
      $         "Albedo surf. "//clnsurf(nsrf), "-",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 c
            call histdef(nid_mth, "rugs_"//clnsurf(nsrf), 
      $         "Latent heat flux "//clnsurf(nsrf), "W/m2",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "ages_"//clnsurf(nsrf), "Snow age","day",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
@@ -690,8 +690,8 @@
 c
          CALL histdef(nid_mth, "albs", "Surface albedo", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
          CALL histdef(nid_mth, "albslw", "Surface albedo LW", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
@@ -703,119 +703,119 @@
      .                "Convective Cloud Liquid water content"
      .                , "kg/kg",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth,"Ma","undilute adiab updraft","kg/m2/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dnwd", "saturated downdraft","kg/m2/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dnwd0", "unsat. downdraft", "kg/m2/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dtdyn", "Dynamics dT", "K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dqdyn", "Dynamics dQ", "(kg/kg)/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dtcon", "Convection dT", "K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
 c        CALL histdef(nid_mth, "ducon", "Convection du", "m/s2",
-c    .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+c    .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
 c    .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dqcon", "Convection dQ", "(kg/kg)/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dtlsc", "Condensation dT", "K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dtlschr",
-     $     "Large-scale condensational heating rate", "K/s",iim,jjphy_nb
+     $     "Large-scale condensational heating rate", "K/s",iim,jj_nb
      $     ,nhori, klev,1,klev,nvert, 32,"ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dqlsc", "Condensation dQ", "(kg/kg)/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dtvdf", "Boundary-layer dT", "K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dqvdf","Boundary-layer dQ","(kg/kg)/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dteva", "Reevaporation dT", "K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dqeva","Reevaporation dQ","(kg/kg)/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 
          CALL histdef(nid_mth, "ptconv", "POINTS CONVECTIFS"," ",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 
          CALL histdef(nid_mth, "ratqs", "RATQS"," ",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 
 c
          CALL histdef(nid_mth, "dtajs", "Dry adjust. dT", "K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 
          CALL histdef(nid_mth,"dqajs","Dry adjust. dQ","(kg/kg)/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dtswr", "SW radiation dT", "K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dtsw0", "CS SW radiation dT", "K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dtlwr", "LW radiation dT", "K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth,"dtlw0","CS LW radiation dT","K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dtec", "Cinetic dissip dT", "K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "duvdf", "Boundary-layer dU", "m/s2",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dvvdf", "Boundary-layer dV", "m/s2",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          IF (ok_orodr) THEN
          CALL histdef(nid_mth, "duoro", "Orography dU", "m/s2",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dvoro", "Orography dV", "m/s2",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
@@ -824,9 +824,9 @@
          IF (ok_orolf) THEN
          CALL histdef(nid_mth, "dulif", "Orography dU", "m/s2",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dvlif", "Orography dV", "m/s2",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
          ENDIF
@@ -837,5 +837,5 @@
          WRITE(str2,'(i2.2)') iq
          CALL histdef(nid_mth, "trac"//str2, "Tracer No."//str2, "-",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
          ELSE
@@ -853,48 +853,48 @@
 c
          CALL histdef(nid_mth, "phis", "Surface geop. height", "m",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "once",  zstophy,zout)
 c
          CALL histdef(nid_mth, "aire", "Grid area", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "once",  zstophy,zout)
 c
          CALL histdef(nid_mth, "pourc_"//clnsurf(is_ter), 
      .         "% "//clnsurf(is_ter), "%",  
-     .         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .         iim,jj_nb,nhori, 1,1,1, -99, 32,
      .         "once", zstophy,zout)
 c
          CALL histdef(nid_mth, "fract_"//clnsurf(is_ter), 
      .         "Fraction "//clnsurf(is_ter), "1",  
-     .         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .         iim,jj_nb,nhori, 1,1,1, -99, 32,
      .         "once", zstophy,zout)
 c
          CALL histdef(nid_mth, "pourc_"//clnsurf(is_lic), 
      .         "% "//clnsurf(is_lic), "%",  
-     .         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .         iim,jj_nb,nhori, 1,1,1, -99, 32,
      .         "once", zstophy,zout)
 c
          CALL histdef(nid_mth, "fract_"//clnsurf(is_lic), 
      .         "Fraction "//clnsurf(is_lic), "1",  
-     .         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .         iim,jj_nb,nhori, 1,1,1, -99, 32,
      .         "once", zstophy,zout)
 c
          CALL histdef(nid_mth, "pourc_"//clnsurf(is_sic),
      .         "% "//clnsurf(is_sic), "%",
-     .         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .         iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "fract_"//clnsurf(is_sic),
      .         "Fraction "//clnsurf(is_sic), "1",
-     .         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .         iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "flat", "Latent heat flux", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "bilTOA",
      .                "Net radiation at TOA", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
@@ -903,88 +903,88 @@
 c    .                "TOA reflected clear-sky shortwave 
 c    .                radiation (method 1)", "W/m2",
-c    .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+c    .                iim,jj_nb,nhori, 1,1,1, -99, 32,
 c    .                "ave(X)", zstophy,zout)
 c
           CALL histdef(nid_mth, "dtdia","dtdia","K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
           CALL histdef(nid_mth, "dtsw","dtsw","K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
           CALL histdef(nid_mth, "dtlw","dtlw","K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
           CALL histdef(nid_mth, "dtcon","dtcon","K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
           CALL histdef(nid_mth, "dtajs","dtajs","K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
           CALL histdef(nid_mth, "dtlsc","dtlsc","K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
           CALL histdef(nid_mth, "dqdia","dqdia","(kg/kg)/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
           CALL histdef(nid_mth, "duoli",
      .         "duoli","m/s2",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
           CALL histdef(nid_mth, "dvoli",
      .         "dvoli","m/s2",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
           CALL histdef(nid_mth, "ducon",
      .         "ducon","m/s2",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
           CALL histdef(nid_mth, "dvcon",
      .         "dvcon","m/s2",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
           CALL histdef(nid_mth, "dutot",
      .         "dutot","m/s2",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
           CALL histdef(nid_mth, "dvtot",
      .         "dvtot","m/s2",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
 c         CALL histdef(nid_mth, "cldtrue",
 c    .         "TRUE Cloud fraction ","%",
-c    .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+c    .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
 c    .         "inst(X)", zout,zout)
 c
 c         CALL histdef(nid_mth, "cldTOA",
 c    .         "Cloud amount (satellite view)","%",
-c    .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+c    .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
 c    .         "ave(X)", zstophy,zout)
 c
 c         CALL histdef(nid_mth, "cldSFC",
 c    .         "Cloud amount (surface view)","%",
-c    .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+c    .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
 c    .         "ave(X)", zstophy,zout)
 c
           CALL histdef(nid_mth, "GWDtaux",
      .         "GWD induced Ewd wind stress","Pa",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .         "ave(X)", zstophy,zout)
 c
           CALL histdef(nid_mth, "GWDtauy",
      .         "GWD induced Nwd wind stress","Pa",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .         "ave(X)", zstophy,zout)
 c
@@ -992,62 +992,62 @@
 c
          CALL histdef(nid_mth, "slp", "Sea Level Pressure", "Pa",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstorad,zout)
 c
          CALL histdef(nid_mth, "tsol", "Surface Temperature", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "t2m", "Temperature 2m", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstorad,zout)
 c
          CALL histdef(nid_mth, "t2m_min", "Temp. 2m min.",
      .                "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                t2mincels, zstophy,zout)
 c
          CALL histdef(nid_mth, "t2m_max", "Temp. 2m max.",
      .                "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                t2maxcels, zstophy,zout)
 c
 c        CALL histdef(nid_mth, "tsoil", "Sfce soil Temperature",
 c    .                "K",
-c    .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+c    .                iim,jj_nb,nhori, 1,1,1, -99, 32,
 c    .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "wind10m","10-m wind speed","m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstorad,zout)
 c
          CALL histdef(nid_mth, "sicf", "Sea-ice fraction", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 
 c
          CALL histdef(nid_mth, "q2m","Specific humidity 2m","kg/kg",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstorad,zout)
 c
          CALL histdef(nid_mth, "u10m", "Vent zonal 10m", "m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstorad,zout)
 c
          CALL histdef(nid_mth, "v10m", "Vent meridien 10m", "m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstorad,zout)
 c
          CALL histdef(nid_mth, "psol", "Surface Pressure", "Pa",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstorad,zout)
 c
          CALL histdef(nid_mth, "qsurf","Surface Air humidity","kg/kg",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
       if (.not. ok_veget) then
          CALL histdef(nid_mth, "qsol", "Soil watter content", "mm",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
       endif
@@ -1055,187 +1055,187 @@
          CALL histdef(nid_mth, "ndayrain", 
      .                "Number of day with rain (liq+sol)", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "inst(X)", zstomth,zout)
 c
          CALL histdef(nid_mth, "precip", "Precipitation Totale liq+sol", 
      .                "kg/(s*m2)",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "plul", "Large-scale Precip.", 
      .   "kg/(s*m2)",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "pluc", "Convective Precip.", 
      .   "kg/(s*m2)",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "snowf", "Snow fall", "kg/(s*m2)",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
 c        CALL histdef(nid_mth, "snow_mass", "Snow Mass", "kg/m2",
-c    .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+c    .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
 c    .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "evap", 
      .                "Evaporation plus sublimation rate", "kg/(s*m2)",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "tops", "Solar rad. at TOA", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "tops0", "CS Solar rad. at TOA", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "topl", "IR rad. at TOA", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "topl0", "IR rad. at TOA", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWupTOA", "SWup at TOA","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWupTOAclr", 
      .                "SWup clear sky at TOA","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWdnTOA", "SWdn at TOA","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWdnTOAclr", 
      .                "SWdn clear sky at TOA","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWup200", "SWup at 200mb","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWup200clr", 
      .                "SWup clear sky at 200mb","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWdn200", "SWdn at 200mb","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWdn200clr", 
      .                "SWdn clear sky at 200mb","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "LWup200", "LWup at 200mb","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "LWup200clr", 
      .                "LWup clear sky at 200mb","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "LWdn200", "LWdn at 200mb","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "LWdn200clr", 
      .                "LWdn clear sky at 200mb","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "sols", "Solar rad. at surf.", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "sols0", "Solar rad. at surf.", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "soll", "IR rad. at surface", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "radsol", "Rayonnement au sol", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "soll0", "IR rad. at surface", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWupSFC", "SWup at surface","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWupSFCclr", 
      .                "SWup clear sky at surface","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWdnSFC", "SWdn at surface","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "SWdnSFCclr", 
      .                "SWdn clear sky at surface","W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1,-99,
+     .                iim,jj_nb,nhori, 1,1,1,-99,
      .                32, "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth,"LWupSFC","Upwd. IR rad. at surface", 
-     .                "W/m2", iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                "W/m2", iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth,"LWdnSFC","Down. IR rad. at surface", 
-     .                "W/m2", iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                "W/m2", iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth,"LWupSFCclr",
      .                "CS Upwd. IR rad. at surface", 
-     .                "W/m2", iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                "W/m2", iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth,"LWdnSFCclr",
      .                "Down. CS IR rad. at surface", 
-     .                "W/m2", iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                "W/m2", iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "bils", "Surf. total heat flux", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "sens", "Sensible heat flux", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "fder", "Heat flux derivation", "W/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
 c          CALL histdef(nid_mth, "frtu", "Zonal wind stress", "Pa",
-c    .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+c    .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
 c    .                "ave(X)", zstophy,zout)
 c
 c        CALL histdef(nid_mth, "frtv", "Meridional wind stress", "Pa",
-c    .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+c    .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
 c    .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "ffonte","Thermal flux for snow melting",
-     .                "W/m2",iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                "W/m2",iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "fqcalving","Ice Calving",
-     .                "kg/m2/s",iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                "kg/m2/s",iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
@@ -1243,10 +1243,10 @@
            call histdef(nid_mth, "taux_"//clnsurf(nsrf), 
      $         "Zonal wind stress"//clnsurf(nsrf), "Pa",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 
            call histdef(nid_mth, "tauy_"//clnsurf(nsrf), 
      $         "Meridional wind stress "//clnsurf(nsrf), "Pa",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
          ENDDO
@@ -1254,10 +1254,10 @@
            call histdef(nid_mth, "pourc_"//clnsurf(is_oce), 
      $         "% "//clnsurf(is_oce), "%",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 c
            call histdef(nid_mth, "fract_"//clnsurf(is_oce), 
      $         "Fraction "//clnsurf(is_oce), "1",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
@@ -1266,35 +1266,35 @@
            call histdef(nid_mth, "tsol_"//clnsurf(nsrf), 
      $         "Temperature "//clnsurf(nsrf), "K",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
            call histdef(nid_mth, "sens_"//clnsurf(nsrf), 
      $         "Sensible heat flux "//clnsurf(nsrf), "W/m2",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 c
            call histdef(nid_mth, "lat_"//clnsurf(nsrf), 
      $         "Latent heat flux "//clnsurf(nsrf), "W/m2",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
            call histdef(nid_mth, "flw_"//clnsurf(nsrf),
      $         "LW "//clnsurf(nsrf), "W/m2",
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 c
            call histdef(nid_mth, "fsw_"//clnsurf(nsrf),
      $         "SW "//clnsurf(nsrf), "W/m2",
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
            call histdef(nid_mth, "wbils_"//clnsurf(nsrf),
      $         "Bilan sol "//clnsurf(nsrf), "W/m2",
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
            call histdef(nid_mth, "wbilo_"//clnsurf(nsrf),
      $         "Bilan eau "//clnsurf(nsrf), "kg/(m2*s)",
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
@@ -1304,10 +1304,10 @@
            call histdef(nid_mth, "evapour_"//clnsurf(nsrf),
      $         "Evap*pourc "//clnsurf(nsrf), "kg/(s*m2)",
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
            call histdef(nid_mth, "prepour_"//clnsurf(nsrf),
      $         "Precip*pourc "//clnsurf(nsrf), "kg/(s*m2)",
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 C
@@ -1318,53 +1318,53 @@
 c
          CALL histdef(nid_mth, "cdrm", "Momentum drag coef.", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "cdrh", "Heat drag coef.", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "cldl", "Low-level cloudiness", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "cldm", "Mid-level cloudiness", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "cldh", "High-level cloudiness", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "cldt", "Total cloudiness", "%",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth,"cldq","Cloud liquid water path","kg/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth,"lwp","Cloud water path","kg/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth,"iwp","Cloud ice water path","kg/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "ue", "Zonal energy transport", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "ve", "Merid energy transport", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "uq", "Zonal humidity transport", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "vq", "Merid humidity transport", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 cKE43
@@ -1372,25 +1372,25 @@
 c
          CALL histdef(nid_mth, "cape", "Conv avlbl pot ener", "J/kg",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "pbase", "Cld base pressure", "mb",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "ptop", "Cld top pressure", "mb",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "fbase", "Cld base mass flux", "kg/m2/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "prw", "Precipitable water", "kg/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "upwd", "saturated updraft", "kg/m2/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
@@ -1401,35 +1401,35 @@
 c HBTM2
          CALL histdef(nid_mth, "s_pblh", "Boundary Layer Height", "m",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
          CALL histdef(nid_mth, "s_pblt", "T at Boundary Layer Height",
      .                "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
          CALL histdef(nid_mth, "s_lcl", "Condensation level", "m",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
          CALL histdef(nid_mth,"s_capCL","Conv avlbl pot ener for ABL",
      .                "J/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
          CALL histdef(nid_mth, "s_oliqCL", "Liq Water in BL", "kg/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
          CALL histdef(nid_mth,"s_cteiCL","Instability criteria (ABL)",
      .                "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
          CALL histdef(nid_mth, "s_therm", "Exces du thermique", "K",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
          CALL histdef(nid_mth, "s_trmb1", "deep_cape(HBTM2)", "J/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
          CALL histdef(nid_mth, "s_trmb2", "inhibition (HBTM2)", "J/m2",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
          CALL histdef(nid_mth, "s_trmb3", "Point Omega (HBTM2)", "m",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "ave(X)", zstophy,zout)
 c
@@ -1453,20 +1453,20 @@
           CALL histdef(nid_mth, "u"//bb2,
      .                 "Zonal wind "//bb2//"mb","m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zout,zout)
 c
           CALL histdef(nid_mth, "v"//bb2,
      .                 "Meridional wind "//bb2//"mb","m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zout,zout)
 c
           CALL histdef(nid_mth, "w"//bb2,
      .                 "Vertical wind "//bb2//"mb","m/s",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zout,zout)
 c
           CALL histdef(nid_mth, "phi"//bb2,
      .                 "Geopotential "//bb2//"mb","m",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)", zout,zout)
 c
@@ -1480,15 +1480,15 @@
        CALL histdef(nid_mth, "fluxo",
      .              "Flux turbulents ocean-atmosphere", "W/m2",
-     .              iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .              iim,jj_nb,nhori, 1,1,1, -99, 32,
      .              "ave(X)", zstophy,zout)
 c
        CALL histdef(nid_mth, "fluxg",
      .              "Flux turbulents ocean-glace de mer","W/m2",
-     .              iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .              iim,jj_nb,nhori, 1,1,1, -99, 32,
      .              "ave(X)", zstophy,zout)
 c
        CALL histdef(nid_mth, "t_oce_sic",
      .              "Temp. mixte oce-sic","K",
-     .              iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .              iim,jj_nb,nhori, 1,1,1, -99, 32,
      .              "ave(X)", zstophy,zout)
 c
@@ -1497,5 +1497,5 @@
         CALL histdef(nid_mth, "lmt_bils",
      .       "Bilan au sol atmosphere forcee", "W/m2",
-     .       iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .       iim,jj_nb,nhori, 1,1,1, -99, 32,
      .       "ave(X)", zstophy,zout)
 c
@@ -1504,17 +1504,17 @@
         CALL histdef(nid_mth, "slab_bils",
      .              "Bilan au sol Slab", "W/m2",
-     .              iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .              iim,jj_nb,nhori, 1,1,1, -99, 32,
      .              "ave(X)", zstophy,zout)
 c
         CALL histdef(nid_mth, "tslab", "Slab SST ", "K",
-     .              iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .              iim,jj_nb,nhori, 1,1,1, -99, 32,
      .              "ave(X)", zstophy,zout)
 c
         CALL histdef(nid_mth, "seaice", "Slab seaice", "kg/m2",
-     .              iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .              iim,jj_nb,nhori, 1,1,1, -99, 32,
      .              "ave(X)", zstophy,zout)
 c
         CALL histdef(nid_mth, "siceh", "Slab seaice height", "m",
-     .              iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .              iim,jj_nb,nhori, 1,1,1, -99, 32,
      .              "ave(X)", zstophy,zout)
 c
@@ -1530,66 +1530,66 @@
          CALL histdef(nid_mth,"lwcon","Cloud liquid water content",
      .                "kg/kg",
-     .                iim,jjphy_nb,nhori, klev,1,klev, nvert, 32, 
+     .                iim,jj_nb,nhori, klev,1,klev, nvert, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth,"iwcon","Cloud ice water content","kg/kg",
-     .                iim,jjphy_nb,nhori, klev,1,klev, nvert, 32, 
+     .                iim,jj_nb,nhori, klev,1,klev, nvert, 32, 
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "temp", "Air temperature", "K",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "ovap", "Specific humidity", "kg/kg",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
 c        CALL histdef(nid_mth,"wvap","Water vapor mixing ratio","kg/kg",
-c    .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+c    .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
 c    .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "geop", "Geopotential height", "m2/s2",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "vitu", "Zonal wind", "m/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "vitv", "Meridional wind", "m/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "vitw", "Vertical wind", "m/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "pres", "Air pressure", "Pa",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
         CALL histdef(nid_mth, "rneb", "Cloud fraction", "%",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "rnebcon", "Convective Cloud Fraction"
      .                , "-",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "rhum", "Relative humidity", "-",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "ozone", "Ozone concentration", "ppmv",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dtphy", "Physics dT", "K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dqphy","Physics dQ","(kg/kg)/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
@@ -1602,14 +1602,14 @@
            call histdef(nid_mth, "albe_"//clnsurf(nsrf), 
      $         "Albedo surf. "//clnsurf(nsrf), "-",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 c
            call histdef(nid_mth, "rugs_"//clnsurf(nsrf), 
      $         "Rugosite "//clnsurf(nsrf), "m",  
-     $         iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     $         iim,jj_nb,nhori, 1,1,1, -99, 32,
      $         "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "ages_"//clnsurf(nsrf), "Snow age","day",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
@@ -1617,8 +1617,8 @@
 c
          CALL histdef(nid_mth, "albs", "Surface albedo", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
          CALL histdef(nid_mth, "albslw", "Surface albedo LW", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32, 
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32, 
      .                "ave(X)", zstophy,zout)
 c
@@ -1630,104 +1630,104 @@
      .                "Convective Cloud Liquid water content"
      .                , "kg/kg",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth,"Ma","undilute adiab updraft","kg/m2/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dnwd", "saturated downdraft","kg/m2/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dnwd0", "unsat. downdraft", "kg/m2/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dtdyn", "Dynamics dT", "K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dqdyn","Dynamics dQ","(kg/kg)/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dqcon","Convection dQ","(kg/kg)/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dtlschr",
      $       "Large-scale condensational heating rate", "K/s",
-     $       iim,jjphy_nb
+     $       iim,jj_nb
      $       ,nhori, klev,1,klev,nvert, 32,"ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dqlsc","Condensation dQ","(kg/kg)/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dtvdf", "Boundary-layer dT", "K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dqvdf","Boundary-layer dQ","(kg/kg)/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dteva", "Reevaporation dT", "K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth,"dqeva","Reevaporation dQ","(kg/kg)/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 
          CALL histdef(nid_mth, "ptconv", "POINTS CONVECTIFS"," ",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 
          CALL histdef(nid_mth, "ratqs", "RATQS"," ",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 
 c
          CALL histdef(nid_mth, "dqajs","Dry adjust. dQ","(kg/kg)/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dtswr", "SW radiation dT", "K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dtsw0", "CS SW radiation dT", "K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dtlwr", "LW radiation dT", "K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth,"dtlw0","CS LW radiation dT","K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dtec", "Cinetic dissip dT", "K/s",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "duvdf", "Boundary-layer dU", "m/s2",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dvvdf", "Boundary-layer dV", "m/s2",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          IF (ok_orodr) THEN
          CALL histdef(nid_mth, "duoro", "Orography dU", "m/s2",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dvoro", "Orography dV", "m/s2",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
@@ -1736,9 +1736,9 @@
          IF (ok_orolf) THEN
          CALL histdef(nid_mth, "dulif", "Orography dU", "m/s2",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
 c
          CALL histdef(nid_mth, "dvlif", "Orography dV", "m/s2",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
          ENDIF
@@ -1748,5 +1748,5 @@
          iiq=niadv(iq)
          CALL histdef(nid_mth, tnom(iq), ttext(iiq), "-",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zstophy,zout)
          ENDDO
Index: LMDZ4/trunk/libf/phylmd/ini_histmthNMC.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/ini_histmthNMC.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/ini_histmthNMC.h	(revision 776)
@@ -39,30 +39,30 @@
           CALL histdef(nid_nmc, "temp",
      .                 "Temperature","K",
-     .                iim,jjphy_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
+     .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .                "inst(X)", zout,zout)
 c
          CALL histdef(nid_nmc, "phi",
      .                "Geopotential", "m",
-     .                iim,jjphy_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
+     .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .                "inst(X)", zout,zout)
 c
           CALL histdef(nid_nmc, "q",
      .                 "Specific humidity","kg/kg",
-     .                iim,jjphy_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
+     .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .                "inst(X)", zout,zout)
 c
          CALL histdef(nid_nmc, "rh",
      .                 "Relative humidity", "%",
-     .                iim,jjphy_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
+     .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .                "inst(X)", zout,zout)
 c
           CALL histdef(nid_nmc, "u",
      .                 "Zonal wind","m/s",
-     .                iim,jjphy_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
+     .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .                "inst(X)", zout,zout)
 c
           CALL histdef(nid_nmc, "v",
      .                 "Meridional wind","m/s",
-     .                iim,jjphy_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
+     .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .                "inst(X)", zout,zout)
 c
@@ -78,35 +78,35 @@
           CALL histdef(nid_nmc, "temp",
      .                 "Temperature","K",
-     .                iim,jjphy_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
+     .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .                "inst(X)", zout,zout)
 c
          CALL histdef(nid_nmc, "phi",
      .                "Geopotential ", "m",
-     .                iim,jjphy_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
+     .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .                "inst(X)", zout,zout)
 c
           CALL histdef(nid_nmc, "q",
      .                 "Specific humidity","kg/kg",
-     .                iim,jjphy_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
+     .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .                "inst(X)", zout,zout)
 c
          CALL histdef(nid_nmc, "rh",
      .                 "Relative humidity", "%",
-     .                iim,jjphy_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
+     .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .                "inst(X)", zout,zout)
 c
           CALL histdef(nid_nmc, "u",
      .                 "Zonal wind","m/s",
-     .                iim,jjphy_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
+     .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .                "inst(X)", zout,zout)
 c
           CALL histdef(nid_nmc, "v",
      .                 "Meridional wind","m/s",
-     .                iim,jjphy_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
+     .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .                "inst(X)", zout,zout)
 c
           CALL histdef(nid_nmc, "w",
      .                 "Vertical motion","Pa/s",
-     .                iim,jjphy_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
+     .                iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .                "inst(X)", zout,zout)
 c
@@ -121,15 +121,15 @@
           CALL histdef(nid_nmc, "psbg",
      .         "Pressure sfce below ground","%",
-     .         iim,jjphy_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
+     .         iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .         "inst(X)", zout,zout)
 c
           CALL histdef(nid_nmc, "uv",
      .         "uv ",
-     .         "m2/s2",iim,jjphy_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
+     .         "m2/s2",iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32,
      .         "inst(X)", zout,zout)
 c
           CALL histdef(nid_nmc, "vq",
      .         "vq ",
-     .         "m/s * (kg/kg)",iim,jjphy_nb,nhori, 
+     .         "m/s * (kg/kg)",iim,jj_nb,nhori, 
      .          nlevSTD,1,nlevSTD, nvert, 32,
      .         "inst(X)", zout,zout)
@@ -137,5 +137,5 @@
           CALL histdef(nid_nmc, "vT",
      .         "vT ", 
-     .         "mK/s",iim,jjphy_nb,nhori, 
+     .         "mK/s",iim,jj_nb,nhori, 
      .          nlevSTD,1,nlevSTD, nvert, 32,
      .         "inst(X)", zout,zout)
@@ -143,5 +143,5 @@
           CALL histdef(nid_nmc, "wq",
      .         "wq ", 
-     .         "(Pa/s)*(kg/kg)",iim,jjphy_nb,nhori,
+     .         "(Pa/s)*(kg/kg)",iim,jj_nb,nhori,
      .          nlevSTD,1,nlevSTD, nvert, 32,
      .         "inst(X)", zout,zout)
@@ -149,5 +149,5 @@
           CALL histdef(nid_nmc, "vphi",
      .         "vphi ", 
-     .         "m2/s",iim,jjphy_nb,nhori, 
+     .         "m2/s",iim,jj_nb,nhori, 
      .          nlevSTD,1,nlevSTD, nvert, 32,
      .         "inst(X)", zout,zout)
@@ -155,5 +155,5 @@
           CALL histdef(nid_nmc, "wT",
      .         "wT ", 
-     .         "K*Pa/s",iim,jjphy_nb,nhori,
+     .         "K*Pa/s",iim,jj_nb,nhori,
      .          nlevSTD,1,nlevSTD, nvert, 32,
      .         "inst(X)", zout,zout)
@@ -161,5 +161,5 @@
           CALL histdef(nid_nmc, "uxu",
      .         "u2 ", 
-     .         "m2/s2",iim,jjphy_nb,nhori,
+     .         "m2/s2",iim,jj_nb,nhori,
      .          nlevSTD,1,nlevSTD, nvert, 32,
      .         "inst(X)", zout,zout)
@@ -167,5 +167,5 @@
           CALL histdef(nid_nmc, "vxv",
      .         "v2 ", 
-     .         "m2/s2",iim,jjphy_nb,nhori,
+     .         "m2/s2",iim,jj_nb,nhori,
      .          nlevSTD,1,nlevSTD, nvert, 32,
      .         "inst(X)", zout,zout)
@@ -173,5 +173,5 @@
           CALL histdef(nid_nmc, "TxT",
      .         "T2 ", 
-     .         "K2",iim,jjphy_nb,nhori,
+     .         "K2",iim,jj_nb,nhori,
      .          nlevSTD,1,nlevSTD, nvert, 32,
      .         "inst(X)", zout,zout)
Index: LMDZ4/trunk/libf/phylmd/ini_histrac.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/ini_histrac.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/ini_histrac.h	(revision 776)
@@ -26,9 +26,9 @@
 c
          CALL histdef(nid_tra, "phis", "Surface geop. height", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "once",  zsto,zout)
 c
          CALL histdef(nid_tra, "aire", "Grid area", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "once",  zsto,zout)
          DO it=1,nqmax
@@ -37,9 +37,9 @@
          iiq=niadv(iq)
          CALL histdef(nid_tra, tnom(iq), ttext(iiq), "U/kga",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zsto,zout)
          if (lessivage) THEN
          CALL histdef(nid_tra, "fl"//tnom(iq),"Flux "//ttext(iiq),
-     .              "U/m2/s",iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .              "U/m2/s",iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .              "ave(X)", zsto,zout)
          endif
@@ -48,13 +48,13 @@
          CALL histdef(nid_tra, "d_tr_th_"//tnom(iq),
      .	              "tendance thermique"// ttext(iiq), "?",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zsto,zout)
          CALL histdef(nid_tra, "d_tr_cv_"//tnom(iq),
      .	              "tendance convection"// ttext(iiq), "?",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zsto,zout)
          CALL histdef(nid_tra, "d_tr_cl_"//tnom(iq),
      .	              "tendance couche limite"// ttext(iiq), "?",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zsto,zout)
 c---fin Olivia	 
@@ -63,60 +63,60 @@
 
          CALL histdef(nid_tra, "pyu1", "Vent niv 1", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)",  zout,zout)
 
          CALL histdef(nid_tra, "pyv1", "Vent niv 1", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)",  zout,zout)
          CALL histdef(nid_tra, "psrf1", "nature sol", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)",  zout,zout)
          CALL histdef(nid_tra, "psrf2", "nature sol", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)",  zout,zout)
          CALL histdef(nid_tra, "psrf3", "nature sol", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)",  zout,zout)
          CALL histdef(nid_tra, "psrf4", "nature sol", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)",  zout,zout)
          CALL histdef(nid_tra, "ftsol1", "temper sol", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)",  zout,zout)
          CALL histdef(nid_tra, "ftsol2", "temper sol", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)",  zout,zout)
          CALL histdef(nid_tra, "ftsol3", "temper sol", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst",  zout,zout)
          CALL histdef(nid_tra, "ftsol4", "temper sol", "-",
-     .                iim,jjphy_nb,nhori, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
      .                "inst(X)",  zout,zout)
          CALL histdef(nid_tra, "pplay", "flux u mont","-",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "inst(X)", zout,zout)
          CALL histdef(nid_tra, "t", "flux u mont","-",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "inst(X)", zout,zout)
          CALL histdef(nid_tra, "mfu", "flux u mont","-",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zsto,zout)
          CALL histdef(nid_tra, "mfd", "flux u decen","-",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zsto,zout)
          CALL histdef(nid_tra, "en_u", "flux u mont","-",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zsto,zout)
          CALL histdef(nid_tra, "en_d", "flux u mont","-",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zsto,zout)
          CALL histdef(nid_tra, "de_d", "flux u mont","-",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zsto,zout)
          CALL histdef(nid_tra, "de_u", "flux u decen","-",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zsto,zout)
          CALL histdef(nid_tra, "coefh", "turbulent coef","-",
-     .                iim,jjphy_nb,nhori, klev,1,klev,nvert, 32,
+     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
      .                "ave(X)", zsto,zout)
 
Index: LMDZ4/trunk/libf/phylmd/ini_paramLMDZ_phy.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/ini_paramLMDZ_phy.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/ini_paramLMDZ_phy.h	(revision 776)
@@ -1,5 +1,5 @@
 cym    Non implemente en mode parallele
 
-       IF (monocpu) THEN  
+       IF (is_sequential) THEN  
 c
        zstophy = dtime
@@ -361,5 +361,5 @@
        CALL histend(nid_ctesGCM)
        
-       ENDIF ! monocpu
+       ENDIF ! is_sequential
 c
 c=================================================================
Index: LMDZ4/trunk/libf/phylmd/ini_undefSTD.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/ini_undefSTD.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/ini_undefSTD.F	(revision 776)
@@ -1,2 +1,6 @@
+!
+! $Header$
+!
+
       SUBROUTINE ini_undefSTD(nlevSTD,itap,
      $           dtime,ecrit_day,ecrit_mth,
Index: LMDZ4/trunk/libf/phylmd/iniphysiq.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/iniphysiq.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/iniphysiq.F	(revision 776)
@@ -9,5 +9,7 @@
      $           plat,plon,parea,pcu,pcv,
      $           prad,pg,pr,pcpp)
-      USE dimphy,klon2=>klon,klon=>klon2
+      USE dimphy
+      USE mod_grid_phy_lmdz
+      USE mod_phys_lmdz_para
       USE comgeomphy
       IMPLICIT NONE
@@ -52,5 +54,6 @@
  
       INTEGER ngrid,nlayer
-      REAL plat(ngrid),plon(ngrid),parea(klon),pcu(klon),pcv(klon)
+      REAL plat(ngrid),plon(ngrid),parea(klon_glo)
+      REAL pcu(klon_glo),pcv(klon_glo)
       INTEGER pdayref
       INTEGER :: ibegin,iend
@@ -66,21 +69,19 @@
       ENDIF
 
-      IF (ngrid.NE.klon) THEN
+      IF (ngrid.NE.klon_glo) THEN
          PRINT*,'STOP in inifis'
          PRINT*,'Probleme de dimensions :'
          PRINT*,'ngrid     = ',ngrid
-         PRINT*,'klon   = ',klon
+         PRINT*,'klon   = ',klon_glo
          STOP
       ENDIF
 c$OMP PARALLEL PRIVATE(ibegin,iend) 
 c$OMP+         SHARED(parea,pcu,pcv,plon,plat)
-      ibegin=klon_begin+klon_omp_begin(omp_rank)-1
-      iend=ibegin+klon_omp-1
 
-      airephy(1:klon_omp)=parea(ibegin:iend)
-      cuphy(1:klon_omp)=pcu(ibegin:iend)
-      cvphy(1:klon_omp)=pcv(ibegin:iend)
-      rlond(1:klon_omp) = plon(ibegin:iend)
-      rlatd(1:klon_omp) = plat(ibegin:iend)
+      airephy(1:klon_omp)=parea(klon_omp_begin:klon_omp_end)
+      cuphy(1:klon_omp)=pcu(klon_omp_begin:klon_omp_end)
+      cvphy(1:klon_omp)=pcv(klon_omp_begin:klon_omp_end)
+      rlond(1:klon_omp) = plon(klon_omp_begin:klon_omp_end)
+      rlatd(1:klon_omp) = plat(klon_omp_begin:klon_omp_end)
 
       call suphec
Index: LMDZ4/trunk/libf/phylmd/initphysto.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/initphysto.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/initphysto.F	(revision 776)
@@ -9,4 +9,5 @@
        
        USE dimphy
+       USE mod_phys_lmdz_para
        USE IOIPSL
        USE iophy
@@ -121,5 +122,5 @@
 
        CALL histdef(fileid, "phis", "Surface geop. height", "-",
-     .                iim,jjphy_nb,nhoriid, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhoriid, 1,1,1, -99, 32,
      .                "once", t_ops, t_wrt)
 c
@@ -127,5 +128,5 @@
 
          CALL histdef(fileid, "aire", "Grid area", "-",
-     .                iim,jjphy_nb,nhoriid, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhoriid, 1,1,1, -99, 32,
      .                "once", t_ops, t_wrt)
          write(*,*) 'apres aire ds initphysto'
@@ -143,5 +144,5 @@
 C
       call histdef(fileid, 't', 'Temperature', 'K',
-     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
+     .             iim, jj_nb, nhoriid, llm, 1, llm, zvertiid,
      .             32, 'inst(X)', t_ops, t_wrt)
         write(*,*) 'apres t ds initphysto'
@@ -149,5 +150,5 @@
 C
       call histdef(fileid, 'mfu', 'flx m. pan. mt', 'kg m/s',
-     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
+     .             iim, jj_nb, nhoriid, llm, 1, llm, zvertiid,
      .             32, 'inst(X)', t_ops, t_wrt)
         write(*,*) 'apres mfu ds initphysto'
@@ -156,5 +157,5 @@
 C
       call histdef(fileid, 'mfd', 'flx m. pan. des', 'kg m/s',
-     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
+     .             iim, jj_nb, nhoriid, llm, 1, llm, zvertiid,
      .             32, 'inst(X)', t_ops, t_wrt)
 
@@ -163,5 +164,5 @@
 C
       call histdef(fileid, 'en_u', 'flx ent pan mt', 'kg m/s',
-     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
+     .             iim, jj_nb, nhoriid, llm, 1, llm, zvertiid,
      .             32, 'inst(X)', t_ops, t_wrt)
                write(*,*) 'apres en_u ds initphysto'
@@ -170,5 +171,5 @@
 C
       call histdef(fileid, 'de_u', 'flx det pan mt', 'kg m/s',
-     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
+     .             iim, jj_nb, nhoriid, llm, 1, llm, zvertiid,
      .             32, 'inst(X)', t_ops, t_wrt)
 
@@ -177,5 +178,5 @@
 C
       call histdef(fileid, 'en_d', 'flx ent pan dt', 'kg m/s',
-     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
+     .             iim, jj_nb, nhoriid, llm, 1, llm, zvertiid,
      .             32, 'inst(X)', t_ops, t_wrt)
 C
@@ -185,5 +186,5 @@
 C
       call histdef(fileid, 'de_d', 'flx det pan dt', 'kg m/s',
-     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
+     .             iim, jj_nb, nhoriid, llm, 1, llm, zvertiid,
      .             32, 'inst(X)', t_ops, t_wrt)
 
@@ -191,14 +192,14 @@
 	
 	call histdef(fileid, "coefh", " ", " ",
-     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
+     .             iim, jj_nb, nhoriid, llm, 1, llm, zvertiid,
      .             32, "inst(X)", t_ops, t_wrt)
 
 c abderrahmane le 16 09 02
         call histdef(fileid, "fm_th", " ", " ",
-     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
+     .             iim, jj_nb, nhoriid, llm, 1, llm, zvertiid,
      .             32, "inst(X)", t_ops, t_wrt)
 
         call histdef(fileid, "en_th", " ", " ",
-     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
+     .             iim, jj_nb, nhoriid, llm, 1, llm, zvertiid,
      .             32, "inst(X)", t_ops, t_wrt)
 c fin aj
@@ -207,9 +208,9 @@
 
 	call histdef(fileid, 'frac_impa', ' ', ' ',
-     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
+     .             iim, jj_nb, nhoriid, llm, 1, llm, zvertiid,
      .             32, 'inst(X)', t_ops, t_wrt)
 	
 	call histdef(fileid, 'frac_nucl', ' ', ' ',
-     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
+     .             iim, jj_nb, nhoriid, llm, 1, llm, zvertiid,
      .             32, 'inst(X)', t_ops, t_wrt)
 
@@ -218,5 +219,5 @@
 c
       CALL histdef(fileid, "pyu1", " ", " ",
-     .                iim,jjphy_nb,nhoriid, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhoriid, 1,1,1, -99, 32,
      .                "inst(X)", t_ops, t_wrt)
 
@@ -225,5 +226,5 @@
 c
 	CALL histdef(fileid, "pyv1", " ", " ",
-     .                iim,jjphy_nb,nhoriid, 1,1,1, -99, 32,
+     .                iim,jj_nb,nhoriid, 1,1,1, -99, 32,
      .                "inst(X)", t_ops, t_wrt)
 	
@@ -233,5 +234,5 @@
 c
 	call histdef(fileid, "ftsol1", " ", " ",
-     .             iim, jjphy_nb, nhoriid, 1, 1,1, -99,32,
+     .             iim, jj_nb, nhoriid, 1, 1,1, -99,32,
      .             "inst(X)", t_ops, t_wrt)
 
@@ -240,5 +241,5 @@
 c
         call histdef(fileid, "ftsol2", " ", " ",
-     .             iim, jjphy_nb, nhoriid, 1, 1,1, -99,32,
+     .             iim, jj_nb, nhoriid, 1, 1,1, -99,32,
      .             "inst(X)", t_ops, t_wrt)
 
@@ -247,5 +248,5 @@
 c
         call histdef(fileid, "ftsol3", " ", " ",
-     .             iim, jjphy_nb, nhoriid, 1, 1,1, -99,
+     .             iim, jj_nb, nhoriid, 1, 1,1, -99,
      .             32, "inst(X)", t_ops, t_wrt)
 
@@ -254,5 +255,5 @@
 c
         call histdef(fileid, "ftsol4", " ", " ",
-     .             iim, jjphy_nb, nhoriid, 1, 1,1, -99,
+     .             iim, jj_nb, nhoriid, 1, 1,1, -99,
      .             32, "inst(X)", t_ops, t_wrt)
 	
@@ -261,5 +262,5 @@
 c
         call histdef(fileid, "rain", " ", " ",
-     .             iim, jjphy_nb, nhoriid, 1, 1,1, -99,
+     .             iim, jj_nb, nhoriid, 1, 1,1, -99,
      .             32, "inst(X)", t_ops, t_wrt)
 
@@ -268,5 +269,5 @@
 c
 	call histdef(fileid, "psrf1", " ", " ",
-     .             iim, jjphy_nb, nhoriid, 1, 1, 1, -99,
+     .             iim, jj_nb, nhoriid, 1, 1, 1, -99,
      .             32, "inst(X)", t_ops, t_wrt)
 	
@@ -275,5 +276,5 @@
 c
         call histdef(fileid, "psrf2", " ", " ",
-     .             iim, jjphy_nb, nhoriid, 1, 1, 1, -99,
+     .             iim, jj_nb, nhoriid, 1, 1, 1, -99,
      .             32, "inst(X)", t_ops, t_wrt)
 
@@ -282,5 +283,5 @@
 c
         call histdef(fileid, "psrf3", " ", " ",
-     .             iim, jjphy_nb, nhoriid, 1, 1, 1, -99,
+     .             iim, jj_nb, nhoriid, 1, 1, 1, -99,
      .             32, "inst(X)", t_ops, t_wrt)
 
@@ -289,5 +290,5 @@
 c
         call histdef(fileid, "psrf4", " ", " ",
-     .             iim, jjphy_nb, nhoriid, 1, 1, 1, -99,
+     .             iim, jj_nb, nhoriid, 1, 1, 1, -99,
      .             32, "inst(X)", t_ops, t_wrt)
 	
Index: LMDZ4/trunk/libf/phylmd/interface_surf.F90
===================================================================
--- LMDZ4/trunk/libf/phylmd/interface_surf.F90	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/interface_surf.F90	(revision 776)
@@ -88,5 +88,5 @@
 
 
-   USE dimphy,only : monocpu,jjphy_nb,omp_rank
+   USE mod_phys_lmdz_para
 ! Cette routine sert d'aiguillage entre l'atmosphere et la surface en general 
 ! (sols continentaux, oceans, glaces) pour les fluxs de chaleur et d'humidite.
@@ -429,5 +429,5 @@
 
 !!$PB
-      ALLOCATE (tmp_rriv(iim,jjphy_nb), stat=error)
+      ALLOCATE (tmp_rriv(iim,jj_nb), stat=error)
       if (error /= 0) then
         abort_message='Pb allocation tmp_rriv'
@@ -435,5 +435,5 @@
       endif
       tmp_rriv=0.
-      ALLOCATE (tmp_rcoa(iim,jjphy_nb), stat=error)
+      ALLOCATE (tmp_rcoa(iim,jj_nb), stat=error)
       if (error /= 0) then
         abort_message='Pb allocation tmp_rcoa'
@@ -442,5 +442,5 @@
       tmp_rcoa=0.
 !ym      ALLOCATE (tmp_rlic(iim,jjm+1), stat=error)
-      ALLOCATE (tmp_rlic(iim,jjphy_nb), stat=error)
+      ALLOCATE (tmp_rlic(iim,jj_nb), stat=error)
       if (error /= 0) then
         abort_message='Pb allocation tmp_rlic'
@@ -1034,5 +1034,6 @@
 
   USE intersurf
-  USE dimphy, klon_x=>klon
+  USE mod_grid_phy_lmdz
+  USE mod_phys_lmdz_para
   IMPLICIT NONE
 ! Cette routine sert d'interface entre le modele atmospherique et le 
@@ -1175,5 +1176,5 @@
   integer :: jjb,jje,ijb,ije
   INTEGER,SAVE :: offset
-  REAL, dimension(klon2) :: rlon_g,rlat_g
+  REAL, dimension(klon_glo) :: rlon_g,rlat_g
   INTEGER, SAVE          :: orch_comm
 #include "temps.inc"
@@ -1245,8 +1246,8 @@
 
     
-    Call GatherField(rlon,rlon_g,1)
-    Call GatherField(rlat,rlat_g,1)
-
-    IF (phy_rank==0) THEN
+    CALL Gather(rlon,rlon_g)
+    CALL Gather(rlat,rlat_g)
+
+    IF (is_mpi_root) THEN
       index = 1
       do jj = 2, jjm
@@ -1260,5 +1261,5 @@
      lat_scat(:,1) = rlat_g(1)
      lon_scat(:,jjm+1) = lon_scat(:,2)
-     lat_scat(:,jjm+1) = rlat_g(klon2)
+     lat_scat(:,jjm+1) = rlat_g(klon_glo)
    ENDIF
    
@@ -1345,6 +1346,4 @@
 !    offset=offset-MOD(offset,iim)
 !  endif
-  
-  PRINT *,'ORCHIDEE ------> KNON : ',knon
   
    
@@ -1395,8 +1394,8 @@
     bidule=0.
     bidule(1:knon)=riverflow(1:knon)
-    call gath2cpl(bidule, tmp_rriv, klon, knon,iim,jjphy_nb,knindex)
+    call gath2cpl(bidule, tmp_rriv, klon, knon,iim,jj_nb,knindex)
     bidule=0.
     bidule(1:knon)=coastalflow(1:knon)
-    call gath2cpl(bidule, tmp_rcoa, klon, knon,iim,jjphy_nb,knindex)
+    call gath2cpl(bidule, tmp_rcoa, klon, knon,iim,jj_nb,knindex)
     alb_new(1:knon) = albedo_out(1:knon,1) 
     alblw(1:knon) = albedo_out(1:knon,2)
@@ -1414,5 +1413,6 @@
   
   SUBROUTINE Init_orchidee_index(iim,knon,orch_comm,knindex,offset,ktindex)
-  USE dimphy
+  USE mod_phys_lmdz_para, ONLY : is_parallel
+  
   IMPLICIT NONE
     INTEGER,INTENT(IN)  :: iim
@@ -1435,5 +1435,5 @@
     MyLastPoint=klon_begin-1+knindex(knon)+iim-1
 
-    IF (.NOT. monocpu) THEN
+    IF (is_parallel) THEN
 #ifdef CPP_PARA    
       call MPI_COMM_SIZE(orch_comm,mpi_size,ierr)
@@ -1445,5 +1445,5 @@
     ENDIF
     
-    IF (.NOT. monocpu) THEN
+    IF (is_parallel) THEN
       IF (mpi_rank /= 0) then
 #ifdef CPP_PARA
@@ -1472,8 +1472,6 @@
   
   SUBROUTINE Get_orchidee_communicator(knon,orch_comm)
-  USE dimphy, only : phy_rank
-#ifdef CPP_PARA
-  USE parallel, only : COMM_LMDZ
-#endif
+  USE mod_phys_lmdz_para, ONLY: mpi_rank, COMM_LMDZ_PHY
+
   IMPLICIT NONE
 #ifdef CPP_PARA
@@ -1493,5 +1491,5 @@
 
 #ifdef CPP_PARA    
-    CALL MPI_COMM_SPLIT(COMM_LMDZ,color,phy_rank,orch_comm,ierr)
+    CALL MPI_COMM_SPLIT(COMM_LMDZ_PHY,color,mpi_rank,orch_comm,ierr)
 #endif
     
@@ -1500,9 +1498,8 @@
     
   SUBROUTINE Init_neighbours(iim,jjm,knon,neighbours,ktindex,pctsrf)
-#ifdef CPP_PARA
-  USE parallel,only : COMM_LMDZ
-#endif
+  USE mod_phys_lmdz_para, not_use_mpi_root=>mpi_root
   USE dimphy
   IMPLICIT NONE
+
 #ifdef CPP_PARA
   include 'mpif.h'
@@ -1514,6 +1511,6 @@
   REAL :: pctsrf(klon)
   
-  INTEGER :: knon_nb(0:phy_size-1)
-  INTEGER,DIMENSION(0:phy_size-1) :: displs,sendcount
+  INTEGER :: knon_nb(0:mpi_size-1)
+  INTEGER,DIMENSION(0:mpi_size-1) :: displs,sendcount
   INTEGER,ALLOCATABLE :: ktindex_g(:)
   REAL*8  :: pctsrf_g(klon2)
@@ -1526,15 +1523,15 @@
   INTEGER :: ktindex_p(knon)
 
-  IF (monocpu) THEN
+  IF (is_sequential) THEN
     knon_nb(:)=knon
   ELSE  
 
 #ifdef CPP_PARA  
-    CALL MPI_GATHER(knon,1,MPI_INTEGER,knon_nb,1,MPI_INTEGER,0,COMM_LMDZ,ierr)
+    CALL MPI_GATHER(knon,1,MPI_INTEGER,knon_nb,1,MPI_INTEGER,0,COMM_LMDZ_PHY,ierr)
 #endif
   
   ENDIF
     
-  IF (phy_rank==0) THEN
+  IF (is_mpi_root) THEN
     knon_g=sum(knon_nb(:))
     ALLOCATE(ktindex_g(knon_g))
@@ -1542,5 +1539,5 @@
     neighbours_g(:,:)=-1
     displs(0)=0
-    DO i=1,phy_size-1
+    DO i=1,mpi_size-1
       displs(i)=displs(i-1)+knon_nb(i-1)
     ENDDO  
@@ -1549,17 +1546,17 @@
   ktindex_p(:)=ktindex(:)+klon_begin-1+iim-1
 
-  IF (monocpu) THEN
+  IF (is_sequential) THEN
     ktindex_g(:)=ktindex_p(:)
   ELSE
 
 #ifdef CPP_PARA  
-    CALL MPI_GATHERV(ktindex_p,knon,MPI_INTEGER,ktindex_g,knon_nb,displs,MPI_INTEGER,0,COMM_LMDZ,ierr)
+    CALL MPI_GATHERV(ktindex_p,knon,MPI_INTEGER,ktindex_g,knon_nb,displs,MPI_INTEGER,0,COMM_LMDZ_PHY,ierr)
 #endif
 
   ENDIF
      
-  CALL GatherField(pctsrf,pctsrf_g,1)
+  CALL Gather(pctsrf,pctsrf_g)
   
-  IF (phy_rank==0) THEN
+  IF (is_mpi_root) THEN
 !  Initialisation des offset    
 !
@@ -1615,9 +1612,9 @@
   
   DO i=1,8
-    IF (monocpu) THEN
+    IF (is_sequential) THEN
       neighbours(:,i)=neighbours_g(:,i)
     ELSE
 #ifdef CPP_PARA
-    CALL MPI_SCATTERV(neighbours_g(:,i),knon_nb,displs,MPI_INTEGER,neighbours(:,i),knon,MPI_INTEGER,0,COMM_LMDZ,ierr) 
+    CALL MPI_SCATTERV(neighbours_g(:,i),knon_nb,displs,MPI_INTEGER,neighbours(:,i),knon,MPI_INTEGER,0,COMM_LMDZ_PHY,ierr) 
 #endif
     ENDIF
@@ -1642,9 +1639,8 @@
 
    USE ioipsl
-   USE dimphy, only : jjphy_nb, iiphy_begin,iiphy_end,phy_rank,phy_size, monocpu
+   USE mod_phys_lmdz_para, not_use_mpi_root=>mpi_root
+   
    USE iophy
-#ifdef CPP_PARA
-   USE parallel, only: pole_nord,pole_sud,COMM_LMDZ
-#endif
+
 #ifdef CPP_PSMILE
    USE oasis
@@ -1774,12 +1770,12 @@
 !ym  REAL, DIMENSION(iim, jjm+1) :: tmp_lon, tmp_lat
 
-  real, dimension(iim, jjphy_nb) :: wri_sol_ice, wri_sol_sea, wri_nsol_ice 
-  real, dimension(iim, jjphy_nb) :: wri_nsol_sea, wri_fder_ice, wri_evap_ice
-  REAL, DIMENSION(iim, jjphy_nb) :: wri_evap_sea, wri_rcoa, wri_rriv
-  REAL, DIMENSION(iim, jjphy_nb) :: wri_rain, wri_snow, wri_taux, wri_tauy
-  REAL, DIMENSION(iim, jjphy_nb) :: wri_calv
-  REAL, DIMENSION(iim, jjphy_nb) :: wri_tauxx, wri_tauyy, wri_tauzz
-  REAL, DIMENSION(iim, jjphy_nb) :: tmp_lon, tmp_lat
-  REAL, DIMENSION(iim, jjphy_nb) :: wri_windsp
+  real, dimension(iim, jj_nb) :: wri_sol_ice, wri_sol_sea, wri_nsol_ice 
+  real, dimension(iim, jj_nb) :: wri_nsol_sea, wri_fder_ice, wri_evap_ice
+  REAL, DIMENSION(iim, jj_nb) :: wri_evap_sea, wri_rcoa, wri_rriv
+  REAL, DIMENSION(iim, jj_nb) :: wri_rain, wri_snow, wri_taux, wri_tauy
+  REAL, DIMENSION(iim, jj_nb) :: wri_calv
+  REAL, DIMENSION(iim, jj_nb) :: wri_tauxx, wri_tauyy, wri_tauzz
+  REAL, DIMENSION(iim, jj_nb) :: tmp_lon, tmp_lat
+  REAL, DIMENSION(iim, jj_nb) :: wri_windsp
 
 ! variables relues par le coupleur
@@ -1793,8 +1789,8 @@
 ! l'avoir lu
   real, allocatable,dimension(:,:),save :: pctsrf_sav
-  real, dimension(iim, jjphy_nb, 3) :: tamp_srf
+  real, dimension(iim, jj_nb, 3) :: tamp_srf
   integer, allocatable, dimension(:), save :: tamp_ind
   real, allocatable, dimension(:,:),save :: tamp_zmasq
-  real, dimension(iim, jjphy_nb) :: deno
+  real, dimension(iim, jj_nb) :: deno
   integer                     :: idtime
   integer, allocatable,dimension(:),save :: unity
@@ -1870,7 +1866,7 @@
 !ym    ALLOCATE(cpl_rcoa(iim,jjm+1), stat=error); sum_error = sum_error + error
 !ym    ALLOCATE(cpl_rlic(iim,jjm+1), stat=error); sum_error = sum_error + error
-    ALLOCATE(cpl_rriv(iim,jjphy_nb), stat=error); sum_error = sum_error + error
-    ALLOCATE(cpl_rcoa(iim,jjphy_nb), stat=error); sum_error = sum_error + error
-    ALLOCATE(cpl_rlic(iim,jjphy_nb), stat=error); sum_error = sum_error + error
+    ALLOCATE(cpl_rriv(iim,jj_nb), stat=error); sum_error = sum_error + error
+    ALLOCATE(cpl_rcoa(iim,jj_nb), stat=error); sum_error = sum_error + error
+    ALLOCATE(cpl_rlic(iim,jj_nb), stat=error); sum_error = sum_error + error
 
 
@@ -1880,8 +1876,8 @@
 !ym    allocate(read_sit(iim, jjm+1), stat = error); sum_error = sum_error + error
 !ym    allocate(read_alb_sic(iim, jjm+1), stat = error); sum_error = sum_error + error
-    allocate(read_sst(iim, jjphy_nb), stat = error); sum_error = sum_error + error
-    allocate(read_sic(iim, jjphy_nb), stat = error); sum_error = sum_error + error
-    allocate(read_sit(iim, jjphy_nb), stat = error); sum_error = sum_error + error
-    allocate(read_alb_sic(iim, jjphy_nb), stat = error); sum_error = sum_error + error
+    allocate(read_sst(iim, jj_nb), stat = error); sum_error = sum_error + error
+    allocate(read_sic(iim, jj_nb), stat = error); sum_error = sum_error + error
+    allocate(read_sit(iim, jj_nb), stat = error); sum_error = sum_error + error
+    allocate(read_alb_sic(iim, jj_nb), stat = error); sum_error = sum_error + error
     read_sst=0.
     read_sic=0.
@@ -1902,5 +1898,5 @@
     allocate(tamp_ind(klon), stat = error); sum_error = sum_error + error
 !ym    allocate(tamp_zmasq(iim, jjm+1), stat = error); sum_error = sum_error + error    
-    allocate(tamp_zmasq(iim, jjphy_nb), stat = error); sum_error = sum_error + error    
+    allocate(tamp_zmasq(iim, jj_nb), stat = error); sum_error = sum_error + error    
     tamp_zmasq=1.
     
@@ -1908,5 +1904,5 @@
       tamp_ind(ig) = ig
     enddo
-    call gath2cpl(zmasq, tamp_zmasq, klon, klon, iim, jjphy_nb, tamp_ind)
+    call gath2cpl(zmasq, tamp_zmasq, klon, klon, iim, jj_nb, tamp_ind)
 !
 ! initialisation couplage
@@ -1917,5 +1913,5 @@
    CALL inicma(iim, (jjm+1))
 #else
-   if (.not. monocpu) then
+   if (is_parallel) then
       abort_message='coupleur parallele uniquement avec PSMILE'
       call abort_gcm(modname,abort_message,1)
@@ -1928,5 +1924,5 @@
 !
  !ym  IO de check deconnecte pour le moment en //
-    IF (monocpu) THEN
+    IF (is_sequential) THEN
     idayref = day_ini
     CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)
@@ -2049,8 +2045,8 @@
 #ifdef CPP_PSMILE
       il_time_secs=(itime-1)*dtime
-      CALL fromcpl(il_time_secs, iim, jjphy_nb,                           &
+      CALL fromcpl(il_time_secs, iim, jj_nb,                           &
      &        read_sst, read_sic, read_sit, read_alb_sic)
 #else
-     if (.not. monocpu) then
+     if (is_parallel) then
         abort_message='coupleur parallele uniquement avec PSMILE'
         call abort_gcm(modname,abort_message,1)
@@ -2064,5 +2060,5 @@
 ! sorties NETCDF des champs recus
 !
-     if (monocpu) THEN
+     if (is_sequential) THEN
        ndexcs(:)=0
        itau_w = itau_phy + itime
@@ -2076,5 +2072,5 @@
 
 !ym      do j = 1, jjm + 1
-       do j = 1, jjphy_nb
+       do j = 1, jj_nb
          do ig = 1, iim
           if (abs(1. - read_sic(ig,j)) < 0.00001) then
@@ -2096,5 +2092,5 @@
 ! transformer read_sic en pctsrf_sav
 !
-      call cpl2gath(read_sic, tamp_sic , klon, klon,iim,jjphy_nb, unity)
+      call cpl2gath(read_sic, tamp_sic , klon, klon,iim,jj_nb, unity)
       do ig = 1, klon
         IF (pctsrf(ig,is_oce) > epsfra .OR.            &
@@ -2139,16 +2135,16 @@
     if (nisurf == is_oce .and. (.not. cumul) ) then
       sum_error = 0
-      allocate(tmp_sols(iim,jjphy_nb,2), stat=error); sum_error = sum_error + error
-      allocate(tmp_nsol(iim,jjphy_nb,2), stat=error); sum_error = sum_error + error
-      allocate(tmp_rain(iim,jjphy_nb,2), stat=error); sum_error = sum_error + error
-      allocate(tmp_snow(iim,jjphy_nb,2), stat=error); sum_error = sum_error + error
-      allocate(tmp_evap(iim,jjphy_nb,2), stat=error); sum_error = sum_error + error
-      allocate(tmp_tsol(iim,jjphy_nb,2), stat=error); sum_error = sum_error + error
-      allocate(tmp_fder(iim,jjphy_nb,2), stat=error); sum_error = sum_error + error
-      allocate(tmp_albe(iim,jjphy_nb,2), stat=error); sum_error = sum_error + error
-      allocate(tmp_taux(iim,jjphy_nb,2), stat=error); sum_error = sum_error + error
-      allocate(tmp_tauy(iim,jjphy_nb,2), stat=error); sum_error = sum_error + error
-! -- LOOP
-       allocate(tmp_windsp(iim,jjphy_nb,2), stat=error); sum_error = sum_error + error
+      allocate(tmp_sols(iim,jj_nb,2), stat=error); sum_error = sum_error + error
+      allocate(tmp_nsol(iim,jj_nb,2), stat=error); sum_error = sum_error + error
+      allocate(tmp_rain(iim,jj_nb,2), stat=error); sum_error = sum_error + error
+      allocate(tmp_snow(iim,jj_nb,2), stat=error); sum_error = sum_error + error
+      allocate(tmp_evap(iim,jj_nb,2), stat=error); sum_error = sum_error + error
+      allocate(tmp_tsol(iim,jj_nb,2), stat=error); sum_error = sum_error + error
+      allocate(tmp_fder(iim,jj_nb,2), stat=error); sum_error = sum_error + error
+      allocate(tmp_albe(iim,jj_nb,2), stat=error); sum_error = sum_error + error
+      allocate(tmp_taux(iim,jj_nb,2), stat=error); sum_error = sum_error + error
+      allocate(tmp_tauy(iim,jj_nb,2), stat=error); sum_error = sum_error + error
+! -- LOOP
+       allocate(tmp_windsp(iim,jj_nb,2), stat=error); sum_error = sum_error + error
 ! -- LOOP
 !!$      allocate(tmp_rriv(iim,jjm+1,2), stat=error); sum_error = sum_error + error
@@ -2165,16 +2161,16 @@
     cpl_index = 1
     if (nisurf == is_sic) cpl_index = 2
-    call gath2cpl(cpl_sols(1,cpl_index), tmp_sols(1,1,cpl_index), klon, knon,iim,jjphy_nb,                  knindex)
-    call gath2cpl(cpl_nsol(1,cpl_index), tmp_nsol(1,1,cpl_index), klon, knon,iim,jjphy_nb,                  knindex)
-    call gath2cpl(cpl_rain(1,cpl_index), tmp_rain(1,1,cpl_index), klon, knon,iim,jjphy_nb,                  knindex)
-    call gath2cpl(cpl_snow(1,cpl_index), tmp_snow(1,1,cpl_index), klon, knon,iim,jjphy_nb,                  knindex)
-    call gath2cpl(cpl_evap(1,cpl_index), tmp_evap(1,1,cpl_index), klon, knon,iim,jjphy_nb,                  knindex)
-    call gath2cpl(cpl_tsol(1,cpl_index), tmp_tsol(1,1,cpl_index), klon, knon,iim,jjphy_nb,                  knindex)
-    call gath2cpl(cpl_fder(1,cpl_index), tmp_fder(1,1,cpl_index), klon, knon,iim,jjphy_nb,                  knindex)
-    call gath2cpl(cpl_albe(1,cpl_index), tmp_albe(1,1,cpl_index), klon, knon,iim,jjphy_nb,                  knindex)
-    call gath2cpl(cpl_taux(1,cpl_index), tmp_taux(1,1,cpl_index), klon, knon,iim,jjphy_nb,                  knindex)
-    call gath2cpl(cpl_tauy(1,cpl_index), tmp_tauy(1,1,cpl_index), klon, knon,iim,jjphy_nb,                  knindex)
-! -- LOOP
-     call gath2cpl(cpl_windsp(1,cpl_index), tmp_windsp(1,1,cpl_index), klon, knon,iim,jjphy_nb,            knindex)
+    call gath2cpl(cpl_sols(1,cpl_index), tmp_sols(1,1,cpl_index), klon, knon,iim,jj_nb,                  knindex)
+    call gath2cpl(cpl_nsol(1,cpl_index), tmp_nsol(1,1,cpl_index), klon, knon,iim,jj_nb,                  knindex)
+    call gath2cpl(cpl_rain(1,cpl_index), tmp_rain(1,1,cpl_index), klon, knon,iim,jj_nb,                  knindex)
+    call gath2cpl(cpl_snow(1,cpl_index), tmp_snow(1,1,cpl_index), klon, knon,iim,jj_nb,                  knindex)
+    call gath2cpl(cpl_evap(1,cpl_index), tmp_evap(1,1,cpl_index), klon, knon,iim,jj_nb,                  knindex)
+    call gath2cpl(cpl_tsol(1,cpl_index), tmp_tsol(1,1,cpl_index), klon, knon,iim,jj_nb,                  knindex)
+    call gath2cpl(cpl_fder(1,cpl_index), tmp_fder(1,1,cpl_index), klon, knon,iim,jj_nb,                  knindex)
+    call gath2cpl(cpl_albe(1,cpl_index), tmp_albe(1,1,cpl_index), klon, knon,iim,jj_nb,                  knindex)
+    call gath2cpl(cpl_taux(1,cpl_index), tmp_taux(1,1,cpl_index), klon, knon,iim,jj_nb,                  knindex)
+    call gath2cpl(cpl_tauy(1,cpl_index), tmp_tauy(1,1,cpl_index), klon, knon,iim,jj_nb,                  knindex)
+! -- LOOP
+     call gath2cpl(cpl_windsp(1,cpl_index), tmp_windsp(1,1,cpl_index), klon, knon,iim,jj_nb,            knindex)
 ! -- LOOP
 
@@ -2188,6 +2184,6 @@
        wri_windsp = 0.
 ! -- LOOP      
-      call gath2cpl(pctsrf(1,is_oce), tamp_srf(1,1,1), klon, klon, iim, jjphy_nb, tamp_ind)
-      call gath2cpl(pctsrf(1,is_sic), tamp_srf(1,1,2), klon, klon, iim, jjphy_nb, tamp_ind)
+      call gath2cpl(pctsrf(1,is_oce), tamp_srf(1,1,1), klon, klon, iim, jj_nb, tamp_ind)
+      call gath2cpl(pctsrf(1,is_sic), tamp_srf(1,1,2), klon, klon, iim, jj_nb, tamp_ind)
 
       wri_sol_ice = tmp_sols(:,:,2)
@@ -2214,9 +2210,9 @@
 !Essai OM+JLD : ca marche !!!! (17 mars 2006)
       tamp_srf(:,:,3)=0.
-      CALL gath2cpl( pctsrf(1,is_lic), tamp_srf(1,1,3), klon, klon, iim, jjphy_nb, tamp_ind)
+      CALL gath2cpl( pctsrf(1,is_lic), tamp_srf(1,1,3), klon, klon, iim, jj_nb, tamp_ind)
 
 !YM pour retrouver resultat avant tamp_srf(:,3)=1.
       
-      DO j = 1, jjphy_nb
+      DO j = 1, jj_nb
          wri_calv(:,j) = DOT_PRODUCT (cpl_rlic(1:iim,j), tamp_srf(1:iim,j,3)) / REAL(iim)
       ENDDO
@@ -2227,27 +2223,27 @@
 !ym      enddo
 
-      IF (.NOT. monocpu) THEN
-        if (phy_rank /= 0) then
+      IF (is_parallel) THEN
+        if (.NOT.is_north_pole) then
 #ifdef CPP_PARA
-          call MPI_RECV(Up,1,MPI_REAL8,phy_rank-1,1234,COMM_LMDZ,status,ierr)
-          call MPI_SEND(wri_calv(1,1),1,MPI_REAL8,phy_rank-1,1234,COMM_LMDZ,ierr)
+          call MPI_RECV(Up,1,MPI_REAL_LMDZ,mpi_rank-1,1234,COMM_LMDZ_PHY,status,ierr)
+          call MPI_SEND(wri_calv(1,1),1,MPI_REAL_LMDZ,mpi_rank-1,1234,COMM_LMDZ_PHY,ierr)
 #endif
         endif
         
-        if (phy_rank /= phy_size-1) then
+        if (.NOT.is_south_pole) then
 #ifdef CPP_PARA
-          call MPI_SEND(wri_calv(1,jjphy_nb),1,MPI_REAL8,phy_rank+1,1234,COMM_LMDZ,ierr)  
-          call MPI_RECV(down,1,MPI_REAL8,phy_rank+1,1234,COMM_LMDZ,status,ierr)
+          call MPI_SEND(wri_calv(1,jj_nb),1,MPI_REAL_LMDZ,mpi_rank+1,1234,COMM_LMDZ_PHY,ierr)  
+          call MPI_RECV(down,1,MPI_REAL_LMDZ,mpi_rank+1,1234,COMM_LMDZ_PHY,status,ierr)
 #endif
         endif
   	
-        if (phy_rank /=0 .and. iiphy_begin /=1) then
+        if (mpi_rank /=0 .and. ii_begin /=1) then
           Up=Up+wri_calv(iim,1)
 	  wri_calv(:,1)=Up
         endif
       
-        if (phy_rank /=phy_size-1 .and. iiphy_end /= iim) then
-          Down=Down+wri_calv(1,jjphy_nb)
-	  wri_calv(:,jjphy_nb)=Down	 
+        if (mpi_rank /=mpi_size-1 .and. ii_end /= iim) then
+          Down=Down+wri_calv(1,jj_nb)
+	  wri_calv(:,jj_nb)=Down	 
         endif
       ENDIF
@@ -2277,16 +2273,22 @@
 !ym      CALL gr_fi_ecrit(1,klon,iim,jjm+1,rlat,tmp_lat)
 
-      CALL phy2dyn(rlon,tmp_lon,1)
-      CALL phy2dyn(rlat,tmp_lat,1)
-      
-!ym      DO i = 1, iim
-!ym        tmp_lon(i,1) = rlon(i+1)
-!ym        tmp_lon(i,jjm + 1) = rlon(i+1)
-!ym      ENDDO
-
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!! ATENTION A NE PAS OUBLIER
+!!! REMPLACER phy2dyn par grid1DTo2D_mpi
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+       CALL Grid1DTo2D_mpi(rlon,tmp_lon)
+       CALL Grid1DTo2D_mpi(rlat,tmp_lat)
+
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+     IF (is_sequential) THEN
+       IF (is_north_pole) tmp_lon(:,1) = tmp_lon(:,2)
+       IF (is_south_pole) tmp_lon(:,jjm + 1) = tmp_lon(:,jjm)
+     ENDIF
 !
 ! sortie netcdf des champs pour le changement de repere
 !
-      IF (monocpu) THEN
+      IF (is_sequential) THEN
         ndexct(:)=0
         CALL histwrite(nidct,'tauxe',itau_w,wri_taux,iim*(jjm+1),ndexct)
@@ -2298,5 +2300,5 @@
 ! calcul 3 coordonnees du vent
 !
-      CALL atm2geo (iim , jjphy_nb, wri_taux, wri_tauy, tmp_lon, tmp_lat, &
+      CALL atm2geo (iim , jj_nb, wri_taux, wri_tauy, tmp_lon, tmp_lat, &
          & wri_tauxx, wri_tauyy, wri_tauzz )
 !
@@ -2304,5 +2306,5 @@
 ! envoi au coupleur
 !
-    IF (monocpu) THEN
+    IF (is_sequential) THEN
       CALL histwrite(nidct,cl_writ(8),itau_w,wri_sol_ice,iim*(jjm+1),ndexct)
       CALL histwrite(nidct,cl_writ(9),itau_w,wri_sol_sea,iim*(jjm+1),ndexct)
@@ -2389,8 +2391,8 @@
 !
   if (nisurf == is_oce) then
-    call cpl2gath(read_sst, tsurf_new, klon, knon,iim,jjphy_nb, knindex)
+    call cpl2gath(read_sst, tsurf_new, klon, knon,iim,jj_nb, knindex)
   else if (nisurf == is_sic) then
-    call cpl2gath(read_sit, tsurf_new, klon, knon,iim,jjphy_nb, knindex)
-    call cpl2gath(read_alb_sic, alb_new, klon, knon,iim,jjphy_nb, knindex)
+    call cpl2gath(read_sit, tsurf_new, klon, knon,iim,jj_nb, knindex)
+    call cpl2gath(read_alb_sic, alb_new, klon, knon,iim,jj_nb, knindex)
   endif
   pctsrf_new(:,nisurf) = pctsrf_sav(:,nisurf)
@@ -2667,10 +2669,10 @@
 !
   SUBROUTINE interfoce_lim(itime, dtime, jour, &
-     & klon_xx, nisurf, knon, knindex, &
+     & klon, nisurf, knon, knindex, &
      & debut,  &
      & lmt_sst_p, pctsrf_new_p)
      
-     USE dimphy,klon=>klon2,klon2=>klon
-
+     USE mod_grid_phy_lmdz
+     USE mod_phys_lmdz_para
 #include "indicesol.inc"
 
@@ -2700,16 +2702,16 @@
   real   , intent(IN) :: dtime
   integer, intent(IN) :: jour
-  integer, intent(in) :: klon_xx
+  integer, intent(in) :: klon
   integer, intent(IN) :: nisurf
   integer, intent(IN) :: knon
-  integer, dimension(klon2), intent(in) :: knindex
+  integer, dimension(klon_loc), intent(in) :: knindex
   logical, intent(IN) :: debut
 
 ! Parametres de sortie
-  real, intent(out), dimension(klon2) :: lmt_sst_p
-  real, intent(out), dimension(klon2,nbsrf) :: pctsrf_new_p
+  real, intent(out), dimension(klon_loc) :: lmt_sst_p
+  real, intent(out), dimension(klon_loc,nbsrf) :: pctsrf_new_p
 
 !  real, dimension(klon) :: lmt_sst
-  real, dimension(klon,nbsrf) :: pctsrf_new
+  real, dimension(klon_glo,nbsrf) :: pctsrf_new
 
 ! Variables locales
@@ -2735,12 +2737,10 @@
   real, allocatable , save, dimension(:) :: sst_lu_p
 !$OMP THREADPRIVATE(sst_lu_p)
-  real, allocatable , save, dimension(:) :: sst_lu_mpi
 
   real, allocatable , save, dimension(:,:) :: pct_tmp_p
 !$OMP THREADPRIVATE(pct_tmp_p)
-  real, allocatable , save, dimension(:,:) :: pct_tmp_mpi
-  real, dimension(klon,nbsrf) :: pct_tmp
-  real, dimension(klon) :: sst_lu
-  real, dimension(klon) :: nat_lu
+  real, dimension(klon_glo,nbsrf) :: pct_tmp
+  real, dimension(klon_glo) :: sst_lu
+  real, dimension(klon_glo) :: nat_lu
 !
 ! quelques variables pour netcdf
@@ -2756,6 +2756,6 @@
     lmt_pas = nint(86400./dtime * 1.0) ! pour une lecture une fois par jour
     jour_lu = jour - 1
-    allocate(sst_lu_p(klon_omp))
-    allocate(pct_tmp_p(klon_omp,nbsrf))
+    allocate(sst_lu_p(klon_loc))
+    allocate(pct_tmp_p(klon_loc,nbsrf))
   endif
 
@@ -2771,8 +2771,5 @@
 !
 !$OMP MASTER
-    if (.not. allocated(sst_lu_mpi)) allocate(sst_lu_mpi(klon_mpi))
-    if (.not. allocated(pct_tmp_mpi)) allocate(pct_tmp_mpi(klon_mpi,nbsrf))
-    
-    if (phy_rank==0) then
+    if (is_mpi_root) then
     
     fich = trim(fich)
@@ -2787,5 +2784,5 @@
     start(1) = 1
     start(2) = jour
-    epais(1) = klon
+    epais(1) = klon_glo
     epais(2) = 1
 !
@@ -2881,5 +2878,5 @@
 ! 
       pct_tmp = 0.0
-      do ii = 1, klon
+      do ii = 1, klon_glo
         pct_tmp(ii,nint(nat_lu(ii)) + 1) = 1.
       enddo
@@ -2915,19 +2912,18 @@
 !
     ierr = NF_CLOSE(nid)
-   endif ! phyrank
-!
-! Recopie des variables dans les champs de sortie
-!
-  call ScatterField(sst_lu,sst_lu_mpi,1)
-  call ScatterField(pct_tmp(:,is_oce),pct_tmp_mpi(:,is_oce),1)
-  call ScatterField(pct_tmp(:,is_sic),pct_tmp_mpi(:,is_sic),1)
+   endif ! is_mpi_root
+
 !$OMP END MASTER
 !$OMP BARRIER
-  call ScatterField_omp(sst_lu_mpi,sst_lu_p,1)
-  call ScatterField_omp(pct_tmp_mpi(:,is_oce),pct_tmp_p(:,is_oce),1)
-  call ScatterField_omp(pct_tmp_mpi(:,is_sic),pct_tmp_p(:,is_sic),1)
+  call Scatter(sst_lu,sst_lu_p)
+  call Scatter(pct_tmp(:,is_oce),pct_tmp_p(:,is_oce))
+  call Scatter(pct_tmp(:,is_sic),pct_tmp_p(:,is_sic))
    deja_lu = .true.
    jour_lu = jour
   endif   
+
+!
+! Recopie des variables dans les champs de sortie
+!
   
   lmt_sst_p = 999999999.
@@ -2937,5 +2933,5 @@
   enddo
 
-  do ii=1,klon2
+  do ii=1,klon_loc
     pctsrf_new_p(ii,is_oce)=pct_tmp_p(ii,is_oce)
     pctsrf_new_p(ii,is_sic)=pct_tmp_p(ii,is_sic)
@@ -2949,10 +2945,11 @@
 !
   SUBROUTINE interfsur_lim(itime, dtime, jour, &
-     & klon_xx, nisurf, knon, knindex, &
+     & klon, nisurf, knon, knindex, &
      & debut,  &
      & lmt_alb_p, lmt_rug_p)
 
-     USE dimphy,klon=>klon2,klon2=>klon
-
+     USE mod_grid_phy_lmdz
+     USE mod_phys_lmdz_para
+     
 ! Cette routine sert d'interface entre le modele atmospherique et un fichier
 ! de conditions aux limites
@@ -2984,11 +2981,11 @@
   integer, intent(IN) :: nisurf
   integer, intent(IN) :: knon
-  integer, intent(IN) :: klon_xx
-  integer, dimension(klon2), intent(in) :: knindex
+  integer, intent(IN) :: klon
+  integer, dimension(klon_loc), intent(in) :: knindex
   logical, intent(IN) :: debut
 
 ! Parametres de sortie
-  real, intent(out), dimension(klon2) :: lmt_alb_p
-  real, intent(out), dimension(klon2) :: lmt_rug_p
+  real, intent(out), dimension(klon_loc) :: lmt_alb_p
+  real, intent(out), dimension(klon_loc) :: lmt_rug_p
 
 !  real,  dimension(klon) :: lmt_alb
@@ -3017,6 +3014,5 @@
   real, allocatable , save, dimension(:) :: alb_lu_p, rug_lu_p
 !$OMP THREADPRIVATE(alb_lu_p, rug_lu_p) 
-  real, allocatable , save, dimension(:) :: alb_lu_mpi, rug_lu_mpi
-  real, dimension(klon) :: alb_lu, rug_lu
+  real, dimension(klon_glo) :: alb_lu, rug_lu
 !
 ! quelques variables pour netcdf
@@ -3034,6 +3030,6 @@
     lmt_pas = nint(86400./dtime * 1.0) ! pour une lecture une fois par jour
     jour_lu_sur = jour - 1
-    allocate(alb_lu_p(klon_omp))
-    allocate(rug_lu_p(klon_omp))
+    allocate(alb_lu_p(klon_loc))
+    allocate(rug_lu_p(klon_loc))
   endif
 
@@ -3048,7 +3044,5 @@
 
 !$OMP MASTER
-    if (.not. allocated(alb_lu_mpi)) allocate(alb_lu_mpi(klon_mpi))
-    if (.not. allocated(rug_lu_mpi)) allocate(rug_lu_mpi(klon_mpi))  
-  if (phy_rank==0) then
+   if (is_mpi_root) then
 !
 ! Ouverture du fichier
@@ -3067,5 +3061,5 @@
     start(1) = 1
     start(2) = jour
-    epais(1) = klon
+    epais(1) = klon_glo
     epais(2) = 1
 !
@@ -3109,13 +3103,9 @@
 
 
-  endif  !! phyrank
-
-    call ScatterField(alb_lu,alb_lu_mpi,1)
-    call ScatterField(rug_lu,rug_lu_mpi,1)
+  endif  !! is_mpi_root
 !$OMP END MASTER
-!$OMP BARRIER
-
-    call ScatterField_omp(alb_lu_mpi,alb_lu_p,1)
-    call ScatterField_omp(rug_lu_mpi,rug_lu_p,1)
+
+    call Scatter(alb_lu,alb_lu_p)
+    call Scatter(rug_lu,rug_lu_p)
     
     deja_lu_sur = .true.
@@ -3151,5 +3141,5 @@
      & petAcoef, peqAcoef, petBcoef, peqBcoef, &
      & tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l)
-     USE dimphy,only : omp_rank
+
 ! Cette routine calcule les fluxs en h et q a l'interface et eventuellement
 ! une temperature de surface (au cas ou ok_veget = false)
@@ -3385,5 +3375,5 @@
 !
   SUBROUTINE gath2cpl(champ_in, champ_out, klon, knon, iim, jmp1, knindex)
-  use dimphy, only: liste_i,liste_j,jjphy_begin,jjphy_nb,phy_rank,phy_size 
+  USE mod_phys_lmdz_para
   implicit none
   
@@ -3404,11 +3394,11 @@
 ! input
   integer                   :: klon, knon, iim, jmp1
-  real, dimension(klon)     :: champ_in
-  integer, dimension(klon)  :: knindex
+  real, dimension(klon_loc)     :: champ_in
+  integer, dimension(klon_loc)  :: knindex
 ! output
   real, dimension(iim,jmp1)  :: champ_out
 ! local
   integer                   :: i, ig, j
-  real, dimension(klon)     :: tamp
+  real, dimension(klon_loc)     :: tamp
 
   tamp = 0.
@@ -3418,23 +3408,6 @@
   enddo    
 
-!ym  ig = 1
-!ym  champ_out(:,1) = tamp(ig)
-!ym  do j = 2, jjm
-!ym    do i = 1, iim
-!ym      ig = ig + 1
-!ym      champ_out(i,j) = tamp(ig)
-!ym    enddo
-!ym  enddo
-!ym  ig = ig + 1
-!ym  champ_out(:,jjm+1) = tamp(ig)
-
-  do ig=1,klon
-    i=liste_i(ig)
-    j=liste_j(ig)-jjphy_begin+1
-    champ_out(i,j)=tamp(ig)
-  enddo
-  
-  if (phy_rank==0) champ_out(:,1)=tamp(1)
-  if (phy_rank==phy_size-1) champ_out(:,jjphy_nb)=tamp(klon)
+
+  CALL Grid1Dto2D_mpi(tamp,champ_out)
 
   END SUBROUTINE gath2cpl
@@ -3443,5 +3416,5 @@
 !
   SUBROUTINE cpl2gath(champ_in, champ_out, klon, knon, iim, jmp1, knindex)
-  use dimphy, only : liste_i, liste_j, jjphy_begin
+  USE mod_phys_lmdz_para
   implicit none
 ! Cette routine ecrit un champ 'gathered' sur la grille 2D pour le passer
@@ -3462,29 +3435,14 @@
   integer                   :: klon, knon, iim, jmp1
   real, dimension(iim,jmp1)     :: champ_in
-  integer, dimension(klon)  :: knindex
+  integer, dimension(klon_loc)  :: knindex
 ! output
-  real, dimension(klon)  :: champ_out
+  real, dimension(klon_loc)  :: champ_out
 ! local
   integer                   :: i, ig, j
-  real, dimension(klon)     :: tamp
+  real, dimension(klon_loc)     :: tamp
   logical ,save                  :: check = .false.
 !$OMP THREADPRIVATE(check)
 
-!ym  ig = 1
-!ym  tamp(ig) = champ_in(1,1)
-!ym  do j = 2, jjm
-!ym    do i = 1, iim
-!ym      ig = ig + 1
-!ym      tamp(ig) = champ_in(i,j)
-!ym    enddo
-!ym  enddo
-!ym  ig = ig + 1
-!ym  tamp(ig) = champ_in(1,jjm+1)
-
-  do ig=1,klon
-   i=liste_i(ig)
-   j=liste_j(ig)-jjphy_begin+1
-   tamp(ig)=champ_in(i,j)
-  enddo
+  CALL Grid2Dto1D_mpi(champ_in,tamp)
   
   do i = 1, knon
Index: LMDZ4/trunk/libf/phylmd/iophy.F90
===================================================================
--- LMDZ4/trunk/libf/phylmd/iophy.F90	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/iophy.F90	(revision 776)
@@ -12,11 +12,10 @@
     MODULE PROCEDURE histwrite2d_phy,histwrite3d_phy
   END INTERFACE 
-  
-  REAL,private,allocatable,save,dimension(:,:) :: buffer_omp
 
 contains
 
   subroutine init_iophy(lat,lon)
-  use dimphy
+  USE dimphy
+  USE mod_phys_lmdz_para
   use ioipsl
   implicit none
@@ -38,34 +37,33 @@
     allocate(io_lon(iim))
     io_lon(:)=lon(:)
-    allocate(tmp_tab2d(iim,jjphy_nb))
-    allocate(tmp_tab3d(iim,jjphy_nb,klev))
-    allocate(ndex2d(iim*jjphy_nb))
-    allocate(ndex3d(iim*jjphy_nb*klev))
+    allocate(tmp_tab2d(iim,jj_nb))
+    allocate(tmp_tab3d(iim,jj_nb,klev))
+    allocate(ndex2d(iim*jj_nb))
+    allocate(ndex3d(iim*jj_nb*klev))
     ndex2d(:)=0
     ndex3d(:)=0
-    allocate(buffer_omp(klon_mpi,klev))
     
     ddid=(/ 1,2 /)
     dsg=(/ iim, jjm+1 /)
-    dsl=(/ iim, jjphy_nb /)
-    dpf=(/ 1,jjphy_begin /)
-    dpl=(/ iim, jjphy_end /)
-    dhs=(/ iiphy_begin-1,0 /)
-    if (phy_rank==phy_size-1) then
+    dsl=(/ iim, jj_nb /)
+    dpf=(/ 1,jj_begin /)
+    dpl=(/ iim, jj_end /)
+    dhs=(/ ii_begin-1,0 /)
+    if (mpi_rank==mpi_size-1) then
       dhe=(/0,0/)
     else
-      dhe=(/ iim-iiphy_end,0 /)  
+      dhe=(/ iim-ii_end,0 /)  
     endif
     
-    call flio_dom_set(phy_size,phy_rank,ddid,dsg,dsl,dpf,dpl,dhs,dhe, &
+    call flio_dom_set(mpi_size,mpi_rank,ddid,dsg,dsl,dpf,dpl,dhs,dhe, &
                       'APPLE',phys_domain_id)
 
 !$OMP END MASTER
-!$OMP FLUSH(buffer_omp)
       
   end subroutine init_iophy
   
   subroutine histbeg_phy(name,itau0,zjulian,dtime,nhori,nid_day)
-  use dimphy
+  USE dimphy
+  USE mod_phys_lmdz_para
   use ioipsl
   use write_field
@@ -81,10 +79,10 @@
 
 !$OMP MASTER    
-    if (monocpu) then
-      call histbeg(name,iim,io_lon, jjphy_nb,io_lat(jjphy_begin:jjphy_end), &
-                   1,iim,1,jjphy_nb,itau0, zjulian, dtime, nhori, nid_day)
+    if (is_sequential) then
+      call histbeg(name,iim,io_lon, jj_nb,io_lat(jj_begin:jj_end), &
+                   1,iim,1,jj_nb,itau0, zjulian, dtime, nhori, nid_day)
     else
-      call histbeg(name,iim,io_lon, jjphy_nb,io_lat(jjphy_begin:jjphy_end), &
-                   1,iim,1,jjphy_nb,itau0, zjulian, dtime, nhori, nid_day,phys_domain_id)
+      call histbeg(name,iim,io_lon, jj_nb,io_lat(jj_begin:jj_end), &
+                   1,iim,1,jj_nb,itau0, zjulian, dtime, nhori, nid_day,phys_domain_id)
     endif
 !$OMP END MASTER
@@ -93,6 +91,7 @@
   
   subroutine histwrite2d_phy(nid,name,itau,field)
-  use dimphy
-  use ioipsl
+  USE dimphy
+  USE mod_phys_lmdz_para
+  USE ioipsl
   implicit none
   include 'dimensions90.h'
@@ -102,14 +101,18 @@
     integer, intent(in) :: itau
     real,dimension(klon),intent(in) :: field
-
-    CALL GatherField_omp(field,buffer_omp,1)    
+    
+    REAL,dimension(klon_mpi) :: buffer_omp
+    
+    CALL Gather_omp(field,buffer_omp)    
 !$OMP MASTER
-    CALL phy2dyn(buffer_omp,tmp_tab2d,1)
-    CALL histwrite(nid,name,itau,tmp_tab2d,iim*jjphy_nb,ndex2d)
+    CALL grid1Dto2D_mpi(buffer_omp,tmp_tab2d)
+    CALL histwrite(nid,name,itau,tmp_tab2d,iim*jj_nb,ndex2d)
 !$OMP END MASTER    
   end subroutine histwrite2d_phy
   
   subroutine histwrite3d_phy(nid,name,itau,field)
-  use dimphy
+  USE dimphy
+  USE mod_phys_lmdz_para
+
   use ioipsl
   implicit none
@@ -120,58 +123,60 @@
     integer, intent(in) :: itau
     real,dimension(klon,klev),intent(in) :: field
+
+    REAL,dimension(klon_mpi,klev) :: buffer_omp
     
-    CALL GatherField_omp(field,buffer_omp,klev)
+    CALL Gather_omp(field,buffer_omp)
 !$OMP MASTER
-    CALL phy2dyn(buffer_omp,tmp_tab3d,klev)
-    CALL histwrite(nid,name,itau,tmp_tab3d,iim*jjphy_nb*klev,ndex3d)
+    CALL grid1Dto2D_mpi(buffer_omp,tmp_tab3d)
+    CALL histwrite(nid,name,itau,tmp_tab3d,iim*jj_nb*klev,ndex3d)
 !$OMP END MASTER    
   end subroutine histwrite3d_phy
   
   
-  subroutine phy2dyn(field_phy,field_dyn,nlev)
-  use dimphy
-  implicit none
-  include 'dimensions90.h'
-  
-    real,dimension(klon_mpi,nlev),intent(in) :: field_phy
-    real,dimension(iim,jjphy_nb,nlev),intent(out) :: field_dyn
-    integer,intent(in) :: nlev
-    
-    integer :: next
-    integer :: j,l
-    
-      do l=1,nlev
-        	
-	if (jjphy_begin==jjphy_end) then
-	  field_dyn(:,1,l)=0.
-	  field_dyn(iiphy_begin:iiphy_end,1,l)=field_phy(1:klon_mpi,l)
-	else
-	
-	 if (jjphy_begin==1) then
-	    field_dyn(:,1,l)=field_phy(1,l)
-	    next=2
-	 else
-	   field_dyn(:,1,l)=0.
-	   next=iim-iiphy_begin+2
-	   field_dyn(iiphy_begin:iim,1,l)=field_phy(1:next-1,l)   
-	 endif
-	
-	  do j=2,jjphy_nb-1
-	    field_dyn(:,j,l)=field_phy(next:next+iim-1,l)
-	    next=next+iim
-	  enddo
-	  
-	  if (jjphy_end==jjm+1) then
-             field_dyn(:,jjphy_nb,l)=field_phy(klon_mpi,l)
-	  else
-	   field_dyn(:,jjphy_nb,l)=0.
-	   field_dyn(1:iiphy_end,jjphy_nb,l)=field_phy(next:next+iiphy_end-1,l)   
-	  endif
-	  
-	endif
-     
-     enddo
-	 
-    end subroutine phy2dyn	    
+!  subroutine phy2dyn(field_phy,field_dyn,nlev)
+!  USE dimphy_old
+!  implicit none
+!  include 'dimensions90.h'
+!  
+!    real,dimension(klon_mpi,nlev),intent(in) :: field_phy
+!    real,dimension(iim,jjphy_nb,nlev),intent(out) :: field_dyn
+!    integer,intent(in) :: nlev
+!    
+!    integer :: next
+!    integer :: j,l
+!    
+!      do l=1,nlev
+!        	
+!	if (jjphy_begin==jjphy_end) then
+!	  field_dyn(:,1,l)=0.
+!	  field_dyn(iiphy_begin:iiphy_end,1,l)=field_phy(1:klon_mpi,l)
+!	else
+!	
+!	 if (jjphy_begin==1) then
+!	    field_dyn(:,1,l)=field_phy(1,l)
+!	    next=2
+!	 else
+!	   field_dyn(:,1,l)=0.
+!	   next=iim-iiphy_begin+2
+!	   field_dyn(iiphy_begin:iim,1,l)=field_phy(1:next-1,l)   
+!	 endif
+!	
+!	  do j=2,jjphy_nb-1
+!	    field_dyn(:,j,l)=field_phy(next:next+iim-1,l)
+!	    next=next+iim
+!	  enddo
+!	  
+!	  if (jjphy_end==jjm+1) then
+!             field_dyn(:,jjphy_nb,l)=field_phy(klon_mpi,l)
+!	  else
+!	   field_dyn(:,jjphy_nb,l)=0.
+!	   field_dyn(1:iiphy_end,jjphy_nb,l)=field_phy(next:next+iiphy_end-1,l)   
+!	  endif
+!	  
+!	endif
+!     
+!     enddo
+!	 
+!    end subroutine phy2dyn	    
   
 	  
Index: LMDZ4/trunk/libf/phylmd/isccp_cloud_types.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/isccp_cloud_types.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/isccp_cloud_types.F	(revision 776)
@@ -32,5 +32,4 @@
      &)
 	
-!$Id$
 
 ! Copyright Steve Klein and Mark Webb 2002 - all rights reserved.
Index: LMDZ4/trunk/libf/phylmd/moy_undefSTD.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/moy_undefSTD.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/moy_undefSTD.F	(revision 776)
@@ -1,2 +1,5 @@
+!
+! $Header$
+!
       SUBROUTINE moy_undefSTD(nlevSTD,itap,
      $           dtime,ecrit_day,ecrit_mth,ecrit_hf2mth,
Index: LMDZ4/trunk/libf/phylmd/moyglo_aire.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/moyglo_aire.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/moyglo_aire.F	(revision 776)
@@ -1,2 +1,5 @@
+!
+! $Header$
+!
       SUBROUTINE moyglo_pondaire(nhori, champ, aire, 
      .            ok_msk, msk, moyglo)
Index: LMDZ4/trunk/libf/phylmd/oasis.psmile
===================================================================
--- LMDZ4/trunk/libf/phylmd/oasis.psmile	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/oasis.psmile	(revision 776)
@@ -94,5 +94,5 @@
 ! Here we go: psmile initialisation
 !
-    IF (monocpu) THEN
+    IF (is_sequential) THEN
       call prism_init_comp_proto (comp_id, clmodnam, ierror)
 
@@ -116,8 +116,8 @@
 !ym   ig_paral(3) = im * jm
    ig_paral(1) = 1    ! apple partition for //
-   ig_paral(2) = (jjphy_begin-1)*im+iiphy_begin-1
-   ig_paral(3) = (jjphy_end*im+iiphy_end)-(jjphy_begin*im+iiphy_begin)+1
-   if (phy_rank==phy_size-1) ig_paral(3)=ig_paral(3)+im-1
-   print *,phy_rank,'ig_paral--->',ig_paral(2),ig_paral(3)
+   ig_paral(2) = (jj_begin-1)*im+ii_begin-1
+   ig_paral(3) = (jj_end*im+ii_end)-(jj_begin*im+ii_begin)+1
+   if (mpi_rank==mpi_size-1) ig_paral(3)=ig_paral(3)+im-1
+   print *,mpi_rank,'ig_paral--->',ig_paral(2),ig_paral(3)
    
    ierror=PRISM_Ok
@@ -222,5 +222,6 @@
    use mod_prism_proto
    use mod_prism_get_proto
-   use dimphy
+   USE dimphy
+   USE mod_phys_lmdz_para
    IMPLICIT none
 
@@ -250,9 +251,9 @@
    CALL flush (nuout)
 
-   istart=iiphy_begin
-   if (phy_rank==phy_size-1) then
-    iend=(jjphy_end-jjphy_begin)*im+im
+   istart=ii_begin
+   if (is_south_pole) then
+    iend=(jj_end-jj_begin)*im+im
    else
-    iend=(jjphy_end-jjphy_begin)*im+iiphy_end
+    iend=(jj_end-jj_begin)*im+ii_end
    endif
    
@@ -313,5 +314,6 @@
    use mod_prism_proto
    use mod_prism_put_proto
-   use dimphy
+   USE dimphy
+   USE mod_phys_lmdz_para
    use write_field_phy
    IMPLICIT NONE
@@ -345,9 +347,9 @@
       WRITE(nuout,*)
 
-   istart=iiphy_begin
-   if (phy_rank==phy_size-1) then
-    iend=(jjphy_end-jjphy_begin)*im+im
+   istart=ii_begin
+   if (is_south_pole) then
+    iend=(jj_end-jj_begin)*im+im
    else
-    iend=(jjphy_end-jjphy_begin)*im+iiphy_end
+    iend=(jj_end-jj_begin)*im+ii_end
    endif
 
@@ -355,6 +357,6 @@
      wstart=istart
      wend=iend
-     IF (phy_rank==0) wstart=istart+im-1
-     IF (phy_rank==phy_size-1) wend=iend-im+1
+     IF (is_north_pole) wstart=istart+im-1
+     IF (is_south_pole) wend=iend-im+1
    
      CALL writeField_phy("fsolice",fsolice(wstart:wend),1)
@@ -533,5 +535,5 @@
 
    if (last) then
-     IF (monocpu) THEN 
+     IF (is_sequential) THEN 
        call prism_terminate_proto(ierror)
          IF (ierror .ne. PRISM_Ok) THEN
Index: LMDZ4/trunk/libf/phylmd/orografi.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/orografi.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/orografi.F	(revision 776)
@@ -1481,5 +1481,5 @@
 C*       0.2   LOCAL ARRAYS
 C              ------------
-      logical lifthigh, ll1
+      logical lifthigh
 cym      integer klevm1, jl, ilevh, jk
       integer  jl, ilevh, jk
@@ -1711,4 +1711,6 @@
       SUBROUTINE SUGWD(NLON,NLEV,paprs,pplay)
       USE dimphy
+      USE mod_phys_lmdz_para
+      USE mod_grid_phy_lmdz
 c      USE parallel
 C
@@ -1764,8 +1766,6 @@
       REAL pplay(nlon,nlev)
       real zpr,zstra,zsigt,zpm1r
-      REAL,SAVE,ALLOCATABLE :: pplay_mpi(:,:)
-      REAL,SAVE,ALLOCATABLE :: paprs_mpi(:,:)
-      REAL,SAVE,ALLOCATABLE :: pplay_glo(:,:)
-      REAL,SAVE,ALLOCATABLE :: paprs_glo(:,:)
+      REAL :: pplay_glo(klon_glo,nlev)
+      REAL :: paprs_glo(klon_glo,nlev+1)
 
 C
@@ -1784,27 +1784,17 @@
 cold  ZSIGT=0.85
 C
-c$OMP MASTER
-      ALLOCATE(pplay_mpi(klon_mpi,nlev))
-      ALLOCATE(paprs_mpi(klon_mpi,nlev+1))
-      ALLOCATE(pplay_glo(klon2,nlev))
-      ALLOCATE(paprs_glo(klon2,nlev+1))
-c$OMP END MASTER
-c$OMP BARRIER
-
-      CALL GatherField_omp(pplay,pplay_mpi,nlev)      
-      CALL GatherField_omp(paprs,paprs_mpi,nlev+1)
-
-c$OMP MASTER      
-      CALL  AllGatherField(pplay_mpi,pplay_glo,nlev)
-      CALL  AllGatherField(paprs_mpi,paprs_glo,nlev+1)
-c$OMP END MASTER
-c$OMP BARRIER
       
+      CALL gather(pplay,pplay_glo)
+      CALL bcast(pplay_glo)
+      CALL gather(paprs,paprs_glo)
+      CALL bcast(paprs_glo)
+      
+            
       DO 110 JK=1,NLEV
-      ZPM1R=pplay_glo(klon2/2,jk)/paprs_glo(klon2/2,1) 
+      ZPM1R=pplay_glo(klon_glo/2,jk)/paprs_glo(klon_glo/2,1) 
       IF(ZPM1R.GE.ZSIGT)THEN
          nktopg=JK
       ENDIF
-      ZPM1R=pplay_glo(klon2/2,jk)/paprs_glo(klon2/2,1) 
+      ZPM1R=pplay_glo(klon_glo/2,jk)/paprs_glo(klon_glo/2,1) 
       IF(ZPM1R.GE.ZSTRA)THEN
          NSTRA=JK
@@ -1812,12 +1802,4 @@
   110 CONTINUE
 
-c$OMP BARRIER
-c$OMP MASTER
-      DEALLOCATE(pplay_mpi)
-      DEALLOCATE(paprs_mpi)
-      DEALLOCATE(pplay_glo)
-      DEALLOCATE(paprs_glo)
-c$OMP END MASTER
-c$OMP BARRIER
 
 c
Index: LMDZ4/trunk/libf/phylmd/phyetat0.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/phyetat0.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/phyetat0.F	(revision 776)
@@ -15,5 +15,7 @@
      .           t_ancien_p,q_ancien_p,ancien_ok_p, rnebcon_p, ratqs_p,
      .           clwcon_p,run_off_lic_0_p)
-      USE dimphy,klon=>klon2,klon2=>klon,zmasq_p=>zmasq
+      USE dimphy
+      USE mod_grid_phy_lmdz
+      USE mod_phys_lmdz_para
       USE iophy
       IMPLICIT none
@@ -33,116 +35,80 @@
       REAL dtime
       INTEGER radpas
+      REAL rlat_p(klon), rlon_p(klon)
       REAL rlat_p(klon2), rlon_p(klon2)
       REAL co2_ppm_etat0
       REAL solaire_etat0
-      REAL tsol_p(klon2,nbsrf)
-      REAL tsoil_p(klon2,nsoilmx,nbsrf)
-      REAL tslab_p(klon2), seaice_p(klon2)
-      REAL qsurf_p(klon2,nbsrf)
-      REAL qsol_p(klon2)
-      REAL snow_p(klon2,nbsrf)
-      REAL albe_p(klon2,nbsrf)
+      REAL tsol_p(klon,nbsrf)
+      REAL tsoil_p(klon,nsoilmx,nbsrf)
+      REAL tslab_p(klon), seaice_p(klon)
+      REAL qsurf_p(klon,nbsrf)
+      REAL qsol_p(klon)
+      REAL snow_p(klon,nbsrf)
+      REAL albe_p(klon,nbsrf)
 cIM BEG alblw
-      REAL alblw_p(klon2,nbsrf)
+      REAL alblw_p(klon,nbsrf)
 cIM END alblw
-      REAL evap_p(klon2,nbsrf)
-      REAL radsol_p(klon2)
-      REAL rain_fall_p(klon2)
-      REAL snow_fall_p(klon2)
-      REAL sollw_p(klon2)
-      real solsw_p(klon2)
-      real fder_p(klon2)
-      REAL frugs_p(klon2,nbsrf)
-      REAL agesno_p(klon2,nbsrf)
-      REAL zmea_p(klon2)
-      REAL zstd_p(klon2)
-      REAL zsig_p(klon2)
-      REAL zgam_p(klon2)
-      REAL zthe_p(klon2)
-      REAL zpic_p(klon2)
-      REAL zval_p(klon2)
-      REAL rugsrel_p(klon2)
-      REAL pctsrf_p(klon2, nbsrf)
-      REAL run_off_lic_0_p(klon2)
+      REAL evap_p(klon,nbsrf)
+      REAL radsol_p(klon)
+      REAL rain_fall_p(klon)
+      REAL snow_fall_p(klon)
+      REAL sollw_p(klon)
+      real solsw_p(klon)
+      real fder_p(klon)
+      REAL frugs_p(klon,nbsrf)
+      REAL agesno_p(klon,nbsrf)
+      REAL zmea_p(klon)
+      REAL zstd_p(klon)
+      REAL zsig_p(klon)
+      REAL zgam_p(klon)
+      REAL zthe_p(klon)
+      REAL zpic_p(klon)
+      REAL zval_p(klon)
+      REAL rugsrel_p(klon)
+      REAL pctsrf_p(klon, nbsrf)
+      REAL run_off_lic_0_p(klon)
       
-      REAL t_ancien_p(klon2,klev), q_ancien_p(klon2,klev)
-      real rnebcon_p(klon2,klev),clwcon_p(klon2,klev)
-      real ratqs_p(klon2,klev)
+      REAL t_ancien_p(klon,klev), q_ancien_p(klon,klev)
+      real rnebcon_p(klon,klev),clwcon_p(klon,klev)
+      real ratqs_p(klon,klev)
       LOGICAL,SAVE ::  ancien_ok
       LOGICAL ::  ancien_ok_p
       
-      REAL zmasq(klon)
-      REAL rlat(klon), rlon(klon)
-      REAL tsol(klon,nbsrf)
-      REAL tsoil(klon,nsoilmx,nbsrf)
+      REAL zmasq_glo(klon_glo)
+      REAL rlat(klon_glo), rlon(klon_glo)
+      REAL tsol(klon_glo,nbsrf)
+      REAL tsoil(klon_glo,nsoilmx,nbsrf)
 cIM "slab" ocean
-      REAL tslab(klon), seaice(klon)
-      REAL qsurf(klon,nbsrf)
-      REAL qsol(klon)
-      REAL snow(klon,nbsrf)
-      REAL albe(klon,nbsrf)
-      REAL alblw(klon,nbsrf)
-      REAL evap(klon,nbsrf)
-      REAL radsol(klon)
-      REAL rain_fall(klon)
-      REAL snow_fall(klon)
-      REAL sollw(klon)
-      real solsw(klon)
-      real fder(klon)
-      REAL frugs(klon,nbsrf)
-      REAL agesno(klon,nbsrf)
-      REAL zmea(klon)
-      REAL zstd(klon)
-      REAL zsig(klon)
-      REAL zgam(klon)
-      REAL zthe(klon)
-      REAL zpic(klon)
-      REAL zval(klon)
-      REAL rugsrel(klon)
-      REAL pctsrf(klon, nbsrf)
-      REAL fractint(klon)
-      REAL run_off_lic_0(klon)
-      REAL t_ancien(klon,klev)
-      REAL q_ancien(klon,klev)
-      real rnebcon(klon,klev)
-      real clwcon(klon,klev)
-      real ratqs(klon,klev)
-
-      REAL,ALLOCATABLE,SAVE :: zmasq_mpi(:)
-      REAL,ALLOCATABLE,SAVE :: rlat_mpi(:), rlon_mpi(:)
-      REAL,ALLOCATABLE,SAVE :: tsol_mpi(:,:)
-      REAL,ALLOCATABLE,SAVE :: tsoil_mpi(:,:,:)
-      REAL,ALLOCATABLE,SAVE :: tslab_mpi(:)
-      REAL,ALLOCATABLE,SAVE :: seaice_mpi(:)
-      REAL,ALLOCATABLE,SAVE :: qsurf_mpi(:,:)
-      REAL,ALLOCATABLE,SAVE :: qsol_mpi(:)
-      REAL,ALLOCATABLE,SAVE :: snow_mpi(:,:)
-      REAL,ALLOCATABLE,SAVE :: albe_mpi(:,:)
-      REAL,ALLOCATABLE,SAVE :: alblw_mpi(:,:)
-      REAL,ALLOCATABLE,SAVE :: evap_mpi(:,:)
-      REAL,ALLOCATABLE,SAVE :: radsol_mpi(:)
-      REAL,ALLOCATABLE,SAVE :: rain_fall_mpi(:)
-      REAL,ALLOCATABLE,SAVE :: snow_fall_mpi(:)
-      REAL,ALLOCATABLE,SAVE :: sollw_mpi(:)
-      real,ALLOCATABLE,SAVE :: solsw_mpi(:)
-      real,ALLOCATABLE,SAVE :: fder_mpi(:)
-      REAL,ALLOCATABLE,SAVE :: frugs_mpi(:,:)
-      REAL,ALLOCATABLE,SAVE :: agesno_mpi(:,:)
-      REAL,ALLOCATABLE,SAVE :: zmea_mpi(:)
-      REAL,ALLOCATABLE,SAVE :: zstd_mpi(:)
-      REAL,ALLOCATABLE,SAVE :: zsig_mpi(:)
-      REAL,ALLOCATABLE,SAVE :: zgam_mpi(:)
-      REAL,ALLOCATABLE,SAVE :: zthe_mpi(:)
-      REAL,ALLOCATABLE,SAVE :: zpic_mpi(:)
-      REAL,ALLOCATABLE,SAVE :: zval_mpi(:)
-      REAL,ALLOCATABLE,SAVE :: rugsrel_mpi(:)
-      REAL,ALLOCATABLE,SAVE :: pctsrf_mpi(:, :)
-      REAL,ALLOCATABLE,SAVE :: run_off_lic_0_mpi(:)
-      REAL,ALLOCATABLE,SAVE :: t_ancien_mpi(:,:)
-      REAL,ALLOCATABLE,SAVE :: q_ancien_mpi(:,:)
-      real,ALLOCATABLE,SAVE :: rnebcon_mpi(:,:)
-      real,ALLOCATABLE,SAVE :: clwcon_mpi(:,:)
-      real,ALLOCATABLE,SAVE :: ratqs_mpi(:,:)
-           
+      REAL tslab(klon_glo), seaice(klon_glo)
+      REAL qsurf(klon_glo,nbsrf)
+      REAL qsol(klon_glo)
+      REAL snow(klon_glo,nbsrf)
+      REAL albe(klon_glo,nbsrf)
+      REAL alblw(klon_glo,nbsrf)
+      REAL evap(klon_glo,nbsrf)
+      REAL radsol(klon_glo)
+      REAL rain_fall(klon_glo)
+      REAL snow_fall(klon_glo)
+      REAL sollw(klon_glo)
+      real solsw(klon_glo)
+      real fder(klon_glo)
+      REAL frugs(klon_glo,nbsrf)
+      REAL agesno(klon_glo,nbsrf)
+      REAL zmea(klon_glo)
+      REAL zstd(klon_glo)
+      REAL zsig(klon_glo)
+      REAL zgam(klon_glo)
+      REAL zthe(klon_glo)
+      REAL zpic(klon_glo)
+      REAL zval(klon_glo)
+      REAL rugsrel(klon_glo)
+      REAL pctsrf(klon_glo, nbsrf)
+      REAL fractint(klon_glo)
+      REAL run_off_lic_0(klon_glo)
+      REAL t_ancien(klon_glo,klev)
+      REAL q_ancien(klon_glo,klev)
+      real rnebcon(klon_glo,klev)
+      real clwcon(klon_glo,klev)
+      real ratqs(klon_glo,klev)
 
       CHARACTER*6 ocean
@@ -172,10 +138,12 @@
 
 c$OMP MASTER
-      print*,'fichnom ',fichnom
-      ierr = NF_OPEN (fichnom, NF_NOWRITE,nid)
-      IF (ierr.NE.NF_NOERR) THEN
-        write(6,*)' Pb d''ouverture du fichier '//fichnom
-        write(6,*)' ierr = ', ierr
-        CALL ABORT
+      IF (is_mpi_root) THEN
+        print*,'fichnom ',fichnom
+        ierr = NF_OPEN (fichnom, NF_NOWRITE,nid)
+        IF (ierr.NE.NF_NOERR) THEN
+          write(6,*)' Pb d''ouverture du fichier '//fichnom
+          write(6,*)' ierr = ', ierr
+          CALL ABORT
+        ENDIF
       ENDIF
 c$OMP END MASTER
@@ -184,4 +152,6 @@
 c
 c$OMP MASTER
+      IF (is_mpi_root) THEN
+      
       ierr = NF_INQ_VARID (nid, "controle", nvarid)
       IF (ierr.NE.NF_NOERR) THEN
@@ -198,10 +168,9 @@
          CALL abort
       ENDIF
+      ENDIF
+
 c$OMP END MASTER
-c$OMP BARRIER
        
-       DO i = 1, length
-         tab_cntrl( i ) = tab_cntrl_omp( i )
-       ENDDO
+       CALL bcast(tab_cntrl)
        
 c
@@ -281,4 +250,6 @@
 c
 c$OMP MASTER
+      IF (is_mpi_root) THEN
+      
       ierr = NF_INQ_VARID (nid, "latitude", nvarid)
       IF (ierr.NE.NF_NOERR) THEN
@@ -321,7 +292,7 @@
       IF (ierr .EQ.  NF_NOERR) THEN
 #ifdef NC_DOUBLE
-          ierr = NF_GET_VAR_DOUBLE(nid, nvarid, zmasq)
-#else
-          ierr = NF_GET_VAR_REAL(nid, nvarid, zmasq)
+          ierr = NF_GET_VAR_DOUBLE(nid, nvarid, zmasq_glo)
+#else
+          ierr = NF_GET_VAR_REAL(nid, nvarid, zmasq_glo)
 #endif
           IF (ierr.NE.NF_NOERR) THEN
@@ -348,7 +319,9 @@
       IF (ierr .EQ.  NF_NOERR) THEN
 #ifdef NC_DOUBLE
-          ierr = NF_GET_VAR_DOUBLE(nid, nvarid, pctsrf(1 : klon,is_ter))
-#else
-          ierr = NF_GET_VAR_REAL(nid, nvarid, pctsrf(1 : klon,is_ter))
+          ierr = NF_GET_VAR_DOUBLE(nid, nvarid,        
+     .                             pctsrf(1 : klon_glo,is_ter))
+#else
+          ierr = NF_GET_VAR_REAL(nid, nvarid, 
+     .                           pctsrf(1 : klon_glo,is_ter))
 #endif
           IF (ierr.NE.NF_NOERR) THEN
@@ -367,7 +340,9 @@
       IF (ierr .EQ.  NF_NOERR) THEN
 #ifdef NC_DOUBLE
-          ierr = NF_GET_VAR_DOUBLE(nid, nvarid, pctsrf(1 : klon,is_lic))
-#else
-          ierr = NF_GET_VAR_REAL(nid, nvarid, pctsrf(1 : klon,is_lic))
+          ierr = NF_GET_VAR_DOUBLE(nid, nvarid, 
+     .                             pctsrf(1 : klon_glo,is_lic))
+#else
+          ierr = NF_GET_VAR_REAL(nid, nvarid, 
+     .                           pctsrf(1 : klon_glo,is_lic))
 #endif
           IF (ierr.NE.NF_NOERR) THEN
@@ -385,7 +360,9 @@
       IF (ierr .EQ.  NF_NOERR) THEN
 #ifdef NC_DOUBLE
-          ierr = NF_GET_VAR_DOUBLE(nid, nvarid, pctsrf(1 : klon,is_oce))
-#else
-          ierr = NF_GET_VAR_REAL(nid, nvarid, pctsrf(1 : klon,is_oce))
+          ierr = NF_GET_VAR_DOUBLE(nid, nvarid, 
+     .                             pctsrf(1 : klon_glo,is_oce))
+#else
+          ierr = NF_GET_VAR_REAL(nid, nvarid, 
+     .                           pctsrf(1 : klon_glo,is_oce))
 #endif
           IF (ierr.NE.NF_NOERR) THEN
@@ -404,7 +381,9 @@
       IF (ierr .EQ.  NF_NOERR) THEN
 #ifdef NC_DOUBLE
-          ierr = NF_GET_VAR_DOUBLE(nid, nvarid, pctsrf(1 : klon,is_sic))
-#else
-          ierr = NF_GET_VAR_REAL(nid, nvarid, pctsrf(1 : klon, is_sic))
+          ierr = NF_GET_VAR_DOUBLE(nid, nvarid, 
+     .                             pctsrf(1 : klon_glo,is_sic))
+#else
+          ierr = NF_GET_VAR_REAL(nid, nvarid, 
+     .                           pctsrf(1 : klon_glo, is_sic))
 #endif
           IF (ierr.NE.NF_NOERR) THEN
@@ -420,19 +399,19 @@
 C  Verification de l'adequation entre le masque et les sous-surfaces
 C
-      fractint( 1 : klon) = pctsrf(1 : klon, is_ter) 
-     $    + pctsrf(1 : klon, is_lic)
-      DO i = 1 , klon
-        IF ( abs(fractint(i) - zmasq(i) ) .GT. EPSFRA ) THEN
+      fractint( 1 : klon_glo) = pctsrf(1 : klon_glo, is_ter) 
+     $    + pctsrf(1 : klon_glo, is_lic)
+      DO i = 1 , klon_glo
+        IF ( abs(fractint(i) - zmasq_glo(i) ) .GT. EPSFRA ) THEN
             WRITE(*,*) 'phyetat0: attention fraction terre pas ', 
-     $          'coherente ', i, zmasq(i), pctsrf(i, is_ter)
+     $          'coherente ', i, zmasq_glo(i), pctsrf(i, is_ter)
      $          ,pctsrf(i, is_lic)
         ENDIF 
       END DO 
-      fractint (1 : klon) =  pctsrf(1 : klon, is_oce) 
-     $    + pctsrf(1 : klon, is_sic)
-      DO i = 1 , klon
-        IF ( abs( fractint(i) - (1. - zmasq(i))) .GT. EPSFRA ) THEN
+      fractint (1 : klon_glo) =  pctsrf(1 : klon_glo, is_oce) 
+     $    + pctsrf(1 : klon_glo, is_sic)
+      DO i = 1 , klon_glo
+        IF ( abs( fractint(i) - (1. - zmasq_glo(i))) .GT. EPSFRA ) THEN
             WRITE(*,*) 'phyetat0 attention fraction ocean pas ', 
-     $          'coherente ', i, zmasq(i) , pctsrf(i, is_oce)
+     $          'coherente ', i, zmasq_glo(i) , pctsrf(i, is_oce)
      $          ,pctsrf(i, is_sic)
         ENDIF 
@@ -470,5 +449,5 @@
            xmin = 1.0E+20
            xmax = -1.0E+20
-           DO i = 1, klon
+           DO i = 1, klon_glo
               xmin = MIN(tsol(i,nsrf),xmin)
               xmax = MAX(tsol(i,nsrf),xmax)
@@ -490,5 +469,5 @@
          xmin = 1.0E+20
          xmax = -1.0E+20
-         DO i = 1, klon
+         DO i = 1, klon_glo
             xmin = MIN(tsol(i,1),xmin)
             xmax = MAX(tsol(i,1),xmax)
@@ -496,5 +475,5 @@
          PRINT*,'Temperature du sol <TS>', xmin, xmax
          DO nsrf = 2, nbsrf
-         DO i = 1, klon
+         DO i = 1, klon_glo
             tsol(i,nsrf) = tsol(i,1)
          ENDDO
@@ -516,5 +495,5 @@
          PRINT*, "phyetat0: Le champ <Tsoil"//str7//"> est absent"
          PRINT*, "          Il prend donc la valeur de surface"
-         DO i=1, klon
+         DO i=1, klon_glo
              tsoil(i,isoil,nsrf)=tsol(i,nsrf)
          ENDDO
@@ -554,5 +533,5 @@
         xmin = 1.0E+20
         xmax = -1.0E+20
-        DO i = 1, klon
+        DO i = 1, klon_glo
           xmin = MIN(tslab(i),xmin)
           xmax = MAX(tslab(i),xmax)
@@ -578,5 +557,5 @@
         xmin = 1.0E+20
         xmax = -1.0E+20
-        DO i = 1, klon
+        DO i = 1, klon_glo
           xmin = MIN(seaice(i),xmin)
           xmax = MAX(seaice(i),xmax)
@@ -617,5 +596,5 @@
            xmin = 1.0E+20
            xmax = -1.0E+20
-           DO i = 1, klon
+           DO i = 1, klon_glo
               xmin = MIN(qsurf(i,nsrf),xmin)
               xmax = MAX(qsurf(i,nsrf),xmax)
@@ -637,5 +616,5 @@
          xmin = 1.0E+20
          xmax = -1.0E+20
-         DO i = 1, klon
+         DO i = 1, klon_glo
             xmin = MIN(qsurf(i,1),xmin)
             xmax = MAX(qsurf(i,1),xmax)
@@ -643,5 +622,5 @@
          PRINT*,'Humidite pres du sol <QS>', xmin, xmax
          DO nsrf = 2, nbsrf
-         DO i = 1, klon
+         DO i = 1, klon_glo
             qsurf(i,nsrf) = qsurf(i,1)
          ENDDO
@@ -670,5 +649,5 @@
       xmin = 1.0E+20
       xmax = -1.0E+20
-      DO i = 1, klon
+      DO i = 1, klon_glo
         xmin = MIN(qsol(i),xmin)
         xmax = MAX(qsol(i),xmax)
@@ -704,5 +683,5 @@
            xmin = 1.0E+20
            xmax = -1.0E+20
-           DO i = 1, klon
+           DO i = 1, klon_glo
               xmin = MIN(snow(i,nsrf),xmin)
               xmax = MAX(snow(i,nsrf),xmax)
@@ -724,5 +703,5 @@
          xmin = 1.0E+20
          xmax = -1.0E+20
-         DO i = 1, klon
+         DO i = 1, klon_glo
             xmin = MIN(snow(i,1),xmin)
             xmax = MAX(snow(i,1),xmax)
@@ -730,5 +709,5 @@
          PRINT*,'Neige du sol <SNOW>', xmin, xmax
          DO nsrf = 2, nbsrf
-         DO i = 1, klon
+         DO i = 1, klon_glo
             snow(i,nsrf) = snow(i,1)
          ENDDO
@@ -764,5 +743,5 @@
            xmin = 1.0E+20
            xmax = -1.0E+20
-           DO i = 1, klon
+           DO i = 1, klon_glo
               xmin = MIN(albe(i,nsrf),xmin)
               xmax = MAX(albe(i,nsrf),xmax)
@@ -784,5 +763,5 @@
          xmin = 1.0E+20
          xmax = -1.0E+20
-         DO i = 1, klon
+         DO i = 1, klon_glo
             xmin = MIN(albe(i,1),xmin)
             xmax = MAX(albe(i,1),xmax)
@@ -790,5 +769,5 @@
          PRINT*,'Neige du sol <ALBE>', xmin, xmax
          DO nsrf = 2, nbsrf
-         DO i = 1, klon
+         DO i = 1, klon_glo
             albe(i,nsrf) = albe(i,1)
          ENDDO
@@ -805,5 +784,5 @@
          PRINT*, '          Mais je vais prendre ALBE**'
          DO nsrf = 1, nbsrf
-           DO i = 1, klon
+           DO i = 1, klon_glo
              alblw(i,nsrf) = albe(i,nsrf)
            ENDDO
@@ -823,5 +802,5 @@
          xmin = 1.0E+20
          xmax = -1.0E+20
-         DO i = 1, klon
+         DO i = 1, klon_glo
             xmin = MIN(alblw(i,1),xmin)
             xmax = MAX(alblw(i,1),xmax)
@@ -829,5 +808,5 @@
          PRINT*,'Neige du sol <ALBLW>', xmin, xmax
          DO nsrf = 2, nbsrf
-         DO i = 1, klon
+         DO i = 1, klon_glo
             alblw(i,nsrf) = alblw(i,1)
          ENDDO
@@ -863,5 +842,5 @@
            xmin = 1.0E+20
            xmax = -1.0E+20
-           DO i = 1, klon
+           DO i = 1, klon_glo
               xmin = MIN(evap(i,nsrf),xmin)
               xmax = MAX(evap(i,nsrf),xmax)
@@ -883,5 +862,5 @@
          xmin = 1.0E+20
          xmax = -1.0E+20
-         DO i = 1, klon
+         DO i = 1, klon_glo
             xmin = MIN(evap(i,1),xmin)
             xmax = MAX(evap(i,1),xmax)
@@ -889,5 +868,5 @@
          PRINT*,'Evap du sol <EVAP>', xmin, xmax
          DO nsrf = 2, nbsrf
-         DO i = 1, klon
+         DO i = 1, klon_glo
             evap(i,nsrf) = evap(i,1)
          ENDDO
@@ -913,5 +892,5 @@
       xmin = 1.0E+20
       xmax = -1.0E+20
-      DO i = 1, klon
+      DO i = 1, klon_glo
          xmin = MIN(rain_fall(i),xmin)
          xmax = MAX(rain_fall(i),xmax)
@@ -937,5 +916,5 @@
       xmin = 1.0E+20
       xmax = -1.0E+20
-      DO i = 1, klon
+      DO i = 1, klon_glo
          xmin = MIN(snow_fall(i),xmin)
          xmax = MAX(snow_fall(i),xmax)
@@ -963,5 +942,5 @@
       xmin = 1.0E+20
       xmax = -1.0E+20
-      DO i = 1, klon
+      DO i = 1, klon_glo
          xmin = MIN(solsw(i),xmin)
          xmax = MAX(solsw(i),xmax)
@@ -989,15 +968,16 @@
       xmin = 1.0E+20
       xmax = -1.0E+20
-      DO i = 1, klon
+      DO i = 1, klon_glo
          xmin = MIN(sollw(i),xmin)
          xmax = MAX(sollw(i),xmax)
       ENDDO
       PRINT*,'Rayonnement IF au sol sollw:', xmin, xmax
-
+      
+      ENDIF  ! is_mpi_root
 c$OMP END MASTER
 
 
 c$OMP MASTER
-
+      IF (is_mpi_root) THEN
 c
 c Lecture derive des flux:
@@ -1021,5 +1001,5 @@
       xmin = 1.0E+20
       xmax = -1.0E+20
-      DO i = 1, klon
+      DO i = 1, klon_glo
          xmin = MIN(fder(i),xmin)
          xmax = MAX(fder(i),xmax)
@@ -1046,5 +1026,5 @@
       xmin = 1.0E+20
       xmax = -1.0E+20
-      DO i = 1, klon
+      DO i = 1, klon_glo
          xmin = MIN(radsol(i),xmin)
          xmax = MAX(radsol(i),xmax)
@@ -1081,5 +1061,5 @@
            xmin = 1.0E+20
            xmax = -1.0E+20
-           DO i = 1, klon
+           DO i = 1, klon_glo
               xmin = MIN(frugs(i,nsrf),xmin)
               xmax = MAX(frugs(i,nsrf),xmax)
@@ -1101,5 +1081,5 @@
          xmin = 1.0E+20
          xmax = -1.0E+20
-         DO i = 1, klon
+         DO i = 1, klon_glo
             xmin = MIN(frugs(i,1),xmin)
             xmax = MAX(frugs(i,1),xmax)
@@ -1107,5 +1087,5 @@
          PRINT*,'rugosite <RUG>', xmin, xmax
          DO nsrf = 2, nbsrf
-         DO i = 1, klon
+         DO i = 1, klon_glo
             frugs(i,nsrf) = frugs(i,1)
          ENDDO
@@ -1142,5 +1122,5 @@
            xmin = 1.0E+20
            xmax = -1.0E+20
-           DO i = 1, klon
+           DO i = 1, klon_glo
               xmin = MIN(agesno(i,nsrf),xmin)
               xmax = MAX(agesno(i,nsrf),xmax)
@@ -1162,5 +1142,5 @@
          xmin = 1.0E+20
          xmax = -1.0E+20
-         DO i = 1, klon
+         DO i = 1, klon_glo
             xmin = MIN(agesno(i,1),xmin)
             xmax = MAX(agesno(i,1),xmax)
@@ -1168,5 +1148,5 @@
          PRINT*,'Age de la neige <AGESNO>', xmin, xmax
          DO nsrf = 2, nbsrf
-         DO i = 1, klon
+         DO i = 1, klon_glo
             agesno(i,nsrf) = agesno(i,1)
          ENDDO
@@ -1191,5 +1171,5 @@
       xmin = 1.0E+20
       xmax = -1.0E+20
-      DO i = 1, klon
+      DO i = 1, klon_glo
          xmin = MIN(zmea(i),xmin)
          xmax = MAX(zmea(i),xmax)
@@ -1214,5 +1194,5 @@
       xmin = 1.0E+20
       xmax = -1.0E+20
-      DO i = 1, klon
+      DO i = 1, klon_glo
          xmin = MIN(zstd(i),xmin)
          xmax = MAX(zstd(i),xmax)
@@ -1237,5 +1217,5 @@
       xmin = 1.0E+20
       xmax = -1.0E+20
-      DO i = 1, klon
+      DO i = 1, klon_glo
          xmin = MIN(zsig(i),xmin)
          xmax = MAX(zsig(i),xmax)
@@ -1260,5 +1240,5 @@
       xmin = 1.0E+20
       xmax = -1.0E+20
-      DO i = 1, klon
+      DO i = 1, klon_glo
          xmin = MIN(zgam(i),xmin)
          xmax = MAX(zgam(i),xmax)
@@ -1283,5 +1263,5 @@
       xmin = 1.0E+20
       xmax = -1.0E+20
-      DO i = 1, klon
+      DO i = 1, klon_glo
          xmin = MIN(zthe(i),xmin)
          xmax = MAX(zthe(i),xmax)
@@ -1306,5 +1286,5 @@
       xmin = 1.0E+20
       xmax = -1.0E+20
-      DO i = 1, klon
+      DO i = 1, klon_glo
          xmin = MIN(zpic(i),xmin)
          xmax = MAX(zpic(i),xmax)
@@ -1328,5 +1308,5 @@
       xmin = 1.0E+20
       xmax = -1.0E+20
-      DO i = 1, klon
+      DO i = 1, klon_glo
          xmin = MIN(zval(i),xmin)
          xmax = MAX(zval(i),xmax)
@@ -1351,5 +1331,5 @@
       xmin = 1.0E+20
       xmax = -1.0E+20
-      DO i = 1, klon
+      DO i = 1, klon_glo
          xmin = MIN(rugsrel(i),xmin)
          xmax = MAX(rugsrel(i),xmax)
@@ -1510,4 +1490,5 @@
 c
       ierr = NF_CLOSE(nid)
+      ENDIF ! is_mpi_root
 c
 c$OMP END MASTER
@@ -1516,164 +1497,50 @@
 cym  en attendant mieux
         iolat(1)=rlat(1)
-	iolat(jjm+1)=rlat(klon)
+	iolat(jjm+1)=rlat(klon_glo)
 	do i=2,jjm
 	  iolat(i)=rlat(2+(i-2)*iim)
 	enddo
-	
+	CALL bcast_mpi(iolat)
+	CALL bcast_mpi(rlon)
         call init_iophy(iolat,rlon(2:iim+1))
        
-      print *,'Allocated ??',allocated(zmasq_mpi)
-      print *,'klon_mpi',klon_mpi
-      print *,'omp_rank',omp_rank
-      ALLOCATE( zmasq_mpi(klon_mpi))
-      ALLOCATE( rlat_mpi(klon_mpi), rlon_mpi(klon_mpi))
-      ALLOCATE( tsol_mpi(klon_mpi,nbsrf))
-      ALLOCATE( tsoil_mpi(klon_mpi,nsoilmx,nbsrf))
-      ALLOCATE( tslab_mpi(klon_mpi))
-      ALLOCATE( seaice_mpi(klon_mpi))
-      ALLOCATE( qsurf_mpi(klon_mpi,nbsrf))
-      ALLOCATE( qsol_mpi(klon_mpi))
-      ALLOCATE( snow_mpi(klon_mpi,nbsrf))
-      ALLOCATE( albe_mpi(klon_mpi,nbsrf))
-      ALLOCATE( alblw_mpi(klon_mpi,nbsrf))
-      ALLOCATE( evap_mpi(klon_mpi,nbsrf))
-      ALLOCATE( radsol_mpi(klon_mpi))
-      ALLOCATE( rain_fall_mpi(klon_mpi))
-      ALLOCATE( snow_fall_mpi(klon_mpi))
-      ALLOCATE( sollw_mpi(klon_mpi))
-      ALLOCATE( solsw_mpi(klon_mpi))
-      ALLOCATE( fder_mpi(klon_mpi))
-      ALLOCATE( frugs_mpi(klon_mpi,nbsrf))
-      ALLOCATE( agesno_mpi(klon_mpi,nbsrf))
-      ALLOCATE( zmea_mpi(klon_mpi))
-      ALLOCATE( zstd_mpi(klon_mpi))
-      ALLOCATE( zsig_mpi(klon_mpi))
-      ALLOCATE( zgam_mpi(klon_mpi))
-      ALLOCATE( zthe_mpi(klon_mpi))
-      ALLOCATE( zpic_mpi(klon_mpi))
-      ALLOCATE( zval_mpi(klon_mpi))
-      ALLOCATE( rugsrel_mpi(klon_mpi))
-      ALLOCATE( pctsrf_mpi(klon_mpi, nbsrf))
-      ALLOCATE( run_off_lic_0_mpi(klon_mpi))
-      ALLOCATE( t_ancien_mpi(klon_mpi,klev))
-      ALLOCATE( q_ancien_mpi(klon_mpi,klev))
-      ALLOCATE( rnebcon_mpi(klon_mpi,klev))
-      ALLOCATE( clwcon_mpi(klon_mpi,klev))
-      ALLOCATE( ratqs_mpi(klon_mpi,klev))
+c$OMP END MASTER
       	
-      call ScatterField( rlat,rlat_mpi,1)
-      call ScatterField( rlon,rlon_mpi,1)
-      call ScatterField( tsol,tsol_mpi,nbsrf)
-      call ScatterField( tsoil,tsoil_mpi,nsoilmx*nbsrf)
-      call ScatterField( tslab,tslab_mpi,1)
-      call ScatterField( seaice,seaice_mpi,1)
-      call ScatterField( qsurf,qsurf_mpi,nbsrf)
-      call ScatterField( qsol,qsol_mpi,1)
-      call ScatterField( snow,snow_mpi,nbsrf)
-      call ScatterField( albe,albe_mpi,nbsrf)
-      call ScatterField( alblw,alblw_mpi,nbsrf)
-      call ScatterField( evap,evap_mpi,nbsrf)
-      call ScatterField( radsol,radsol_mpi,1)
-      call ScatterField( rain_fall,rain_fall_mpi,1)
-      call ScatterField( snow_fall,snow_fall_mpi,1)
-      call ScatterField( sollw,sollw_mpi,1)
-      call ScatterField( solsw,solsw_mpi,1)
-      call ScatterField( fder,fder_mpi,1)
-      call ScatterField( frugs,frugs_mpi,nbsrf)
-      call ScatterField( agesno,agesno_mpi,nbsrf)
-      call ScatterField( zmea,zmea_mpi,1)
-      call ScatterField( zstd,zstd_mpi,1)
-      call ScatterField( zsig,zsig_mpi,1)
-      call ScatterField( zgam,zgam_mpi,1)
-      call ScatterField( zthe,zthe_mpi,1)
-      call ScatterField( zpic,zpic_mpi,1)
-      call ScatterField( zval,zval_mpi,1)
-      call ScatterField( rugsrel,rugsrel_mpi,1)
-      call ScatterField( pctsrf,pctsrf_mpi, nbsrf)
-      call ScatterField( run_off_lic_0,run_off_lic_0_mpi,1)
-      call ScatterField( t_ancien,t_ancien_mpi,klev)
-      call ScatterField( q_ancien,q_ancien_mpi,klev)
-      call ScatterField( rnebcon,rnebcon_mpi,klev)
-      call ScatterField( clwcon,clwcon_mpi,klev)
-      call ScatterField( ratqs,ratqs_mpi,klev)
-      call ScatterField( zmasq,zmasq_mpi,1)
-c$OMP END MASTER
-c$OMP BARRIER
-      call ScatterField_omp( rlat_mpi,rlat_p,1)
-      call ScatterField_omp( rlon_mpi,rlon_p,1)
-      call ScatterField_omp( tsol_mpi,tsol_p,nbsrf)
-      call ScatterField_omp( tsoil_mpi,tsoil_p,nsoilmx*nbsrf)
-      call ScatterField_omp( tslab_mpi,tslab_p,1)
-      call ScatterField_omp( seaice_mpi,seaice_p,1)
-      call ScatterField_omp( qsurf_mpi,qsurf_p,nbsrf)
-      call ScatterField_omp( qsol_mpi,qsol_p,1)
-      call ScatterField_omp( snow_mpi,snow_p,nbsrf)
-      call ScatterField_omp( albe_mpi,albe_p,nbsrf)
-      call ScatterField_omp( alblw_mpi,alblw_p,nbsrf)
-      call ScatterField_omp( evap_mpi,evap_p,nbsrf)
-      call ScatterField_omp( radsol_mpi,radsol_p,1)
-      call ScatterField_omp( rain_fall_mpi,rain_fall_p,1)
-      call ScatterField_omp( snow_fall_mpi,snow_fall_p,1)
-      call ScatterField_omp( sollw_mpi,sollw_p,1)
-      call ScatterField_omp( solsw_mpi,solsw_p,1)
-      call ScatterField_omp( fder_mpi,fder_p,1)
-      call ScatterField_omp( frugs_mpi,frugs_p,nbsrf)
-      call ScatterField_omp( agesno_mpi,agesno_p,nbsrf)
-      call ScatterField_omp( zmea_mpi,zmea_p,1)
-      call ScatterField_omp( zstd_mpi,zstd_p,1)
-      call ScatterField_omp( zsig_mpi,zsig_p,1)
-      call ScatterField_omp( zgam_mpi,zgam_p,1)
-      call ScatterField_omp( zthe_mpi,zthe_p,1)
-      call ScatterField_omp( zpic_mpi,zpic_p,1)
-      call ScatterField_omp( zval_mpi,zval_p,1)
-      call ScatterField_omp( rugsrel_mpi,rugsrel_p,1)
-      call ScatterField_omp( pctsrf_mpi,pctsrf_p, nbsrf)
-      call ScatterField_omp( run_off_lic_0_mpi,run_off_lic_0_p,1)
-      call ScatterField_omp( t_ancien_mpi,t_ancien_p,klev)
-      call ScatterField_omp( q_ancien_mpi,q_ancien_p,klev)
-      call ScatterField_omp( rnebcon_mpi,rnebcon_p,klev)
-      call ScatterField_omp( clwcon_mpi,clwcon_p,klev)
-      call ScatterField_omp( ratqs_mpi,ratqs_p,klev)
-      call ScatterField_omp( zmasq_mpi,zmasq_p,1)
-      ancien_ok_p=ancien_ok
-
-c$OMP MASTER
-      DEALLOCATE( zmasq_mpi)
-      DEALLOCATE( rlat_mpi, rlon_mpi)
-      DEALLOCATE( tsol_mpi)
-      DEALLOCATE( tsoil_mpi)
-      DEALLOCATE( tslab_mpi)
-      DEALLOCATE( seaice_mpi)
-      DEALLOCATE( qsurf_mpi)
-      DEALLOCATE( qsol_mpi)
-      DEALLOCATE( snow_mpi)
-      DEALLOCATE( albe_mpi)
-      DEALLOCATE( alblw_mpi)
-      DEALLOCATE( evap_mpi)
-      DEALLOCATE( radsol_mpi)
-      DEALLOCATE( rain_fall_mpi)
-      DEALLOCATE( snow_fall_mpi)
-      DEALLOCATE( sollw_mpi)
-      DEALLOCATE( solsw_mpi)
-      DEALLOCATE( fder_mpi)
-      DEALLOCATE( frugs_mpi)
-      DEALLOCATE( agesno_mpi)
-      DEALLOCATE( zmea_mpi)
-      DEALLOCATE( zstd_mpi)
-      DEALLOCATE( zsig_mpi)
-      DEALLOCATE( zgam_mpi)
-      DEALLOCATE( zthe_mpi)
-      DEALLOCATE( zpic_mpi)
-      DEALLOCATE( zval_mpi)
-      DEALLOCATE( rugsrel_mpi)
-      DEALLOCATE( pctsrf_mpi)
-      DEALLOCATE( run_off_lic_0_mpi)
-      DEALLOCATE( t_ancien_mpi)
-      DEALLOCATE( q_ancien_mpi)
-      DEALLOCATE( rnebcon_mpi)
-      DEALLOCATE( clwcon_mpi)   
-
-c$OMP END MASTER
-c$OMP BARRIER
+      call Scatter( rlat,rlat_p)
+      call Scatter( rlon,rlon_p)
+      call Scatter( tsol,tsol_p)
+      call Scatter( tsoil,tsoil_p)
+      call Scatter( tslab,tslab_p)
+      call Scatter( seaice,seaice_p)
+      call Scatter( qsurf,qsurf_p)
+      call Scatter( qsol,qsol_p)
+      call Scatter( snow,snow_p)
+      call Scatter( albe,albe_p)
+      call Scatter( alblw,alblw_p)
+      call Scatter( evap,evap_p)
+      call Scatter( radsol,radsol_p)
+      call Scatter( rain_fall,rain_fall_p)
+      call Scatter( snow_fall,snow_fall_p)
+      call Scatter( sollw,sollw_p)
+      call Scatter( solsw,solsw_p)
+      call Scatter( fder,fder_p)
+      call Scatter( frugs,frugs_p)
+      call Scatter( agesno,agesno_p)
+      call Scatter( zmea,zmea_p)
+      call Scatter( zstd,zstd_p)
+      call Scatter( zsig,zsig_p)
+      call Scatter( zgam,zgam_p)
+      call Scatter( zthe,zthe_p)
+      call Scatter( zpic,zpic_p)
+      call Scatter( zval,zval_p)
+      call Scatter( rugsrel,rugsrel_p)
+      call Scatter( pctsrf,pctsrf_p)
+      call Scatter( run_off_lic_0,run_off_lic_0_p)
+      call Scatter( t_ancien,t_ancien_p)
+      call Scatter( q_ancien,q_ancien_p)
+      call Scatter( rnebcon,rnebcon_p)
+      call Scatter( clwcon,clwcon_p)
+      call Scatter( ratqs,ratqs_p)
+      call Scatter( zmasq_glo,zmasq)
 
       RETURN
Index: LMDZ4/trunk/libf/phylmd/phyredem.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/phyredem.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/phyredem.F	(revision 776)
@@ -14,4 +14,6 @@
      .           run_off_lic_0_p)
       USE dimphy
+      USE mod_grid_phy_lmdz
+      USE mod_phys_lmdz_para
       IMPLICIT none
 c======================================================================
@@ -65,35 +67,37 @@
       REAL run_off_lic_0_p(klon)
       
-      REAL rlat(klon2), rlon(klon2)
-      REAL tsol(klon2,nbsrf)
-      REAL tsoil(klon2,nsoilmx,nbsrf)
-      REAL tslab(klon2), seaice(klon2)
-      REAL qsurf(klon2,nbsrf)
-      REAL qsol(klon2)
-      REAL snow(klon2,nbsrf)
-      REAL albedo(klon2,nbsrf)
-      REAL alblw(klon2,nbsrf)
-      REAL evap(klon2,nbsrf)
-      REAL rain_fall(klon2)
-      REAL snow_fall(klon2)
-      real solsw(klon2)
-      real sollw(klon2)
-      real fder(klon2)
-      REAL radsol(klon2)
-      REAL frugs(klon2,nbsrf)
-      REAL agesno(klon2,nbsrf)
-      REAL zmea(klon2)
-      REAL zstd(klon2)
-      REAL zsig(klon2)
-      REAL zgam(klon2)
-      REAL zthe(klon2)
-      REAL zpic(klon2)
-      REAL zval(klon2)
-      REAL rugsrel(klon2)
-      REAL pctsrf(klon2, nbsrf)
-      REAL t_ancien(klon2,klev), q_ancien(klon2,klev)
-      real clwcon(klon2,klev),rnebcon(klon2,klev),ratqs(klon2,klev)
-      REAL run_off_lic_0(klon2)
-      REAL masq(klon2)
+      REAL rlat(klon_glo), rlon(klon_glo)
+      REAL tsol(klon_glo,nbsrf)
+      REAL tsoil(klon_glo,nsoilmx,nbsrf)
+      REAL tslab(klon_glo), seaice(klon_glo)
+      REAL qsurf(klon_glo,nbsrf)
+      REAL qsol(klon_glo)
+      REAL snow(klon_glo,nbsrf)
+      REAL albedo(klon_glo,nbsrf)
+      REAL alblw(klon_glo,nbsrf)
+      REAL evap(klon_glo,nbsrf)
+      REAL rain_fall(klon_glo)
+      REAL snow_fall(klon_glo)
+      real solsw(klon_glo)
+      real sollw(klon_glo)
+      real fder(klon_glo)
+      REAL radsol(klon_glo)
+      REAL frugs(klon_glo,nbsrf)
+      REAL agesno(klon_glo,nbsrf)
+      REAL zmea(klon_glo)
+      REAL zstd(klon_glo)
+      REAL zsig(klon_glo)
+      REAL zgam(klon_glo)
+      REAL zthe(klon_glo)
+      REAL zpic(klon_glo)
+      REAL zval(klon_glo)
+      REAL rugsrel(klon_glo)
+      REAL pctsrf(klon_glo, nbsrf)
+      REAL t_ancien(klon_glo,klev), q_ancien(klon_glo,klev)
+      REAL clwcon(klon_glo,klev)
+      REAL rnebcon(klon_glo,klev) 
+      REAL ratqs(klon_glo,klev)
+      REAL run_off_lic_0(klon_glo)
+      REAL masq(klon_glo)
 c
       INTEGER nid, nvarid, idim1, idim2, idim3
@@ -107,187 +111,43 @@
       CHARACTER*2 str2
 c
-      REAL,SAVE,ALLOCATABLE :: rlat_mpi(:), rlon_mpi(:)
-      REAL,SAVE,ALLOCATABLE :: tsol_mpi(:,:)
-      REAL,SAVE,ALLOCATABLE :: tsoil_mpi(:,:,:)
-      REAL,SAVE,ALLOCATABLE :: tslab_mpi(:)
-      REAL,SAVE,ALLOCATABLE :: seaice_mpi(:)
-      REAL,SAVE,ALLOCATABLE :: qsurf_mpi(:,:)
-      REAL,SAVE,ALLOCATABLE :: qsol_mpi(:)
-      REAL,SAVE,ALLOCATABLE :: snow_mpi(:,:)
-      REAL,SAVE,ALLOCATABLE :: albedo_mpi(:,:)
-      REAL,SAVE,ALLOCATABLE :: alblw_mpi(:,:)
-      REAL,SAVE,ALLOCATABLE :: evap_mpi(:,:)
-      REAL,SAVE,ALLOCATABLE :: rain_fall_mpi(:)
-      REAL,SAVE,ALLOCATABLE :: snow_fall_mpi(:)
-      REAL,SAVE,ALLOCATABLE :: solsw_mpi(:)
-      REAL,SAVE,ALLOCATABLE :: sollw_mpi(:)
-      REAL,SAVE,ALLOCATABLE :: fder_mpi(:)
-      REAL,SAVE,ALLOCATABLE :: radsol_mpi(:)
-      REAL,SAVE,ALLOCATABLE :: frugs_mpi(:,:)
-      REAL,SAVE,ALLOCATABLE :: agesno_mpi(:,:)
-      REAL,SAVE,ALLOCATABLE :: zmea_mpi(:)
-      REAL,SAVE,ALLOCATABLE :: zstd_mpi(:)
-      REAL,SAVE,ALLOCATABLE :: zsig_mpi(:)
-      REAL,SAVE,ALLOCATABLE :: zgam_mpi(:)
-      REAL,SAVE,ALLOCATABLE :: zthe_mpi(:)
-      REAL,SAVE,ALLOCATABLE :: zpic_mpi(:)
-      REAL,SAVE,ALLOCATABLE :: zval_mpi(:)
-      REAL,SAVE,ALLOCATABLE :: rugsrel_mpi(:)
-      REAL,SAVE,ALLOCATABLE :: pctsrf_mpi(:, :)
-      REAL,SAVE,ALLOCATABLE :: t_ancien_mpi(:,:), q_ancien_mpi(:,:)
-      REAL,SAVE,ALLOCATABLE :: clwcon_mpi(:,:),rnebcon_mpi(:,:)
-      REAL,SAVE,ALLOCATABLE :: ratqs_mpi(:,:)
-      REAL,SAVE,ALLOCATABLE :: run_off_lic_0_mpi(:)
-      REAL,SAVE,ALLOCATABLE :: masq_mpi(:)
+      call Gather( rlat_p,rlat)
+      call Gather( rlon_p,rlon)
+      call Gather( tsol_p,tsol)
+      call Gather( tsoil_p,tsoil)
+      call Gather( tslab_p,tslab)
+      call Gather( seaice_p,seaice)
+      call Gather( qsurf_p,qsurf)
+      call Gather( qsol_p,qsol)
+      call Gather( snow_p,snow)
+      call Gather( albedo_p,albedo)
+      call Gather( alblw_p,alblw)
+      call Gather( evap_p,evap)
+      call Gather( radsol_p,radsol)
+      call Gather( rain_fall_p,rain_fall)
+      call Gather( snow_fall_p,snow_fall)
+      call Gather( sollw_p,sollw)
+      call Gather( solsw_p,solsw)
+      call Gather( fder_p,fder)
+      call Gather( frugs_p,frugs)
+      call Gather( agesno_p,agesno)
+      call Gather( zmea_p,zmea)
+      call Gather( zstd_p,zstd)
+      call Gather( zsig_p,zsig)
+      call Gather( zgam_p,zgam)
+      call Gather( zthe_p,zthe)
+      call Gather( zpic_p,zpic)
+      call Gather( zval_p,zval)
+      call Gather( rugsrel_p,rugsrel)
+      call Gather( pctsrf_p,pctsrf)
+      call Gather( run_off_lic_0_p,run_off_lic_0)
+      call Gather( t_ancien_p,t_ancien)
+      call Gather( q_ancien_p,q_ancien)
+      call Gather( rnebcon_p,rnebcon)
+      call Gather( clwcon_p,clwcon)
+      call Gather( ratqs_p,ratqs)
+      call Gather( zmasq,masq)
       
 c$OMP MASTER
-      ALLOCATE( rlat_mpi(klon_mpi), rlon_mpi(klon_mpi))
-      ALLOCATE( tsol_mpi(klon_mpi,nbsrf))
-      ALLOCATE( tsoil_mpi(klon_mpi,nsoilmx,nbsrf))
-      ALLOCATE( tslab_mpi(klon_mpi))
-      ALLOCATE( seaice_mpi(klon_mpi))
-      ALLOCATE( qsurf_mpi(klon_mpi,nbsrf))
-      ALLOCATE( qsol_mpi(klon_mpi))
-      ALLOCATE( snow_mpi(klon_mpi,nbsrf))
-      ALLOCATE( albedo_mpi(klon_mpi,nbsrf))
-      ALLOCATE( alblw_mpi(klon_mpi,nbsrf))
-      ALLOCATE( evap_mpi(klon_mpi,nbsrf))
-      ALLOCATE( rain_fall_mpi(klon_mpi))
-      ALLOCATE( snow_fall_mpi(klon_mpi))
-      ALLOCATE( solsw_mpi(klon_mpi))
-      ALLOCATE( sollw_mpi(klon_mpi))
-      ALLOCATE( fder_mpi(klon_mpi))
-      ALLOCATE( radsol_mpi(klon_mpi))
-      ALLOCATE( frugs_mpi(klon_mpi,nbsrf))
-      ALLOCATE( agesno_mpi(klon_mpi,nbsrf))
-      ALLOCATE( zmea_mpi(klon_mpi))
-      ALLOCATE( zstd_mpi(klon_mpi))
-      ALLOCATE( zsig_mpi(klon_mpi))
-      ALLOCATE( zgam_mpi(klon_mpi))
-      ALLOCATE( zthe_mpi(klon_mpi))
-      ALLOCATE( zpic_mpi(klon_mpi))
-      ALLOCATE( zval_mpi(klon_mpi))
-      ALLOCATE( rugsrel_mpi(klon_mpi))
-      ALLOCATE( pctsrf_mpi(klon_mpi, nbsrf))
-      ALLOCATE( t_ancien_mpi(klon_mpi,klev))
-      ALLOCATE( q_ancien_mpi(klon_mpi,klev))
-      ALLOCATE( clwcon_mpi(klon_mpi,klev),rnebcon_mpi(klon_mpi,klev))
-      ALLOCATE( ratqs_mpi(klon_mpi,klev))
-      ALLOCATE( run_off_lic_0_mpi(klon_mpi))
-      ALLOCATE( masq_mpi(klon_mpi))
-c$OMP END MASTER
-c$OMP BARRIER      
-
-      call GatherField_omp( rlat_p,rlat_mpi,1)
-      call GatherField_omp( rlon_p,rlon_mpi,1)
-      call GatherField_omp( tsol_p,tsol_mpi,nbsrf)
-      call GatherField_omp( tsoil_p,tsoil_mpi,nsoilmx*nbsrf)
-      call GatherField_omp( tslab_p,tslab_mpi,1)
-      call GatherField_omp( seaice_p,seaice_mpi,1)
-      call GatherField_omp( qsurf_p,qsurf_mpi,nbsrf)
-      call GatherField_omp( qsol_p,qsol_mpi,1)
-      call GatherField_omp( snow_p,snow_mpi,nbsrf)
-      call GatherField_omp( albedo_p,albedo_mpi,nbsrf)
-      call GatherField_omp( alblw_p,alblw_mpi,nbsrf)
-      call GatherField_omp( evap_p,evap_mpi,nbsrf)
-      call GatherField_omp( radsol_p,radsol_mpi,1)
-      call GatherField_omp( rain_fall_p,rain_fall_mpi,1)
-      call GatherField_omp( snow_fall_p,snow_fall_mpi,1)
-      call GatherField_omp( sollw_p,sollw_mpi,1)
-      call GatherField_omp( solsw_p,solsw_mpi,1)
-      call GatherField_omp( fder_p,fder_mpi,1)
-      call GatherField_omp( frugs_p,frugs_mpi,nbsrf)
-      call GatherField_omp( agesno_p,agesno_mpi,nbsrf)
-      call GatherField_omp( zmea_p,zmea_mpi,1)
-      call GatherField_omp( zstd_p,zstd_mpi,1)
-      call GatherField_omp( zsig_p,zsig_mpi,1)
-      call GatherField_omp( zgam_p,zgam_mpi,1)
-      call GatherField_omp( zthe_p,zthe_mpi,1)
-      call GatherField_omp( zpic_p,zpic_mpi,1)
-      call GatherField_omp( zval_p,zval_mpi,1)
-      call GatherField_omp( rugsrel_p,rugsrel_mpi,1)
-      call GatherField_omp( pctsrf_p,pctsrf_mpi, nbsrf)
-      call GatherField_omp( run_off_lic_0_p,run_off_lic_0_mpi,1)
-      call GatherField_omp( t_ancien_p,t_ancien_mpi,klev)
-      call GatherField_omp( q_ancien_p,q_ancien_mpi,klev)
-      call GatherField_omp( rnebcon_p,rnebcon_mpi,klev)
-      call GatherField_omp( clwcon_p,clwcon_mpi,klev)
-      call GatherField_omp( ratqs_p,ratqs_mpi,klev)
-      call GatherField_omp( zmasq,masq_mpi,1)
-
-c$OMP MASTER      
-      call GatherField( rlat_mpi,rlat,1)
-      call GatherField( rlon_mpi,rlon,1)
-      call GatherField( tsol_mpi,tsol,nbsrf)
-      call GatherField( tsoil_mpi,tsoil,nsoilmx*nbsrf)
-      call GatherField( tslab_mpi,tslab,1)
-      call GatherField( seaice_mpi,seaice,1)
-      call GatherField( qsurf_mpi,qsurf,nbsrf)
-      call GatherField( qsol_mpi,qsol,1)
-      call GatherField( snow_mpi,snow,nbsrf)
-      call GatherField( albedo_mpi,albedo,nbsrf)
-      call GatherField( alblw_mpi,alblw,nbsrf)
-      call GatherField( evap_mpi,evap,nbsrf)
-      call GatherField( radsol_mpi,radsol,1)
-      call GatherField( rain_fall_mpi,rain_fall,1)
-      call GatherField( snow_fall_mpi,snow_fall,1)
-      call GatherField( sollw_mpi,sollw,1)
-      call GatherField( solsw_mpi,solsw,1)
-      call GatherField( fder_mpi,fder,1)
-      call GatherField( frugs_mpi,frugs,nbsrf)
-      call GatherField( agesno_mpi,agesno,nbsrf)
-      call GatherField( zmea_mpi,zmea,1)
-      call GatherField( zstd_mpi,zstd,1)
-      call GatherField( zsig_mpi,zsig,1)
-      call GatherField( zgam_mpi,zgam,1)
-      call GatherField( zthe_mpi,zthe,1)
-      call GatherField( zpic_mpi,zpic,1)
-      call GatherField( zval_mpi,zval,1)
-      call GatherField( rugsrel_mpi,rugsrel,1)
-      call GatherField( pctsrf_mpi,pctsrf, nbsrf)
-      call GatherField( run_off_lic_0_mpi,run_off_lic_0,1)
-      call GatherField( t_ancien_mpi,t_ancien,klev)
-      call GatherField( q_ancien_mpi,q_ancien,klev)
-      call GatherField( rnebcon_mpi,rnebcon,klev)
-      call GatherField( clwcon_mpi,clwcon,klev)
-      call GatherField( ratqs_mpi,ratqs,klev)
-      call GatherField( masq_mpi,masq,1)
-      
-      DEALLOCATE( rlat_mpi, rlon_mpi)
-      DEALLOCATE( tsol_mpi)
-      DEALLOCATE( tsoil_mpi)
-      DEALLOCATE( tslab_mpi)
-      DEALLOCATE( seaice_mpi)
-      DEALLOCATE( qsurf_mpi)
-      DEALLOCATE( qsol_mpi)
-      DEALLOCATE( snow_mpi)
-      DEALLOCATE( albedo_mpi)
-      DEALLOCATE( alblw_mpi)
-      DEALLOCATE( evap_mpi)
-      DEALLOCATE( rain_fall_mpi)
-      DEALLOCATE( snow_fall_mpi)
-      DEALLOCATE( solsw_mpi)
-      DEALLOCATE( sollw_mpi)
-      DEALLOCATE( fder_mpi)
-      DEALLOCATE( radsol_mpi)
-      DEALLOCATE( frugs_mpi)
-      DEALLOCATE( agesno_mpi)
-      DEALLOCATE( zmea_mpi)
-      DEALLOCATE( zstd_mpi)
-      DEALLOCATE( zsig_mpi)
-      DEALLOCATE( zgam_mpi)
-      DEALLOCATE( zthe_mpi)
-      DEALLOCATE( zpic_mpi)
-      DEALLOCATE( zval_mpi)
-      DEALLOCATE( rugsrel_mpi)
-      DEALLOCATE( pctsrf_mpi)
-      DEALLOCATE( t_ancien_mpi)
-      DEALLOCATE( q_ancien_mpi)
-      DEALLOCATE( clwcon_mpi,rnebcon_mpi)
-      DEALLOCATE( ratqs_mpi)
-      DEALLOCATE( run_off_lic_0_mpi)
-      DEALLOCATE( masq_mpi)
-
-      if (phy_rank==0) then
+      IF (is_mpi_root) THEN
       
       ierr = NF_CREATE(fichnom, NF_CLOBBER, nid)
@@ -302,6 +162,6 @@
 c
       ierr = NF_DEF_DIM (nid, "index", length, idim1)
-      ierr = NF_DEF_DIM (nid, "points_physiques", klon2, idim2)
-      ierr = NF_DEF_DIM (nid, "horizon_vertical", klon2*klev, idim3)
+      ierr = NF_DEF_DIM (nid, "points_physiques", klon_glo, idim2)
+      ierr = NF_DEF_DIM (nid, "horizon_vertical", klon_glo*klev, idim3)
 c
       ierr = NF_ENDDEF(nid)
@@ -402,7 +262,7 @@
       ierr = NF_ENDDEF(nid)
 #ifdef NC_DOUBLE
-      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pctsrf(1 : klon2, is_ter))
-#else
-      ierr = NF_PUT_VAR_REAL (nid,nvarid,pctsrf(1 : klon2, is_ter))
+      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pctsrf(1 : klon_glo, is_ter))
+#else
+      ierr = NF_PUT_VAR_REAL (nid,nvarid,pctsrf(1 : klon_glo, is_ter))
 #endif
 C 
@@ -419,7 +279,7 @@
       ierr = NF_ENDDEF(nid)
 #ifdef NC_DOUBLE
-      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pctsrf(1 : klon2,is_lic))
-#else
-      ierr = NF_PUT_VAR_REAL (nid,nvarid,pctsrf(1 : klon2, is_lic))
+      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pctsrf(1 : klon_glo,is_lic))
+#else
+      ierr = NF_PUT_VAR_REAL (nid,nvarid,pctsrf(1 : klon_glo, is_lic))
 #endif
 C
@@ -436,7 +296,7 @@
       ierr = NF_ENDDEF(nid)
 #ifdef NC_DOUBLE
-      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pctsrf(1 : klon2, is_oce))
-#else
-      ierr = NF_PUT_VAR_REAL (nid,nvarid,pctsrf(1 : klon2, is_oce))
+      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pctsrf(1 : klon_glo, is_oce))
+#else
+      ierr = NF_PUT_VAR_REAL (nid,nvarid,pctsrf(1 : klon_glo, is_oce))
 #endif
 C
@@ -453,7 +313,7 @@
       ierr = NF_ENDDEF(nid)
 #ifdef NC_DOUBLE
-      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pctsrf(1 : klon2, is_sic))
-#else
-      ierr = NF_PUT_VAR_REAL (nid,nvarid,pctsrf(1 : klon2, is_sic))
+      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pctsrf(1 : klon_glo, is_sic))
+#else
+      ierr = NF_PUT_VAR_REAL (nid,nvarid,pctsrf(1 : klon_glo, is_sic))
 #endif
 C
@@ -767,5 +627,5 @@
 cc ----> necessaire pour eviter bug openMP sur SX6
 c$OMP MASTER
-      if (phy_rank==0) then
+      if (is_mpi_root) then
       DO nsrf = 1, nbsrf
         IF (nsrf.LE.99) THEN
@@ -1020,5 +880,5 @@
       ierr = NF_CLOSE(nid)
 c
-      endif   ! phy_rank==0
+      endif   ! is_mpi_root
 c$OMP END MASTER
       RETURN
Index: LMDZ4/trunk/libf/phylmd/physiq.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/physiq.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/physiq.F	(revision 776)
@@ -21,4 +21,6 @@
       USE write_field_phy
       USE dimphy
+      USE mod_grid_phy_lmdz
+      USE mod_phys_lmdz_para
       USE iophy
       USE misc_mod, mydebug=>debug
@@ -68,6 +70,8 @@
 c d_q_dyn-input-R-tendance dynamique pour "q" (kg/kg/s)
 c omega---input-R-vitesse verticale en Pa/s
+cIM comgeomphy.h BEG
 c cuphy----input-R-resolution des mailles en x (m)
 c cvphy----input-R-resolution des mailles en y (m)
+cIM comgeomphy.h END
 c d_u-----output-R-tendance physique de "u" (m/s/s)
 c d_v-----output-R-tendance physique de "v" (m/s/s)
@@ -75,4 +79,5 @@
 c d_qx----output-R-tendance physique de "qx" (kg/kg/s)
 c d_ps----output-R-tendance physique de la pression au sol
+cIM
 c PVteta--output-R-vorticite potentielle a des thetas constantes
 c======================================================================
@@ -440,5 +445,5 @@
       INTEGER ncolmx, seed(klon,napisccp)
       REAL nbsunlit(nregISCtot,klon,napisccp)  !nbsunlit : moyenne de sunlit
-      PARAMETER(ncolmx=1500)
+      PARAMETER(ncolmx=350)
 c
 cIM verif boxptop BEG
@@ -1415,5 +1420,5 @@
 c Declaration des constantes et des fonctions thermodynamiques
 c
-      REAL Field_tmp(klon2,klevp1)
+      REAL Field_tmp(klon_glo,klevp1)
       LOGICAL,SAVE :: first=.true.
 c$OMP THREADPRIVATE(first)
@@ -3299,5 +3304,5 @@
 cIM calcul composantes axiales du moment angulaire et couple des montagnes
 c
-      IF (monocpu) THEN
+      IF (is_sequential) THEN
       
         CALL aaam_bud (27,klon,klev,rjourvrai,gmtime,
Index: LMDZ4/trunk/libf/phylmd/phytrac.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/phytrac.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/phytrac.F	(revision 776)
@@ -64,4 +64,6 @@
       USE ioipsl
       USE dimphy
+      USE mod_grid_phy_lmdz
+      USE mod_phys_lmdz_para
       USE comgeomphy
       USE iophy
@@ -211,6 +213,5 @@
 c$OMP THREADPRIVATE(trs)
 cym      SAVE trs
-      REAL :: trs_tmp(klon2)
-      REAL,SAVE,ALLOCATABLE :: trs_mpi(:)
+      REAL :: trs_tmp(klon_glo)
       
       REAL,save,allocatable :: masktr(:,:) ! Masque reservoir de sol traceur
@@ -403,7 +404,4 @@
          if (debutphy) then
            allocate( trs(klon,nbtr) )
-c$OMP MASTER
-	   allocate( trs_mpi(klon_mpi) )  
-c$OMP END MASTER           
 	   allocate( masktr(klon,nbtr)) 
            allocate( fshtr(klon,nbtr) )
@@ -447,14 +445,14 @@
          trs(:,:) = 0.
 c$OMP MASTER         
-       if (phy_rank==0) then
+       if (is_mpi_root) then
          trs_tmp(:)=0.
 	 open (99,file='starttrac',status='old',
      .         err=999,form='formatted')
-         read(99,*) (trs_tmp(i),i=1,klon2)
+         read(99,*) (trs_tmp(i),i=1,klon_glo)
 999      close(99)
        endif
-       call ScatterField(trs_tmp,trs_mpi,1)
 c$OMP END MASTER
-      call ScatterField_omp(trs_mpi,trs(:,1),1)
+       call Scatter(trs_tmp,trs(:,1))
+
 c         print*, 'apres starttrac'
 
@@ -923,11 +921,10 @@
       if (lafin) then
          print*, 'c est la fin de la physique'
-	 call GatherField_omp(trs(:,1),trs_mpi,1)
+	 call Gather(trs(:,1),trs_tmp)
 c$OMP MASTER	 
-	 call GatherField(trs_mpi,trs_tmp,1)
-	 if (phy_rank==0) then
+	 if (is_mpi_root) then
          
 	   open (99,file='restarttrac',  form='formatted')
-           do i=1,klon
+           do i=1,klon_glo
                write(99,*) trs_tmp(i)
            enddo
Index: LMDZ4/trunk/libf/phylmd/readsulfate.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/readsulfate.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/readsulfate.F	(revision 776)
@@ -3,5 +3,7 @@
 !
       SUBROUTINE readsulfate (r_day, first, sulfate_p)
-      USE dimphy, klon=>klon2,klon2=>klon
+      USE dimphy, ONLY : klev
+      USE mod_grid_phy_lmdz, klon=>klon_glo
+      USE mod_phys_lmdz_para
       IMPLICIT none
       
@@ -84,10 +86,9 @@
         allocate( so4(klon, klev, 12) )
         allocate( so4_out(klon, klev))
-        allocate(sulfate_mpi(klon_mpi,klev))  
         first2=.false.
 	
       endif
 
-      if (phy_rank==0) then
+      if (is_mpi_root) then
             
       iday = INT(r_day) 
@@ -288,8 +289,6 @@
       endif   ! phy_rank==0
       
-      call ScatterField(real(sulfate),real(sulfate_mpi),klev)
 c$OMP END MASTER
-      call ScatterField_omp(real(sulfate_mpi),real(sulfate_p)
-     . ,klev)            
+      call Scatter(real(sulfate),real(sulfate_p))            
 
       RETURN
@@ -305,5 +304,7 @@
       
       SUBROUTINE readsulfate_preind (r_day, first, pi_sulfate_p)
-      USE dimphy, klon=>klon2,klon2=>klon
+      USE dimphy, ONLY : klev
+      USE mod_grid_phy_lmdz, klon=>klon_glo
+      USE mod_phys_lmdz_para
       IMPLICIT none
       
@@ -347,5 +348,4 @@
       REAL*8  pi_sulfate (klon, klev)  ! Number conc. sulfate (monthly mean data, 
                                   !  from fil
-      REAL*8,SAVE,ALLOCATABLE :: pi_sulfate_mpi(:,:)			  
 c      
 c Local Variables:
@@ -377,10 +377,9 @@
         allocate( pi_so4(klon, klev, 12) )
         allocate( pi_so4_out(klon, klev))
-        allocate(pi_sulfate_mpi (klon_mpi, klev))  
         first2=.false.
 	
       endif
 
-      if (phy_rank==0) then
+      if (is_mpi_root) then
     
       
@@ -528,10 +527,8 @@
       ENDIF ! Was this the beginning of a new day?
 
-      endif   ! phy_rank==0
-      
-      call ScatterField(real(pi_sulfate),real(pi_sulfate_mpi),klev)
+      endif   ! is_mpi_root==0
+      
 c$OMP END MASTER
-      call ScatterField_omp(real(pi_sulfate_mpi),real(pi_sulfate_p)
-     .,klev)            
+      call Scatter(real(pi_sulfate),real(pi_sulfate_p))            
 
       RETURN
Index: LMDZ4/trunk/libf/phylmd/soil.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/soil.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/soil.F	(revision 776)
@@ -4,5 +4,6 @@
       SUBROUTINE soil(ptimestep, indice, knon, snow, ptsrf, ptsoil,
      s          pcapcal, pfluxgrd)
-      use dimphy
+      USE dimphy
+      USE mod_phys_lmdz_para
       IMPLICIT NONE
 
@@ -73,4 +74,5 @@
       REAL zdz2(nsoilmx),z1(klon,nbsrf)
       REAL,SAVE :: min_period,dalph_soil
+c$OMP THREADPRIVATE( min_period,dalph_soil)     
       REAL ztherm_i(klon)
 
@@ -151,4 +153,5 @@
          dalph_soil=2.    ! rapport entre les epaisseurs de 2 couches succ.
 c$OMP MASTER
+         IF (is_mpi_root) THEN
          OPEN(99,file='soil.def',status='old',form='formatted',err=9999)
          READ(99,*) min_period
@@ -159,6 +162,8 @@
          CLOSE(99)
 9999     CONTINUE
+         ENDIF  ! is_mpi_root
 c$OMP END MASTER
-c$OMP BARRIER
+         CALL bcast(min_period)
+	 CALL bcast(dalph_soil)
 
 c   la premiere couche represente un dixieme de cycle diurne
Index: LMDZ4/trunk/libf/phylmd/tetalevel.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/tetalevel.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/tetalevel.F	(revision 776)
@@ -1,2 +1,5 @@
+!
+! $Header$
+!
 c================================================================
 c================================================================
Index: LMDZ4/trunk/libf/phylmd/thermcell.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/thermcell.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/thermcell.F	(revision 776)
@@ -1,2 +1,6 @@
+!
+! $Header$
+!
+
       SUBROUTINE thermcell(ngrid,nlay,ptimestep
      s                  ,pplay,pplev,pphi
Index: LMDZ4/trunk/libf/phylmd/thermcell.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/thermcell.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/thermcell.h	(revision 776)
@@ -1,2 +1,6 @@
+!
+! $Header$
+!
+
       integer iflag_thermals,nsplit_thermals
       real r_aspect_thermals,l_mix_thermals,tho_thermals
Index: LMDZ4/trunk/libf/phylmd/transp_lay.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/transp_lay.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/transp_lay.F	(revision 776)
@@ -1,2 +1,5 @@
+!
+! $Header$
+!
       SUBROUTINE transp_lay (paprs,tsol,
      e                   t, q, u, v, geom,
Index: LMDZ4/trunk/libf/phylmd/undefSTD.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/undefSTD.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/undefSTD.F	(revision 776)
@@ -1,2 +1,5 @@
+!
+! $Header$
+!
       SUBROUTINE undefSTD(nlevSTD,itap,tlevSTD,
      $           dtime,ecrit_hf,
Index: LMDZ4/trunk/libf/phylmd/wrgradsfi.F
===================================================================
--- LMDZ4/trunk/libf/phylmd/wrgradsfi.F	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/wrgradsfi.F	(revision 776)
@@ -3,5 +3,7 @@
 !
       subroutine wrgradsfi(if,nl,fieldfi_p,name,titlevar)
-      use dimphy
+      USE dimphy
+      USE mod_grid_phy_lmdz
+      USE mod_phys_lmdz_para
       implicit none
 
@@ -14,5 +16,5 @@
       integer if,nl
       real fieldfi_p(klon,nl)
-      real fieldfi(klon2,nl)
+      real fieldfi(klon_glo,nl)
       real fielddyn((iim+1)*(jjm+1),llm)
       character*10 name
@@ -26,12 +28,15 @@
 
 c     print*,'Transformation pour ',name
-      call GatherField(fieldfi_p,fieldfi,nl)
-      
-      if (phy_rank==0) then
+      call Gather(fieldfi_p,fieldfi)
+
+c$OMP MASTER      
+      if (is_mpi_root) then
         call gr_fi_dyn(nl,klon,iim+1,jjm+1,fieldfi,fielddyn)
+        
 c     print*,'Transformation OK '
         call wrgrads(if,nl,fielddyn,name,titlevar)
 c     print*,'Ecriture ok'
       endif
+c$OMP END MASTER
       
       return
Index: LMDZ4/trunk/libf/phylmd/write_field_phy.F90
===================================================================
--- LMDZ4/trunk/libf/phylmd/write_field_phy.F90	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/write_field_phy.F90	(revision 776)
@@ -1,2 +1,5 @@
+!
+! $Header$
+!
 MODULE write_field_phy
 
@@ -5,5 +8,8 @@
     SUBROUTINE WriteField_phy(name,Field,ll)
     USE dimphy
+    USE mod_phys_lmdz_para
+    USE mod_grid_phy_lmdz
     USE Write_Field
+    
     IMPLICIT NONE
     include 'dimensions90.h'
@@ -14,24 +20,15 @@
     real, dimension(klon_omp,ll) :: Field
     real,save,allocatable :: Field_tmp(:,:)
-    real, dimension(klon2,ll):: New_Field
+    real, dimension(klon_glo,ll):: New_Field
     real, dimension(iim,jjp1,ll):: Field_2d
-	
-    if (omp_rank==0) then
-      allocate(Field_tmp(klon_mpi,ll))
-    endif
-    
-!$OMP BARRIER
-    CALL GatherField_omp(Field,Field_tmp,ll)
-!$OMP BARRIER
 
-  if (omp_rank==0) then
-    CALL GatherField(Field_tmp,New_Field,ll)
-    IF (phy_rank==0) THEN
-      CALL gr_fi_ecrit(ll, klon2,iim,jjp1, New_Field, Field_2d)
+    CALL Gather(Field,New_Field)
+!$OMP MASTER
+    IF (is_mpi_root) THEN	
+      CALL Grid1Dto2D_glo(New_Field,Field_2D)
       CALL WriteField(name,Field_2d)
     ENDIF
-    deallocate(Field_tmp)
-  endif
-!$OMP BARRIER 
+!$OMP END MASTER
+
   
    END SUBROUTINE WriteField_phy
Index: LMDZ4/trunk/libf/phylmd/write_histREGDYN.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/write_histREGDYN.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/write_histREGDYN.h	(revision 776)
@@ -4,5 +4,5 @@
       if (ok_regdyn) then
       
-      if (monocpu) then
+      if (is_sequential) then
 
 
@@ -59,5 +59,5 @@
       endif
 
-      endif ! monocpu
+      endif ! is_sequential
 
       endif
Index: LMDZ4/trunk/libf/phylmd/write_histday_seri.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/write_histday_seri.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/write_histday_seri.h	(revision 776)
@@ -2,4 +2,6 @@
 c $Header$
 c
+      IF (is_sequential) THEN
+      
       IF (monocpu) THEN
       
Index: LMDZ4/trunk/libf/phylmd/write_histhf.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/write_histhf.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/write_histhf.h	(revision 776)
@@ -329,5 +329,5 @@
       CALL histwrite_phy(nid_hf, "SWupTOA",itau_w,zx_tmp_fi2d)
 c
-      IF (monocpu) THEN
+      IF (is_sequential) THEN
 cym      CALL gr_fi_ecrit(nbteta,klon,iim,jjmp1,PVteta,zx_tmp_3dte)
       DO k=1, nbteta
Index: LMDZ4/trunk/libf/phylmd/write_paramLMDZ_phy.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/write_paramLMDZ_phy.h	(revision 775)
+++ LMDZ4/trunk/libf/phylmd/write_paramLMDZ_phy.h	(revision 776)
@@ -1,4 +1,4 @@
 c
-      IF (monocpu) THEN
+      IF (is_sequential) THEN
       
       ndex2d = 0
