Index: LMDZ5/trunk/libf/dyn3d/gcm.F90
===================================================================
--- LMDZ5/trunk/libf/dyn3d/gcm.F90	(revision 2350)
+++ LMDZ5/trunk/libf/dyn3d/gcm.F90	(revision 2351)
@@ -22,4 +22,5 @@
   USE infotrac
   USE control_mod
+  USE mod_const_mpi, ONLY: COMM_LMDZ
 
 #ifdef INCA
@@ -181,8 +182,8 @@
   ! A nettoyer. On ne veut qu'une ou deux routines d'interface 
   ! dynamique -> physique pour l'initialisation
-#ifdef CPP_PHYS
-  CALL Init_Phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/))
-  !      call InitComgeomphy ! now done in iniphysiq
-#endif
+!#ifdef CPP_PHYS
+!  CALL Init_Phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/))
+!  !      call InitComgeomphy ! now done in iniphysiq
+!#endif
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !-----------------------------------------------------------------------
@@ -415,5 +416,7 @@
      ! Physics:
 #ifdef CPP_PHYS
-     CALL iniphysiq(iim,jjm,llm,daysec,day_ini,dtphys/nsplit_phys, &
+     CALL iniphysiq(iim,jjm,llm, &
+          (jjm-1)*iim+2,comm_lmdz, &
+          daysec,day_ini,dtphys/nsplit_phys, &
           rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp, &
           iflag_phys)
Index: LMDZ5/trunk/libf/dyn3dmem/bands.F90
===================================================================
--- LMDZ5/trunk/libf/dyn3dmem/bands.F90	(revision 2350)
+++ LMDZ5/trunk/libf/dyn3dmem/bands.F90	(revision 2351)
@@ -105,11 +105,9 @@
    SUBROUTINE  Set_Bands 
      USE parallel_lmdz
-#ifdef CPP_PHYS
-! Ehouarn: what follows is only related to // physics
-     USE mod_phys_lmdz_para, ONLY : jj_para_begin,jj_para_end
-#endif
      IMPLICIT NONE
      INCLUDE 'dimensions.h'    
-     INTEGER :: i
+     INTEGER :: i, ij
+     INTEGER :: jj_para_begin(0:mpi_size-1)
+     INTEGER :: jj_para_end(0:mpi_size-1)
         
       do i=0,mpi_size-1
@@ -118,6 +116,16 @@
       enddo
           
-#ifdef CPP_PHYS
-      do i=0,MPI_Size-1
+      jj_para_begin(0)=1
+      ij=distrib_phys(0)+iim-1
+      jj_para_end(0)=((ij-1)/iim)+1
+      
+      DO i=1,mpi_Size-1
+        ij=ij+1
+        jj_para_begin(i)=((ij-1)/iim)+1
+        ij=ij+distrib_phys(i)-1
+        jj_para_end(i)=((ij-1)/iim)+1
+      ENDDO
+ 
+       do i=0,MPI_Size-1
         jj_Nb_physic(i)=jj_para_end(i)-jj_para_begin(i)+1
         if (i/=0) then
@@ -139,5 +147,5 @@
         endif
       enddo
-#endif      
+
       CALL create_distrib(jj_Nb_Caldyn,distrib_caldyn)
       CALL create_distrib(jj_Nb_vanleer,distrib_vanleer)
@@ -479,2 +487,3 @@
   
   
+
Index: LMDZ5/trunk/libf/dyn3dmem/gcm.F90
===================================================================
--- LMDZ5/trunk/libf/dyn3dmem/gcm.F90	(revision 2350)
+++ LMDZ5/trunk/libf/dyn3dmem/gcm.F90	(revision 2351)
@@ -10,7 +10,7 @@
   USE parallel_lmdz
   USE infotrac
-#ifdef CPP_PHYS
-  USE mod_interface_dyn_phys, ONLY: init_interface_dyn_phys
-#endif
+!#ifdef CPP_PHYS
+!  USE mod_interface_dyn_phys, ONLY: init_interface_dyn_phys
+!#endif
   USE mod_hallo
   USE Bands
@@ -152,11 +152,11 @@
   call Read_Distrib
 
-#ifdef CPP_PHYS
-  CALL Init_Phys_lmdz(iim,jjp1,llm,mpi_size,distrib_phys)
+!#ifdef CPP_PHYS
+!  CALL Init_Phys_lmdz(iim,jjp1,llm,mpi_size,distrib_phys)
   !#endif
   !      CALL set_bands
   !#ifdef CPP_PHYS
-  CALL Init_interface_dyn_phys
-#endif
+!  CALL Init_interface_dyn_phys
+!#endif
   CALL barrier
 
@@ -397,5 +397,7 @@
      ! Physics:
 #ifdef CPP_PHYS
-     CALL iniphysiq(iim,jjm,llm,daysec,day_ini,dtphys/nsplit_phys, &
+     CALL iniphysiq(iim,jjm,llm, &
+          distrib_phys(mpi_rank),comm_lmdz, &
+          daysec,day_ini,dtphys/nsplit_phys, &
           rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp, &
           iflag_phys)
Index: LMDZ5/trunk/libf/dyn3dpar/bands.F90
===================================================================
--- LMDZ5/trunk/libf/dyn3dpar/bands.F90	(revision 2350)
+++ LMDZ5/trunk/libf/dyn3dpar/bands.F90	(revision 2351)
@@ -93,12 +93,10 @@
    SUBROUTINE  Set_Bands 
      USE parallel_lmdz
-#ifdef CPP_PHYS
-! Ehouarn: what follows is only related to // physics
-     USE mod_phys_lmdz_para, ONLY : jj_para_begin,jj_para_end
-#endif
      IMPLICIT NONE
      INCLUDE 'dimensions.h'    
-     INTEGER :: i
-        
+     INTEGER :: i, ij
+     INTEGER :: jj_para_begin(0:mpi_size-1)
+     INTEGER :: jj_para_end(0:mpi_size-1)
+       
       do i=0,mpi_size-1
          jj_nb_vanleer2(i)=(jjm+1)/mpi_size
@@ -106,5 +104,15 @@
       enddo
           
-#ifdef CPP_PHYS
+      jj_para_begin(0)=1
+      ij=distrib_phys(0)+iim-1
+      jj_para_end(0)=((ij-1)/iim)+1
+      
+      DO i=1,mpi_Size-1
+        ij=ij+1
+        jj_para_begin(i)=((ij-1)/iim)+1
+        ij=ij+distrib_phys(i)-1
+        jj_para_end(i)=((ij-1)/iim)+1
+      ENDDO
+ 
       do i=0,MPI_Size-1
         jj_Nb_physic(i)=jj_para_end(i)-jj_para_begin(i)+1
@@ -127,5 +135,4 @@
         endif
       enddo
-#endif      
       
     end subroutine Set_Bands
Index: LMDZ5/trunk/libf/dyn3dpar/gcm.F
===================================================================
--- LMDZ5/trunk/libf/dyn3dpar/gcm.F	(revision 2350)
+++ LMDZ5/trunk/libf/dyn3dpar/gcm.F	(revision 2351)
@@ -14,7 +14,7 @@
       USE parallel_lmdz
       USE infotrac
-#ifdef CPP_PHYS
-      USE mod_interface_dyn_phys, ONLY: init_interface_dyn_phys
-#endif
+!#ifdef CPP_PHYS
+!      USE mod_interface_dyn_phys, ONLY: init_interface_dyn_phys
+!#endif
       USE mod_hallo
       USE Bands
@@ -159,11 +159,11 @@
       call Read_Distrib
 
-#ifdef CPP_PHYS
-        CALL Init_Phys_lmdz(iim,jjp1,llm,mpi_size,distrib_phys)
+!#ifdef CPP_PHYS
+!        CALL Init_Phys_lmdz(iim,jjp1,llm,mpi_size,distrib_phys)
 !#endif
 !      CALL set_bands
 !#ifdef CPP_PHYS
-      CALL Init_interface_dyn_phys
-#endif
+!      CALL Init_interface_dyn_phys
+!#endif
       CALL barrier
 
@@ -403,5 +403,7 @@
 ! Physics:
 #ifdef CPP_PHYS
-         CALL iniphysiq(iim,jjm,llm,daysec,day_ini,dtphys/nsplit_phys,
+         CALL iniphysiq(iim,jjm,llm,
+     &                distrib_phys(mpi_rank),comm_lmdz,
+     &                daysec,day_ini,dtphys/nsplit_phys,
      &                rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp,
      &                iflag_phys)
Index: LMDZ5/trunk/libf/dynlonlat_phylonlat/calfis_loc.F
===================================================================
--- LMDZ5/trunk/libf/dynlonlat_phylonlat/calfis_loc.F	(revision 2350)
+++ LMDZ5/trunk/libf/dynlonlat_phylonlat/calfis_loc.F	(revision 2351)
@@ -32,5 +32,7 @@
 c   .........
       USE dimphy
-      USE mod_phys_lmdz_para, mpi_root_xx=>mpi_root 
+      USE mod_phys_lmdz_mpi_data, mpi_root_xx=>mpi_master
+      USE mod_phys_lmdz_omp_data, ONLY: klon_omp, klon_omp_begin
+      USE mod_const_mpi, ONLY: COMM_LMDZ
       USE mod_interface_dyn_phys
       USE IOPHY
Index: LMDZ5/trunk/libf/dynlonlat_phylonlat/calfis_p.F
===================================================================
--- LMDZ5/trunk/libf/dynlonlat_phylonlat/calfis_p.F	(revision 2350)
+++ LMDZ5/trunk/libf/dynlonlat_phylonlat/calfis_p.F	(revision 2351)
@@ -29,5 +29,7 @@
 ! If using physics
       USE dimphy
-      USE mod_phys_lmdz_para, mpi_root_xx=>mpi_root 
+      USE mod_phys_lmdz_mpi_data, mpi_root_xx=>mpi_master
+      USE mod_phys_lmdz_omp_data, ONLY: klon_omp, klon_omp_begin
+      USE mod_const_mpi, ONLY: COMM_LMDZ
       USE mod_interface_dyn_phys
       USE IOPHY
Index: LMDZ5/trunk/libf/dynlonlat_phylonlat/mod_interface_dyn_phys.F90
===================================================================
--- LMDZ5/trunk/libf/dynlonlat_phylonlat/mod_interface_dyn_phys.F90	(revision 2350)
+++ LMDZ5/trunk/libf/dynlonlat_phylonlat/mod_interface_dyn_phys.F90	(revision 2351)
@@ -7,8 +7,8 @@
   
   
+CONTAINS
+  
 #ifdef CPP_PARA
 ! Interface with parallel physics,
-CONTAINS
-  
   SUBROUTINE Init_interface_dyn_phys
     USE mod_phys_lmdz_mpi_data
@@ -54,4 +54,8 @@
   
   END SUBROUTINE Init_interface_dyn_phys 
+#else
+  SUBROUTINE Init_interface_dyn_phys
+  ! dummy routine for seq case
+  END SUBROUTINE Init_interface_dyn_phys 
 #endif
 ! of #ifdef CPP_PARA
Index: LMDZ5/trunk/libf/dynlonlat_phylonlat/phydev/iniphysiq_mod.F90
===================================================================
--- LMDZ5/trunk/libf/dynlonlat_phylonlat/phydev/iniphysiq_mod.F90	(revision 2350)
+++ LMDZ5/trunk/libf/dynlonlat_phylonlat/phydev/iniphysiq_mod.F90	(revision 2351)
@@ -6,20 +6,17 @@
 CONTAINS
 
-SUBROUTINE iniphysiq(iim,jjm,nlayer,punjours, pdayref,ptimestep, &
+SUBROUTINE iniphysiq(iim,jjm,nlayer, &
+                     nbp, communicator, &
+                     punjours, pdayref,ptimestep, &
                      rlatu,rlatv,rlonu,rlonv,aire,cu,cv, &
                      prad,pg,pr,pcpp,iflag_phys)
-  USE dimphy, ONLY: klev ! number of atmospheric levels
-  USE mod_grid_phy_lmdz, ONLY: klon_glo ! number of atmospheric columns
-                                        ! (on full grid)
+  USE dimphy, ONLY: init_dimphy
+  USE mod_grid_phy_lmdz, ONLY: klon_glo,  & ! number of atmospheric columns (on full grid)
+                               regular_lonlat  ! regular longitude-latitude grid type
   USE mod_phys_lmdz_para, ONLY: klon_omp, & ! number of columns (on local omp grid)
                                 klon_omp_begin, & ! start index of local omp subgrid
                                 klon_omp_end, & ! end index of local omp subgrid
                                 klon_mpi_begin ! start indes of columns (on local mpi grid)
-  USE comgeomphy, ONLY: initcomgeomphy, &
-                        airephy, & ! physics grid area (m2)
-                        cuphy, & ! cu coeff. (u_covariant = cu * u)
-                        cvphy, & ! cv coeff. (v_covariant = cv * v)
-                        rlond, & ! longitudes
-                        rlatd ! latitudes
+  USE geometry_mod, ONLY : init_geometry
   USE infotrac, ONLY: nqtot, type_trac
   USE infotrac_phy, ONLY: init_infotrac_phy
@@ -30,8 +27,10 @@
   USE inifis_mod, ONLY: inifis
   USE phyaqua_mod, ONLY: iniaqua
+  USE physics_distribution_mod, ONLY : init_physics_distribution
   USE regular_lonlat_mod, ONLY : init_regular_lonlat, &
                                  east, west, north, south, &
                                  north_east, north_west, &
                                  south_west, south_east
+  USE mod_interface_dyn_phys, ONLY :  init_interface_dyn_phys
   USE nrtype, ONLY: pi
   IMPLICIT NONE
@@ -53,4 +52,6 @@
   INTEGER, INTENT (IN) :: iim ! number of atmospheric coulumns along longitudes
   INTEGER, INTENT (IN) :: jjm  ! number of atompsheric columns along latitudes
+  INTEGER, INTENT(IN) :: nbp ! number of physics columns for this MPI process
+  INTEGER, INTENT(IN) :: communicator ! MPI communicator
   REAL, INTENT (IN) :: rlatu(jjm+1) ! latitudes of the physics grid
   REAL, INTENT (IN) :: rlatv(jjm) ! latitude boundaries of the physics grid
@@ -65,5 +66,5 @@
 
   INTEGER :: ibegin,iend,offset
-  INTEGER :: i,j
+  INTEGER :: i,j,k
   CHARACTER (LEN=20) :: modname='iniphysiq'
   CHARACTER (LEN=80) :: abort_message
@@ -75,20 +76,26 @@
 
   ! global array, on full physics grid:
-  REAL,ALLOCATABLE :: latfi(:)
-  REAL,ALLOCATABLE :: lonfi(:)
-  REAL,ALLOCATABLE :: cufi(:)
-  REAL,ALLOCATABLE :: cvfi(:)
-  REAL,ALLOCATABLE :: airefi(:)
-
-  IF (nlayer.NE.klev) THEN
-    WRITE(lunout,*) 'STOP in ',trim(modname)
-    WRITE(lunout,*) 'Problem with dimensions :'
-    WRITE(lunout,*) 'nlayer     = ',nlayer
-    WRITE(lunout,*) 'klev   = ',klev
-    abort_message = ''
-    CALL abort_gcm (modname,abort_message,1)
-  ENDIF
-
-  !call init_phys_lmdz(iim,jjm+1,llm,1,(/(jjm-1)*iim+2/))
+  REAL,ALLOCATABLE :: latfi_glo(:)
+  REAL,ALLOCATABLE :: lonfi_glo(:)
+  REAL,ALLOCATABLE :: cufi_glo(:)
+  REAL,ALLOCATABLE :: cvfi_glo(:)
+  REAL,ALLOCATABLE :: airefi_glo(:)
+  REAL,ALLOCATABLE :: boundslonfi_glo(:,:)
+  REAL,ALLOCATABLE :: boundslatfi_glo(:,:)
+
+  ! local arrays, on given MPI/OpenMP domain:
+  REAL,ALLOCATABLE,SAVE :: latfi(:)
+  REAL,ALLOCATABLE,SAVE :: lonfi(:)
+  REAL,ALLOCATABLE,SAVE :: cufi(:)
+  REAL,ALLOCATABLE,SAVE :: cvfi(:)
+  REAL,ALLOCATABLE,SAVE :: airefi(:)
+  REAL,ALLOCATABLE,SAVE :: boundslonfi(:,:)
+  REAL,ALLOCATABLE,SAVE :: boundslatfi(:,:)
+!$OMP THREADPRIVATE (latfi,lonfi,cufi,cvfi,airefi,boundslonfi,boundslatfi)
+
+  ! Initialize Physics distibution and parameters and interface with dynamics
+  CALL init_physics_distribution(regular_lonlat,4, &
+                                 nbp,iim,jjm+1,nlayer,communicator)
+  CALL init_interface_dyn_phys
   
   ! init regular global longitude-latitude grid points and boundaries
@@ -115,35 +122,63 @@
 
   ! Generate global arrays on full physics grid
-  ALLOCATE(latfi(klon_glo),lonfi(klon_glo),cufi(klon_glo),cvfi(klon_glo))
-  ALLOCATE(airefi(klon_glo))
+  ALLOCATE(latfi_glo(klon_glo),lonfi_glo(klon_glo))
+  ALLOCATE(cufi_glo(klon_glo),cvfi_glo(klon_glo))
+  ALLOCATE(airefi_glo(klon_glo))
+  ALLOCATE(boundslonfi_glo(klon_glo,4))
+  ALLOCATE(boundslatfi_glo(klon_glo,4))
 
     ! North pole
-    latfi(1)=rlatu(1)
-    lonfi(1)=0.
-    cufi(1) = cu(1)
-    cvfi(1) = cv(1)
+    latfi_glo(1)=rlatu(1)
+    lonfi_glo(1)=0.
+    cufi_glo(1) = cu(1)
+    cvfi_glo(1) = cv(1)
+    boundslonfi_glo(1,north_east)=0
+    boundslatfi_glo(1,north_east)=PI/2
+    boundslonfi_glo(1,north_west)=2*PI
+    boundslatfi_glo(1,north_west)=PI/2
+    boundslonfi_glo(1,south_west)=2*PI
+    boundslatfi_glo(1,south_west)=rlatv(1)
+    boundslonfi_glo(1,south_east)=0
+    boundslatfi_glo(1,south_east)=rlatv(1)
     DO j=2,jjm
       DO i=1,iim
-        latfi((j-2)*iim+1+i)= rlatu(j)
-        lonfi((j-2)*iim+1+i)= rlonv(i)
-        cufi((j-2)*iim+1+i) = cu((j-1)*iim+1+i)
-        cvfi((j-2)*iim+1+i) = cv((j-1)*iim+1+i)
+        k=(j-2)*iim+1+i
+        latfi_glo(k)= rlatu(j)
+        lonfi_glo(k)= rlonv(i)
+        cufi_glo(k) = cu((j-1)*iim+1+i)
+        cvfi_glo(k) = cv((j-1)*iim+1+i)
+        boundslonfi_glo(k,north_east)=rlonu(i)
+        boundslatfi_glo(k,north_east)=rlatv(j-1)
+        boundslonfi_glo(k,north_west)=rlonu(i+1)
+        boundslatfi_glo(k,north_west)=rlatv(j-1)
+        boundslonfi_glo(k,south_west)=rlonu(i+1)
+        boundslatfi_glo(k,south_west)=rlatv(j)
+        boundslonfi_glo(k,south_east)=rlonu(i)
+        boundslatfi_glo(k,south_east)=rlatv(j)
       ENDDO
     ENDDO
     ! South pole
-    latfi(klon_glo)= rlatu(jjm+1)
-    lonfi(klon_glo)= 0.
-    cufi(klon_glo) = cu((iim+1)*jjm+1)
-    cvfi(klon_glo) = cv((iim+1)*jjm-iim)
+    latfi_glo(klon_glo)= rlatu(jjm+1)
+    lonfi_glo(klon_glo)= 0.
+    cufi_glo(klon_glo) = cu((iim+1)*jjm+1)
+    cvfi_glo(klon_glo) = cv((iim+1)*jjm-iim)
+    boundslonfi_glo(klon_glo,north_east)= 0
+    boundslatfi_glo(klon_glo,north_east)= rlatv(jjm)
+    boundslonfi_glo(klon_glo,north_west)= 2*PI
+    boundslatfi_glo(klon_glo,north_west)= rlatv(jjm)
+    boundslonfi_glo(klon_glo,south_west)= 2*PI
+    boundslatfi_glo(klon_glo,south_west)= -PI/2
+    boundslonfi_glo(klon_glo,south_east)= 0
+    boundslatfi_glo(klon_glo,south_east)= -Pi/2
 
     ! build airefi(), mesh area on physics grid
-    CALL gr_dyn_fi(1,iim+1,jjm+1,klon_glo,aire,airefi)
+    CALL gr_dyn_fi(1,iim+1,jjm+1,klon_glo,aire,airefi_glo)
     ! Poles are single points on physics grid
-    airefi(1)=sum(aire(1:iim,1))
-    airefi(klon_glo)=sum(aire(1:iim,jjm+1))
+    airefi_glo(1)=sum(aire(1:iim,1))
+    airefi_glo(klon_glo)=sum(aire(1:iim,jjm+1))
 
     ! Sanity check: do total planet area match between physics and dynamics?
     total_area_dyn=sum(aire(1:iim,1:jjm+1))
-    total_area_phy=sum(airefi(1:klon_glo))
+    total_area_phy=sum(airefi_glo(1:klon_glo))
     IF (total_area_dyn/=total_area_phy) THEN
       WRITE (lunout, *) 'iniphysiq: planet total surface discrepancy !!!'
@@ -158,4 +193,24 @@
 
 !$OMP PARALLEL 
+  ! Now generate local lon/lat/cu/cv/area/bounds arrays
+  ALLOCATE(latfi(klon_omp),lonfi(klon_omp),cufi(klon_omp),cvfi(klon_omp))
+  ALLOCATE(airefi(klon_omp))
+  ALLOCATE(boundslonfi(klon_omp,4))
+  ALLOCATE(boundslatfi(klon_omp,4))
+
+
+  offset = klon_mpi_begin - 1
+  airefi(1:klon_omp) = airefi_glo(offset+klon_omp_begin:offset+klon_omp_end)
+  cufi(1:klon_omp) = cufi_glo(offset+klon_omp_begin:offset+klon_omp_end)
+  cvfi(1:klon_omp) = cvfi_glo(offset+klon_omp_begin:offset+klon_omp_end)
+  lonfi(1:klon_omp) = lonfi_glo(offset+klon_omp_begin:offset+klon_omp_end)
+  latfi(1:klon_omp) = latfi_glo(offset+klon_omp_begin:offset+klon_omp_end)
+  boundslonfi(1:klon_omp,:) = boundslonfi_glo(offset+klon_omp_begin:offset+klon_omp_end,:)
+  boundslatfi(1:klon_omp,:) = boundslatfi_glo(offset+klon_omp_begin:offset+klon_omp_end,:)
+
+  ! copy over local grid longitudes and latitudes
+  CALL init_geometry(klon_omp,lonfi,latfi,boundslonfi,boundslatfi, &
+                     airefi,cufi,cvfi)
+
   ! Initialize physical constants in physics:
   CALL inifis(prad,pg,pr,pcpp)
@@ -164,17 +219,7 @@
   CALL init_infotrac_phy(nqtot,type_trac)
 
-  ! Now generate local lon/lat/cu/cv/area arrays
-  CALL initcomgeomphy
-
-  offset = klon_mpi_begin - 1
-  airephy(1:klon_omp) = airefi(offset+klon_omp_begin:offset+klon_omp_end)
-  cuphy(1:klon_omp) = cufi(offset+klon_omp_begin:offset+klon_omp_end)
-  cvphy(1:klon_omp) = cvfi(offset+klon_omp_begin:offset+klon_omp_end)
-  rlond(1:klon_omp) = lonfi(offset+klon_omp_begin:offset+klon_omp_end)
-  rlatd(1:klon_omp) = latfi(offset+klon_omp_begin:offset+klon_omp_end)
-
   ! Additional initializations for aquaplanets 
   IF (iflag_phys>=100) THEN
-    CALL iniaqua(klon_omp,rlatd,rlond,iflag_phys)
+    CALL iniaqua(klon_omp,iflag_phys)
   ENDIF
 !$OMP END PARALLEL
Index: LMDZ5/trunk/libf/dynlonlat_phylonlat/phylmd/ce0l.F90
===================================================================
--- LMDZ5/trunk/libf/dynlonlat_phylonlat/phylmd/ce0l.F90	(revision 2350)
+++ LMDZ5/trunk/libf/dynlonlat_phylonlat/phylmd/ce0l.F90	(revision 2351)
@@ -26,4 +26,5 @@
   USE filtreg_mod,    ONLY: inifilr
   USE iniphysiq_mod,  ONLY: iniphysiq
+  USE mod_const_mpi,  ONLY: comm_lmdz
 #ifdef inca
   USE indice_sol_mod, ONLY: nbsrf, is_oce, is_sic, is_ter, is_lic
@@ -106,8 +107,4 @@
   CALL read_distrib()
   CALL init_mod_hallo()
-  CALL Init_Phys_lmdz(iim,jjp1,llm,mpi_size,distrib_phys)
-  CALL init_interface_dyn_phys()
-#else
-  CALL Init_Phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/))
 #endif
   WRITE(lunout,*)'---> klon=',klon
@@ -126,5 +123,7 @@
 
   CALL inifilr()
-  CALL iniphysiq(iim,jjm,llm,daysec,day_ini,dtphys/nsplit_phys, &
+  CALL iniphysiq(iim,jjm,llm, &
+                 distrib_phys(mpi_rank),comm_lmdz, &
+                 daysec,day_ini,dtphys/nsplit_phys, &
                  rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp,iflag_phys)
   IF(pressure_exner) CALL test_disvert
Index: LMDZ5/trunk/libf/dynlonlat_phylonlat/phylmd/iniphysiq_mod.F90
===================================================================
--- LMDZ5/trunk/libf/dynlonlat_phylonlat/phylmd/iniphysiq_mod.F90	(revision 2350)
+++ LMDZ5/trunk/libf/dynlonlat_phylonlat/phylmd/iniphysiq_mod.F90	(revision 2351)
@@ -6,14 +6,17 @@
 CONTAINS
 
-SUBROUTINE iniphysiq(ii,jj,nlayer,punjours, pdayref,ptimestep, &
+SUBROUTINE iniphysiq(ii,jj,nlayer, &
+                     nbp, communicator, &
+                     punjours, pdayref,ptimestep, &
                      rlatu,rlatv,rlonu,rlonv,aire,cu,cv,       &
                      prad,pg,pr,pcpp,iflag_phys)
-  USE dimphy, ONLY: klev ! number of atmospheric levels
-  USE mod_grid_phy_lmdz, ONLY: klon_glo ! number of atmospheric columns
-                                        ! (on full grid)
+  USE dimphy, ONLY: init_dimphy
+  USE mod_grid_phy_lmdz, ONLY: klon_glo,  & ! number of atmospheric columns (on full grid)
+                               regular_lonlat  ! regular longitude-latitude grid type
   USE mod_phys_lmdz_para, ONLY: klon_omp, & ! number of columns (on local omp grid)
                                 klon_omp_begin, & ! start index of local omp subgrid
                                 klon_omp_end, & ! end index of local omp subgrid
                                 klon_mpi_begin ! start indes of columns (on local mpi grid)
+  USE geometry_mod, ONLY : init_geometry
   USE vertical_layers_mod, ONLY : init_vertical_layers
   USE infotrac, ONLY: nqtot,nqo,nbtr,tname,ttext,type_trac,&
@@ -26,11 +29,8 @@
                       indnum_fn_num,index_trac,&
                       niso,ntraceurs_zone,ntraciso
+#ifdef REPROBUS
+  USE CHEM_REP, ONLY : Init_chem_rep_phys
+#endif
   USE control_mod, ONLY: dayref,anneeref,day_step,nday,offline
-  USE comgeomphy, ONLY: initcomgeomphy, &
-                        airephy, & ! physics grid area (m2)
-                        cuphy, & ! cu coeff. (u_covariant = cu * u)
-                        cvphy, & ! cv coeff. (v_covariant = cv * v)
-                        rlond, & ! longitudes
-                        rlatd ! latitudes
   USE inifis_mod, ONLY: inifis
   USE time_phylmdz_mod, ONLY: init_time
@@ -38,8 +38,10 @@
   USE phystokenc_mod, ONLY: init_phystokenc
   USE phyaqua_mod, ONLY: iniaqua
+  USE physics_distribution_mod, ONLY : init_physics_distribution
   USE regular_lonlat_mod, ONLY : init_regular_lonlat, &
                                  east, west, north, south, &
                                  north_east, north_west, &
                                  south_west, south_east
+  USE mod_interface_dyn_phys, ONLY :  init_interface_dyn_phys
   IMPLICIT NONE
 
@@ -64,4 +66,6 @@
   INTEGER, INTENT (IN) :: ii ! number of atmospheric columns along longitudes
   INTEGER, INTENT (IN) :: jj ! number of atompsheric columns along latitudes
+  INTEGER, INTENT(IN) :: nbp ! number of physics columns for this MPI process
+  INTEGER, INTENT(IN) :: communicator ! MPI communicator
   REAL, INTENT (IN) :: rlatu(jj+1) ! latitudes of the physics grid
   REAL, INTENT (IN) :: rlatv(jj) ! latitude boundaries of the physics grid
@@ -76,5 +80,5 @@
 
   INTEGER :: ibegin, iend, offset
-  INTEGER :: i,j
+  INTEGER :: i,j,k
   CHARACTER (LEN=20) :: modname = 'iniphysiq'
   CHARACTER (LEN=80) :: abort_message
@@ -86,17 +90,26 @@
 
   ! global array, on full physics grid:
-  REAL,ALLOCATABLE :: latfi(:)
-  REAL,ALLOCATABLE :: lonfi(:)
-  REAL,ALLOCATABLE :: cufi(:)
-  REAL,ALLOCATABLE :: cvfi(:)
-  REAL,ALLOCATABLE :: airefi(:)
-
-  IF (nlayer/=klev) THEN
-    WRITE (lunout, *) 'nlayer     = ', nlayer
-    WRITE (lunout, *) 'klev   = ', klev
-    CALL abort_gcm(modname, 'Problem with dimensions', 1)
-  END IF
-
-  !call init_phys_lmdz(ii,jj+1,llm,1,(/(jj-1)*ii+2/))
+  REAL,ALLOCATABLE :: latfi_glo(:)
+  REAL,ALLOCATABLE :: lonfi_glo(:)
+  REAL,ALLOCATABLE :: cufi_glo(:)
+  REAL,ALLOCATABLE :: cvfi_glo(:)
+  REAL,ALLOCATABLE :: airefi_glo(:)
+  REAL,ALLOCATABLE :: boundslonfi_glo(:,:)
+  REAL,ALLOCATABLE :: boundslatfi_glo(:,:)
+
+  ! local arrays, on given MPI/OpenMP domain:
+  REAL,ALLOCATABLE,SAVE :: latfi(:)
+  REAL,ALLOCATABLE,SAVE :: lonfi(:)
+  REAL,ALLOCATABLE,SAVE :: cufi(:)
+  REAL,ALLOCATABLE,SAVE :: cvfi(:)
+  REAL,ALLOCATABLE,SAVE :: airefi(:)
+  REAL,ALLOCATABLE,SAVE :: boundslonfi(:,:)
+  REAL,ALLOCATABLE,SAVE :: boundslatfi(:,:)
+!$OMP THREADPRIVATE (latfi,lonfi,cufi,cvfi,airefi,boundslonfi,boundslatfi)
+
+  ! Initialize Physics distibution and parameters and interface with dynamics
+  CALL init_physics_distribution(regular_lonlat,4, &
+                                 nbp,ii,jj+1,nlayer,communicator)
+  CALL init_interface_dyn_phys
   
   ! init regular global longitude-latitude grid points and boundaries
@@ -123,36 +136,65 @@
 
   ! Generate global arrays on full physics grid
-  ALLOCATE(latfi(klon_glo),lonfi(klon_glo),cufi(klon_glo),cvfi(klon_glo))
-  ALLOCATE(airefi(klon_glo))
+  ALLOCATE(latfi_glo(klon_glo),lonfi_glo(klon_glo))
+  ALLOCATE(cufi_glo(klon_glo),cvfi_glo(klon_glo))
+  ALLOCATE(airefi_glo(klon_glo))
+  ALLOCATE(boundslonfi_glo(klon_glo,4))
+  ALLOCATE(boundslatfi_glo(klon_glo,4))
+  
 
   IF (klon_glo>1) THEN ! general case
     ! North pole
-    latfi(1)=rlatu(1)
-    lonfi(1)=0.
-    cufi(1) = cu(1)
-    cvfi(1) = cv(1)
+    latfi_glo(1)=rlatu(1)
+    lonfi_glo(1)=0.
+    cufi_glo(1) = cu(1)
+    cvfi_glo(1) = cv(1)
+    boundslonfi_glo(1,north_east)=0
+    boundslatfi_glo(1,north_east)=PI/2
+    boundslonfi_glo(1,north_west)=2*PI
+    boundslatfi_glo(1,north_west)=PI/2
+    boundslonfi_glo(1,south_west)=2*PI
+    boundslatfi_glo(1,south_west)=rlatv(1)
+    boundslonfi_glo(1,south_east)=0
+    boundslatfi_glo(1,south_east)=rlatv(1)
     DO j=2,jj
       DO i=1,ii
-        latfi((j-2)*ii+1+i)= rlatu(j)
-        lonfi((j-2)*ii+1+i)= rlonv(i)
-        cufi((j-2)*ii+1+i) = cu((j-1)*(ii+1)+i)
-        cvfi((j-2)*ii+1+i) = cv((j-1)*(ii+1)+i)
+        k=(j-2)*ii+1+i
+        latfi_glo(k)= rlatu(j)
+        lonfi_glo(k)= rlonv(i)
+        cufi_glo(k) = cu((j-1)*ii+1+i)
+        cvfi_glo(k) = cv((j-1)*ii+1+i)
+        boundslonfi_glo(k,north_east)=rlonu(i)
+        boundslatfi_glo(k,north_east)=rlatv(j-1)
+        boundslonfi_glo(k,north_west)=rlonu(i+1)
+        boundslatfi_glo(k,north_west)=rlatv(j-1)
+        boundslonfi_glo(k,south_west)=rlonu(i+1)
+        boundslatfi_glo(k,south_west)=rlatv(j)
+        boundslonfi_glo(k,south_east)=rlonu(i)
+        boundslatfi_glo(k,south_east)=rlatv(j)
       ENDDO
     ENDDO
     ! South pole
-    latfi(klon_glo)= rlatu(jj+1)
-    lonfi(klon_glo)= 0.
-    cufi(klon_glo) = cu((ii+1)*jj+1)
-    cvfi(klon_glo) = cv((ii+1)*jj-ii)
-
-    ! build airefi(), mesh area on physics grid
-    CALL gr_dyn_fi(1,ii+1,jj+1,klon_glo,aire,airefi)
+    latfi_glo(klon_glo)= rlatu(jj+1)
+    lonfi_glo(klon_glo)= 0.
+    cufi_glo(klon_glo) = cu((ii+1)*jj+1)
+    cvfi_glo(klon_glo) = cv((ii+1)*jj-ii)
+    boundslonfi_glo(klon_glo,north_east)= 0
+    boundslatfi_glo(klon_glo,north_east)= rlatv(jj)
+    boundslonfi_glo(klon_glo,north_west)= 2*PI
+    boundslatfi_glo(klon_glo,north_west)= rlatv(jj)
+    boundslonfi_glo(klon_glo,south_west)= 2*PI
+    boundslatfi_glo(klon_glo,south_west)= -PI/2
+    boundslonfi_glo(klon_glo,south_east)= 0
+    boundslatfi_glo(klon_glo,south_east)= -Pi/2
+
+    ! build airefi_glo(), mesh area on physics grid
+    CALL gr_dyn_fi(1,ii+1,jj+1,klon_glo,aire,airefi_glo)
     ! Poles are single points on physics grid
-    airefi(1)=sum(aire(1:ii,1))
-    airefi(klon_glo)=sum(aire(1:ii,jj+1))
+    airefi_glo(1)=sum(aire(1:ii,1))
+    airefi_glo(klon_glo)=sum(aire(1:ii,jj+1))
 
     ! Sanity check: do total planet area match between physics and dynamics?
     total_area_dyn=sum(aire(1:ii,1:jj+1))
-    total_area_phy=sum(airefi(1:klon_glo))
+    total_area_phy=sum(airefi_glo(1:klon_glo))
     IF (total_area_dyn/=total_area_phy) THEN
       WRITE (lunout, *) 'iniphysiq: planet total surface discrepancy !!!'
@@ -167,22 +209,54 @@
   ELSE ! klon_glo==1, running the 1D model
     ! just copy over input values
-    latfi(1)=rlatu(1)
-    lonfi(1)=rlonv(1)
-    cufi(1)=cu(1)
-    cvfi(1)=cv(1)
-    airefi(1)=aire(1,1)
+    latfi_glo(1)=rlatu(1)
+    lonfi_glo(1)=rlonv(1)
+    cufi_glo(1)=cu(1)
+    cvfi_glo(1)=cv(1)
+    airefi_glo(1)=aire(1,1)
+    boundslonfi_glo(1,north_east)=rlonu(1)
+    boundslatfi_glo(1,north_east)=PI/2
+    boundslonfi_glo(1,north_west)=rlonu(2)
+    boundslatfi_glo(1,north_west)=PI/2
+    boundslonfi_glo(1,south_west)=rlonu(2)
+    boundslatfi_glo(1,south_west)=rlatv(1)
+    boundslonfi_glo(1,south_east)=rlonu(1)
+    boundslatfi_glo(1,south_east)=rlatv(1)
   ENDIF ! of IF (klon_glo>1)
 
 !$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/)
-  ! Initialize physical constants in physics:
-  CALL inifis(punjours,prad,pg,pr,pcpp)
-  CALL init_time(annee_ref,day_ref,day_ini,start_time,nday,ptimestep)
-
-  ! Copy over "offline" settings
-  CALL init_phystokenc(offline,istphy)
+  ! Now generate local lon/lat/cu/cv/area/bounds arrays
+  ALLOCATE(latfi(klon_omp),lonfi(klon_omp),cufi(klon_omp),cvfi(klon_omp))
+  ALLOCATE(airefi(klon_omp))
+  ALLOCATE(boundslonfi(klon_omp,4))
+  ALLOCATE(boundslatfi(klon_omp,4))
+
+
+  offset = klon_mpi_begin - 1
+  airefi(1:klon_omp) = airefi_glo(offset+klon_omp_begin:offset+klon_omp_end)
+  cufi(1:klon_omp) = cufi_glo(offset+klon_omp_begin:offset+klon_omp_end)
+  cvfi(1:klon_omp) = cvfi_glo(offset+klon_omp_begin:offset+klon_omp_end)
+  lonfi(1:klon_omp) = lonfi_glo(offset+klon_omp_begin:offset+klon_omp_end)
+  latfi(1:klon_omp) = latfi_glo(offset+klon_omp_begin:offset+klon_omp_end)
+  boundslonfi(1:klon_omp,:) = boundslonfi_glo(offset+klon_omp_begin:offset+klon_omp_end,:)
+  boundslatfi(1:klon_omp,:) = boundslatfi_glo(offset+klon_omp_begin:offset+klon_omp_end,:)
+
+  ! copy over local grid longitudes and latitudes
+  CALL init_geometry(klon_omp,lonfi,latfi,boundslonfi,boundslatfi, &
+                     airefi,cufi,cvfi)
 
   ! copy over preff , ap(), bp(), etc 
   CALL init_vertical_layers(nlayer,preff,scaleheight, &
                             ap,bp,presnivs,pseudoalt)
+
+  ! Initialize physical constants in physics:
+  CALL inifis(punjours,prad,pg,pr,pcpp)
+
+  CALL init_time(annee_ref,day_ref,day_ini,start_time,nday,ptimestep)
+
+  ! Initialize dimphy module
+  CALL Init_dimphy(klon_omp,nlayer)
+
+  ! Copy over "offline" settings
+  CALL init_phystokenc(offline,istphy)
 
   ! Initialize tracer names, numbers, etc. for physics
@@ -197,17 +271,14 @@
                          niso,ntraceurs_zone,ntraciso)
 
-  ! Now generate local lon/lat/cu/cv/area arrays
-  CALL initcomgeomphy
-
-  offset = klon_mpi_begin - 1
-  airephy(1:klon_omp) = airefi(offset+klon_omp_begin:offset+klon_omp_end)
-  cuphy(1:klon_omp) = cufi(offset+klon_omp_begin:offset+klon_omp_end)
-  cvphy(1:klon_omp) = cvfi(offset+klon_omp_begin:offset+klon_omp_end)
-  rlond(1:klon_omp) = lonfi(offset+klon_omp_begin:offset+klon_omp_end)
-  rlatd(1:klon_omp) = latfi(offset+klon_omp_begin:offset+klon_omp_end)
+  ! Initializations for Reprobus
+  IF (type_trac == 'repr') THEN
+#ifdef REPROBUS
+    CALL Init_chem_rep_phys(klon_omp,nlayer)
+#endif
+  ENDIF
 
   ! Additional initializations for aquaplanets 
   IF (iflag_phys>=100) THEN
-    CALL iniaqua(klon_omp, rlatd, rlond, iflag_phys)
+    CALL iniaqua(klon_omp,iflag_phys)
   END IF
 !$OMP END PARALLEL
Index: LMDZ5/trunk/libf/dynlonlat_phylonlat/phymar/iniphysiq_mod.F90
===================================================================
--- LMDZ5/trunk/libf/dynlonlat_phylonlat/phymar/iniphysiq_mod.F90	(revision 2350)
+++ LMDZ5/trunk/libf/dynlonlat_phylonlat/phymar/iniphysiq_mod.F90	(revision 2351)
@@ -6,20 +6,17 @@
 CONTAINS
 
-SUBROUTINE iniphysiq(iim,jjm,nlayer,punjours, pdayref,ptimestep, &
+SUBROUTINE iniphysiq(iim,jjm,nlayer,
+                     nbp, communicator, &
+                     punjours, pdayref,ptimestep, &
                      rlatu,rlatv,rlonu,rlonv,aire,cu,cv,         &
                      prad,pg,pr,pcpp,iflag_phys)
-  USE dimphy, ONLY: klev ! number of atmospheric levels
-  USE mod_grid_phy_lmdz, ONLY: klon_glo ! number of atmospheric columns
-                                        ! (on full grid)
+  USE dimphy, ONLY: init_dimphy
+  USE mod_grid_phy_lmdz, ONLY: klon_glo,  & ! number of atmospheric columns (on full grid)
+                               regular_lonlat  ! regular longitude-latitude grid type
   USE mod_phys_lmdz_para, ONLY: klon_omp, & ! number of columns (on local omp grid)
                                 klon_omp_begin, & ! start index of local omp subgrid
                                 klon_omp_end, & ! end index of local omp subgrid
                                 klon_mpi_begin ! start indes of columns (on local mpi grid)
-  USE comgeomphy, ONLY: initcomgeomphy, &
-                        airephy, & ! physics grid area (m2)
-                        cuphy, & ! cu coeff. (u_covariant = cu * u)
-                        cvphy, & ! cv coeff. (v_covariant = cv * v)
-                        rlond, & ! longitudes
-                        rlatd ! latitudes
+  USE geometry_mod, ONLY : init_geometry
   USE comcstphy, ONLY: rradius, & ! planet radius (m)
                        rr, & ! recuced gas constant: R/molar mass of atm
@@ -27,8 +24,10 @@
                        rcpp  ! specific heat of the atmosphere
 !  USE phyaqua_mod, ONLY: iniaqua
+  USE physics_distribution_mod, ONLY : init_physics_distribution
   USE regular_lonlat_mod, ONLY : init_regular_lonlat, &
                                  east, west, north, south, &
                                  north_east, north_west, &
                                  south_west, south_east
+  USE mod_interface_dyn_phys, ONLY :  init_interface_dyn_phys
   USE nrtype, ONLY: pi
   IMPLICIT NONE
@@ -50,4 +49,6 @@
   INTEGER, INTENT (IN) :: iim ! number of atmospheric coulumns along longitudes
   INTEGER, INTENT (IN) :: jjm  ! number of atompsheric columns along latitudes
+  INTEGER, INTENT(IN) :: nbp ! number of physics columns for this MPI process
+  INTEGER, INTENT(IN) :: communicator ! MPI communicator
   REAL, INTENT (IN) :: rlatu(jjm+1) ! latitudes of the physics grid
   REAL, INTENT (IN) :: rlatv(jjm) ! latitude boundaries of the physics grid
@@ -62,5 +63,5 @@
 
   INTEGER :: ibegin,iend,offset
-  INTEGER :: i,j
+  INTEGER :: i,j,k
   CHARACTER (LEN=20) :: modname='iniphysiq'
   CHARACTER (LEN=80) :: abort_message
@@ -72,19 +73,27 @@
 
   ! global array, on full physics grid:
-  REAL,ALLOCATABLE :: latfi(:)
-  REAL,ALLOCATABLE :: lonfi(:)
-  REAL,ALLOCATABLE :: cufi(:)
-  REAL,ALLOCATABLE :: cvfi(:)
-  REAL,ALLOCATABLE :: airefi(:)
- 
-  IF (nlayer.NE.klev) THEN
-    WRITE(lunout,*) 'STOP in ',trim(modname)
-    WRITE(lunout,*) 'Problem with dimensions :'
-    WRITE(lunout,*) 'nlayer     = ',nlayer
-    WRITE(lunout,*) 'klev   = ',klev
-    abort_message = ''
-    CALL abort_gcm (modname,abort_message,1)
-  ENDIF
-
+  REAL,ALLOCATABLE :: latfi_glo(:)
+  REAL,ALLOCATABLE :: lonfi_glo(:)
+  REAL,ALLOCATABLE :: cufi_glo(:)
+  REAL,ALLOCATABLE :: cvfi_glo(:)
+  REAL,ALLOCATABLE :: airefi_glo(:)
+  REAL,ALLOCATABLE :: boundslonfi_glo(:,:)
+  REAL,ALLOCATABLE :: boundslatfi_glo(:,:)
+
+  ! local arrays, on given MPI/OpenMP domain:
+  REAL,ALLOCATABLE,SAVE :: latfi(:)
+  REAL,ALLOCATABLE,SAVE :: lonfi(:)
+  REAL,ALLOCATABLE,SAVE :: cufi(:)
+  REAL,ALLOCATABLE,SAVE :: cvfi(:)
+  REAL,ALLOCATABLE,SAVE :: airefi(:)
+  REAL,ALLOCATABLE,SAVE :: boundslonfi(:,:)
+  REAL,ALLOCATABLE,SAVE :: boundslatfi(:,:)
+!$OMP THREADPRIVATE (latfi,lonfi,cufi,cvfi,airefi,boundslonfi,boundslatfi)
+
+  ! Initialize Physics distibution and parameters and interface with dynamics
+  CALL init_physics_distribution(regular_lonlat,4, &
+                                 nbp,ii,jj+1,nlayer,communicator)
+  CALL init_interface_dyn_phys
+  
   ! init regular global longitude-latitude grid points and boundaries
   ALLOCATE(boundslon_reg(iim,2))
@@ -110,36 +119,64 @@
 
   ! Generate global arrays on full physics grid
-  ALLOCATE(latfi(klon_glo),lonfi(klon_glo),cufi(klon_glo),cvfi(klon_glo))
-  ALLOCATE(airefi(klon_glo))
+  ALLOCATE(latfi_glo(klon_glo),lonfi_glo(klon_glo))
+  ALLOCATE(cufi_glo(klon_glo),cvfi_glo(klon_glo))
+  ALLOCATE(airefi_glo(klon_glo))
+  ALLOCATE(boundslonfi_glo(klon_glo,4))
+  ALLOCATE(boundslatfi_glo(klon_glo,4))
 
   IF (klon_glo>1) THEN ! general case
     ! North pole
-    latfi(1)=rlatu(1)
-    lonfi(1)=0.
-    cufi(1) = cu(1)
-    cvfi(1) = cv(1)
+    latfi_glo(1)=rlatu(1)
+    lonfi_glo(1)=0.
+    cufi_glo(1) = cu(1)
+    cvfi_glo(1) = cv(1)
+    boundslonfi_glo(1,north_east)=0
+    boundslatfi_glo(1,north_east)=PI/2
+    boundslonfi_glo(1,north_west)=2*PI
+    boundslatfi_glo(1,north_west)=PI/2
+    boundslonfi_glo(1,south_west)=2*PI
+    boundslatfi_glo(1,south_west)=rlatv(1)
+    boundslonfi_glo(1,south_east)=0
+    boundslatfi_glo(1,south_east)=rlatv(1)
     DO j=2,jjm
       DO i=1,iim
-        latfi((j-2)*iim+1+i)= rlatu(j)
-        lonfi((j-2)*iim+1+i)= rlonv(i)
-        cufi((j-2)*iim+1+i) = cu((j-1)*iim+1+i)
-        cvfi((j-2)*iim+1+i) = cv((j-1)*iim+1+i)
+        k=(j-2)*iim+1+i
+        latfi_glo((j-2)*iim+1+i)= rlatu(j)
+        lonfi_glo((j-2)*iim+1+i)= rlonv(i)
+        cufi_glo((j-2)*iim+1+i) = cu((j-1)*iim+1+i)
+        cvfi_glo((j-2)*iim+1+i) = cv((j-1)*iim+1+i)
+        boundslonfi_glo(k,north_east)=rlonu(i)
+        boundslatfi_glo(k,north_east)=rlatv(j-1)
+        boundslonfi_glo(k,north_west)=rlonu(i+1)
+        boundslatfi_glo(k,north_west)=rlatv(j-1)
+        boundslonfi_glo(k,south_west)=rlonu(i+1)
+        boundslatfi_glo(k,south_west)=rlatv(j)
+        boundslonfi_glo(k,south_east)=rlonu(i)
+        boundslatfi_glo(k,south_east)=rlatv(j)
       ENDDO
     ENDDO
     ! South pole
-    latfi(klon_glo)= rlatu(jjm+1)
-    lonfi(klon_glo)= 0.
-    cufi(klon_glo) = cu((iim+1)*jjm+1)
-    cvfi(klon_glo) = cv((iim+1)*jjm-iim)
+    latfi_glo(klon_glo)= rlatu(jjm+1)
+    lonfi_glo(klon_glo)= 0.
+    cufi_glo(klon_glo) = cu((iim+1)*jjm+1)
+    cvfi_glo(klon_glo) = cv((iim+1)*jjm-iim)
+    boundslonfi_glo(klon_glo,north_east)= 0
+    boundslatfi_glo(klon_glo,north_east)= rlatv(jjm)
+    boundslonfi_glo(klon_glo,north_west)= 2*PI
+    boundslatfi_glo(klon_glo,north_west)= rlatv(jjm)
+    boundslonfi_glo(klon_glo,south_west)= 2*PI
+    boundslatfi_glo(klon_glo,south_west)= -PI/2
+    boundslonfi_glo(klon_glo,south_east)= 0
+    boundslatfi_glo(klon_glo,south_east)= -Pi/2
 
     ! build airefi(), mesh area on physics grid
-    CALL gr_dyn_fi(1,iim+1,jjm+1,klon_glo,aire,airefi)
+    CALL gr_dyn_fi(1,iim+1,jjm+1,klon_glo,aire,airefi_glo)
     ! Poles are single points on physics grid
-    airefi(1)=sum(aire(1:iim,1))
-    airefi(klon_glo)=sum(aire(1:iim,jjm+1))
+    airefi_glo(1)=sum(aire(1:iim,1))
+    airefi_glo(klon_glo)=sum(aire(1:iim,jjm+1))
 
     ! Sanity check: do total planet area match between physics and dynamics?
     total_area_dyn=sum(aire(1:iim,1:jjm+1))
-    total_area_phy=sum(airefi(1:klon_glo))
+    total_area_phy=sum(airefi_glo(1:klon_glo))
     IF (total_area_dyn/=total_area_phy) THEN
       WRITE (lunout, *) 'iniphysiq: planet total surface discrepancy !!!'
@@ -154,21 +191,40 @@
   ELSE ! klon_glo==1, running the 1D model
     ! just copy over input values
-    latfi(1)=rlatu(1)
-    lonfi(1)=rlonv(1)
-    cufi(1)=cu(1)
-    cvfi(1)=cv(1)
-    airefi(1)=aire(1,1)
+    latfi_glo(1)=rlatu(1)
+    lonfi_glo(1)=rlonv(1)
+    cufi_glo(1)=cu(1)
+    cvfi_glo(1)=cv(1)
+    airefi_glo(1)=aire(1,1)
+    boundslonfi_glo(1,north_east)=rlonu(1)
+    boundslatfi_glo(1,north_east)=PI/2
+    boundslonfi_glo(1,north_west)=rlonu(2)
+    boundslatfi_glo(1,north_west)=PI/2
+    boundslonfi_glo(1,south_west)=rlonu(2)
+    boundslatfi_glo(1,south_west)=rlatv(1)
+    boundslonfi_glo(1,south_east)=rlonu(1)
+    boundslatfi_glo(1,south_east)=rlatv(1)
   ENDIF ! of IF (klon_glo>1)
 
 !$OMP PARALLEL
-  ! Now generate local lon/lat/cu/cv/area arrays
-  CALL initcomgeomphy
-      
+  ! Now generate local lon/lat/cu/cv/area/bounds arrays
+  ALLOCATE(latfi(klon_omp),lonfi(klon_omp),cufi(klon_omp),cvfi(klon_omp))
+  ALLOCATE(airefi(klon_omp))
+  ALLOCATE(boundslonfi(klon_omp,4))
+  ALLOCATE(boundslatfi(klon_omp,4))
+
+
   offset = klon_mpi_begin - 1
-  airephy(1:klon_omp) = airefi(offset+klon_omp_begin:offset+klon_omp_end)
-  cuphy(1:klon_omp) = cufi(offset+klon_omp_begin:offset+klon_omp_end)
-  cvphy(1:klon_omp) = cvfi(offset+klon_omp_begin:offset+klon_omp_end)
-  rlond(1:klon_omp) = lonfi(offset+klon_omp_begin:offset+klon_omp_end)
-  rlatd(1:klon_omp) = latfi(offset+klon_omp_begin:offset+klon_omp_end)
+  airefi(1:klon_omp) = airefi_glo(offset+klon_omp_begin:offset+klon_omp_end)
+  cufi(1:klon_omp) = cufi_glo(offset+klon_omp_begin:offset+klon_omp_end)
+  cvfi(1:klon_omp) = cvfi_glo(offset+klon_omp_begin:offset+klon_omp_end)
+  lonfi(1:klon_omp) = lonfi_glo(offset+klon_omp_begin:offset+klon_omp_end)
+  latfi(1:klon_omp) = latfi_glo(offset+klon_omp_begin:offset+klon_omp_end)
+  boundslonfi(1:klon_omp,:) = boundslonfi_glo(offset+klon_omp_begin:offset+klon_omp_end,:)
+  boundslatfi(1:klon_omp,:) = boundslatfi_glo(offset+klon_omp_begin:offset+klon_omp_end,:)
+
+  ! copy over local grid longitudes and latitudes
+  CALL init_geometry(klon_omp,lonfi,latfi,boundslonfi,boundslatfi, &
+                     airefi,cufi,cvfi)
+
 
 ! copy some fundamental parameters to physics
Index: LMDZ5/trunk/libf/phy_common/geometry_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phy_common/geometry_mod.F90	(revision 2351)
+++ LMDZ5/trunk/libf/phy_common/geometry_mod.F90	(revision 2351)
@@ -0,0 +1,76 @@
+MODULE geometry_mod
+
+! Store informations concerning the local (to MPI/OpenMP core) geometry
+
+  REAL,SAVE,ALLOCATABLE :: longitude(:) ! longitude of the cell (rad)
+!$OMP THREADPRIVATE(longitude)
+
+  REAL,SAVE,ALLOCATABLE :: latitude(:)! latitude of the cell (rad)
+!$OMP THREADPRIVATE(latitude)
+
+  REAL,SAVE,ALLOCATABLE :: longitude_deg(:) ! longitude of the cell (degree)
+!$OMP THREADPRIVATE(longitude_deg)
+
+  REAL,SAVE,ALLOCATABLE :: latitude_deg(:)! latitude of the cell (degree)
+!$OMP THREADPRIVATE(latitude_deg)
+
+  REAL,SAVE,ALLOCATABLE :: boundslon(:,:)  ! boundaries of the cell (rad)
+!$OMP THREADPRIVATE(boundslon)
+
+  REAL,SAVE,ALLOCATABLE :: boundslat(:,:) ! boundaries of the cell (rad)
+!$OMP THREADPRIVATE(boundslat)
+
+  REAL,SAVE,ALLOCATABLE :: dx(:)      ! resolution of longitude cell (valid only for 2D grid)
+!$OMP THREADPRIVATE(dx)
+  
+  REAL,SAVE,ALLOCATABLE :: dy(:)      ! resolution of latitude cell (valid only for 2D grid)
+!$OMP THREADPRIVATE(dy)
+
+  REAL,SAVE,ALLOCATABLE :: cell_area(:)      ! area of the cell
+!$OMP THREADPRIVATE(cell_area)
+
+
+CONTAINS
+
+  SUBROUTINE init_geometry(klon,longitude_,latitude_, &
+                           boundslon_,boundslat_, &
+                           cell_area_,dx_,dy_)
+  USE mod_grid_phy_lmdz, ONLY: nvertex
+  USE nrtype, ONLY : PI
+  IMPLICIT NONE
+    INTEGER,INTENT(IN) :: klon ! number of columns for this MPI/OpenMP domain
+    REAL,INTENT(IN) :: longitude_(klon)
+    REAL,INTENT(IN) :: latitude_(klon)
+    REAL,INTENT(IN) :: boundslon_(klon,nvertex)
+    REAL,INTENT(IN) :: boundslat_(klon,nvertex)
+    REAL,INTENT(IN) :: cell_area_(klon)
+    REAL,OPTIONAL,INTENT(IN) :: dx_(klon)
+    REAL,OPTIONAL,INTENT(IN) :: dy_(klon)
+    
+    ALLOCATE(longitude(klon))
+    ALLOCATE(latitude(klon))
+    ALLOCATE(longitude_deg(klon))
+    ALLOCATE(latitude_deg(klon))
+    ALLOCATE(boundslon(klon,nvertex))
+    ALLOCATE(boundslat(klon,nvertex))
+    ALLOCATE(cell_area(klon))
+    IF (PRESENT(dx_)) ALLOCATE(dx(klon))
+    IF (PRESENT(dy_))ALLOCATE(dy(klon))
+    
+    longitude(:) = longitude_(:)
+    latitude(:) = latitude_(:)
+    longitude_deg(:) = longitude(:)*180./PI
+    latitude_deg(:) = latitude(:)*180./PI
+    boundslon(:,:) = boundslon_(:,:)
+    boundslat(:,:) = boundslat_(:,:)
+    cell_area(:) = cell_area_(:)
+    IF (PRESENT(dx_)) dx(:) = dx_(:)
+    IF (PRESENT(dy_)) dy(:) = dy_(:)
+    
+    ! Ehouarn debug
+    write(*,*) "init_geometry: cell_area(1)=",cell_area(1)
+  END SUBROUTINE init_geometry
+
+
+END MODULE geometry_mod
+
Index: LMDZ5/trunk/libf/phy_common/mod_grid_phy_lmdz.F90
===================================================================
--- LMDZ5/trunk/libf/phy_common/mod_grid_phy_lmdz.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phy_common/mod_grid_phy_lmdz.F90	(revision 2351)
@@ -8,8 +8,13 @@
              grid2dTo1d_glo_igen, grid2dTo1d_glo_rgen, grid2dTo1d_glo_lgen
   
+  INTEGER,PARAMETER :: unstructured=0
+  INTEGER,PARAMETER :: regular_lonlat=1
+
+  INTEGER,SAVE :: grid_type
+  INTEGER,SAVE :: nvertex
   INTEGER,SAVE :: nbp_lon  ! == iim
-  INTEGER,SAVE :: nbp_lat  ! == jjmp1
+  INTEGER,SAVE :: nbp_lat  ! == jjmp1 (or == 1 if running 1D model)
   INTEGER,SAVE :: nbp_lev  ! == llm
-  INTEGER,SAVE :: klon_glo
+  INTEGER,SAVE :: klon_glo ! total number of atmospheric columns
 
   INTERFACE grid1dTo2d_glo
@@ -32,16 +37,25 @@
 
 
-  SUBROUTINE Init_grid_phy_lmdz(iim,jjp1,llm)
+  SUBROUTINE init_grid_phy_lmdz(grid_type_,nvertex_,nbp_lon_,nbp_lat_,nbp_lev_)
   IMPLICIT NONE
-  INTEGER, INTENT(in) :: iim
-  INTEGER, INTENT(in) :: jjp1
-  INTEGER, INTENT(in) :: llm
-  
-    nbp_lon=iim
-    nbp_lat=jjp1
-    nbp_lev=llm
-    klon_glo=(iim*jjp1)-2*(iim-1)
-  
-  END SUBROUTINE Init_grid_phy_lmdz
+  INTEGER,INTENT(IN)  :: grid_type_ 
+  INTEGER,INTENT(IN)  :: nvertex_ 
+  INTEGER, INTENT(IN) :: nbp_lon_
+  INTEGER, INTENT(IN) :: nbp_lat_
+  INTEGER, INTENT(IN) :: nbp_lev_
+  
+    grid_type = grid_type_
+    nvertex   = nvertex_
+    nbp_lon   = nbp_lon_
+    nbp_lat   = nbp_lat_
+    nbp_lev   = nbp_lev_
+    
+    IF (nbp_lon*nbp_lat==1) THEN
+      klon_glo=1
+    ELSE    
+      klon_glo=(nbp_lon*nbp_lat)-2*(nbp_lon-1)
+    ENDIF
+  
+  END SUBROUTINE init_grid_phy_lmdz
   
   
Index: LMDZ5/trunk/libf/phy_common/mod_phys_lmdz_mpi_data.F90
===================================================================
--- LMDZ5/trunk/libf/phy_common/mod_phys_lmdz_mpi_data.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phy_common/mod_phys_lmdz_mpi_data.F90	(revision 2351)
@@ -3,5 +3,5 @@
 !
 MODULE mod_phys_lmdz_mpi_data
-  USE mod_const_mpi
+!  USE mod_const_mpi
   
   INTEGER,SAVE :: ii_begin
@@ -35,5 +35,6 @@
   INTEGER,SAVE :: mpi_rank
   INTEGER,SAVE :: mpi_size
-  INTEGER,SAVE :: mpi_root
+  INTEGER,SAVE :: mpi_master
+!  INTEGER,SAVE :: mpi_root
   LOGICAL,SAVE :: is_mpi_root
   LOGICAL,SAVE :: is_using_mpi
@@ -43,15 +44,21 @@
   LOGICAL,SAVE :: is_south_pole
   INTEGER,SAVE :: COMM_LMDZ_PHY
+  INTEGER,SAVE :: MPI_REAL_LMDZ   ! MPI_REAL8
 
 CONTAINS
   
-  SUBROUTINE Init_phys_lmdz_mpi_data(iim,jjp1,nb_proc,distrib)
-  USE mod_const_mpi, ONLY : COMM_LMDZ
+!  SUBROUTINE Init_phys_lmdz_mpi_data(iim,jjp1,nb_proc,distrib)
+  SUBROUTINE init_phys_lmdz_mpi_data(nbp, nbp_lon, nbp_lat, communicator)
+!  USE mod_const_mpi, ONLY : COMM_LMDZ
   IMPLICIT NONE
-    INTEGER,INTENT(in) :: iim
-    INTEGER,INTENT(in) :: jjp1
-    INTEGER,INTENT(in) :: nb_proc
-    INTEGER,INTENT(in) :: distrib(0:nb_proc-1)
-    
+#ifdef CPP_MPI
+    INCLUDE 'mpif.h'
+#endif
+    INTEGER,INTENT(in) :: nbp
+    INTEGER,INTENT(in) :: nbp_lon
+    INTEGER,INTENT(in) :: nbp_lat
+    INTEGER,INTENT(in) :: communicator
+    
+    INTEGER,ALLOCATABLE :: distrib(:)
     INTEGER :: ierr
     INTEGER :: klon_glo
@@ -64,14 +71,17 @@
 #endif
     
-    if (iim.eq.1) then
+    if ((nbp_lon.eq.1).and.(nbp_lat.eq.1)) then ! running 1D column model
        klon_glo=1
     else
-       klon_glo=iim*(jjp1-2)+2
+    ! The usual global physics grid: 1 point for each pole and nbp_lon points
+    ! for all other latitudes
+       klon_glo=nbp_lon*(nbp_lat-2)+2
     endif
     
-    COMM_LMDZ_PHY=COMM_LMDZ
+    COMM_LMDZ_PHY=communicator
 
     IF (is_using_mpi) THEN    
 #ifdef CPP_MPI
+      MPI_REAL_LMDZ=MPI_REAL8
       CALL MPI_COMM_SIZE(COMM_LMDZ_PHY,mpi_size,ierr)    
       CALL MPI_COMM_RANK(COMM_LMDZ_PHY,mpi_rank,ierr)
@@ -82,6 +92,17 @@
     ENDIF
     
+    ALLOCATE(distrib(0:mpi_size-1))
+
+    IF (is_using_mpi) THEN    
+#ifdef CPP_MPI
+    CALL MPI_ALLGATHER(nbp,1,MPI_INTEGER,distrib,1,MPI_INTEGER,COMM_LMDZ_PHY,ierr)
+#endif
+    ELSE
+     distrib(:)=nbp
+    ENDIF
+
+
     IF (mpi_rank == 0) THEN
-      mpi_root = 0
+      mpi_master = 0
       is_mpi_root = .true.
     ENDIF
@@ -115,5 +136,5 @@
   
       
-    klon_mpi_para_nb(0:mpi_size-1)=distrib(0:nb_proc-1)
+    klon_mpi_para_nb(0:mpi_size-1)=distrib(0:mpi_size-1)
 
     DO i=0,mpi_size-1
@@ -132,14 +153,14 @@
         ij_para_begin(i) = 1
       ELSE
-        ij_para_begin(i) = klon_mpi_para_begin(i)+iim-1
+        ij_para_begin(i) = klon_mpi_para_begin(i)+nbp_lon-1
       ENDIF
 
-      jj_para_begin(i) = (ij_para_begin(i)-1)/iim + 1
-      ii_para_begin(i) = MOD(ij_para_begin(i)-1,iim) + 1
+      jj_para_begin(i) = (ij_para_begin(i)-1)/nbp_lon + 1
+      ii_para_begin(i) = MOD(ij_para_begin(i)-1,nbp_lon) + 1
 
       
-      ij_para_end(i) = klon_mpi_para_end(i)+iim-1
-      jj_para_end(i) = (ij_para_end(i)-1)/iim + 1
-      ii_para_end(i) = MOD(ij_para_end(i)-1,iim) + 1
+      ij_para_end(i) = klon_mpi_para_end(i)+nbp_lon-1
+      jj_para_end(i) = (ij_para_end(i)-1)/nbp_lon + 1
+      ii_para_end(i) = MOD(ij_para_end(i)-1,nbp_lon) + 1
 
 
@@ -166,6 +187,7 @@
 
   SUBROUTINE print_module_data
+  USE print_control_mod, ONLY: lunout
   IMPLICIT NONE
-  INCLUDE "iniprint.h" 
+!  INCLUDE "iniprint.h" 
   
     WRITE(lunout,*) 'ii_begin =', ii_begin
@@ -193,5 +215,5 @@
     WRITE(lunout,*) 'mpi_rank =', mpi_rank
     WRITE(lunout,*) 'mpi_size =', mpi_size
-    WRITE(lunout,*) 'mpi_root =', mpi_root
+    WRITE(lunout,*) 'mpi_master =', mpi_master
     WRITE(lunout,*) 'is_mpi_root =', is_mpi_root
     WRITE(lunout,*) 'is_north_pole =', is_north_pole
Index: LMDZ5/trunk/libf/phy_common/mod_phys_lmdz_mpi_transfert.F90
===================================================================
--- LMDZ5/trunk/libf/phy_common/mod_phys_lmdz_mpi_transfert.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phy_common/mod_phys_lmdz_mpi_transfert.F90	(revision 2351)
@@ -1236,5 +1236,5 @@
 
   SUBROUTINE bcast_mpi_cgen(var,nb)
-    USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
+    USE mod_phys_lmdz_mpi_data 
     IMPLICIT NONE
     
@@ -1250,5 +1250,5 @@
     
 #ifdef CPP_MPI
-    CALL MPI_BCAST(Var,nb,MPI_CHARACTER,mpi_root_x,COMM_LMDZ_PHY,ierr)
+    CALL MPI_BCAST(Var,nb,MPI_CHARACTER,mpi_master,COMM_LMDZ_PHY,ierr)
 #endif
         
@@ -1258,5 +1258,5 @@
       
   SUBROUTINE bcast_mpi_igen(var,nb)
-    USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
+    USE mod_phys_lmdz_mpi_data
     IMPLICIT NONE
     
@@ -1272,5 +1272,5 @@
 
 #ifdef CPP_MPI
-    CALL MPI_BCAST(Var,nb,MPI_INTEGER,mpi_root_x,COMM_LMDZ_PHY,ierr)
+    CALL MPI_BCAST(Var,nb,MPI_INTEGER,mpi_master,COMM_LMDZ_PHY,ierr)
 #endif
         
@@ -1281,5 +1281,5 @@
   
   SUBROUTINE bcast_mpi_rgen(var,nb)
-    USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
+    USE mod_phys_lmdz_mpi_data
     IMPLICIT NONE
     
@@ -1295,5 +1295,5 @@
 
 #ifdef CPP_MPI
-    CALL MPI_BCAST(Var,nb,MPI_REAL_LMDZ,mpi_root_x,COMM_LMDZ_PHY,ierr)
+    CALL MPI_BCAST(Var,nb,MPI_REAL_LMDZ,mpi_master,COMM_LMDZ_PHY,ierr)
 #endif
     
@@ -1304,5 +1304,5 @@
 
   SUBROUTINE bcast_mpi_lgen(var,nb)
-    USE mod_phys_lmdz_mpi_data ,  mpi_root_x=>mpi_root
+    USE mod_phys_lmdz_mpi_data
     IMPLICIT NONE
     
@@ -1318,5 +1318,5 @@
 
 #ifdef CPP_MPI
-    CALL MPI_BCAST(Var,nb,MPI_LOGICAL,mpi_root_x,COMM_LMDZ_PHY,ierr)
+    CALL MPI_BCAST(Var,nb,MPI_LOGICAL,mpi_master,COMM_LMDZ_PHY,ierr)
 #endif
 
@@ -1326,5 +1326,5 @@
 
   SUBROUTINE scatter_mpi_igen(VarIn, VarOut, dimsize)
-    USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
+    USE mod_phys_lmdz_mpi_data 
     USE mod_grid_phy_lmdz
     IMPLICIT NONE
@@ -1365,5 +1365,5 @@
 #ifdef CPP_MPI 
     CALL MPI_SCATTERV(VarTmp,counts,displs,MPI_INTEGER,VarOut,klon_mpi*dimsize,   &
-                      MPI_INTEGER,mpi_root_x, COMM_LMDZ_PHY,ierr)
+                      MPI_INTEGER,mpi_master, COMM_LMDZ_PHY,ierr)
 #endif
 
@@ -1371,5 +1371,5 @@
 
   SUBROUTINE scatter_mpi_rgen(VarIn, VarOut, dimsize)
-    USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
+    USE mod_phys_lmdz_mpi_data 
     USE mod_grid_phy_lmdz
     IMPLICIT NONE
@@ -1409,5 +1409,5 @@
 #ifdef CPP_MPI 
     CALL MPI_SCATTERV(VarTmp,counts,displs,MPI_REAL_LMDZ,VarOut,klon_mpi*dimsize,   &
-                      MPI_REAL_LMDZ,mpi_root_x, COMM_LMDZ_PHY,ierr)
+                      MPI_REAL_LMDZ,mpi_master, COMM_LMDZ_PHY,ierr)
 
 #endif
@@ -1417,5 +1417,5 @@
   
   SUBROUTINE scatter_mpi_lgen(VarIn, VarOut, dimsize)
-    USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
+    USE mod_phys_lmdz_mpi_data 
     USE mod_grid_phy_lmdz
     IMPLICIT NONE
@@ -1455,5 +1455,5 @@
 #ifdef CPP_MPI
     CALL MPI_SCATTERV(VarTmp,counts,displs,MPI_LOGICAL,VarOut,klon_mpi*dimsize,   &
-                      MPI_LOGICAL,mpi_root_x, COMM_LMDZ_PHY,ierr)
+                      MPI_LOGICAL,mpi_master, COMM_LMDZ_PHY,ierr)
 #endif
 
@@ -1464,5 +1464,5 @@
 
   SUBROUTINE gather_mpi_igen(VarIn, VarOut, dimsize)
-    USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
+    USE mod_phys_lmdz_mpi_data
     USE mod_grid_phy_lmdz
     IMPLICIT NONE
@@ -1500,5 +1500,5 @@
 #ifdef CPP_MPI
     CALL MPI_GATHERV(VarIn,klon_mpi*dimsize,MPI_INTEGER,VarTmp,counts,displs,   &
-                     MPI_INTEGER,mpi_root_x, COMM_LMDZ_PHY,ierr)
+                     MPI_INTEGER,mpi_master, COMM_LMDZ_PHY,ierr)
 #endif
 
@@ -1518,5 +1518,5 @@
 
   SUBROUTINE gather_mpi_rgen(VarIn, VarOut, dimsize)
-    USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
+    USE mod_phys_lmdz_mpi_data 
     USE mod_grid_phy_lmdz
     IMPLICIT NONE
@@ -1553,5 +1553,5 @@
 #ifdef CPP_MPI
     CALL MPI_GATHERV(VarIn,klon_mpi*dimsize,MPI_REAL_LMDZ,VarTmp,counts,displs,   &
-                      MPI_REAL_LMDZ,mpi_root_x, COMM_LMDZ_PHY,ierr)
+                      MPI_REAL_LMDZ,mpi_master, COMM_LMDZ_PHY,ierr)
 #endif
                           
@@ -1570,5 +1570,5 @@
 
   SUBROUTINE gather_mpi_lgen(VarIn, VarOut, dimsize)
-    USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
+    USE mod_phys_lmdz_mpi_data
     USE mod_grid_phy_lmdz
     IMPLICIT NONE
@@ -1606,5 +1606,5 @@
 #ifdef CPP_MPI
     CALL MPI_GATHERV(VarIn,klon_mpi*dimsize,MPI_LOGICAL,VarTmp,counts,displs,   &
-                      MPI_LOGICAL,mpi_root_x, COMM_LMDZ_PHY,ierr)
+                      MPI_LOGICAL,mpi_master, COMM_LMDZ_PHY,ierr)
 #endif
                           
@@ -1625,5 +1625,5 @@
 
   SUBROUTINE reduce_sum_mpi_igen(VarIn,VarOut,nb)
-    USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
+    USE mod_phys_lmdz_mpi_data 
     USE mod_grid_phy_lmdz
     IMPLICIT NONE
@@ -1645,5 +1645,5 @@
 
 #ifdef CPP_MPI
-    CALL MPI_REDUCE(VarIn,VarOut,nb,MPI_INTEGER,MPI_SUM,mpi_root_x,COMM_LMDZ_PHY,ierr)
+    CALL MPI_REDUCE(VarIn,VarOut,nb,MPI_INTEGER,MPI_SUM,mpi_master,COMM_LMDZ_PHY,ierr)
 #endif
             
@@ -1651,5 +1651,5 @@
   
   SUBROUTINE reduce_sum_mpi_rgen(VarIn,VarOut,nb)
-    USE mod_phys_lmdz_mpi_data , mpi_root_x=>mpi_root
+    USE mod_phys_lmdz_mpi_data 
     USE mod_grid_phy_lmdz
 
@@ -1671,5 +1671,5 @@
    
 #ifdef CPP_MPI
-    CALL MPI_REDUCE(VarIn,VarOut,nb,MPI_REAL_LMDZ,MPI_SUM,mpi_root_x,COMM_LMDZ_PHY,ierr)
+    CALL MPI_REDUCE(VarIn,VarOut,nb,MPI_REAL_LMDZ,MPI_SUM,mpi_master,COMM_LMDZ_PHY,ierr)
 #endif
         
@@ -1901,2 +1901,3 @@
 
 END MODULE mod_phys_lmdz_mpi_transfert
+
Index: LMDZ5/trunk/libf/phy_common/mod_phys_lmdz_para.F90
===================================================================
--- LMDZ5/trunk/libf/phy_common/mod_phys_lmdz_para.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phy_common/mod_phys_lmdz_para.F90	(revision 2351)
@@ -16,12 +16,12 @@
 CONTAINS
 
-  SUBROUTINE Init_phys_lmdz_para(iim,jjp1,nb_proc,distrib)
+  SUBROUTINE Init_phys_lmdz_para(nbp,nbp_lon,nbp_lat,communicator)
   IMPLICIT NONE
-    INTEGER,INTENT(in) :: iim
-    INTEGER,INTENT(in) :: jjp1
-    INTEGER,INTENT(in) :: nb_proc
-    INTEGER,INTENT(in) :: distrib(0:nb_proc-1)
+    INTEGER,INTENT(in) :: nbp
+    INTEGER,INTENT(in) :: nbp_lon
+    INTEGER,INTENT(in) :: nbp_lat
+    INTEGER,INTENT(in) :: communicator
 
-    CALL Init_phys_lmdz_mpi_data(iim,jjp1,nb_proc,distrib)
+    CALL Init_phys_lmdz_mpi_data(nbp,nbp_lon,nbp_lat,communicator)
 !$OMP PARALLEL
     CALL Init_phys_lmdz_omp_data(klon_mpi)
Index: LMDZ5/trunk/libf/phy_common/physics_distribution_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phy_common/physics_distribution_mod.F90	(revision 2351)
+++ LMDZ5/trunk/libf/phy_common/physics_distribution_mod.F90	(revision 2351)
@@ -0,0 +1,71 @@
+!
+!$Id$
+!
+MODULE physics_distribution_mod
+
+
+CONTAINS
+
+  SUBROUTINE init_physics_distribution(grid_type, nvertex, &
+                                       nbp, nbp_lon, nbp_lat, nbp_lev, &
+                                       communicator)
+  USE mod_phys_lmdz_para, ONLY: init_phys_lmdz_para
+  USE mod_grid_phy_lmdz, ONLY: init_grid_phy_lmdz
+  IMPLICIT NONE
+    INTEGER,INTENT(IN) :: grid_type 
+    INTEGER,INTENT(IN) :: nvertex 
+    INTEGER,INTENT(IN) :: nbp           
+    INTEGER,INTENT(IN) :: nbp_lon
+    INTEGER,INTENT(IN) :: nbp_lat
+    INTEGER,INTENT(IN) :: nbp_lev
+    INTEGER,INTENT(IN) :: communicator
+
+
+    CALL init_grid_phy_lmdz(grid_type,nvertex, nbp_lon,nbp_lat,nbp_lev)
+    CALL init_phys_lmdz_para(nbp,nbp_lon, nbp_lat, communicator)
+
+  END SUBROUTINE init_physics_distribution  
+
+!SUBROUTINE Init_Phys_lmdz(iim,jjp1,llm,nb_proc,distrib)
+!  USE mod_phys_lmdz_para, ONLY: Init_phys_lmdz_para!, klon_omp
+!  USE mod_grid_phy_lmdz, ONLY: Init_grid_phy_lmdz!, nbp_lev
+!  USE dimphy, ONLY : Init_dimphy
+!  USE infotrac_phy, ONLY : type_trac
+!#ifdef REPROBUS
+!  USE CHEM_REP, ONLY : Init_chem_rep_phys
+!#endif
+
+!  IMPLICIT NONE
+  
+!    INTEGER,INTENT(in) :: iim
+!    INTEGER,INTENT(in) :: jjp1
+!    INTEGER,INTENT(in) :: llm
+!    INTEGER,INTENT(in) :: nb_proc
+!    INTEGER,INTENT(in) :: distrib(0:nb_proc-1)
+
+
+!    CALL Init_grid_phy_lmdz(iim,jjp1,llm)
+!    CALL Init_phys_lmdz_para(iim,jjp1,nb_proc,distrib)
+!!$OMP PARALLEL
+!    CALL Init_dimphy(klon_omp,nbp_lev)
+!
+!! Initialization of Reprobus
+!    IF (type_trac == 'repr') THEN
+!#ifdef REPROBUS
+!       CALL Init_chem_rep_phys(klon_omp,nbp_lev)
+!#endif
+!    END IF
+!
+!!$OMP END PARALLEL
+ 
+!END SUBROUTINE Init_Phys_lmdz  
+
+
+
+
+
+
+
+
+END MODULE physics_distribution_mod
+
Index: LMDZ5/trunk/libf/phydev/comgeomphy.F90
===================================================================
--- LMDZ5/trunk/libf/phydev/comgeomphy.F90	(revision 2350)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link ../phylmd/comgeomphy.F90
Index: LMDZ5/trunk/libf/phydev/init_phys_lmdz.F90
===================================================================
--- LMDZ5/trunk/libf/phydev/init_phys_lmdz.F90	(revision 2350)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link ../phylmd/init_phys_lmdz.F90
Index: LMDZ5/trunk/libf/phydev/phyaqua_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phydev/phyaqua_mod.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phydev/phyaqua_mod.F90	(revision 2351)
@@ -8,5 +8,5 @@
 CONTAINS
 
-  SUBROUTINE iniaqua(nlon, latfi, lonfi, iflag_phys)
+  SUBROUTINE iniaqua(nlon, iflag_phys)
 
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -17,9 +17,8 @@
   USE phys_state_var_mod, ONLY: rlat, rlon, phys_state_var_init
   USE mod_phys_lmdz_para, ONLY: klon_omp
-  USE comgeomphy, ONLY: rlond, rlatd
+  USE geometry_mod, ONLY: longitude_deg, latitude_deg
   IMPLICIT NONE
       
   INTEGER,INTENT(IN) :: nlon,iflag_phys
-  REAL,INTENT(IN) :: lonfi(nlon),latfi(nlon)
 
   ! local variables
@@ -31,6 +30,6 @@
   CALL phys_state_var_init()
 
-  rlat(1:klon_omp)=rlatd(1:klon_omp)*180./pi
-  rlon(1:klon_omp)=rlond(1:klon_omp)*180./pi
+  rlat(1:klon_omp)=latitude_deg(1:klon_omp)
+  rlon(1:klon_omp)=longitude_deg(1:klon_omp)
 
 
Index: LMDZ5/trunk/libf/phydev/physiq.F90
===================================================================
--- LMDZ5/trunk/libf/phydev/physiq.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phydev/physiq.F90	(revision 2351)
@@ -5,5 +5,5 @@
      &            debut,lafin,jD_cur, jH_cur,pdtphys, &
      &            paprs,pplay,pphi,pphis,presnivs, &
-     &            u,v,t,qx, &
+     &            u,v,rot,t,qx, &
      &            flxmass_w, &
      &            d_u, d_v, d_t, d_qx, d_ps &
@@ -12,5 +12,5 @@
       USE dimphy, only : klon,klev
       USE infotrac_phy, only : nqtot
-      USE comgeomphy, only : rlatd
+      USE geometry_mod, only : latitude
       USE comcstphy, only : rg
       USE iophy, only : histbeg_phy,histwrite_phy
@@ -53,4 +53,6 @@
       real,intent(out) :: d_ps(klon) ! physics tendency on surface pressure
       real,intent(in) :: dudyn(nbp_lon+1,nbp_lat,klev) ! Not used
+      REAL, intent(in):: rot(klon, klev) ! Not used
+      ! relative vorticity, in s-1, needed for frontal waves 
 
 integer,save :: itau=0 ! counter to count number of calls to physics
@@ -157,5 +159,5 @@
 ! newtonian relaxation towards temp_newton()
 do k=1,klev
-  temp_newton(1:klon,k)=280.+cos(rlatd(1:klon))*40.-pphi(1:klon,k)/rg*6.e-3
+  temp_newton(1:klon,k)=280.+cos(latitude(1:klon))*40.-pphi(1:klon,k)/rg*6.e-3
   d_t(1:klon,k)=(temp_newton(1:klon,k)-t(1:klon,k))/1.e5
 enddo
Index: LMDZ5/trunk/libf/phylmd/calcul_divers.h
===================================================================
--- LMDZ5/trunk/libf/phylmd/calcul_divers.h	(revision 2350)
+++ LMDZ5/trunk/libf/phylmd/calcul_divers.h	(revision 2351)
@@ -8,5 +8,5 @@
          DO i=1, klon
             IF(pctsrf(i,is_ter).GT.0.) THEN
-               paire_ter(i)=airephy(i)*pctsrf(i,is_ter)
+               paire_ter(i)=cell_area(i)*pctsrf(i,is_ter)
             ENDIF 
          ENDDO
Index: LMDZ5/trunk/libf/phylmd/carbon_cycle_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/carbon_cycle_mod.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phylmd/carbon_cycle_mod.F90	(revision 2351)
@@ -86,5 +86,5 @@
 
     USE dimphy
-    USE comgeomphy
+    USE geometry_mod, ONLY : cell_area 
     USE mod_phys_lmdz_transfert_para
     USE infotrac_phy, ONLY: nbtr, nqo, niadv, tname
@@ -290,5 +290,5 @@
 ! 5) Calculate total area of the earth surface
 ! --------------------------------------------
-    CALL reduce_sum(SUM(airephy),airetot)
+    CALL reduce_sum(SUM(cell_area),airetot)
     CALL bcast(airetot)
 
@@ -309,7 +309,7 @@
     USE phys_cal_mod, ONLY : mth_cur, mth_len
     USE phys_cal_mod, ONLY : day_cur
-    USE comgeomphy
     USE indice_sol_mod
     USE print_control_mod, ONLY: lunout
+    USE geometry_mod, ONLY : cell_area
 
     IMPLICIT NONE
@@ -444,5 +444,5 @@
 
           ! Calculate a global mean value of delta CO2 flux
-          fco2_tmp(1:klon) = fco2_tmp(1:klon) * airephy(1:klon)
+          fco2_tmp(1:klon) = fco2_tmp(1:klon) * cell_area(1:klon)
           CALL reduce_sum(SUM(fco2_tmp),sumtmp)
           CALL bcast(sumtmp)
Index: LMDZ5/trunk/libf/phylmd/comgeomphy.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/comgeomphy.F90	(revision 2350)
+++ 	(revision )
@@ -1,23 +1,0 @@
-module comgeomphy
-   real,save,allocatable :: airephy(:)
-   real,save,allocatable :: cuphy(:)
-   real,save,allocatable :: cvphy(:)
-   real,save,allocatable :: rlatd(:)
-   real,save,allocatable :: rlond(:)
-!$OMP THREADPRIVATE(airephy,cuphy,cvphy,rlatd,rlond)
-contains
-  
-  subroutine InitComgeomphy
-  USE mod_phys_lmdz_para
-  implicit none
-    
- 
-    allocate(airephy(klon_omp))
-    allocate(cuphy(klon_omp))
-    allocate(cvphy(klon_omp))
-    allocate(rlatd(klon_omp))
-    allocate(rlond(klon_omp))
-
-  end subroutine InitComgeomphy
-  
-end module comgeomphy
Index: LMDZ5/trunk/libf/phylmd/comgeomphy.h
===================================================================
--- LMDZ5/trunk/libf/phylmd/comgeomphy.h	(revision 2350)
+++ 	(revision )
@@ -1,9 +1,0 @@
-!
-! $Header$
-!
-c
-c
-c Common de passage de la geometrie de la dynamique a la physique
-      real airephy(klon),cuphy(klon),cvphy(klon)
-      REAL rlatd(klon), rlond(klon)
-      common/comgeomphy/airephy,cuphy,cvphy,rlatd, rlond
Index: LMDZ5/trunk/libf/phylmd/dyn1d/lmdz1d.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/dyn1d/lmdz1d.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phylmd/dyn1d/lmdz1d.F90	(revision 2351)
@@ -24,4 +24,5 @@
       USE print_control_mod, ONLY: prt_level
       USE iniphysiq_mod, ONLY: iniphysiq
+      USE mod_const_mpi, ONLY: comm_lmdz
 
       implicit none
@@ -486,5 +487,5 @@
 ! Initialization of dimensions, geometry and initial state
 !---------------------------------------------------------------------
-      call init_phys_lmdz(1,1,llm,1,(/1/))
+!      call init_phys_lmdz(1,1,llm,1,(/1/)) ! job now done via iniphysiq
       call suphel
       call infotrac_init 
@@ -626,5 +627,7 @@
      ! e.g. for cell boundaries, which are meaningless in 1D; so pad these 
      ! with '0.' when necessary
-      call iniphysiq(iim,jjm,llm,rday,day_ini,timestep,  &
+      call iniphysiq(iim,jjm,llm, &
+           1,comm_lmdz, &
+           rday,day_ini,timestep,  &
            (/rlat_rad(1),0./),(/0./), &
            (/0.,0./),(/rlon_rad(1),0./),  &
Index: LMDZ5/trunk/libf/phylmd/dyn1d/mod_interface_dyn_phys.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/dyn1d/mod_interface_dyn_phys.F90	(revision 2351)
+++ LMDZ5/trunk/libf/phylmd/dyn1d/mod_interface_dyn_phys.F90	(revision 2351)
@@ -0,0 +1,1 @@
+link ../../dynlonlat_phylonlat/mod_interface_dyn_phys.F90
Index: LMDZ5/trunk/libf/phylmd/init_be.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/init_be.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phylmd/init_be.F90	(revision 2351)
@@ -5,7 +5,7 @@
 
   USE dimphy
-  USE comgeomphy
   USE infotrac_phy, ONLY : nbtr
   USE indice_sol_mod
+  USE geometry_mod, ONLY : longitude, latitude
     
   IMPLICIT NONE 
@@ -114,8 +114,8 @@
 
   DO i = 1,klon
-     qcos=sin(glt)*sin(rlatd(i))
+     qcos=sin(glt)*sin(latitude(i))
 !!jyg
-!!     qcos=qcos+cos(glt)*cos(rlatd(i))*cos(rlond(i)+glg)
-     qcos=qcos+cos(glt)*cos(rlatd(i))*cos(rlond(i)-glg)
+!!     qcos=qcos+cos(glt)*cos(latitude(i))*cos(longitude(i)+glg)
+     qcos=qcos+cos(glt)*cos(latitude(i))*cos(longitude(i)-glg)
 !!jyg end
      IF ( qcos .LT. -1.) qcos = -1.
Index: LMDZ5/trunk/libf/phylmd/init_phys_lmdz.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/init_phys_lmdz.F90	(revision 2350)
+++ 	(revision )
@@ -1,36 +1,0 @@
-!
-!$Header$
-!
-SUBROUTINE Init_Phys_lmdz(iim,jjp1,llm,nb_proc,distrib)
-  USE mod_phys_lmdz_para, ONLY: Init_phys_lmdz_para, klon_omp
-  USE mod_grid_phy_lmdz, ONLY: Init_grid_phy_lmdz, nbp_lev
-  USE dimphy, ONLY : Init_dimphy
-  USE infotrac_phy, ONLY : type_trac
-#ifdef REPROBUS
-  USE CHEM_REP, ONLY : Init_chem_rep_phys
-#endif
-
-  IMPLICIT NONE
-  
-    INTEGER,INTENT(in) :: iim
-    INTEGER,INTENT(in) :: jjp1
-    INTEGER,INTENT(in) :: llm
-    INTEGER,INTENT(in) :: nb_proc
-    INTEGER,INTENT(in) :: distrib(0:nb_proc-1)
-
-
-    CALL Init_grid_phy_lmdz(iim,jjp1,llm)
-    CALL Init_phys_lmdz_para(iim,jjp1,nb_proc,distrib)
-!$OMP PARALLEL
-    CALL Init_dimphy(klon_omp,nbp_lev)
-
-! Initialization of Reprobus
-    IF (type_trac == 'repr') THEN
-#ifdef REPROBUS
-       CALL Init_chem_rep_phys(klon_omp,nbp_lev)
-#endif
-    END IF
-
-!$OMP END PARALLEL
- 
-END SUBROUTINE Init_Phys_lmdz  
Index: LMDZ5/trunk/libf/phylmd/lsc_scav.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/lsc_scav.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phylmd/lsc_scav.F90	(revision 2351)
@@ -14,5 +14,4 @@
   USE traclmdz_mod
   USE infotrac_phy,ONLY : nbtr
-  USE comgeomphy
   USE iophy
   IMPLICIT NONE 
Index: LMDZ5/trunk/libf/phylmd/mod_surf_para.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/mod_surf_para.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phylmd/mod_surf_para.F90	(revision 2351)
@@ -49,5 +49,5 @@
 
   SUBROUTINE Init_surf_para(knon)
-  USE mod_phys_lmdz_para, mpi_rank_root=>mpi_root
+  USE mod_phys_lmdz_para
 #ifdef CPP_MPI
   INCLUDE 'mpif.h'
@@ -168,5 +168,5 @@
      
   SUBROUTINE gather_surf_mpi_i(FieldIn,FieldOut)
-  USE mod_phys_lmdz_para, mpi_rank_root => mpi_root
+  USE mod_phys_lmdz_para
 #ifdef CPP_MPI
   INCLUDE 'mpif.h'
@@ -180,5 +180,5 @@
       CALL MPI_Gatherv(FieldIn,knon_mpi,MPI_INTEGER,                                &
                        FieldOut,knon_mpi_para,knon_mpi_begin_para(:)-1,MPI_INTEGER, &
-                       mpi_rank_root,COMM_LMDZ_PHY,ierr)
+                       mpi_master,COMM_LMDZ_PHY,ierr)
 #endif
     ELSE
@@ -223,5 +223,5 @@
      
   SUBROUTINE gather_surf_mpi_r(FieldIn,FieldOut)
-  USE mod_phys_lmdz_para, mpi_rank_root => mpi_root
+  USE mod_phys_lmdz_para
 #ifdef CPP_MPI
   INCLUDE 'mpif.h'
@@ -235,5 +235,5 @@
       CALL MPI_Gatherv(FieldIn,knon_mpi,MPI_REAL_LMDZ,                                 &
                        FieldOut,knon_mpi_para,knon_mpi_begin_para(:)-1,MPI_REAL_LMDZ,  &
-                       mpi_rank_root,COMM_LMDZ_PHY,ierr)            
+                       mpi_master,COMM_LMDZ_PHY,ierr)            
 #endif
     ELSE
@@ -276,5 +276,5 @@
      
   SUBROUTINE scatter_surf_mpi_i(FieldIn,FieldOut)
-  USE mod_phys_lmdz_para, mpi_rank_root => mpi_root
+  USE mod_phys_lmdz_para
 #ifdef CPP_MPI
   INCLUDE 'mpif.h'
@@ -288,5 +288,5 @@
       CALL MPI_Scatterv(FieldIn,knon_mpi_para,knon_mpi_begin_para(:)-1,MPI_INTEGER,   &
                         FieldOut,knon_mpi,MPI_INTEGER,                                &
-                        mpi_rank_root,COMM_LMDZ_PHY,ierr)
+                        mpi_master,COMM_LMDZ_PHY,ierr)
 #endif
     ELSE
@@ -328,5 +328,5 @@
      
   SUBROUTINE scatter_surf_mpi_r(FieldIn,FieldOut)
-  USE mod_phys_lmdz_para, mpi_rank_root => mpi_root
+  USE mod_phys_lmdz_para
 #ifdef CPP_MPI
   INCLUDE 'mpif.h'
@@ -340,5 +340,5 @@
       CALL MPI_Scatterv(FieldIn,knon_mpi_para,knon_mpi_begin_para(:)-1,MPI_INTEGER,   &
                         FieldOut,knon_mpi,MPI_INTEGER,                                &
-                        mpi_rank_root,COMM_LMDZ_PHY,ierr)
+                        mpi_master,COMM_LMDZ_PHY,ierr)
 #endif
     ELSE
@@ -349,2 +349,3 @@
 
 END MODULE mod_surf_para
+
Index: LMDZ5/trunk/libf/phylmd/phyaqua_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/phyaqua_mod.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phylmd/phyaqua_mod.F90	(revision 2351)
@@ -5,5 +5,5 @@
 CONTAINS
 
-  SUBROUTINE iniaqua(nlon, latfi, lonfi, iflag_phys)
+  SUBROUTINE iniaqua(nlon, iflag_phys)
 
     ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -19,6 +19,6 @@
     ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-    USE comgeomphy, ONLY: rlatd, rlond
     USE dimphy, ONLY: klon
+    USE geometry_mod, ONLY : latitude
     USE surface_data, ONLY: type_ocean, ok_veget
     USE pbl_surface_mod, ONLY: pbl_surface_init
@@ -38,5 +38,5 @@
     INTEGER, INTENT (IN) :: nlon, iflag_phys
     ! IM ajout latfi, lonfi
-    REAL, INTENT (IN) :: lonfi(nlon), latfi(nlon)
+!    REAL, INTENT (IN) :: lonfi(nlon), latfi(nlon)
 
     INTEGER type_profil, type_aqua
@@ -117,8 +117,8 @@
     INTEGER l, ierr, aslun
 
-    REAL longitude, latitude
+!    REAL longitude, latitude
     REAL paire
 
-    DATA latitude, longitude/48., 0./
+!    DATA latitude, longitude/48., 0./
 
     ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -149,8 +149,8 @@
 
     ! IM ajout latfi, lonfi
-    rlatd = latfi
-    rlond = lonfi
-    rlat = rlatd*180./pi
-    rlon = rlond*180./pi
+!    rlatd = latfi
+!    rlond = lonfi
+!    rlat = rlatd*180./pi
+!    rlon = rlond*180./pi
 
     ! -----------------------------------------------------------------------
@@ -160,7 +160,7 @@
     day_ini = day_ref
     day_end = day_ini + ndays
-    airefi = 1.
-    zcufi = 1.
-    zcvfi = 1.
+!    airefi = 1.
+!    zcufi = 1.
+!    zcvfi = 1.
     !$OMP MASTER
     nbapp_rad_omp = 24
@@ -260,5 +260,5 @@
     END DO
     ! IM calcul profil sst
-    CALL profil_sst(nlon, rlatd, type_profil, phy_sst)
+    CALL profil_sst(nlon, latitude, type_profil, phy_sst)
 
     CALL writelim(klon, phy_nat, phy_alb, phy_sst, phy_bil, phy_rug, phy_ice, &
Index: LMDZ5/trunk/libf/phylmd/phys_output_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/phys_output_mod.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phylmd/phys_output_mod.F90	(revision 2351)
@@ -531,5 +531,4 @@
     real                :: ttt,xxx,timestep,dayseconde,dtime
     parameter (dayseconde=86400.)
-    include "comconst.h"
 
     ipos=scan(str,'0123456789.',.TRUE.)
Index: LMDZ5/trunk/libf/phylmd/phys_output_write_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/phys_output_write_mod.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phylmd/phys_output_write_mod.F90	(revision 2351)
@@ -248,5 +248,5 @@
     USE indice_sol_mod, only: nbsrf
     USE infotrac_phy, only: nqtot, nqo, type_trac
-    USE comgeomphy, only: airephy
+    USE geometry_mod, only: cell_area
     USE surface_data, only: type_ocean, version_ocean, ok_veget, ok_snow
 !    USE aero_mod, only: naero_spc
@@ -337,5 +337,5 @@
 !!! Champs 1D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        CALL histwrite_phy(o_phis, pphis)
-       CALL histwrite_phy(o_aire, airephy)
+       CALL histwrite_phy(o_aire, cell_area)
 
        IF (vars_defined) THEN
Index: LMDZ5/trunk/libf/phylmd/physiq.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/physiq.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phylmd/physiq.F90	(revision 2351)
@@ -12,5 +12,5 @@
   USE ioipsl, only: histbeg, histvert, histdef, histend, histsync, &
        histwrite, ju2ymds, ymds2ju, getin
-  USE comgeomphy
+  USE geometry_mod, ONLY: cell_area, latitude_deg, longitude_deg
   USE phys_cal_mod, only: year_len, mth_len, days_elapsed, jh_1jan, year_cur, &
        mth_cur,jD_cur, jH_cur, jD_ref, phys_cal_update
@@ -923,5 +923,5 @@
      igout=klon/2+1/klon
      write(lunout,*) 'DEBUT DE PHYSIQ !!!!!!!!!!!!!!!!!!!!'
-     write(lunout,*) 'igout, rlat, rlon ',igout, rlatd(igout)*180./3.141593, rlond(igout)*180./3.141593
+     write(lunout,*) 'igout, rlat, rlon ',igout, latitude_deg(igout), longitude_deg(igout)
      write(lunout,*) &
           'nlon,klev,nqtot,debut,lafin, jD_cur, jH_cur,pdtphys'
@@ -1356,5 +1356,5 @@
              rg, &
              ra, &
-             airephy, &
+             cell_area, &
              rlat, &
              rlon, &
@@ -1563,5 +1563,5 @@
   IF (ip_ebil_phy.ge.1) THEN 
      ztit='after dynamic'
-     CALL diagetpq(airephy,ztit,ip_ebil_phy,1,1,dtime &
+     CALL diagetpq(cell_area,ztit,ip_ebil_phy,1,1,dtime &
           , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
           , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
@@ -1570,5 +1570,5 @@
      !     est egale a la variation de la physique au pas de temps precedent.
      !     Donc la somme de ces 2 variations devrait etre nulle.
-     call diagphy(airephy,ztit,ip_ebil_phy &
+     call diagphy(cell_area,ztit,ip_ebil_phy &
           , zero_v, zero_v, zero_v, zero_v, zero_v &
           , zero_v, zero_v, zero_v, ztsol &
@@ -1774,8 +1774,8 @@
   IF (ip_ebil_phy.ge.2) THEN 
      ztit='after reevap'
-     CALL diagetpq(airephy,ztit,ip_ebil_phy,2,1,dtime &
+     CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,1,dtime &
           , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
           , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
-     call diagphy(airephy,ztit,ip_ebil_phy &
+     call diagphy(cell_area,ztit,ip_ebil_phy &
           , zero_v, zero_v, zero_v, zero_v, zero_v &
           , zero_v, zero_v, zero_v, ztsol &
@@ -2032,8 +2032,8 @@
      IF (ip_ebil_phy.ge.2) THEN 
         ztit='after surface_main'
-        CALL diagetpq(airephy,ztit,ip_ebil_phy,2,2,dtime &
+        CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime &
              , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
              , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
-        call diagphy(airephy,ztit,ip_ebil_phy &
+        call diagphy(cell_area,ztit,ip_ebil_phy &
              , zero_v, zero_v, zero_v, zero_v, sens &
              , evap  , zero_v, zero_v, ztsol &
@@ -2082,5 +2082,5 @@
   ENDDO
   IF (check) THEN
-     za = qcheck(klon,klev,paprs,q_seri,ql_seri,airephy)
+     za = qcheck(klon,klev,paprs,q_seri,ql_seri,cell_area)
      WRITE(lunout,*) "avantcon=", za
   ENDIF
@@ -2102,5 +2102,5 @@
   DO k = 1, klev
      DO i = 1, klon
-        omega(i,k) = RG*flxmass_w(i,k) / airephy(i)
+        omega(i,k) = RG*flxmass_w(i,k) / cell_area(i)
      END DO
   END DO
@@ -2488,8 +2488,8 @@
   IF (ip_ebil_phy.ge.2) THEN 
      ztit='after convect'
-     CALL diagetpq(airephy,ztit,ip_ebil_phy,2,2,dtime &
+     CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime &
           , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
           , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
-     call diagphy(airephy,ztit,ip_ebil_phy &
+     call diagphy(cell_area,ztit,ip_ebil_phy &
           , zero_v, zero_v, zero_v, zero_v, zero_v &
           , zero_v, rain_con, snow_con, ztsol &
@@ -2499,12 +2499,12 @@
   !
   IF (check) THEN
-     za = qcheck(klon,klev,paprs,q_seri,ql_seri,airephy)
+     za = qcheck(klon,klev,paprs,q_seri,ql_seri,cell_area)
      WRITE(lunout,*)"aprescon=", za
      zx_t = 0.0
      za = 0.0
      DO i = 1, klon
-        za = za + airephy(i)/REAL(klon)
+        za = za + cell_area(i)/REAL(klon)
         zx_t = zx_t + (rain_con(i)+ &
-             snow_con(i))*airephy(i)/REAL(klon)
+             snow_con(i))*cell_area(i)/REAL(klon)
      ENDDO
      zx_t = zx_t/za*dtime
@@ -2653,8 +2653,8 @@
   IF (ip_ebil_phy.ge.2) THEN 
      ztit='after wake'
-     CALL diagetpq(airephy,ztit,ip_ebil_phy,2,2,dtime &
+     CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime &
           , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
           , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
-     call diagphy(airephy,ztit,ip_ebil_phy &
+     call diagphy(cell_area,ztit,ip_ebil_phy &
           , zero_v, zero_v, zero_v, zero_v, zero_v &
           , zero_v, zero_v, zero_v, ztsol &
@@ -2746,5 +2746,5 @@
              ,ztv,zpspsk,ztla,zthl &
              !cc nrlmd le 10/04/2012
-             ,pbl_tke_input,pctsrf,omega,airephy &
+             ,pbl_tke_input,pctsrf,omega,cell_area &
              ,zlcl_th,fraca0,w0,w_conv,therm_tke_max0,env_tke_max0 &
              ,n2,s2,ale_bl_stat &
@@ -2970,8 +2970,8 @@
   IF (ip_ebil_phy.ge.2) THEN 
      ztit='after dry_adjust'
-     CALL diagetpq(airephy,ztit,ip_ebil_phy,2,2,dtime &
+     CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime &
           , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
           , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
-     call diagphy(airephy,ztit,ip_ebil_phy &
+     call diagphy(cell_area,ztit,ip_ebil_phy &
           , zero_v, zero_v, zero_v, zero_v, zero_v &
           , zero_v, zero_v, zero_v, ztsol &
@@ -3023,12 +3023,12 @@
   ENDDO
   IF (check) THEN
-     za = qcheck(klon,klev,paprs,q_seri,ql_seri,airephy)
+     za = qcheck(klon,klev,paprs,q_seri,ql_seri,cell_area)
      WRITE(lunout,*)"apresilp=", za
      zx_t = 0.0
      za = 0.0
      DO i = 1, klon
-        za = za + airephy(i)/REAL(klon)
+        za = za + cell_area(i)/REAL(klon)
         zx_t = zx_t + (rain_lsc(i) &
-             + snow_lsc(i))*airephy(i)/REAL(klon)
+             + snow_lsc(i))*cell_area(i)/REAL(klon)
      ENDDO
      zx_t = zx_t/za*dtime
@@ -3038,8 +3038,8 @@
   IF (ip_ebil_phy.ge.2) THEN 
      ztit='after fisrt'
-     CALL diagetpq(airephy,ztit,ip_ebil_phy,2,2,dtime &
+     CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime &
           , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
           , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
-     call diagphy(airephy,ztit,ip_ebil_phy &
+     call diagphy(cell_area,ztit,ip_ebil_phy &
           , zero_v, zero_v, zero_v, zero_v, zero_v &
           , zero_v, rain_lsc, snow_lsc, ztsol &
@@ -3308,8 +3308,8 @@
   IF (ip_ebil_phy.ge.2) THEN 
      ztit="after diagcld"
-     CALL diagetpq(airephy,ztit,ip_ebil_phy,2,2,dtime &
+     CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime &
           , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
           , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
-     call diagphy(airephy,ztit,ip_ebil_phy &
+     call diagphy(cell_area,ztit,ip_ebil_phy &
           , zero_v, zero_v, zero_v, zero_v, zero_v &
           , zero_v, zero_v, zero_v, ztsol &
@@ -3377,5 +3377,5 @@
         CALL AEROSOL_METEO_CALC( &
              calday,pdtphys,pplay,paprs,t,pmflxr,pmflxs, &
-             prfl,psfl,pctsrf,airephy,rlat,rlon,u10m,v10m)
+             prfl,psfl,pctsrf,cell_area,rlat,rlon,u10m,v10m)
      END IF
 
@@ -3388,5 +3388,5 @@
           rlat, &
           rlon, &
-          airephy, &
+          cell_area, &
           paprs, &
           pplay, &
@@ -3735,8 +3735,8 @@
   IF (ip_ebil_phy.ge.2) THEN 
      ztit='after rad'
-     CALL diagetpq(airephy,ztit,ip_ebil_phy,2,2,dtime &
+     CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime &
           , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
           , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
-     call diagphy(airephy,ztit,ip_ebil_phy &
+     call diagphy(cell_area,ztit,ip_ebil_phy &
           , topsw, toplw, solsw, sollw, zero_v &
           , zero_v, zero_v, zero_v, ztsol &
@@ -3953,8 +3953,8 @@
   IF (ip_ebil_phy.ge.2) THEN 
      ztit='after orography'
-     CALL diagetpq(airephy,ztit,ip_ebil_phy,2,2,dtime &
+     CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime &
           , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
           , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
-     call diagphy(airephy,ztit,ip_ebil_phy &
+     call diagphy(cell_area,ztit,ip_ebil_phy &
           , zero_v, zero_v, zero_v, zero_v, zero_v &
           , zero_v, zero_v, zero_v, ztsol &
@@ -4061,5 +4061,5 @@
           cdragh,coefh(1:klon,1:klev,is_ave),u1,v1,ftsol,pctsrf, &
           frac_impa, frac_nucl, &
-          pphis,airephy,dtime,itap, &
+          pphis,cell_area,dtime,itap, &
           qx(:,:,ivap),da,phi,mp,upwd,dnwd)
 
@@ -4101,5 +4101,5 @@
   IF (ip_ebil_phy.ge.1) THEN 
      ztit='after physic'
-     CALL diagetpq(airephy,ztit,ip_ebil_phy,1,1,dtime &
+     CALL diagetpq(cell_area,ztit,ip_ebil_phy,1,1,dtime &
           , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &
           , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)
@@ -4109,5 +4109,5 @@
      !     Donc la somme de ces 2 variations devrait etre nulle.
 
-     call diagphy(airephy,ztit,ip_ebil_phy &
+     call diagphy(cell_area,ztit,ip_ebil_phy &
           , topsw, toplw, solsw, sollw, sens &
           , evap, rain_fall, snow_fall, ztsol &
@@ -4169,5 +4169,5 @@
           paprs, &
           q_seri, &
-          airephy, &
+          cell_area, &
           pphi, &
           pphis, &
Index: LMDZ5/trunk/libf/phylmd/phytrac_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/phytrac_mod.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phylmd/phytrac_mod.F90	(revision 2351)
@@ -92,5 +92,4 @@
     USE mod_grid_phy_lmdz
     USE mod_phys_lmdz_para
-    USE comgeomphy
     USE iophy
     USE traclmdz_mod
Index: LMDZ5/trunk/libf/phylmd/surf_land_bucket_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/surf_land_bucket_mod.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phylmd/surf_land_bucket_mod.F90	(revision 2351)
@@ -24,5 +24,5 @@
     USE cpl_mod
     USE dimphy
-    USE comgeomphy
+    USE geometry_mod, ONLY: latitude 
     USE mod_grid_phy_lmdz
     USE mod_phys_lmdz_para
@@ -99,5 +99,5 @@
     CALL calbeta(dtime, is_ter, knon, snow, qsol, beta, capsol, dif_grnd)
     if (type_veget=='betaclim') then
-       CALL calbeta_clim(knon,jour,rlatd(knindex(1:knon)),beta)
+       CALL calbeta_clim(knon,jour,latitude(knindex(1:knon)),beta)
     endif
        
Index: LMDZ5/trunk/libf/phylmd/surf_land_orchidee_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/surf_land_orchidee_mod.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phylmd/surf_land_orchidee_mod.F90	(revision 2351)
@@ -16,7 +16,7 @@
   USE cpl_mod,      ONLY : cpl_send_land_fields
   USE surface_data, ONLY : type_ocean
-  USE comgeomphy,   ONLY : cuphy, cvphy
+  USE geometry_mod, ONLY : dx, dy
   USE mod_grid_phy_lmdz
-  USE mod_phys_lmdz_para, mpi_root_rank=>mpi_root
+  USE mod_phys_lmdz_para, mpi_root_rank=>mpi_master
 
   IMPLICIT NONE
@@ -330,6 +330,6 @@
        DO igrid = 1, knon
           ij = knindex(igrid)
-          resolution(igrid,1) = cuphy(ij)
-          resolution(igrid,2) = cvphy(ij)
+          resolution(igrid,1) = dx(ij)
+          resolution(igrid,2) = dy(ij)
        ENDDO
      
Index: LMDZ5/trunk/libf/phylmd/surf_land_orchidee_noopenmp_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/surf_land_orchidee_noopenmp_mod.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phylmd/surf_land_orchidee_noopenmp_mod.F90	(revision 2351)
@@ -21,5 +21,5 @@
   USE cpl_mod,      ONLY : cpl_send_land_fields
   USE surface_data, ONLY : type_ocean
-  USE comgeomphy,   ONLY : cuphy, cvphy
+  USE geometry_mod, ONLY : dx, dy
   USE mod_grid_phy_lmdz
   USE mod_phys_lmdz_para
@@ -334,6 +334,6 @@
        DO igrid = 1, knon
           ij = knindex(igrid)
-          resolution(igrid,1) = cuphy(ij)
-          resolution(igrid,2) = cvphy(ij)
+          resolution(igrid,1) = dx(ij)
+          resolution(igrid,2) = dy(ij)
        ENDDO
      
Index: LMDZ5/trunk/libf/phylmd/thermcellV0_main.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/thermcellV0_main.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phylmd/thermcellV0_main.F90	(revision 2351)
@@ -13,5 +13,4 @@
 
       USE dimphy
-      USE comgeomphy , ONLY:rlond,rlatd
       USE print_control_mod, ONLY: prt_level,lunout
       IMPLICIT NONE
Index: LMDZ5/trunk/libf/phylmd/thermcell_main.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/thermcell_main.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phylmd/thermcell_main.F90	(revision 2351)
@@ -23,5 +23,4 @@
       USE dimphy
       USE ioipsl
-      USE comgeomphy , ONLY:rlond,rlatd
       USE indice_sol_mod
       USE print_control_mod, ONLY: lunout,prt_level
Index: LMDZ5/trunk/libf/phylmd/tracinca_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/tracinca_mod.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phylmd/tracinca_mod.F90	(revision 2351)
@@ -54,5 +54,4 @@
     USE infotrac_phy, ONLY: nbtr
     USE vampir
-    USE comgeomphy
     USE indice_sol_mod
 
Index: LMDZ5/trunk/libf/phylmd/write_histday_seri.h
===================================================================
--- LMDZ5/trunk/libf/phylmd/write_histday_seri.h	(revision 2350)
+++ LMDZ5/trunk/libf/phylmd/write_histday_seri.h	(revision 2351)
@@ -20,5 +20,5 @@
       ok_msk=.FALSE.
       msk(1:klon)=pctsrf(1:klon,is_ter)
-      CALL moyglo_pondaire(klon, zx_tmp_fi2d, airephy,  &
+      CALL moyglo_pondaire(klon, zx_tmp_fi2d, cell_area,  &
            ok_msk, msk, moyglo)
       zx_tmp_fi2d(1:klon)=moyglo
@@ -29,5 +29,5 @@
 !
       ok_msk=.FALSE.
-      CALL moyglo_pondaire(klon, bils, airephy,  &
+      CALL moyglo_pondaire(klon, bils, cell_area,  &
            ok_msk, msk, moyglo)
       zx_tmp_fi2d(1:klon)=moyglo
@@ -45,5 +45,5 @@
 !
       CALL moyglo_pondaima(klon, klev, zx_tmp_fi3d,  &
-           airephy, paprs, moyglo)
+           cell_area, paprs, moyglo)
       zx_tmp_fi2d(1:klon)=moyglo
 !
@@ -62,5 +62,5 @@
 !
       CALL moyglo_pondaima(klon, klev, zx_tmp_fi3d,  &
-           airephy, paprs, moyglo)
+           cell_area, paprs, moyglo)
       zx_tmp_fi2d(1:klon)=moyglo
 !
@@ -76,5 +76,5 @@
 !
       ok_msk=.FALSE.
-      CALL moyglo_pondaire(klon, zx_tmp_fi2d, airephy,  &
+      CALL moyglo_pondaire(klon, zx_tmp_fi2d, cell_area,  &
            ok_msk, msk, moyglo)
       zx_tmp_fi2d(1:klon)=moyglo
@@ -87,5 +87,5 @@
 !
 !IM 190504 BEG
-      CALL gr_fi_dyn(1,klon,nbp_lon+1,nbp_lat,airephy,airedyn)
+      CALL gr_fi_dyn(1,klon,nbp_lon+1,nbp_lat,cell_area,airedyn)
       CALL gr_fi_dyn(klev+1,klon,nbp_lon+1,nbp_lat,paprs,padyn)
       CALL gr_fi_dyn(1,klon,nbp_lon+1,nbp_lat,rlat,rlatdyn)
@@ -120,6 +120,6 @@
 !
 !
-      CALL gr_fi_dyn(1,klon,nbp_lon+1,nbp_lat,airephy,airedyn)
-      CALL gr_fi_ecrit(1,klon,nbp_lon,nbp_lat,airephy,zx_tmp_2d)
+      CALL gr_fi_dyn(1,klon,nbp_lon+1,nbp_lat,cell_area,airedyn)
+      CALL gr_fi_ecrit(1,klon,nbp_lon,nbp_lat,cell_area,zx_tmp_2d)
       airetot=0.
 !     DO j = 1, nbp_lat
@@ -134,5 +134,5 @@
 !
       DO i=1, klon
-       airetot=airetot+airephy(i)
+       airetot=airetot+cell_area(i)
       ENDDO
 !     IF(itap.EQ.1) PRINT*,'airetotphy=',airetot
@@ -161,5 +161,5 @@
 !
       CALL moyglo_pondmass(klon, klev, t_seri, &
-           airephy, paprs, moyglo)
+           cell_area, paprs, moyglo)
       zx_tmp_fi2d(1:klon)=moyglo
 !
@@ -169,5 +169,5 @@
 !
       ok_msk=.FALSE.
-      CALL moyglo_pondaire(klon, paprs(:,1), airephy,  &
+      CALL moyglo_pondaire(klon, paprs(:,1), cell_area,  &
            ok_msk, msk, moyglo)
       zx_tmp_fi2d(1:klon)=moyglo
@@ -178,5 +178,5 @@
 !
       ok_msk=.FALSE.
-      CALL moyglo_pondaire(klon, evap, airephy,  &
+      CALL moyglo_pondaire(klon, evap, cell_area,  &
            ok_msk, msk, moyglo)
       zx_tmp_fi2d(1:klon)=moyglo
@@ -192,5 +192,5 @@
 !     ok_msk=.TRUE.
 !     msk(1:klon)=pctsrf(1:klon,is_ter)
-!     CALL moyglo_pondaire(klon, zx_tmp_fi2d, airephy, 
+!     CALL moyglo_pondaire(klon, zx_tmp_fi2d, cell_area, 
 !    .                     ok_msk, msk, moyglo)
 !     zx_tmp_fi2d(1:klon)=moyglo
@@ -208,5 +208,5 @@
 !     ok_msk=.TRUE.
 !     msk(1:klon)=pctsrf(1:klon,is_ter)
-!     CALL moyglo_pondaire(klon, zx_tmp_fi2d, airephy, 
+!     CALL moyglo_pondaire(klon, zx_tmp_fi2d, cell_area, 
 !    .     ok_msk, msk, moyglo)
 !     zx_tmp_fi2d(1:klon)=moyglo
@@ -222,5 +222,5 @@
       ok_msk=.TRUE.
       msk(1:klon)=pctsrf(1:klon,is_oce)
-      CALL moyglo_pondaire(klon, zx_tmp_fi2d, airephy,  &
+      CALL moyglo_pondaire(klon, zx_tmp_fi2d, cell_area,  &
            ok_msk, msk, moyglo)
       zx_tmp_fi2d(1:klon)=moyglo
Index: LMDZ5/trunk/libf/phylmd/write_paramLMDZ_phy.h
===================================================================
--- LMDZ5/trunk/libf/phylmd/write_paramLMDZ_phy.h	(revision 2350)
+++ LMDZ5/trunk/libf/phylmd/write_paramLMDZ_phy.h	(revision 2351)
@@ -2,24 +2,24 @@
 ! calcul moyennes globales
 !
-       zx_tmp_fi2d=bils*airephy
-       CALL global_mean(zx_tmp_fi2d,airephy,.TRUE.,gbils)
-       zx_tmp_fi2d=evap*airephy
-       CALL global_mean(zx_tmp_fi2d,airephy,.TRUE.,gevap)
-       zx_tmp_fi2d(:)=fevap(:, is_ter)*airephy(:)
-       CALL global_mean(zx_tmp_fi2d,airephy,.TRUE.,gevapt)
-       zx_tmp_fi2d=zxfluxlat*airephy
-       CALL global_mean(zx_tmp_fi2d,airephy,.TRUE.,glat)
-       zx_tmp_fi2d=(topsw0-toplw0)*airephy
-       CALL global_mean(zx_tmp_fi2d,airephy,.TRUE.,gnet0)
-       zx_tmp_fi2d=(topsw-toplw)*airephy
-       CALL global_mean(zx_tmp_fi2d,airephy,.TRUE.,gnet)
-       zx_tmp_fi2d=(rain_fall+snow_fall)*airephy
-       CALL global_mean(zx_tmp_fi2d,airephy,.TRUE.,grain)
-       zx_tmp_fi2d=zxtsol*airephy
-       CALL global_mean(zx_tmp_fi2d,airephy,.TRUE.,gtsol)
-       zx_tmp_fi2d=zt2m*airephy
-       CALL global_mean(zx_tmp_fi2d,airephy,.TRUE.,gt2m)
-       zx_tmp_fi2d=prw*airephy
-       CALL global_mean(zx_tmp_fi2d,airephy,.TRUE.,gprw)
+       zx_tmp_fi2d=bils*cell_area
+       CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gbils)
+       zx_tmp_fi2d=evap*cell_area
+       CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gevap)
+       zx_tmp_fi2d(:)=fevap(:, is_ter)*cell_area(:)
+       CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gevapt)
+       zx_tmp_fi2d=zxfluxlat*cell_area
+       CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,glat)
+       zx_tmp_fi2d=(topsw0-toplw0)*cell_area
+       CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gnet0)
+       zx_tmp_fi2d=(topsw-toplw)*cell_area
+       CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gnet)
+       zx_tmp_fi2d=(rain_fall+snow_fall)*cell_area
+       CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,grain)
+       zx_tmp_fi2d=zxtsol*cell_area
+       CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gtsol)
+       zx_tmp_fi2d=zt2m*cell_area
+       CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gt2m)
+       zx_tmp_fi2d=prw*cell_area
+       CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gprw)
 !
 !$OMP MASTER
Index: LMDZ5/trunk/libf/phymar/comgeomphy.F90
===================================================================
--- LMDZ5/trunk/libf/phymar/comgeomphy.F90	(revision 2350)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link ../phylmd/comgeomphy.F90
Index: LMDZ5/trunk/libf/phymar/init_phys_lmdz.F90
===================================================================
--- LMDZ5/trunk/libf/phymar/init_phys_lmdz.F90	(revision 2350)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link ../phylmd/init_phys_lmdz.F90
Index: LMDZ5/trunk/libf/phymar/phyaqua.F
===================================================================
--- LMDZ5/trunk/libf/phymar/phyaqua.F	(revision 2350)
+++ 	(revision )
@@ -1,41 +1,0 @@
-!
-! $Id: $
-!
-
-      subroutine iniaqua(nlon,latfi,lonfi,iflag_phys)
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!  Create an initial state (startphy.nc) for the physics
-!  Usefull for idealised cases (e.g. aquaplanets or testcases)
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-      use phys_state_var_mod, only : rlat,rlon,
-     &                               phys_state_var_init
-      use mod_phys_lmdz_para, only : klon_omp
-      use comgeomphy, only : rlond,rlatd
-      implicit none
-      
-      integer,intent(in) :: nlon,iflag_phys
-      real,intent(in) :: lonfi(nlon),latfi(nlon)
-
-! local variables
-      real :: pi
-
-! initializations:
-      pi=2.*asin(1.)
-
-      call phys_state_var_init()
-
-      rlat(1:klon_omp)=rlatd(1:klon_omp)*180./pi
-      rlon(1:klon_omp)=rlond(1:klon_omp)*180./pi
-
-
-! Here you could create an initial condition for the physics
-! ...
-! ... fill in the fields...
-! ...
-! ... and create a "startphy.nc" file
-      CALL phyredem ("startphy.nc")
-
-      end
-
Index: LMDZ5/trunk/libf/phymar/phyaqua_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phymar/phyaqua_mod.F90	(revision 2351)
+++ LMDZ5/trunk/libf/phymar/phyaqua_mod.F90	(revision 2351)
@@ -0,0 +1,45 @@
+!
+! $Id: $
+!
+MODULE phyaqua_mod
+
+  IMPLICIT NONE
+
+CONTAINS
+
+  SUBROUTINE iniaqua(nlon, iflag_phys)
+
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  !  Create an initial state (startphy.nc) for the physics
+  !  Usefull for idealised cases (e.g. aquaplanets or testcases)
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+  USE phys_state_var_mod, ONLY: rlat, rlon, phys_state_var_init
+  USE mod_phys_lmdz_para, ONLY: klon_omp
+  USE geometry_mod, ONLY: longitude_deg, latitude_deg
+  IMPLICIT NONE
+      
+  INTEGER,INTENT(IN) :: nlon,iflag_phys
+
+  ! local variables
+  REAL :: pi
+
+  ! initializations:
+  pi=2.*ASIN(1.)
+
+  CALL phys_state_var_init()
+
+  rlat(1:klon_omp)=latitude_deg(1:klon_omp)
+  rlon(1:klon_omp)=longitude_deg(1:klon_omp)
+
+
+  ! Here you could create an initial condition for the physics
+  ! ...
+  ! ... fill in the fields...
+  ! ...
+  ! ... and create a "startphy.nc" file
+      CALL phyredem ("startphy.nc")
+
+  END SUBROUTINE iniaqua
+
+END MODULE phyaqua_mod
Index: LMDZ5/trunk/libf/phymar/physiq.F90
===================================================================
--- LMDZ5/trunk/libf/phymar/physiq.F90	(revision 2350)
+++ LMDZ5/trunk/libf/phymar/physiq.F90	(revision 2351)
@@ -11,5 +11,5 @@
      &            debut,lafin,jD_cur, jH_cur,pdtphys, &
      &            paprs,pplay,pphi,pphis,ppresnivs, &
-     &            u,v,t,qx, &
+     &            u,v,rot,t,qx, &
      &            flxmass_w, &
      &            d_u, d_v, d_t, d_qx, d_ps &
@@ -18,5 +18,5 @@
       USE dimphy, only : klon,klev,klevp1
       USE infotrac_phy, only : nqtot
-      USE comgeomphy, only : rlatd,rlond,airephy
+      USE geometry_mod, only : latitude,longitude,cell_area
       !USE comcstphy, only : rg
       USE iophy, only : histbeg_phy,histwrite_phy
@@ -498,11 +498,11 @@
 
 DO i=1,klon
-  IF (rlond(i) .LT. 0) THEN
-    lonh_HOST(i)=rlond(i)*12./rpi+24. ! from radians to hours
+  IF (longitude(i) .LT. 0) THEN
+    lonh_HOST(i)=longitude(i)*12./rpi+24. ! from radians to hours
    ELSE
-    lonh_HOST(i)=rlond(i)*12./rpi ! from radians to hours
+    lonh_HOST(i)=longitude(i)*12./rpi ! from radians to hours
   ENDIF
 ENDDO
-latr_HOST(:)=rlatd(:) ! from radians to radians
+latr_HOST(:)=latitude(:) ! from radians to radians
 
 !PRINT*, 'lonh_HOST(:)=',lonh_HOST(:)
@@ -689,6 +689,6 @@
 PRINT*, 'Initialisation de la temperature de surface avec les SST aquaplanète'
           DO i = 1,klon
-            Ts___HOST(i)=273.+27.*(1-sin(1.5*rlatd(i))**2)
-            IF ((rlatd(i).GT.1.0471975).OR.(rlatd(i).LT.-1.0471975)) THEN
+            Ts___HOST(i)=273.+27.*(1-sin(1.5*latitude(i))**2)
+            IF ((latitude(i).GT.1.0471975).OR.(latitude(i).LT.-1.0471975)) THEN
               Ts___HOST(i)=273.
             ENDIF
@@ -791,6 +791,6 @@
 DO k = 1, klev
   i=klev+1-k
-  !omega(i,k) = RG*flxmass_w(i,k) / airephy(i) ! omega en Pa/s
-  Wa___HOST(:,i)=flxmass_w(:,k) / airephy(:) * (gZam_HOST(:,i+1) - gZam_HOST(:,i))/(paprs(:,k+1)-paprs(:,k)) ! Equilibre hydrostatique
+  !omega(i,k) = RG*flxmass_w(i,k) / cell_area(i) ! omega en Pa/s
+  Wa___HOST(:,i)=flxmass_w(:,k) / cell_area(:) * (gZam_HOST(:,i+1) - gZam_HOST(:,i))/(paprs(:,k+1)-paprs(:,k)) ! Equilibre hydrostatique
 END DO
 Wa___HOST(:,klev)=0 ! Vitesse nulle à la surface.
@@ -853,6 +853,6 @@
 !IF (debut) THEN
   DO i=1,klon
-    sst__HOST(i)=273.+27.*(1-sin(1.5*rlatd(i))**2)
-    IF ((rlatd(i).GT.1.0471975).OR.(rlatd(i).LT.-1.0471975)) THEN
+    sst__HOST(i)=273.+27.*(1-sin(1.5*latitude(i))**2)
+    IF ((latitude(i).GT.1.0471975).OR.(latitude(i).LT.-1.0471975)) THEN
       sst__HOST(i)=273.
     ENDIF
@@ -908,6 +908,6 @@
       ikl0 = i
       PRINT*,'Attention : NaN at'
-      PRINT*,'longitude=',rlond(i)*180/rpi
-      PRINT*,'latitude=',rlatd(i)*180/rpi
+      PRINT*,'longitude=',longitude(i)*180/rpi
+      PRINT*,'latitude=',latitude(i)*180/rpi
     ENDIF
   ENDDO
