Index: /LMDZ5/trunk/libf/dyn3d/gcm.F90
===================================================================
--- /LMDZ5/trunk/libf/dyn3d/gcm.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/dyn3d/gcm.F90	(revision 2346)
@@ -417,5 +417,5 @@
 #ifdef CPP_PHYS
      CALL iniphysiq(iim,jjm,llm,daysec,day_ini,dtphys/nsplit_phys, &
-          rlatu,rlonv,aire,cu,cv,rad,g,r,cpp, &
+          rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp, &
           iflag_phys)
 #endif
Index: /LMDZ5/trunk/libf/dyn3dmem/gcm.F90
===================================================================
--- /LMDZ5/trunk/libf/dyn3dmem/gcm.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/dyn3dmem/gcm.F90	(revision 2346)
@@ -401,5 +401,5 @@
 #ifdef CPP_PHYS
      CALL iniphysiq(iim,jjm,llm,daysec,day_ini,dtphys/nsplit_phys, &
-          rlatu,rlonv,aire,cu,cv,rad,g,r,cpp, &
+          rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp, &
           iflag_phys)
 #endif
Index: /LMDZ5/trunk/libf/dyn3dpar/gcm.F
===================================================================
--- /LMDZ5/trunk/libf/dyn3dpar/gcm.F	(revision 2345)
+++ /LMDZ5/trunk/libf/dyn3dpar/gcm.F	(revision 2346)
@@ -407,5 +407,5 @@
 #ifdef CPP_PHYS
          CALL iniphysiq(iim,jjm,llm,daysec,day_ini,dtphys/nsplit_phys,
-     &                rlatu,rlonv,aire,cu,cv,rad,g,r,cpp,
+     &                rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp,
      &                iflag_phys)
 #endif
Index: /LMDZ5/trunk/libf/dynlonlat_phylonlat/phydev/iniphysiq.F90
===================================================================
--- /LMDZ5/trunk/libf/dynlonlat_phylonlat/phydev/iniphysiq.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/dynlonlat_phylonlat/phydev/iniphysiq.F90	(revision 2346)
@@ -2,6 +2,6 @@
 ! $Id: iniphysiq.F 1403 2010-07-01 09:02:53Z fairhead $
 !
-SUBROUTINE iniphysiq(iim,jjm,nlayer,punjours, pdayref,ptimestep,         &
-                     rlatu,rlonv,aire,cu,cv,                             &
+SUBROUTINE iniphysiq(iim,jjm,nlayer,punjours, pdayref,ptimestep, &
+                     rlatu,rlatv,rlonu,rlonv,aire,cu,cv, &
                      prad,pg,pr,pcpp,iflag_phys)
   USE dimphy, ONLY: klev ! number of atmospheric levels
@@ -26,4 +26,9 @@
   USE inifis_mod, ONLY: inifis
   USE phyaqua_mod, ONLY: iniaqua
+  USE regular_lonlat_mod, ONLY : init_regular_lonlat, &
+                                 east, west, north, south, &
+                                 north_east, north_west, &
+                                 south_west, south_east
+  USE nrtype, ONLY: pi
   IMPLICIT NONE
   !
@@ -45,5 +50,7 @@
   INTEGER, INTENT (IN) :: jjm  ! number of atompsheric columns along latitudes
   REAL, INTENT (IN) :: rlatu(jjm+1) ! latitudes of the physics grid
+  REAL, INTENT (IN) :: rlatv(jjm) ! latitude boundaries of the physics grid
   REAL, INTENT (IN) :: rlonv(iim+1) ! longitudes of the physics grid
+  REAL, INTENT (IN) :: rlonu(iim+1) ! longitude boundaries of the physics grid
   REAL, INTENT (IN) :: aire(iim+1,jjm+1) ! area of the dynamics grid (m2)
   REAL, INTENT (IN) :: cu((iim+1)*(jjm+1)) ! cu coeff. (u_covariant = cu * u)
@@ -59,4 +66,7 @@
   REAL :: total_area_phy, total_area_dyn
 
+  ! boundaries, on global grid
+  REAL,ALLOCATABLE :: boundslon_reg(:,:)
+  REAL,ALLOCATABLE :: boundslat_reg(:,:)
 
   ! global array, on full physics grid:
@@ -78,4 +88,26 @@
   !call init_phys_lmdz(iim,jjm+1,llm,1,(/(jjm-1)*iim+2/))
   
+  ! init regular global longitude-latitude grid points and boundaries
+  ALLOCATE(boundslon_reg(iim,2))
+  ALLOCATE(boundslat_reg(jjm+1,2))
+  
+  DO i=1,iim
+   boundslon_reg(i,east)=rlonu(i) 
+   boundslon_reg(i,west)=rlonu(i+1) 
+  ENDDO
+
+  boundslat_reg(1,north)= PI/2 
+  boundslat_reg(1,south)= rlatv(1)
+  DO j=2,jjm
+   boundslat_reg(j,north)=rlatv(j-1) 
+   boundslat_reg(j,south)=rlatv(j) 
+  ENDDO
+  boundslat_reg(jjm+1,north)= rlatv(jjm) 
+  boundslat_reg(jjm+1,south)= -PI/2
+
+  ! Write values in module regular_lonlat_mod
+  CALL init_regular_lonlat(iim,jjm+1, rlonv(1:iim), rlatu, &
+                           boundslon_reg, boundslat_reg)
+
   ! Generate global arrays on full physics grid
   ALLOCATE(latfi(klon_glo),lonfi(klon_glo),cufi(klon_glo),cvfi(klon_glo))
Index: /LMDZ5/trunk/libf/dynlonlat_phylonlat/phylmd/iniphysiq.F90
===================================================================
--- /LMDZ5/trunk/libf/dynlonlat_phylonlat/phylmd/iniphysiq.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/dynlonlat_phylonlat/phylmd/iniphysiq.F90	(revision 2346)
@@ -3,6 +3,6 @@
 
 
-SUBROUTINE iniphysiq(ii,jj,nlayer,punjours, pdayref,ptimestep,           &
-                     rlatu,rlonv,aire,cu,cv,                             &
+SUBROUTINE iniphysiq(ii,jj,nlayer,punjours, pdayref,ptimestep, &
+                     rlatu,rlatv,rlonu,rlonv,aire,cu,cv,       &
                      prad,pg,pr,pcpp,iflag_phys)
   USE dimphy, ONLY: klev ! number of atmospheric levels
@@ -35,4 +35,8 @@
   USE phystokenc_mod, ONLY: init_phystokenc
   USE phyaqua_mod, ONLY: iniaqua
+  USE regular_lonlat_mod, ONLY : init_regular_lonlat, &
+                                 east, west, north, south, &
+                                 north_east, north_west, &
+                                 south_west, south_east
   IMPLICIT NONE
 
@@ -44,4 +48,5 @@
   include "dimensions.h"
   include "comvert.h"
+  include "comconst.h"
   include "iniprint.h"
   include "temps.h"
@@ -57,5 +62,7 @@
   INTEGER, INTENT (IN) :: jj ! number of atompsheric columns along latitudes
   REAL, INTENT (IN) :: rlatu(jj+1) ! latitudes of the physics grid
+  REAL, INTENT (IN) :: rlatv(jj) ! latitude boundaries of the physics grid
   REAL, INTENT (IN) :: rlonv(ii+1) ! longitudes of the physics grid
+  REAL, INTENT (IN) :: rlonu(ii+1) ! longitude boundaries of the physics grid
   REAL, INTENT (IN) :: aire(ii+1,jj+1) ! area of the dynamics grid (m2)
   REAL, INTENT (IN) :: cu((ii+1)*(jj+1)) ! cu coeff. (u_covariant = cu * u)
@@ -71,4 +78,7 @@
   REAL :: total_area_phy, total_area_dyn
 
+  ! boundaries, on global grid
+  REAL,ALLOCATABLE :: boundslon_reg(:,:)
+  REAL,ALLOCATABLE :: boundslat_reg(:,:)
 
   ! global array, on full physics grid:
@@ -87,4 +97,26 @@
   !call init_phys_lmdz(ii,jj+1,llm,1,(/(jj-1)*ii+2/))
   
+  ! init regular global longitude-latitude grid points and boundaries
+  ALLOCATE(boundslon_reg(ii,2))
+  ALLOCATE(boundslat_reg(jj+1,2))
+  
+  DO i=1,ii
+   boundslon_reg(i,east)=rlonu(i) 
+   boundslon_reg(i,west)=rlonu(i+1) 
+  ENDDO
+
+  boundslat_reg(1,north)= PI/2 
+  boundslat_reg(1,south)= rlatv(1)
+  DO j=2,jj
+   boundslat_reg(j,north)=rlatv(j-1) 
+   boundslat_reg(j,south)=rlatv(j) 
+  ENDDO
+  boundslat_reg(jj+1,north)= rlatv(jj) 
+  boundslat_reg(jj+1,south)= -PI/2
+
+  ! Write values in module regular_lonlat_mod
+  CALL init_regular_lonlat(ii,jj+1, rlonv(1:ii), rlatu, &
+                           boundslon_reg, boundslat_reg)
+
   ! Generate global arrays on full physics grid
   ALLOCATE(latfi(klon_glo),lonfi(klon_glo),cufi(klon_glo),cvfi(klon_glo))
Index: /LMDZ5/trunk/libf/dynlonlat_phylonlat/phymar/iniphysiq.F90
===================================================================
--- /LMDZ5/trunk/libf/dynlonlat_phylonlat/phymar/iniphysiq.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/dynlonlat_phylonlat/phymar/iniphysiq.F90	(revision 2346)
@@ -2,6 +2,6 @@
 ! $Id: iniphysiq.F 1403 2010-07-01 09:02:53Z fairhead $
 !
-SUBROUTINE iniphysiq(iim,jjm,nlayer,punjours, pdayref,ptimestep,         &
-                     rlatu,rlonv,aire,cu,cv,                             &
+SUBROUTINE iniphysiq(iim,jjm,nlayer,punjours, pdayref,ptimestep, &
+                     rlatu,rlatv,rlonu,rlonv,aire,cu,cv,         &
                      prad,pg,pr,pcpp,iflag_phys)
   USE dimphy, ONLY: klev ! number of atmospheric levels
@@ -23,4 +23,9 @@
                        rcpp  ! specific heat of the atmosphere
 !  USE phyaqua_mod, ONLY: iniaqua
+  USE regular_lonlat_mod, ONLY : init_regular_lonlat, &
+                                 east, west, north, south, &
+                                 north_east, north_west, &
+                                 south_west, south_east
+  USE nrtype, ONLY: pi
   IMPLICIT NONE
   !
@@ -42,5 +47,7 @@
   INTEGER, INTENT (IN) :: jjm  ! number of atompsheric columns along latitudes
   REAL, INTENT (IN) :: rlatu(jjm+1) ! latitudes of the physics grid
+  REAL, INTENT (IN) :: rlatv(jjm) ! latitude boundaries of the physics grid
   REAL, INTENT (IN) :: rlonv(iim+1) ! longitudes of the physics grid
+  REAL, INTENT (IN) :: rlonu(iim+1) ! longitude boundaries of the physics grid
   REAL, INTENT (IN) :: aire(iim+1,jjm+1) ! area of the dynamics grid (m2)
   REAL, INTENT (IN) :: cu((iim+1)*(jjm+1)) ! cu coeff. (u_covariant = cu * u)
@@ -56,4 +63,7 @@
   REAL :: total_area_phy, total_area_dyn
 
+  ! boundaries, on global grid
+  REAL,ALLOCATABLE :: boundslon_reg(:,:)
+  REAL,ALLOCATABLE :: boundslat_reg(:,:)
 
   ! global array, on full physics grid:
@@ -73,4 +83,25 @@
   ENDIF
 
+  ! init regular global longitude-latitude grid points and boundaries
+  ALLOCATE(boundslon_reg(iim,2))
+  ALLOCATE(boundslat_reg(jjm+1,2))
+  
+  DO i=1,iim
+   boundslon_reg(i,east)=rlonu(i) 
+   boundslon_reg(i,west)=rlonu(i+1) 
+  ENDDO
+
+  boundslat_reg(1,north)= PI/2 
+  boundslat_reg(1,south)= rlatv(1)
+  DO j=2,jjm
+   boundslat_reg(j,north)=rlatv(j-1) 
+   boundslat_reg(j,south)=rlatv(j) 
+  ENDDO
+  boundslat_reg(jjm+1,north)= rlatv(jjm) 
+  boundslat_reg(jjm+1,south)= -PI/2
+
+  ! Write values in module regular_lonlat_mod
+  CALL init_regular_lonlat(iim,jjm+1, rlonv(1:iim), rlatu, &
+                           boundslon_reg, boundslat_reg)
 
   ! Generate global arrays on full physics grid
Index: /LMDZ5/trunk/libf/phy_common/regular_lonlat_mod.F90
===================================================================
--- /LMDZ5/trunk/libf/phy_common/regular_lonlat_mod.F90	(revision 2346)
+++ /LMDZ5/trunk/libf/phy_common/regular_lonlat_mod.F90	(revision 2346)
@@ -0,0 +1,55 @@
+MODULE regular_lonlat_mod
+
+  ! Store information on the global physics grid
+  ! for a regular (longitude-latitude) grid
+  
+  INTEGER, PARAMETER :: north_east=1     ! boundaries of regular lontlat
+  INTEGER, PARAMETER :: north_west=2     ! boundaries of regular lontlat
+  INTEGER, PARAMETER :: south_west=3     ! boundaries of regular lontlat
+  INTEGER, PARAMETER :: south_east=4     ! boundaries of regular lontlat
+  INTEGER, PARAMETER :: east=1           ! boundaries of regular lontlat
+  INTEGER, PARAMETER :: west=2           ! boundaries of regular lontlat
+  INTEGER, PARAMETER :: north=1          ! boundaries of regular lontlat
+  INTEGER, PARAMETER :: south=2          ! boundaries of regular lontlat
+
+! Global definition, shared by all threads
+! Do not set threadprivate directives
+
+  REAL,SAVE,ALLOCATABLE :: lon_reg(:)      ! value of longitude cell (rad)
+
+  REAL,SAVE,ALLOCATABLE :: lat_reg(:)      ! value of longitude cell (rad)
+
+  REAL,SAVE,ALLOCATABLE :: boundslon_reg(:,:)      ! value of boundaries cell (1=>east, 2=>west)(rad)
+
+  REAL,SAVE,ALLOCATABLE :: boundslat_reg(:,:)      ! value of longitude cell (1=>north, 2=>south)(rad)
+
+
+CONTAINS
+  
+  SUBROUTINE init_regular_lonlat(nbp_lon, nbp_lat, lon_reg_, lat_reg_, boundslon_reg_, boundslat_reg_)
+    IMPLICIT NONE
+    INTEGER,INTENT(IN) :: nbp_lon
+    INTEGER,INTENT(IN) :: nbp_lat
+    REAL,   INTENT(IN) :: lon_reg_(nbp_lon)  
+    REAL,   INTENT(IN) :: lat_reg_(nbp_lat) 
+    REAL,   INTENT(IN) :: boundslon_reg_(nbp_lon,2) 
+    REAL,   INTENT(IN) :: boundslat_reg_(nbp_lat,2)  
+
+    
+    ALLOCATE(lon_reg(nbp_lon))
+    lon_reg(:)=lon_reg_(:)
+
+    ALLOCATE(lat_reg(nbp_lat)) 
+    lat_reg(:)=lat_reg_(:)
+
+    ALLOCATE(boundslon_reg(nbp_lon,2)) 
+    boundslon_reg(:,:)=boundslon_reg_(:,:)
+
+    ALLOCATE(boundslat_reg(nbp_lat,2))  
+    boundslat_reg(:,:)=boundslat_reg_(:,:)
+
+  
+  END SUBROUTINE init_regular_lonlat    
+
+END MODULE regular_lonlat_mod
+
Index: /LMDZ5/trunk/libf/phylmd/aaam_bud.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/aaam_bud.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/aaam_bud.F90	(revision 2346)
@@ -6,4 +6,5 @@
 
   USE dimphy
+  USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat
   IMPLICIT NONE
   ! ======================================================================
@@ -58,8 +59,8 @@
   ! ===================
 
-  ! iim--common-I: Number of longitude intervals
-  ! jjm--common-I: Number of latitude intervals
+  ! nbp_lon--common-I: Number of longitude intervals
+  ! (nbp_lat-1)--common-I: Number of latitude intervals
   ! klon-common-I: Number of points seen by the physics
-  ! iim*(jjm-1)+2 for instance
+  ! nbp_lon*(nbp_lat-2)+2 for instance
   ! klev-common-I: Number of vertical layers
   ! ======================================================================
@@ -84,7 +85,4 @@
   ! ======================================================================
 
-  include "dimensions.h"
-  ! cc#include "dimphy.h"
-
   ! ARGUMENTS
 
@@ -121,5 +119,5 @@
   ! PUT AAM QUANTITIES AT ZERO:
 
-  IF (iim+1>801 .OR. jjm+1>401) THEN
+  IF (nbp_lon+1>801 .OR. nbp_lat>401) THEN
     abort_message = 'Pb de dimension dans aaam_bud'
     CALL abort_physic(modname, abort_message, 1)
@@ -129,6 +127,6 @@
   hadley = 1.E18
   hadday = 1.E18*24.*3600.
-  dlat = xpi/real(jjm)
-  dlon = 2.*xpi/real(iim)
+  dlat = xpi/real(nbp_lat-1)
+  dlon = 2.*xpi/real(nbp_lon)
 
   DO iax = 1, 3
@@ -155,5 +153,5 @@
   zlat(1) = plat(l)*xpi/180.
 
-  DO i = 1, iim + 1
+  DO i = 1, nbp_lon + 1
 
     zs(i, 1) = phis(l)/rg
@@ -169,26 +167,26 @@
 
 
-  DO j = 2, jjm
+  DO j = 2, nbp_lat-1
 
     ! Values at Greenwich (Periodicity)
 
-    zs(iim+1, j) = phis(l+1)/rg
-    ps(iim+1, j) = p(l+1, 1)
-    ssou(iim+1, j) = dragu(l+1) + liftu(l+1)
-    ssov(iim+1, j) = dragv(l+1) + liftv(l+1)
-    blsu(iim+1, j) = phyu(l+1) - dragu(l+1) - liftu(l+1)
-    blsv(iim+1, j) = phyv(l+1) - dragv(l+1) - liftv(l+1)
-    zlon(iim+1) = -plon(l+1)*xpi/180.
+    zs(nbp_lon+1, j) = phis(l+1)/rg
+    ps(nbp_lon+1, j) = p(l+1, 1)
+    ssou(nbp_lon+1, j) = dragu(l+1) + liftu(l+1)
+    ssov(nbp_lon+1, j) = dragv(l+1) + liftv(l+1)
+    blsu(nbp_lon+1, j) = phyu(l+1) - dragu(l+1) - liftu(l+1)
+    blsv(nbp_lon+1, j) = phyv(l+1) - dragv(l+1) - liftv(l+1)
+    zlon(nbp_lon+1) = -plon(l+1)*xpi/180.
     zlat(j) = plat(l+1)*xpi/180.
 
-    ub(iim+1, j) = 0.
-    vb(iim+1, j) = 0.
+    ub(nbp_lon+1, j) = 0.
+    vb(nbp_lon+1, j) = 0.
     DO k = 1, nlev
-      ub(iim+1, j) = ub(iim+1, j) + u(l+1, k)*(p(l+1,k)-p(l+1,k+1))/rg
-      vb(iim+1, j) = vb(iim+1, j) + v(l+1, k)*(p(l+1,k)-p(l+1,k+1))/rg
-    END DO
-
-
-    DO i = 1, iim
+      ub(nbp_lon+1, j) = ub(nbp_lon+1, j) + u(l+1, k)*(p(l+1,k)-p(l+1,k+1))/rg
+      vb(nbp_lon+1, j) = vb(nbp_lon+1, j) + v(l+1, k)*(p(l+1,k)-p(l+1,k+1))/rg
+    END DO
+
+
+    DO i = 1, nbp_lon
 
       l = l + 1
@@ -215,23 +213,23 @@
   ! South Pole
 
-  IF (jjm>1) THEN
+  IF (nbp_lat-1>1) THEN
     l = l + 1
-    ub(1, jjm+1) = 0.
-    vb(1, jjm+1) = 0.
+    ub(1, nbp_lat) = 0.
+    vb(1, nbp_lat) = 0.
     DO k = 1, nlev
-      ub(1, jjm+1) = ub(1, jjm+1) + u(l, k)*(p(l,k)-p(l,k+1))/rg
-      vb(1, jjm+1) = vb(1, jjm+1) + v(l, k)*(p(l,k)-p(l,k+1))/rg
-    END DO
-    zlat(jjm+1) = plat(l)*xpi/180.
-
-    DO i = 1, iim + 1
-      zs(i, jjm+1) = phis(l)/rg
-      ps(i, jjm+1) = p(l, 1)
-      ssou(i, jjm+1) = dragu(l) + liftu(l)
-      ssov(i, jjm+1) = dragv(l) + liftv(l)
-      blsu(i, jjm+1) = phyu(l) - dragu(l) - liftu(l)
-      blsv(i, jjm+1) = phyv(l) - dragv(l) - liftv(l)
-      ub(i, jjm+1) = ub(1, jjm+1)
-      vb(i, jjm+1) = vb(1, jjm+1)
+      ub(1, nbp_lat) = ub(1, nbp_lat) + u(l, k)*(p(l,k)-p(l,k+1))/rg
+      vb(1, nbp_lat) = vb(1, nbp_lat) + v(l, k)*(p(l,k)-p(l,k+1))/rg
+    END DO
+    zlat(nbp_lat) = plat(l)*xpi/180.
+
+    DO i = 1, nbp_lon + 1
+      zs(i, nbp_lat) = phis(l)/rg
+      ps(i, nbp_lat) = p(l, 1)
+      ssou(i, nbp_lat) = dragu(l) + liftu(l)
+      ssov(i, nbp_lat) = dragv(l) + liftv(l)
+      blsu(i, nbp_lat) = phyu(l) - dragu(l) - liftu(l)
+      blsv(i, nbp_lat) = phyv(l) - dragv(l) - liftv(l)
+      ub(i, nbp_lat) = ub(1, nbp_lat)
+      vb(i, nbp_lat) = vb(1, nbp_lat)
     END DO
   END IF
@@ -240,6 +238,6 @@
   ! MOMENT ANGULAIRE
 
-  DO j = 1, jjm
-    DO i = 1, iim
+  DO j = 1, nbp_lat-1
+    DO i = 1, nbp_lon
 
       raam(1) = raam(1) - rea**3*dlon*dlat*0.5*(cos(zlon(i))*sin(zlat(j))*cos &
@@ -274,6 +272,6 @@
 
 
-  DO j = 1, jjm
-    DO i = 1, iim
+  DO j = 1, nbp_lat-1
+    DO i = 1, nbp_lon
       tmou(1) = tmou(1) - rea**2*dlon*0.5*sin(zlon(i))*(zs(i,j)-zs(i,j+1))*( &
         cos(zlat(j+1))*ps(i,j+1)+cos(zlat(j))*ps(i,j))
@@ -283,6 +281,6 @@
   END DO
 
-  DO j = 2, jjm
-    DO i = 1, iim
+  DO j = 2, nbp_lat-1
+    DO i = 1, nbp_lon
       tmou(1) = tmou(1) + rea**2*dlat*0.5*sin(zlat(j))*(zs(i+1,j)-zs(i,j))*( &
         cos(zlon(i+1))*ps(i+1,j)+cos(zlon(i))*ps(i,j))
@@ -298,6 +296,6 @@
 
   l = 1
-  DO j = 2, jjm
-    DO i = 1, iim
+  DO j = 2, nbp_lat-1
+    DO i = 1, nbp_lon
       l = l + 1
       tsso(1) = tsso(1) - rea**3*cos(zlat(j))*dlon*dlat*ssou(i, j)*sin(zlat(j &
@@ -341,12 +339,12 @@
 100 FORMAT (F12.5, 15(1X,F12.5))
 
-  ! write(iam+1,*)((zs(i,j),i=1,iim),j=1,jjm+1)
-  ! write(iam+1,*)((ps(i,j),i=1,iim),j=1,jjm+1)
-  ! write(iam+1,*)((ub(i,j),i=1,iim),j=1,jjm+1)
-  ! write(iam+1,*)((vb(i,j),i=1,iim),j=1,jjm+1)
-  ! write(iam+1,*)((ssou(i,j),i=1,iim),j=1,jjm+1)
-  ! write(iam+1,*)((ssov(i,j),i=1,iim),j=1,jjm+1)
-  ! write(iam+1,*)((blsu(i,j),i=1,iim),j=1,jjm+1)
-  ! write(iam+1,*)((blsv(i,j),i=1,iim),j=1,jjm+1)
+  ! write(iam+1,*)((zs(i,j),i=1,nbp_lon),j=1,nbp_lat)
+  ! write(iam+1,*)((ps(i,j),i=1,nbp_lon),j=1,nbp_lat)
+  ! write(iam+1,*)((ub(i,j),i=1,nbp_lon),j=1,nbp_lat)
+  ! write(iam+1,*)((vb(i,j),i=1,nbp_lon),j=1,nbp_lat)
+  ! write(iam+1,*)((ssou(i,j),i=1,nbp_lon),j=1,nbp_lat)
+  ! write(iam+1,*)((ssov(i,j),i=1,nbp_lon),j=1,nbp_lat)
+  ! write(iam+1,*)((blsu(i,j),i=1,nbp_lon),j=1,nbp_lat)
+  ! write(iam+1,*)((blsv(i,j),i=1,nbp_lon),j=1,nbp_lat)
 
   aam = raam(3)
Index: /LMDZ5/trunk/libf/phylmd/add_pbl_tend.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/add_pbl_tend.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/add_pbl_tend.F90	(revision 2346)
@@ -15,13 +15,16 @@
   USE phys_local_var_mod
   USE phys_state_var_mod
+  USE mod_grid_phy_lmdz, ONLY: nbp_lev
   IMPLICIT NONE
-  include "dimensions.h"
-  REAL hthturb_gcssold(llm)
-  REAL hqturb_gcssold(llm)
-  REAL dtime_frcg
+  REAL,SAVE,ALLOCATABLE :: hthturb_gcssold(:)
+  REAL,SAVE,ALLOCATABLE :: hqturb_gcssold(:)
+!$OMP THREADPRIVATE(hthturb_gcssold,hqturb_gcssold)
+  REAL,SAVE :: dtime_frcg
+  LOGICAL,SAVE :: turb_fcg_gcssold
+  LOGICAL,SAVE :: firstcall=.true.
+!$OMP THREADPRIVATE(firstcall,turb_fcg_gcssold,dtime_frcg)
   INTEGER abortphy
-  LOGICAL turb_fcg_gcssold
-  COMMON /turb_forcing/dtime_frcg, hthturb_gcssold, hqturb_gcssold, &
-    turb_fcg_gcssold
+!  COMMON /turb_forcing/dtime_frcg, hthturb_gcssold, hqturb_gcssold, &
+!    turb_fcg_gcssold
 
   ! Arguments :
@@ -36,4 +39,10 @@
   REAL zzdt(klon, klev), zzdq(klon, klev)
   INTEGER i, k
+
+  IF (firstcall) THEN
+    ALLOCATE(hthturb_gcssold(nbp_lev))
+    ALLOCATE(hqturb_gcssold(nbp_lev))
+    firstcall=.false.
+  ENDIF
 
   IF (turb_fcg_gcssold) THEN
Index: /LMDZ5/trunk/libf/phylmd/aeropt.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/aeropt.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/aeropt.F90	(revision 2346)
@@ -10,6 +10,4 @@
 
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
 
Index: /LMDZ5/trunk/libf/phylmd/ajsec.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/ajsec.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/ajsec.F90	(revision 2346)
@@ -14,6 +14,4 @@
   ! d_t-----output-R-Incrementation de la temperature
   ! ======================================================================
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   REAL paprs(klon, klev+1), pplay(klon, klev)
@@ -168,6 +166,4 @@
   ! d_t-----output-R-Incrementation de la temperature
   ! ======================================================================
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   REAL paprs(klon, klev+1), pplay(klon, klev)
@@ -319,6 +315,4 @@
   ! d_t-----output-R-Incrementation de la temperature
   ! ======================================================================
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   REAL paprs(klon, klev+1), pplay(klon, klev)
Index: /LMDZ5/trunk/libf/phylmd/albedo.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/albedo.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/albedo.F90	(revision 2346)
@@ -19,6 +19,4 @@
     ! albedo (out,R): albedo obtenu (de 0 a 1)
     ! ======================================================================
-    ! ym#include "dimensions.h"
-    ! ym#include "dimphy.h"
     include "YOMCST.h"
     include "clesphys.h"
Index: /LMDZ5/trunk/libf/phylmd/atm2geo.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/atm2geo.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/atm2geo.F90	(revision 2346)
@@ -6,5 +6,4 @@
   USE mod_phys_lmdz_para
   IMPLICIT NONE
-  INCLUDE 'dimensions.h'
   INCLUDE 'YOMCST.h'
 !
Index: /LMDZ5/trunk/libf/phylmd/calltherm.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/calltherm.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/calltherm.F90	(revision 2346)
@@ -24,7 +24,5 @@
 
       implicit none
-#include "dimensions.h"
-!#include "dimphy.h"
-#include "thermcell.h"
+      include "thermcell.h"
 
 
Index: /LMDZ5/trunk/libf/phylmd/calwake.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/calwake.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/calwake.F90	(revision 2346)
@@ -22,6 +22,4 @@
   IMPLICIT NONE
   ! ======================================================================
-  include "dimensions.h"
-  ! #include "dimphy.h"
   include "YOMCST.h"
 
Index: /LMDZ5/trunk/libf/phylmd/cfmip_point_locations.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/cfmip_point_locations.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/cfmip_point_locations.F90	(revision 2346)
@@ -34,8 +34,7 @@
   USE dimphy
   USE iophy
-  USE mod_grid_phy_lmdz
+  USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo
 
   IMPLICIT none 
-#include "dimensions.h"
   INTEGER :: npCFMIP
   REAL, DIMENSION(npCFMIP) :: lonCFMIP, latCFMIP
@@ -44,13 +43,13 @@
   REAL :: dlon1, dlon2
   REAL :: dlat1, dlat2
-  REAL, DIMENSION(iim+1) :: lon
+  REAL, DIMENSION(nbp_lon+1) :: lon
   INTEGER, DIMENSION(npCFMIP) :: tabijGCM
   REAL, DIMENSION(npCFMIP) :: lonGCM, latGCM
 
-  lon(1:iim)=io_lon(:)
-  lon(iim+1)=-1*lon(1)
+  lon(1:nbp_lon)=io_lon(:)
+  lon(nbp_lon+1)=-1*lon(1)
   OPEN(22, file="LMDZ_pointsCFMIP.txt")
   DO np=1, npCFMIP
-  DO i=1, iim
+  DO i=1, nbp_lon
 !
 ! PRINT*,'IM np i lonCF lonGCM lonGCM+1',np,i,lonCFMIP(np),lon(i), &
@@ -85,5 +84,5 @@
    ELSE
     j=j+1
-    IF(j.LE.jjm) THEN 
+    IF(j.LE.nbp_lat-1) THEN 
      GOTO 40
     ENDIF
@@ -99,9 +98,9 @@
      lonGCM(ip)=lon(ipt(ip))
      latGCM(ip)=io_lat(jpt(ip))
-     if(jpt(ip).GE.2.AND.jpt(ip).LE.jjm) THEN     
-      tabijGCM(ip)=1+(jpt(ip)-2)*iim+ipt(ip)
+     if(jpt(ip).GE.2.AND.jpt(ip).LE.nbp_lat-1) THEN     
+      tabijGCM(ip)=1+(jpt(ip)-2)*nbp_lon+ipt(ip)
      else if(jpt(ip).EQ.1) THEN
       tabijGCM(ip)=1
-     else if(jpt(ip).EQ.jjm+1) THEN
+     else if(jpt(ip).EQ.nbp_lat) THEN
       tabijGCM(ip)=klon_glo
      else 
Index: /LMDZ5/trunk/libf/phylmd/conccm.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/conccm.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/conccm.F90	(revision 2346)
@@ -12,6 +12,4 @@
   ! (schema standard du modele NCAR CCM2)
   ! ======================================================================
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   include "YOETHF.h"
@@ -160,6 +158,4 @@
   ! simplifier la lecture et la comprehension.
   ! -----------------------------------------------------------------------
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   INTEGER pcnst ! nombre de traceurs passifs
   PARAMETER (pcnst=1)
Index: /LMDZ5/trunk/libf/phylmd/concvl.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/concvl.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/concvl.F90	(revision 2346)
@@ -84,5 +84,4 @@
 
   include "clesphys.h"
-  include "dimensions.h"
 
   INTEGER iflag_clos
Index: /LMDZ5/trunk/libf/phylmd/conema3.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/conema3.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/conema3.F90	(revision 2346)
@@ -53,5 +53,4 @@
   ! ======================================================================
 
-  include "dimensions.h"
   include "conema3.h"
   INTEGER i, l, m, itra
Index: /LMDZ5/trunk/libf/phylmd/conemav.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/conemav.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/conemav.F90	(revision 2346)
@@ -41,6 +41,4 @@
   ! Ice_flag-input-L-TRUE->prise en compte de la thermodynamique de la glace
   ! ======================================================================
-
-  include "dimensions.h"
 
 
Index: /LMDZ5/trunk/libf/phylmd/conflx.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/conflx.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/conflx.F90	(revision 2346)
@@ -16,6 +16,4 @@
   ! et lessivage des traceurs passifs.
   ! ======================================================================
-  ! yminclude "dimensions.h"
-  ! yminclude "dimphy.h"
   include "YOMCST.h"
   include "YOETHF.h"
@@ -210,6 +208,4 @@
   IMPLICIT NONE
   ! ------------------------------------------------------------------
-  ! yminclude "dimensions.h"
-  ! yminclude "dimphy.h"
   include "YOMCST.h"
   include "YOETHF.h"
@@ -489,6 +485,4 @@
   ! AND INITIALIZES VALUES FOR UPDRAFTS
   ! ----------------------------------------------------------------------
-  ! yminclude "dimensions.h"
-  ! yminclude "dimphy.h"
   include "YOMCST.h"
   include "YOETHF.h"
@@ -619,6 +613,4 @@
   ! (NON ENTRAINING PLUME,I.E.CONSTANT MASSFLUX)
   ! ----------------------------------------------------------------------
-  ! yminclude "dimensions.h"
-  ! yminclude "dimphy.h"
   include "YOMCST.h"
   include "YOETHF.h"
@@ -696,6 +688,4 @@
   ! FOR CUMULUS PARAMETERIZATION
   ! ----------------------------------------------------------------------
-  ! yminclude "dimensions.h"
-  ! yminclude "dimphy.h"
   include "YOMCST.h"
   include "YOETHF.h"
@@ -998,6 +988,4 @@
   ! FLUXES IN THE CLOUD LAYER AND IN THE SUBCLOUD LAYER
   ! ----------------------------------------------------------------------
-  ! yminclude "dimensions.h"
-  ! yminclude "dimphy.h"
   include "YOMCST.h"
   include "YOETHF.h"
@@ -1242,6 +1230,4 @@
   ! calculer les tendances T et Q
   ! ----------------------------------------------------------------------
-  ! yminclude "dimensions.h"
-  ! yminclude "dimphy.h"
   include "YOMCST.h"
   include "YOETHF.h"
@@ -1319,6 +1305,4 @@
   ! MOIST ENVIRONMENTAL AIR AND CLOUD AIR.
   ! ----------------------------------------------------------------------
-  ! yminclude "dimensions.h"
-  ! yminclude "dimphy.h"
   include "YOMCST.h"
   include "YOETHF.h"
@@ -1428,6 +1412,4 @@
 
   ! ----------------------------------------------------------------------
-  ! yminclude "dimensions.h"
-  ! yminclude "dimphy.h"
   include "YOMCST.h"
   include "YOETHF.h"
@@ -1535,6 +1517,4 @@
   ! kcall=2  EVAPORATION IN DOWNDRAFTS (E.G. CUDLFS,CUDDRAF)
 
-  ! yminclude "dimensions.h"
-  ! yminclude "dimphy.h"
   include "YOMCST.h"
 
Index: /LMDZ5/trunk/libf/phylmd/conlmd.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/conlmd.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/conlmd.F90	(revision 2346)
@@ -11,6 +11,4 @@
   ! Ajustement humide (Manabe) + Ajustement convectif (Kuo)
   ! ======================================================================
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   include "YOETHF.h"
@@ -105,6 +103,4 @@
   ! du modele.
   ! ======================================================================
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
 
@@ -310,6 +306,4 @@
   ! et itop est le haut du plus haut bloc
   ! ======================================================================
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
 
@@ -1059,6 +1053,4 @@
   ! N.B. version vectorielle (le 6 oct. 1997)
   ! ======================================================================
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
 
@@ -1578,6 +1570,4 @@
   ! kcbot---output-I- Niveau du bas de la convection
   ! ======================================================================
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   include "YOETHF.h"
@@ -1682,6 +1672,4 @@
   ! KCALL=2  EVAPORATION IN DOWNDRAFTS (E.G. CUDLFS,CUDDRAF)
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
 
@@ -1777,6 +1765,4 @@
   ! Ajustement humide (Schema de convection de Manabe)
   ! .
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
 
@@ -2062,6 +2048,4 @@
   IMPLICIT NONE
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
 
Index: /LMDZ5/trunk/libf/phylmd/convect1.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/convect1.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/convect1.F90	(revision 2346)
@@ -111,7 +111,4 @@
   USE dimphy
   IMPLICIT NONE
-
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
 
   INTEGER len
Index: /LMDZ5/trunk/libf/phylmd/convect2.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/convect2.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/convect2.F90	(revision 2346)
@@ -150,7 +150,4 @@
   USE dimphy
   IMPLICIT NONE
-
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
 
   INTEGER kmax2, imax2, kmin2, imin2
Index: /LMDZ5/trunk/libf/phylmd/convect3.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/convect3.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/convect3.F90	(revision 2346)
@@ -18,5 +18,4 @@
   USE infotrac_phy, ONLY: nbtr
   IMPLICIT NONE
-  include "dimensions.h"
   INTEGER na
   PARAMETER (na=60)
Index: /LMDZ5/trunk/libf/phylmd/cv_driver.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/cv_driver.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/cv_driver.F90	(revision 2346)
@@ -95,7 +95,4 @@
 
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-
   ! Input
   INTEGER len
Index: /LMDZ5/trunk/libf/phylmd/cva_driver.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/cva_driver.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/cva_driver.F90	(revision 2346)
@@ -160,6 +160,4 @@
 
 
-  include "dimensions.h"
-!!!!!#include "dimphy.h"
 
 ! Input
Index: /LMDZ5/trunk/libf/phylmd/diagphy.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/diagphy.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/diagphy.F90	(revision 2346)
@@ -50,6 +50,4 @@
   IMPLICIT NONE
 
-  include "dimensions.h"
-  ! cccc#include "dimphy.h"
   include "YOMCST.h"
   include "YOETHF.h"
@@ -209,6 +207,4 @@
   IMPLICIT NONE
 
-  include "dimensions.h"
-  ! ccccc#include "dimphy.h"
   include "YOMCST.h"
   include "YOETHF.h"
Index: /LMDZ5/trunk/libf/phylmd/fisrtilp.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/fisrtilp.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/fisrtilp.F90	(revision 2346)
@@ -23,6 +23,4 @@
   !======================================================================
   !======================================================================
-  !ym include "dimensions.h"
-  !ym include "dimphy.h"
   include "YOMCST.h"
   include "fisrtilp.h"
Index: /LMDZ5/trunk/libf/phylmd/fisrtilp_tr.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/fisrtilp_tr.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/fisrtilp_tr.F90	(revision 2346)
@@ -19,6 +19,4 @@
   ! ======================================================================
   ! ======================================================================
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
 
Index: /LMDZ5/trunk/libf/phylmd/flxtr.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/flxtr.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/flxtr.F90	(revision 2346)
@@ -25,6 +25,4 @@
   ! =====================================================================
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   include "YOECUMF.h"
Index: /LMDZ5/trunk/libf/phylmd/fonte_neige_mod.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/fonte_neige_mod.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/fonte_neige_mod.F90	(revision 2346)
@@ -141,5 +141,4 @@
 !   evap
 !
-  INCLUDE "dimensions.h"
   INCLUDE "YOETHF.h"
   INCLUDE "YOMCST.h"
Index: /LMDZ5/trunk/libf/phylmd/geo2atm.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/geo2atm.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/geo2atm.F90	(revision 2346)
@@ -7,5 +7,4 @@
 
   IMPLICIT NONE
-  INCLUDE 'dimensions.h'
   INCLUDE 'YOMCST.h'
 
Index: /LMDZ5/trunk/libf/phylmd/grid_noro_m.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/grid_noro_m.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/grid_noro_m.F90	(revision 2346)
@@ -48,5 +48,4 @@
   USE print_control_mod, ONLY: lunout
   IMPLICIT NONE 
-!  include "dimensions.h"
   REAL, PARAMETER :: epsfra = 1.e-5
 !-------------------------------------------------------------------------------
Index: /LMDZ5/trunk/libf/phylmd/hbtm.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/hbtm.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/hbtm.F90	(revision 2346)
@@ -41,6 +41,4 @@
 
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   REAL rlvcp, reps
Index: /LMDZ5/trunk/libf/phylmd/hbtm2l.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/hbtm2l.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/hbtm2l.F90	(revision 2346)
@@ -29,6 +29,4 @@
   ! * re-ecriture complete Alain Mars 2012 dans LMDZ5V5           *
   ! ***************************************************************
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   REAL rlvcp, reps
Index: /LMDZ5/trunk/libf/phylmd/hgardfou.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/hgardfou.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/hgardfou.F90	(revision 2346)
@@ -10,5 +10,4 @@
   ! Verifier la temperature
   ! ======================================================================
-  include "dimensions.h"
   include "YOMCST.h"
   REAL t(klon, klev), tsol(klon, nbsrf)
Index: /LMDZ5/trunk/libf/phylmd/hines_gwd.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/hines_gwd.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/hines_gwd.F90	(revision 2346)
@@ -16,6 +16,4 @@
   IMPLICIT NONE
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOEGWD.h"
   include "YOMCST.h"
Index: /LMDZ5/trunk/libf/phylmd/histo_o500_pctau.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/histo_o500_pctau.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/histo_o500_pctau.F90	(revision 2346)
@@ -8,6 +8,4 @@
   INTEGER :: ij, k, l, nw
   INTEGER :: nreg, nbreg
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   INTEGER, PARAMETER :: kmax = 8, lmax = 8
   INTEGER, PARAMETER :: kmaxm1 = kmax - 1, lmaxm1 = lmax - 1
Index: /LMDZ5/trunk/libf/phylmd/homogene.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/homogene.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/homogene.F90	(revision 2346)
@@ -18,6 +18,4 @@
   ! dv:   output, incrementation pour v
   ! ==============================================================
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
 
   REAL paprs(klon, klev+1)
Index: /LMDZ5/trunk/libf/phylmd/hydrol.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/hydrol.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/hydrol.F90	(revision 2346)
@@ -25,6 +25,4 @@
   ! snow: couverture neigeuse
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
 
Index: /LMDZ5/trunk/libf/phylmd/ini_undefSTD.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/ini_undefSTD.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/ini_undefSTD.F90	(revision 2346)
@@ -31,7 +31,4 @@
   ! ====================================================================
 
-  ! ym #include "dimensions.h"
-  ! ym      integer jjmp1
-  ! ym      parameter (jjmp1=jjm+1-1/jjm)
   ! ym #include "dimphy.h"
   ! variables Input/Output
Index: /LMDZ5/trunk/libf/phylmd/iophy.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/iophy.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/iophy.F90	(revision 2346)
@@ -54,5 +54,4 @@
 #endif
   IMPLICIT NONE
-!  INCLUDE 'dimensions.h'
     REAL,DIMENSION(klon),INTENT(IN) :: rlon
     REAL,DIMENSION(klon),INTENT(IN) :: rlat
Index: /LMDZ5/trunk/libf/phylmd/lsc_scav.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/lsc_scav.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/lsc_scav.F90	(revision 2346)
@@ -24,5 +24,4 @@
 !=====================================================================
 
-  include "dimensions.h"
   include "chem.h"
   include "YOMCST.h"
Index: /LMDZ5/trunk/libf/phylmd/moy_undefSTD.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/moy_undefSTD.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/moy_undefSTD.F90	(revision 2346)
@@ -35,8 +35,4 @@
   ! NB: mettre "inst(X)" dans le write_hist*NMC.h !
   ! ====================================================================
-  ! ym#include "dimensions.h"
-  ! ym      integer jjmp1
-  ! ym      parameter (jjmp1=jjm+1-1/jjm)
-  ! ym#include "dimphy.h"
 
 
Index: /LMDZ5/trunk/libf/phylmd/moyglo_aire.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/moyglo_aire.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/moyglo_aire.F90	(revision 2346)
@@ -16,6 +16,4 @@
   ! ==================================================================
 
-  include "dimensions.h"
-  ! ym#include "dimphy.h"
   INTEGER i, nhori
   REAL champ(klon), aire(klon), msk(klon)
@@ -74,6 +72,4 @@
 
   ! ==================================================================
-  include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   INTEGER i, k, nhori, nvert
@@ -119,6 +115,4 @@
 
   ! ==================================================================
-  include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   INTEGER i, k, nhori, nvert
Index: /LMDZ5/trunk/libf/phylmd/nuage.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/nuage.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/nuage.F90	(revision 2346)
@@ -37,6 +37,4 @@
   include "nuage.h" ! JBM 3/14
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   REAL paprs(klon, klev+1), pplay(klon, klev)
   REAL t(klon, klev)
@@ -246,6 +244,4 @@
   ! ces nuages. Je dois avouer que c'est une frustration.
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
 
@@ -323,6 +319,4 @@
   IMPLICIT NONE
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
 
Index: /LMDZ5/trunk/libf/phylmd/o3_chem_m.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/o3_chem_m.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/o3_chem_m.F90	(revision 2346)
@@ -14,5 +14,5 @@
 
     ! All the 2-dimensional arrays are on the partial "physics" grid.
-    ! Their shape is "(/klon, llm/)".
+    ! Their shape is "(/klon, nbp_lev/)".
     ! Index "(i, :)" is for longitude "rlon(i)", latitude "rlat(i)".
 
@@ -20,10 +20,12 @@
     use dimphy, only: klon
     use regr_pr_comb_coefoz_m, only: c_Mob, a4_mass, a2, r_het_interm
+    use mod_grid_phy_lmdz, only: nbp_lev
+    use nrtype, only: pi
 
     integer, intent(in):: julien ! jour julien, 1 <= julien <= 360
     real, intent(in):: gmtime ! heure de la journée en fraction de jour
-    real, intent(in):: t_seri(:, :) ! (klon, llm) temperature, in K
+    real, intent(in):: t_seri(:, :) ! (klon, nbp_lev) temperature, in K
 
-    real, intent(in):: zmasse(:, :) ! (klon, llm)
+    real, intent(in):: zmasse(:, :) ! (klon, nbp_lev)
     ! (column-density of mass of air in a cell, in kg m-2)
     ! "zmasse(:, k)" is for layer "k".)
@@ -34,24 +36,22 @@
     ! (longitude and latitude of each horizontal position, in degrees)
 
-    real, intent(inout):: q(:, :) ! (klon, llm) mass fraction of ozone
+    real, intent(inout):: q(:, :) ! (klon, nbp_lev) mass fraction of ozone
     ! "q(:, k)" is at middle of layer "k".)
 
     ! Variables local to the procedure:
-    include "dimensions.h"
-    include "comconst.h"
     ! (for "pi")
     integer k
 
-    real c(klon, llm)
+    real c(klon, nbp_lev)
     ! (constant term during a time step in the net mass production
     ! rate of ozone by chemistry, per unit mass of air, in s-1)
     ! "c(:, k)" is at middle of layer "k".)
 
-    real b(klon, llm)
+    real b(klon, nbp_lev)
     ! (coefficient of "q" in the net mass production
     ! rate of ozone by chemistry, per unit mass of air, in s-1)
     ! "b(:, k)" is at middle of layer "k".)
 
-    real dq_o3_chem(klon, llm)
+    real dq_o3_chem(klon, nbp_lev)
     ! (variation of ozone mass fraction due to chemistry during a time step)
     ! "dq_o3_chem(:, k)" is at middle of layer "k".)
@@ -69,6 +69,6 @@
     call assert(klon == (/size(q, 1), size(t_seri, 1), size(zmasse, 1), &
          size(rlat), size(rlon)/), "o3_chem klon")
-    call assert(llm == (/size(q, 2), size(t_seri, 2), size(zmasse, 2)/), &
-         "o3_chem llm")
+    call assert(nbp_lev == (/size(q, 2), size(t_seri, 2), size(zmasse, 2)/), &
+         "o3_chem nbp_lev")
 
     c = c_Mob + a4_mass * t_seri
@@ -86,5 +86,5 @@
     call orbite(real(julien), earth_long, trash1)
     call zenang(earth_long, gmtime, pdtphys, rlat, rlon, pmu0, trash2)
-    forall (k = 1: llm)
+    forall (k = 1: nbp_lev)
        where (pmu0 <= cos(87. / 180. * pi)) b(:, k) = 0.
     end forall
@@ -112,5 +112,5 @@
 
     ! All the 2-dimensional arrays are on the partial "physics" grid.
-    ! Their shape is "(/klon, llm/)".
+    ! Their shape is "(/klon, nbp_lev/)".
     ! Index "(i, :)" is for longitude "rlon(i)", latitude "rlat(i)".
 
@@ -118,4 +118,5 @@
     use assert_m, only: assert
     use dimphy, only: klon
+    use mod_grid_phy_lmdz, only: nbp_lev
 
     real, intent(in):: q(:, :) ! mass fraction of ozone
@@ -136,7 +137,5 @@
     ! ("b(:, k)" is at middle of layer "k".)
 
-    include "dimensions.h"
-
-    real o3_prod(klon, llm)
+    real o3_prod(klon, nbp_lev)
     ! (net mass production rate of ozone by chemistry, per unit mass
     ! of air, in s-1)
@@ -145,5 +144,5 @@
     ! Variables local to the procedure:
 
-    real sigma_mass(klon, llm)
+    real sigma_mass(klon, nbp_lev)
     ! (mass column-density of ozone above point, in kg m-2)
     ! ("sigma_mass(:, k)" is at middle of layer "k".)
@@ -155,5 +154,5 @@
     call assert(klon == (/size(q, 1), size(zmasse, 1), size(c, 1), &
          size(b, 1)/), "o3_prod 1")
-    call assert(llm == (/size(q, 2), size(zmasse, 2), size(c, 2), &
+    call assert(nbp_lev == (/size(q, 2), size(zmasse, 2), size(c, 2), &
          size(b, 2)/), "o3_prod 2")
 
@@ -161,6 +160,6 @@
     ! "k", and, as a first approximation, take it as column-density
     ! above the middle of layer "k":
-    sigma_mass(:, llm) = zmasse(:, llm) * q(:, llm) ! top layer
-    do k =  llm - 1, 1, -1
+    sigma_mass(:, nbp_lev) = zmasse(:, nbp_lev) * q(:, nbp_lev) ! top layer
+    do k =  nbp_lev - 1, 1, -1
        sigma_mass(:, k) = sigma_mass(:, k+1) + zmasse(:, k) * q(:, k)
     end do
Index: /LMDZ5/trunk/libf/phylmd/oasis.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/oasis.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/oasis.F90	(revision 2346)
@@ -100,6 +100,5 @@
 #endif
     USE print_control_mod, ONLY: lunout
-
-    INCLUDE "dimensions.h"
+    USE mod_grid_phy_lmdz, ONLY nbp_lon, nbp_lat
 
 ! Local variables
@@ -228,8 +227,8 @@
 !************************************************************************************
     ig_paral(1) = 1                            ! apple partition for //
-    ig_paral(2) = (jj_begin-1)*iim+ii_begin-1  ! offset
-    ig_paral(3) = (jj_end*iim+ii_end) - (jj_begin*iim+ii_begin) + 1
-
-    IF (mpi_rank==mpi_size-1) ig_paral(3)=ig_paral(3)+iim-1
+    ig_paral(2) = (jj_begin-1)*nbp_lon+ii_begin-1  ! offset
+    ig_paral(3) = (jj_end*nbp_lon+ii_end) - (jj_begin*nbp_lon+ii_begin) + 1
+
+    IF (mpi_rank==mpi_size-1) ig_paral(3)=ig_paral(3)+nbp_lon-1
     WRITE(lunout,*) mpi_rank,'ig_paral--->',ig_paral(2),ig_paral(3)
     
@@ -248,7 +247,7 @@
 
     il_var_actual_shape(1) = 1
-    il_var_actual_shape(2) = iim
+    il_var_actual_shape(2) = nbp_lon
     il_var_actual_shape(3) = 1
-    il_var_actual_shape(4) = jjm+1
+    il_var_actual_shape(4) = nbp_lat
    
     il_var_type = PRISM_Real
@@ -320,5 +319,5 @@
 !
     USE print_control_mod, ONLY: lunout
-    INCLUDE "dimensions.h"
+    USE mod_grid_phy_lmdz, ONLY nbp_lon, nbp_lat
 ! Input arguments
 !************************************************************************************
@@ -327,5 +326,5 @@
 ! Output arguments
 !************************************************************************************
-    REAL, DIMENSION(iim, jj_nb,maxrecv), INTENT(OUT) :: tab_get
+    REAL, DIMENSION(nbp_lon, jj_nb,maxrecv), INTENT(OUT) :: tab_get
 
 ! Local variables
@@ -335,5 +334,5 @@
     CHARACTER (len = 20)          :: modname = 'fromcpl'
     CHARACTER (len = 80)          :: abort_message 
-    REAL, DIMENSION(iim*jj_nb)    :: field
+    REAL, DIMENSION(nbp_lon*jj_nb)    :: field
 
 !************************************************************************************
@@ -344,7 +343,7 @@
     istart=ii_begin
     IF (is_south_pole) THEN
-       iend=(jj_end-jj_begin)*iim+iim
+       iend=(jj_end-jj_begin)*nbp_lon+nbp_lon
     ELSE
-       iend=(jj_end-jj_begin)*iim+ii_end
+       iend=(jj_end-jj_begin)*nbp_lon+ii_end
     ENDIF
     
@@ -353,5 +352,5 @@
           field(:) = -99999.
           CALL prism_get_proto(inforecv(i)%nid, ktime, field(istart:iend), ierror)
-          tab_get(:,:,i) = RESHAPE(field(:),(/iim,jj_nb/))
+          tab_get(:,:,i) = RESHAPE(field(:),(/nbp_lon,jj_nb/))
        
           IF (ierror .NE. PRISM_Ok .AND. ierror.NE.PRISM_Recvd .AND. &
@@ -382,10 +381,10 @@
 ! 
     USE print_control_mod, ONLY: lunout
-    INCLUDE "dimensions.h"
+    USE mod_grid_phy_lmdz, ONLY nbp_lon, nbp_lat
 ! Input arguments
 !************************************************************************************
     INTEGER, INTENT(IN)                              :: ktime
     LOGICAL, INTENT(IN)                              :: last
-    REAL, DIMENSION(iim, jj_nb, maxsend), INTENT(IN) :: tab_put
+    REAL, DIMENSION(nbp_lon, jj_nb, maxsend), INTENT(IN) :: tab_put
 
 ! Local variables
@@ -395,5 +394,5 @@
     INTEGER                          :: wstart,wend
     INTEGER                          :: ierror, i
-    REAL, DIMENSION(iim*jj_nb)       :: field
+    REAL, DIMENSION(nbp_lon*jj_nb)       :: field
     CHARACTER (len = 20),PARAMETER   :: modname = 'intocpl'
     CHARACTER (len = 80)             :: abort_message 
@@ -410,7 +409,7 @@
     istart=ii_begin
     IF (is_south_pole) THEN
-       iend=(jj_end-jj_begin)*iim+iim
+       iend=(jj_end-jj_begin)*nbp_lon+nbp_lon
     ELSE
-       iend=(jj_end-jj_begin)*iim+ii_end
+       iend=(jj_end-jj_begin)*nbp_lon+ii_end
     ENDIF
     
@@ -418,10 +417,10 @@
        wstart=istart
        wend=iend
-       IF (is_north_pole) wstart=istart+iim-1
-       IF (is_south_pole) wend=iend-iim+1
+       IF (is_north_pole) wstart=istart+nbp_lon-1
+       IF (is_south_pole) wend=iend-nbp_lon+1
        
        DO i = 1, maxsend
           IF (infosend(i)%action) THEN
-             field = RESHAPE(tab_put(:,:,i),(/iim*jj_nb/))
+             field = RESHAPE(tab_put(:,:,i),(/nbp_lon*jj_nb/))
              CALL writefield_phy(infosend(i)%name,field(wstart:wend),1)
           END IF
@@ -435,5 +434,5 @@
     DO i = 1, maxsend
       IF (infosend(i)%action .AND. infosend(i)%nid .NE. -1 ) THEN
-          field = RESHAPE(tab_put(:,:,i),(/iim*jj_nb/))
+          field = RESHAPE(tab_put(:,:,i),(/nbp_lon*jj_nb/))
           CALL prism_put_proto(infosend(i)%nid, ktime, field(istart:iend), ierror)
           
Index: /LMDZ5/trunk/libf/phylmd/orbite.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/orbite.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/orbite.F90	(revision 2346)
@@ -63,6 +63,4 @@
   ! la journee (0 a 1)
   ! ======================================================================
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   REAL longi
   REAL lati(klon), frac(klon), muzero(klon)
@@ -129,6 +127,4 @@
   ! frac-----OUTPUT: ensoleillement moyen entre gmtime et gmtime+pdtrad
   ! ================================================================
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   ! ================================================================
@@ -266,6 +262,4 @@
 
   ! ====================================================================
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   ! ====================================================================
Index: /LMDZ5/trunk/libf/phylmd/orografi.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/orografi.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/orografi.F90	(revision 2346)
@@ -24,6 +24,4 @@
   ! d_v-----output-R-increment de la vitesse v
   ! ======================================================================
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
 
@@ -171,6 +169,4 @@
 
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   include "YOEGWD.h"
@@ -404,6 +400,4 @@
 
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   include "YOEGWD.h"
@@ -849,6 +843,4 @@
   USE dimphy
   IMPLICIT NONE
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   include "YOEGWD.h"
@@ -980,6 +972,4 @@
 
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   include "YOEGWD.h"
@@ -1209,6 +1199,4 @@
   ! d_v-----output-R-increment de la vitesse v
   ! ======================================================================
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
 
@@ -1324,6 +1312,4 @@
 
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   include "YOEGWD.h"
Index: /LMDZ5/trunk/libf/phylmd/orografi_strato.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/orografi_strato.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/orografi_strato.F90	(revision 2346)
@@ -61,6 +61,4 @@
 
   ! ======================================================================
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   include "YOEGWD.h"
@@ -239,6 +237,4 @@
 
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   include "YOEGWD.h"
@@ -541,6 +537,4 @@
 
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   include "YOEGWD.h"
@@ -995,6 +989,4 @@
   IMPLICIT NONE
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   include "YOEGWD.h"
@@ -1114,6 +1106,4 @@
   IMPLICIT NONE
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   include "YOEGWD.h"
@@ -1350,6 +1340,4 @@
   ! ======================================================================
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   include "YOEGWD.h"
@@ -1510,6 +1498,4 @@
 
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
   include "YOEGWD.h"
Index: /LMDZ5/trunk/libf/phylmd/phyaqua_mod.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/phyaqua_mod.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/phyaqua_mod.F90	(revision 2346)
@@ -489,6 +489,4 @@
     USE mod_phys_lmdz_transfert_para, ONLY: gather
     IMPLICIT NONE
-    ! #include "dimensions.h"
-    ! #include "dimphy.h"
     include "netcdf.inc"
 
Index: /LMDZ5/trunk/libf/phylmd/plevel.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/plevel.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/plevel.F90	(revision 2346)
@@ -16,7 +16,4 @@
 #endif
   IMPLICIT NONE
-
-  ! ym#include "dimensions.h"
-  ! y#include "dimphy.h"
 
   ! ================================================================
Index: /LMDZ5/trunk/libf/phylmd/plevel_new.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/plevel_new.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/plevel_new.F90	(revision 2346)
@@ -18,7 +18,4 @@
 
   IMPLICIT NONE
-
-  ! ym#include "dimensions.h"
-  ! y#include "dimphy.h"
 
   ! ================================================================
Index: /LMDZ5/trunk/libf/phylmd/radiation_AR4.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/radiation_AR4.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/radiation_AR4.F90	(revision 2346)
@@ -9,7 +9,4 @@
   IMPLICIT NONE
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! ym#include "raddim.h"
   include "YOMCST.h"
 
@@ -317,7 +314,4 @@
     rtdumg, rth2o, rtumg
   IMPLICIT NONE
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! ym#include "raddim.h"
   include "radepsi.h"
   include "radopt.h"
@@ -491,7 +485,4 @@
 
   IMPLICIT NONE
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! ym#include "raddim.h"i
 
   ! ------------------------------------------------------------------
@@ -715,7 +706,4 @@
 
   IMPLICIT NONE
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! ym#include "raddim.h"
   include "radepsi.h"
 
@@ -1210,7 +1198,4 @@
   USE radiation_ar4_param, ONLY: taua, rpiza, rcga
   IMPLICIT NONE
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! ym#include "raddim.h"
   include "radepsi.h"
   include "radopt.h"
@@ -1541,7 +1526,4 @@
   USE dimphy
   IMPLICIT NONE
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! ym#include "raddim.h"
   include "radepsi.h"
   include "radopt.h"
@@ -1871,7 +1853,4 @@
   USE dimphy
   IMPLICIT NONE
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! ym#include "raddim.h"
 
   ! ------------------------------------------------------------------
@@ -1998,7 +1977,4 @@
   USE radiation_ar4_param, ONLY: apad, bpad, d
   IMPLICIT NONE
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! ym#include "raddim.h"
 
   ! -----------------------------------------------------------------------
@@ -2070,7 +2046,4 @@
   USE radiation_ar4_param, ONLY: apad, bpad, d
   IMPLICIT NONE
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! ym#include "raddim.h"
 
   ! -----------------------------------------------------------------------
@@ -2153,7 +2126,4 @@
   USE print_control_mod, ONLY: lunout
   IMPLICIT NONE
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! ym#include "raddim.h"
   include "raddimlw.h"
   include "YOMCST.h"
@@ -2348,7 +2318,4 @@
 
   IMPLICIT NONE
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! ym#include "raddim.h"
   include "raddimlw.h"
   include "YOMCST.h"
@@ -2714,7 +2681,4 @@
   USE dimphy
   IMPLICIT NONE
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! ym#include "raddim.h"
   include "raddimlw.h"
   include "YOMCST.h"
@@ -2803,7 +2767,4 @@
   USE dimphy
   IMPLICIT NONE
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! ym#include "raddim.h"
   include "radepsi.h"
   include "radopt.h"
@@ -3183,7 +3144,4 @@
   USE radiation_ar4_param, ONLY: tintp, xp, ga, gb
   IMPLICIT NONE
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! ym#include "raddim.h"
   include "raddimlw.h"
 
@@ -4585,7 +4543,4 @@
   USE dimphy
   IMPLICIT NONE
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! ym#include "raddim.h"
   include "raddimlw.h"
   include "YOMCST.h"
@@ -4693,7 +4648,4 @@
   USE dimphy
   IMPLICIT NONE
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! ym#include "raddim.h"
   include "raddimlw.h"
   include "radopt.h"
@@ -4995,7 +4947,4 @@
   USE dimphy
   IMPLICIT NONE
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! ym#include "raddim.h"
   include "raddimlw.h"
 
@@ -5231,7 +5180,4 @@
   USE radiation_ar4_param, ONLY: wg1
   IMPLICIT NONE
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! ym#include "raddim.h"
   include "raddimlw.h"
 
@@ -5426,7 +5372,4 @@
   USE dimphy
   IMPLICIT NONE
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! ym#include "raddim.h"
   include "raddimlw.h"
 
@@ -5602,7 +5545,4 @@
   USE dimphy
   IMPLICIT NONE
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! ym#include "raddim.h"
   include "raddimlw.h"
 
Index: /LMDZ5/trunk/libf/phylmd/readaerosol.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/readaerosol.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/readaerosol.F90	(revision 2346)
@@ -178,5 +178,5 @@
 ! 3) Read field month by month
 ! 4) Close file  
-! 5) Transform the global field from 2D(iim, jjp+1) to 1D(klon_glo)
+! 5) Transform the global field from 2D(nbp_lon,nbp_lat) to 1D(klon_glo)
 !     - Also the levels and the latitudes have to be inversed
 !
@@ -188,5 +188,6 @@
     USE netcdf
     USE dimphy
-    USE mod_grid_phy_lmdz
+    USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo, &
+                                 grid2Dto1D_glo
     USE mod_phys_lmdz_para
     USE iophy, ONLY : io_lon, io_lat
@@ -195,6 +196,4 @@
     IMPLICIT NONE
       
-    INCLUDE "dimensions.h"      
-
 ! Input argumets
     CHARACTER(len=7), INTENT(IN)          :: varname
@@ -223,11 +222,11 @@
     REAL, ALLOCATABLE, DIMENSION(:)       :: varktmp
 
-    REAL, DIMENSION(iim,jjm+1,12)         :: psurf_glo2D   ! Surface pression for 12 months on dynamics global grid
+    REAL, DIMENSION(nbp_lon,nbp_lat,12)         :: psurf_glo2D   ! Surface pression for 12 months on dynamics global grid
     REAL, DIMENSION(klon_glo,12)          :: psurf_glo1D   ! -"- on physical global grid
-    REAL, DIMENSION(iim,jjm+1,12)         :: load_glo2D    ! Load for 12 months on dynamics global grid
+    REAL, DIMENSION(nbp_lon,nbp_lat,12)         :: load_glo2D    ! Load for 12 months on dynamics global grid
     REAL, DIMENSION(klon_glo,12)          :: load_glo1D    ! -"- on physical global grid
-    REAL, DIMENSION(iim,jjm+1)            :: vartmp
-    REAL, DIMENSION(iim)                  :: lon_src              ! longitudes in file
-    REAL, DIMENSION(jjm+1)                :: lat_src, lat_src_inv ! latitudes in file
+    REAL, DIMENSION(nbp_lon,nbp_lat)            :: vartmp
+    REAL, DIMENSION(nbp_lon)                  :: lon_src              ! longitudes in file
+    REAL, DIMENSION(nbp_lat)                :: lat_src, lat_src_inv ! latitudes in file
     LOGICAL                               :: new_file             ! true if new file format detected
     LOGICAL                               :: invert_lat           ! true if the field has to be inverted for latitudes
@@ -267,6 +266,6 @@
 
        ! Invert source latitudes
-       DO j = 1, jjm+1
-          lat_src_inv(j) = lat_src(jjm+1 +1 -j)
+       DO j = 1, nbp_lat
+          lat_src_inv(j) = lat_src(nbp_lat +1 -j)
        END DO
 
@@ -313,5 +312,5 @@
        
      ! Allocate variables depending on the number of vertical levels
-       ALLOCATE(varmth(iim, jjm+1, klev_src), varyear(iim, jjm+1, klev_src, 12), stat=ierr)
+       ALLOCATE(varmth(nbp_lon,nbp_lat, klev_src), varyear(nbp_lon,nbp_lat, klev_src, 12), stat=ierr)
        IF (ierr /= 0) CALL abort_physic('get_aero_fromfile', 'pb in allocation 1',1)
 
@@ -435,5 +434,5 @@
      
 
-! 5) Transform the global field from 2D(iim, jjp+1) to 1D(klon_glo)
+! 5) Transform the global field from 2D(nbp_lon,nbp_lat) to 1D(klon_glo)
 !****************************************************************************************
 ! Test if vertical levels have to be inversed
@@ -448,6 +447,6 @@
              varmth(:,:,:) = varyear(:,:,:,imth) ! use varmth temporarly
              DO k=1, klev_src
-                DO j=1, jjm+1
-                   DO i=1,iim 
+                DO j=1, nbp_lat
+                   DO i=1, nbp_lon
                       varyear(i,j,k,imth) = varmth(i,j,klev_src+1-k)
                    END DO
@@ -482,7 +481,7 @@
              varmth(:,:,:) = varyear(:,:,:,imth) ! use varmth temporarly
              DO k=1,klev_src
-                DO j=1,jjm+1
-                   DO i=1,iim
-                      varyear(i,j,k,imth) = varmth(i,jjm+1+1-j,k)
+                DO j=1,nbp_lat
+                   DO i=1,nbp_lon
+                      varyear(i,j,k,imth) = varmth(i,nbp_lat+1-j,k)
                    END DO
                 END DO
@@ -491,7 +490,7 @@
              ! Invert latitudes for surface pressure
              vartmp(:,:) = psurf_glo2D(:,:,imth)
-             DO j=1, jjm+1
-                DO i=1,iim
-                   psurf_glo2D(i,j,imth)= vartmp(i,jjm+1+1-j)
+             DO j=1,nbp_lat
+                DO i=1,nbp_lon
+                   psurf_glo2D(i,j,imth)= vartmp(i,nbp_lat+1-j)
                 END DO
              END DO
@@ -499,7 +498,7 @@
              ! Invert latitudes for the load
              vartmp(:,:) = load_glo2D(:,:,imth)
-             DO j=1, jjm+1
-                DO i=1,iim
-                   load_glo2D(i,j,imth)= vartmp(i,jjm+1+1-j)
+             DO j=1,nbp_lat
+                DO i=1,nbp_lon
+                   load_glo2D(i,j,imth)= vartmp(i,nbp_lat+1-j)
                 END DO
              END DO
@@ -509,13 +508,13 @@
           DO k=1, klev_src
              npole=0.  ! North pole, j=1
-             spole=0.  ! South pole, j=jjm+1         
-             DO i=1,iim
+             spole=0.  ! South pole, j=nbp_lat        
+             DO i=1,nbp_lon
                 npole = npole + varyear(i,1,k,imth)
-                spole = spole + varyear(i,jjm+1,k,imth)
+                spole = spole + varyear(i,nbp_lat,k,imth)
              END DO
-             npole = npole/REAL(iim)
-             spole = spole/REAL(iim)
+             npole = npole/REAL(nbp_lon)
+             spole = spole/REAL(nbp_lon)
              varyear(:,1,    k,imth) = npole
-             varyear(:,jjm+1,k,imth) = spole
+             varyear(:,nbp_lat,k,imth) = spole
           END DO
        END DO ! imth
Index: /LMDZ5/trunk/libf/phylmd/readaerosolstrato.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/readaerosolstrato.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/readaerosolstrato.F90	(revision 2346)
@@ -6,5 +6,6 @@
 
     USE phys_cal_mod, ONLY : mth_cur
-    USE mod_grid_phy_lmdz
+    USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo, &
+                                 grid2dto1d_glo
     USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
     USE mod_phys_lmdz_para 
@@ -17,5 +18,4 @@
 
     include "YOMCST.h"
-    include "dimensions.h"
 
 ! Variable input
@@ -85,6 +85,6 @@
     n_lat = size(latitude)
     print *, 'LAT aerosol strato=', n_lat, latitude
-    IF (n_lat.NE.jjm+1) THEN 
-       print *,'Le nombre de lat n est pas egal a jjm+1'
+    IF (n_lat.NE.nbp_lat) THEN 
+       print *,'Le nombre de lat n est pas egal a nbp_lat'
        STOP
     ENDIF
@@ -94,6 +94,6 @@
     n_lon = size(longitude)
     print *, 'LON aerosol strato=', n_lon, longitude
-    IF (n_lon.NE.iim) THEN 
-       print *,'Le nombre de lon n est pas egal a iim'
+    IF (n_lon.NE.nbp_lon) THEN 
+       print *,'Le nombre de lon n est pas egal a nbp_lon'
        STOP
     ENDIF
Index: /LMDZ5/trunk/libf/phylmd/readchlorophyll.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/readchlorophyll.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/readchlorophyll.F90	(revision 2346)
@@ -10,5 +10,6 @@
 
     USE phys_cal_mod, ONLY : mth_cur
-    USE mod_grid_phy_lmdz
+    USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo, &
+                                 grid2dto1d_glo
     USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
     USE mod_phys_lmdz_para 
@@ -20,5 +21,4 @@
 
     include "YOMCST.h"
-    include "dimensions.h"
 
 ! Variable input
@@ -62,6 +62,6 @@
     n_lon = size(longitude)
 !    print *, 'LON chlorophyll=', n_lon, longitude
-    IF (n_lon.NE.iim) THEN
-       print *,'Le nombre de lon n est pas egal a iim'
+    IF (n_lon.NE.nbp_lon) THEN
+       print *,'Le nombre de lon n est pas egal a nbp_lon'
        STOP
     ENDIF
@@ -72,6 +72,6 @@
     n_lat = size(latitude)
 !    print *, 'LAT chlorophyll=', n_lat, latitude
-    IF (n_lat.NE.jjm+1) THEN 
-       print *,'Le nombre de lat n est pas egal a jjm+1'
+    IF (n_lat.NE.nbp_lat) THEN 
+       print *,'Le nombre de lat n est pas egal a jnbp_lat'
        STOP
     ENDIF
Index: /LMDZ5/trunk/libf/phylmd/regr_lat_time_climoz_m.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/regr_lat_time_climoz_m.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/regr_lat_time_climoz_m.F90	(revision 2346)
@@ -66,4 +66,5 @@
     ! year.
 
+    use mod_grid_phy_lmdz, ONLY : nbp_lat
     use regr1_step_av_m, only: regr1_step_av
     use regr3_lint_m, only: regr3_lint
@@ -73,4 +74,6 @@
     use netcdf, only: nf90_get_att, nf90_get_var, nf90_noerr, nf90_nowrite
     use assert_m, only: assert
+    use regular_lonlat_mod, only : boundslat_reg, south
+    use nrtype, only: pi
 
     integer, intent(in):: read_climoz ! read ozone climatology
@@ -81,13 +84,4 @@
 
     ! Variables local to the procedure:
-
-    include "dimensions.h"
-    ! (for "jjm")
-    include "paramet.h"
-    ! (for the other included files)
-    include "comgeom2.h"
-    ! (for "rlatv")
-    include "comconst.h"
-    ! (for "pi")
 
     integer n_plev ! number of pressure levels in the input data
@@ -289,6 +283,6 @@
     call nf95_close(ncid_in)
 
-    allocate(o3_regr_lat(jjm + 1, n_plev, 0:13, read_climoz))
-    allocate(o3_out(jjm + 1, n_plev, 360, read_climoz))
+    allocate(o3_regr_lat(nbp_lat, n_plev, 0:13, read_climoz))
+    allocate(o3_out(nbp_lat, n_plev, 360, read_climoz))
 
     ! Regrid in latitude:
@@ -298,6 +292,6 @@
        print *, &
             "Found 12 months in ozone climatologies, assuming periodicity..."
-       o3_regr_lat(jjm+1:1:-1, :, 1:12, :) = regr1_step_av(o3_in, &
-            xs=sin(lat_in_edg), xt=sin((/- pi / 2, rlatv(jjm:1:-1), pi / 2/)))
+       o3_regr_lat(nbp_lat:1:-1, :, 1:12, :) = regr1_step_av(o3_in, &
+            xs=sin(lat_in_edg), xt=sin((/- pi / 2, boundslat_reg(nbp_lat-1:1:-1,south), pi / 2/)))
        ! (invert order of indices in "o3_regr_lat" because "rlatu" is
        ! in descending order)
@@ -309,6 +303,6 @@
     else
        print *, "Using 14 months in ozone climatologies..."
-       o3_regr_lat(jjm+1:1:-1, :, :, :) = regr1_step_av(o3_in, &
-            xs=sin(lat_in_edg), xt=sin((/- pi / 2, rlatv(jjm:1:-1), pi / 2/)))
+       o3_regr_lat(nbp_lat:1:-1, :, :, :) = regr1_step_av(o3_in, &
+            xs=sin(lat_in_edg), xt=sin((/- pi / 2, boundslat_reg(nbp_lat-1:1:-1,south), pi / 2/)))
        ! (invert order of indices in "o3_regr_lat" because "rlatu" is
        ! in descending order)
@@ -320,5 +314,5 @@
     ! Write to file:
     do m = 1, read_climoz
-       call nf95_put_var(ncid_out, varid_out(m), o3_out(jjm+1:1:-1, :, :, m))
+       call nf95_put_var(ncid_out, varid_out(m), o3_out(nbp_lat:1:-1, :, :, m))
        ! (The order of "rlatu" is inverted in the output file)
     end do
@@ -336,7 +330,10 @@
     ! dimensions and variables, and writes one of the coordinate variables.
 
+    use mod_grid_phy_lmdz, ONLY : nbp_lat
     use netcdf95, only: nf95_create, nf95_def_dim, nf95_def_var, &
          nf95_put_att, nf95_enddef, nf95_copy_att, nf95_put_var
     use netcdf, only: nf90_clobber, nf90_float, nf90_global
+    use nrtype, only: pi
+    use regular_lonlat_mod, only : lat_reg
 
     integer, intent(in):: ncid_in, n_plev
@@ -349,13 +346,4 @@
     ! Variables local to the procedure:
 
-    include "dimensions.h"
-    ! (for "jjm")
-    include "paramet.h"
-    ! (for the other included files)
-    include "comgeom2.h"
-    ! (for "rlatu")
-    include "comconst.h"
-    ! (for "pi")
-
     integer ncerr
     integer dimid_rlatu, dimid_plev, dimid_time
@@ -371,5 +359,5 @@
     call nf95_def_dim(ncid_out, "time", 360, dimid_time)
     call nf95_def_dim(ncid_out, "plev", n_plev, dimid_plev)
-    call nf95_def_dim(ncid_out, "rlatu", jjm + 1, dimid_rlatu)
+    call nf95_def_dim(ncid_out, "rlatu", nbp_lat, dimid_rlatu)
 
     ! Define coordinate variables:
@@ -432,5 +420,5 @@
 
     ! Write one of the coordinate variables:
-    call nf95_put_var(ncid_out, varid_rlatu, rlatu(jjm+1:1:-1) / pi * 180.)
+    call nf95_put_var(ncid_out, varid_rlatu, lat_reg(nbp_lat:1:-1) / pi * 180.)
     ! (convert from rad to degrees and sort in ascending order)
 
Index: /LMDZ5/trunk/libf/phylmd/regr_lat_time_coefoz_m.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/regr_lat_time_coefoz_m.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/regr_lat_time_coefoz_m.F90	(revision 2346)
@@ -40,4 +40,5 @@
     ! when we regrid in pressure).
 
+    use mod_grid_phy_lmdz, ONLY : nbp_lat
     use regr1_step_av_m, only: regr1_step_av
     use regr3_lint_m, only: regr3_lint
@@ -45,14 +46,8 @@
          nf95_put_var, nf95_gw_var
     use netcdf, only: nf90_nowrite, nf90_get_var
+    use nrtype, only: pi
+    use regular_lonlat_mod, only: boundslat_reg, south
 
     ! Variables local to the procedure:
-
-    include "dimensions.h"
-    ! (for "jjm")
-    include "paramet.h"
-    include "comgeom2.h"
-    ! (for "rlatv")
-    include "comconst.h"
-    ! (for "pi")
 
     integer ncid_in, ncid_out ! NetCDF IDs for input and output files
@@ -164,5 +159,5 @@
     call nf95_inq_varid(ncid_in, "latitude", varid)
     call nf95_gw_var(ncid_in, varid, latitude)
-    ! Convert from degrees to rad, because "rlatv" is in rad:
+    ! Convert from degrees to rad, because "boundslat_reg" is in rad:
     latitude = latitude / 180. * pi
     n_lat = size(latitude)
@@ -200,6 +195,6 @@
 
     allocate(o3_par_in(n_lat, n_plev, 12))
-    allocate(v_regr_lat(jjm + 1, n_plev, 0:13))
-    allocate(o3_par_out(jjm + 1, n_plev, 360))
+    allocate(v_regr_lat(nbp_lat, n_plev, 0:13))
+    allocate(o3_par_out(nbp_lat, n_plev, 360))
 
     do i_v = 1, n_o3_param
@@ -214,6 +209,6 @@
        ! We average with respect to sine of latitude, which is
        ! equivalent to weighting by cosine of latitude:
-       v_regr_lat(jjm+1:1:-1, :, 1:12) = regr1_step_av(o3_par_in, &
-            xs=sin(lat_in_edg), xt=sin((/- pi / 2, rlatv(jjm:1:-1), pi / 2/)))
+       v_regr_lat(nbp_lat:1:-1, :, 1:12) = regr1_step_av(o3_par_in, &
+            xs=sin(lat_in_edg), xt=sin((/- pi / 2, boundslat_reg(nbp_lat-1:1:-1,south), pi / 2/)))
        ! (invert order of indices in "v_regr_lat" because "rlatu" is
        ! in descending order)
@@ -229,5 +224,5 @@
        ! Write to file:
        call nf95_put_var(ncid_out, varid_out(i_v), &
-            o3_par_out(jjm+1:1:-1, :, :))
+            o3_par_out(nbp_lat:1:-1, :, :))
        ! (The order of "rlatu" is inverted in the output file)
     end do
@@ -246,4 +241,5 @@
     ! dimensions and variables, and writes one of the coordinate variables.
 
+    use mod_grid_phy_lmdz, ONLY : nbp_lat
     use assert_eq_m, only: assert_eq
 
@@ -251,4 +247,6 @@
          nf95_put_att, nf95_enddef, nf95_copy_att, nf95_put_var
     use netcdf, only: nf90_clobber, nf90_float, nf90_copy_att, nf90_global
+    use nrtype, only: pi
+    use regular_lonlat_mod, only : lat_reg
 
     integer, intent(in):: ncid_in, varid_in(:), n_plev
@@ -257,12 +255,4 @@
 
     ! Variables local to the procedure:
-
-    include "dimensions.h"
-    ! (for "jjm")
-    include "paramet.h"
-    include "comgeom2.h"
-    ! (for "rlatu")
-    include "comconst.h"
-    ! (for "pi")
 
     integer ncerr
@@ -282,5 +272,5 @@
     call nf95_def_dim(ncid_out, "time", 360, dimid_time)
     call nf95_def_dim(ncid_out, "plev", n_plev, dimid_plev)
-    call nf95_def_dim(ncid_out, "rlatu", jjm + 1, dimid_rlatu)
+    call nf95_def_dim(ncid_out, "rlatu", nbp_lat, dimid_rlatu)
 
     ! Define coordinate variables:
@@ -332,5 +322,5 @@
 
     ! Write one of the coordinate variables:
-    call nf95_put_var(ncid_out, varid_rlatu, rlatu(jjm+1:1:-1) / pi * 180.)
+    call nf95_put_var(ncid_out, varid_rlatu, lat_reg(nbp_lat:1:-1) / pi * 180.)
     ! (convert from rad to degrees and sort in ascending order)
 
Index: /LMDZ5/trunk/libf/phylmd/regr_pr_av_m.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/regr_pr_av_m.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/regr_pr_av_m.F90	(revision 2346)
@@ -40,5 +40,5 @@
     use regr1_step_av_m, only: regr1_step_av
     use mod_phys_lmdz_mpi_data, only: is_mpi_root
-
+    use mod_grid_phy_lmdz, only: nbp_lon, nbp_lat, nbp_lev
     use mod_phys_lmdz_transfert_para, only: scatter2d
     ! (pack to the LMDZ horizontal "physics" grid and scatter)
@@ -63,8 +63,7 @@
     ! Variables local to the procedure:
 
-    include "dimensions.h"
     integer varid, ncerr ! for NetCDF
 
-    real  v1(iim, jjm + 1, size(press_in_edg) - 1, size(name))
+    real  v1(nbp_lon, nbp_lat, size(press_in_edg) - 1, size(name))
     ! input fields at day "julien", on the global "dynamics" horizontal grid
     ! First dimension is for longitude.
@@ -84,7 +83,7 @@
     !--------------------------------------------
 
-    call assert(size(v3, 1) == klon, size(v3, 2) == llm, "regr_pr_av v3 klon")
+    call assert(size(v3, 1) == klon, size(v3, 2) == nbp_lev, "regr_pr_av v3 klon")
     n_var = assert_eq(size(name), size(v3, 3), "regr_pr_av v3 n_var")
-    call assert(shape(paprs) == (/klon, llm+1/), "regr_pr_av paprs")
+    call assert(shape(paprs) == (/klon, nbp_lev+1/), "regr_pr_av paprs")
 
     !$omp master
@@ -102,8 +101,8 @@
        ! Latitudes are in ascending order in the input file while
        ! "rlatu" is in descending order so we need to invert order:
-       v1(1, :, :, :) = v1(1, jjm+1:1:-1, :, :)
+       v1(1, :, :, :) = v1(1, nbp_lat:1:-1, :, :)
 
        ! Duplicate on all longitudes:
-       v1(2:, :, :, :) = spread(v1(1, :, :, :), dim=1, ncopies=iim-1)
+       v1(2:, :, :, :) = spread(v1(1, :, :, :), dim=1, ncopies=nbp_lon-1)
     end if
     !$omp end master
@@ -113,6 +112,6 @@
     ! Regrid in pressure at each horizontal position:
     do i = 1, klon
-       v3(i, llm:1:-1, :) = regr1_step_av(v2(i, :, :), press_in_edg, &
-            paprs(i, llm+1:1:-1))
+       v3(i, nbp_lev:1:-1, :) = regr1_step_av(v2(i, :, :), press_in_edg, &
+            paprs(i, nbp_lev+1:1:-1))
        ! (invert order of indices because "paprs" is in descending order)
     end do
Index: /LMDZ5/trunk/libf/phylmd/regr_pr_comb_coefoz_m.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/regr_pr_comb_coefoz_m.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/regr_pr_comb_coefoz_m.F90	(revision 2346)
@@ -40,7 +40,7 @@
 
     use dimphy, only: klon
+    use mod_grid_phy_lmdz, only: nbp_lev
 
     ! Variables local to the procedure:
-    include "dimensions.h"
 
     !---------------------------------------
@@ -49,6 +49,6 @@
     print *, "Call sequence information: alloc_coefoz"
     !$omp end master
-    allocate(c_Mob(klon, llm), a2(klon, llm), a4_mass(klon, llm))
-    allocate(a6_mass(klon, llm), r_het_interm(klon, llm))
+    allocate(c_Mob(klon, nbp_lev), a2(klon, nbp_lev), a4_mass(klon, nbp_lev))
+    allocate(a6_mass(klon, nbp_lev), r_het_interm(klon, nbp_lev))
 
   end subroutine alloc_coefoz
@@ -79,4 +79,5 @@
     use regr_pr_int_m, only: regr_pr_int
     use press_coefoz_m, only: press_in_edg, plev
+    use mod_grid_phy_lmdz, only: nbp_lev
 
     integer, intent(in):: julien ! jour julien, 1 <= julien <= 360
@@ -85,16 +86,15 @@
     ! (latitude on the partial "physics" grid, in degrees)
 
-    real, intent(in):: paprs(:, :) ! (klon, llm + 1)
+    real, intent(in):: paprs(:, :) ! (klon, nbp_lev + 1)
     ! (pression pour chaque inter-couche, en Pa)
 
-    real, intent(in):: pplay(:, :) ! (klon, llm)
+    real, intent(in):: pplay(:, :) ! (klon, nbp_lev)
     ! (pression pour le mileu de chaque couche, en Pa)
 
     ! Variables local to the procedure:
 
-    include "dimensions.h"
     integer ncid ! for NetCDF
 
-    real coefoz(klon, llm, 7)
+    real coefoz(klon, nbp_lev, 7)
     ! (temporary storage for 7 ozone coefficients)
     ! (On the partial "physics" grid.
@@ -102,5 +102,5 @@
     ! middle of layer "k".)
 
-    real a6(klon, llm)
+    real a6(klon, nbp_lev)
     ! (derivative of "P_net_Mob" with respect to column-density of ozone
     ! above, in cm2 s-1)
@@ -121,6 +121,6 @@
     call assert((/size(rlat), size(paprs, 1), size(pplay, 1)/) == klon, &
          "regr_pr_comb_coefoz klon")
-    call assert((/size(paprs, 2) - 1, size(pplay, 2)/) == llm, &
-         "regr_pr_comb_coefoz llm")
+    call assert((/size(paprs, 2) - 1, size(pplay, 2)/) == nbp_lev, &
+         "regr_pr_comb_coefoz nbp_lev")
 
     !$omp master
@@ -150,5 +150,5 @@
     r_het_interm = coefoz(:, :, 7)
     ! Heterogeneous chemistry is only at high latitudes:
-    forall (k = 1: llm)
+    forall (k = 1: nbp_lev)
        where (abs(rlat) <= 45.) r_het_interm(:, k) = 0.
     end forall
Index: /LMDZ5/trunk/libf/phylmd/regr_pr_int_m.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/regr_pr_int_m.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/regr_pr_int_m.F90	(revision 2346)
@@ -30,5 +30,5 @@
     use regr1_lint_m, only: regr1_lint
     use mod_phys_lmdz_mpi_data, only: is_mpi_root
-
+    use mod_grid_phy_lmdz, only: nbp_lon, nbp_lat, nbp_lev
     use mod_phys_lmdz_transfert_para, only: scatter2d
     ! (pack to the LMDZ horizontal "physics" grid and scatter)
@@ -41,5 +41,5 @@
     ! (pressure level of input data, in Pa, in strictly ascending order)
 
-    real, intent(in):: pplay(:, :) ! (klon, llm)
+    real, intent(in):: pplay(:, :) ! (klon, nbp_lev)
     ! (pression pour le mileu de chaque couche, en Pa)
 
@@ -47,5 +47,5 @@
     ! (extra value of field at 0 pressure)
 
-    real, intent(out):: v3(:, :) ! (klon, llm)
+    real, intent(out):: v3(:, :) ! (klon, nbp_lev)
     ! (regridded field on the partial "physics" grid)
     ! ("v3(i, k)" is at longitude "xlon(i)", latitude
@@ -54,8 +54,7 @@
     ! Variables local to the procedure:
 
-    include "dimensions.h"
     integer varid, ncerr ! for NetCDF
 
-    real  v1(iim, jjm + 1, 0:size(plev))
+    real  v1(nbp_lon, nbp_lat, 0:size(plev))
     ! (input field at day "julien", on the global "dynamics" horizontal grid)
     ! (First dimension is for longitude.
@@ -72,6 +71,6 @@
     !--------------------------------------------
 
-    call assert(shape(v3) == (/klon, llm/), "regr_pr_int v3")
-    call assert(shape(pplay) == (/klon, llm/), "regr_pr_int pplay")
+    call assert(shape(v3) == (/klon, nbp_lev/), "regr_pr_int v3")
+    call assert(shape(pplay) == (/klon, nbp_lev/), "regr_pr_int pplay")
 
     !$omp master
@@ -84,5 +83,5 @@
        ! Latitudes are in ascending order in the input file while
        ! "rlatu" is in descending order so we need to invert order:
-       v1(1, :, 1:) = v1(1, jjm+1:1:-1, 1:)
+       v1(1, :, 1:) = v1(1, nbp_lat:1:-1, 1:)
 
        ! Complete "v1" with the value at 0 pressure:
@@ -90,5 +89,5 @@
 
        ! Duplicate on all longitudes:
-       v1(2:, :, :) = spread(v1(1, :, :), dim=1, ncopies=iim-1)
+       v1(2:, :, :) = spread(v1(1, :, :), dim=1, ncopies=nbp_lon-1)
     end if
     !$omp end master
@@ -98,5 +97,5 @@
     ! Regrid in pressure at each horizontal position:
     do i = 1, klon
-       v3(i, llm:1:-1) = regr1_lint(v2(i, :), (/0., plev/), pplay(i, llm:1:-1))
+       v3(i, nbp_lev:1:-1) = regr1_lint(v2(i, :), (/0., plev/), pplay(i, nbp_lev:1:-1))
        ! (invert order of indices because "pplay" is in descending order)
     end do
Index: /LMDZ5/trunk/libf/phylmd/regr_pr_o3_m.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/regr_pr_o3_m.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/regr_pr_o3_m.F90	(revision 2346)
@@ -31,4 +31,5 @@
     use press_coefoz_m, only: press_in_edg
     use time_phylmdz_mod, only: day_ref
+    use mod_grid_phy_lmdz, only: nbp_lon, nbp_lat, nbp_lev
 
     REAL, intent(in):: p3d(:, :, :) ! pressure at layer interfaces, in Pa
@@ -43,10 +44,8 @@
     ! Variables local to the procedure:
 
-    include "dimensions.h"
-
     integer ncid, varid, ncerr ! for NetCDF
     integer i, j
 
-    real r_mob(jjm + 1, size(press_in_edg) - 1)
+    real r_mob(nbp_lat, size(press_in_edg) - 1)
     ! (ozone mole fraction from Mobidic at day "day_ref")
     ! (r_mob(j, k) is at latitude "rlatu(j)", in pressure interval
@@ -56,7 +55,7 @@
 
     print *, "Call sequence information: regr_pr_o3"
-    call assert(shape(o3_mob_regr) == (/iim + 1, jjm + 1, llm/), &
+    call assert(shape(o3_mob_regr) == (/nbp_lon + 1, nbp_lat, nbp_lev/), &
          "regr_pr_o3 o3_mob_regr")
-    call assert(shape(p3d) == (/iim + 1, jjm + 1, llm + 1/), "regr_pr_o3 p3d")
+    call assert(shape(p3d) == (/nbp_lon + 1, nbp_lat, nbp_lev + 1/), "regr_pr_o3 p3d")
 
     call nf95_open("coefoz_LMDZ.nc", nf90_nowrite, ncid)
@@ -68,5 +67,5 @@
     ! Latitudes are in ascending order in the input file while
     ! "rlatu" is in descending order so we need to invert order:
-    r_mob = r_mob(jjm+1:1:-1, :)
+    r_mob = r_mob(nbp_lat:1:-1, :)
 
     call nf95_close(ncid)
@@ -75,16 +74,16 @@
 
     ! Poles:
-    do j = 1, jjm + 1, jjm
-       o3_mob_regr(1, j, llm:1:-1) &
-            = regr1_step_av(r_mob(j, :), press_in_edg, p3d(1, j, llm+1:1:-1))
+    do j = 1, nbp_lat, nbp_lat-1
+       o3_mob_regr(1, j, nbp_lev:1:-1) &
+            = regr1_step_av(r_mob(j, :), press_in_edg, p3d(1, j, nbp_lev+1:1:-1))
        ! (invert order of indices because "p3d" is in descending order)
     end do
 
     ! Other latitudes:
-    do j = 2, jjm
-       do i = 1, iim
-          o3_mob_regr(i, j, llm:1:-1) &
+    do j = 2, nbp_lat-1
+       do i = 1, nbp_lon
+          o3_mob_regr(i, j, nbp_lev:1:-1) &
                = regr1_step_av(r_mob(j, :), press_in_edg, &
-               p3d(i, j, llm+1:1:-1))
+               p3d(i, j, nbp_lev+1:1:-1))
              ! (invert order of indices because "p3d" is in descending order)
        end do
@@ -92,10 +91,10 @@
 
     ! Duplicate pole values on all longitudes:
-    o3_mob_regr(2:, 1, :) = spread(o3_mob_regr(1, 1, :), dim=1, ncopies=iim)
-    o3_mob_regr(2:, jjm + 1, :) &
-         = spread(o3_mob_regr(1, jjm + 1, :), dim=1, ncopies=iim)
+    o3_mob_regr(2:, 1, :) = spread(o3_mob_regr(1, 1, :), dim=1, ncopies=nbp_lon)
+    o3_mob_regr(2:, nbp_lat, :) &
+         = spread(o3_mob_regr(1, nbp_lat, :), dim=1, ncopies=nbp_lon)
 
     ! Duplicate first longitude to last longitude:
-    o3_mob_regr(iim + 1, 2:jjm, :) = o3_mob_regr(1, 2:jjm, :)
+    o3_mob_regr(nbp_lon + 1, 2:nbp_lat-1, :) = o3_mob_regr(1, 2:nbp_lat-1, :)
 
   end subroutine regr_pr_o3
Index: /LMDZ5/trunk/libf/phylmd/thermcell.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/thermcell.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/thermcell.F90	(revision 2346)
@@ -34,6 +34,4 @@
   ! -------------
 
-  include "dimensions.h"
-  ! ccc#include "dimphy.h"
   include "YOMCST.h"
 
@@ -998,6 +996,4 @@
   IMPLICIT NONE
 
-  include "dimensions.h"
-  ! ccc#include "dimphy.h"
   include "YOMCST.h"
 
Index: /LMDZ5/trunk/libf/phylmd/thermcellV0_main.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/thermcellV0_main.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/thermcellV0_main.F90	(revision 2346)
@@ -42,5 +42,4 @@
 !   -------------
 
-      include "dimensions.h"
       include "YOMCST.h"
       include "YOETHF.h"
Index: /LMDZ5/trunk/libf/phylmd/thermcell_main.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/thermcell_main.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/thermcell_main.F90	(revision 2346)
@@ -63,5 +63,4 @@
 !   -------------
 
-#include "dimensions.h"
 #include "YOMCST.h"
 #include "YOETHF.h"
Index: /LMDZ5/trunk/libf/phylmd/thermcell_old.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/thermcell_old.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/thermcell_old.F90	(revision 2346)
@@ -31,5 +31,4 @@
   ! -------------
 
-  include "dimensions.h"
   include "YOMCST.h"
 
@@ -742,6 +741,4 @@
   ! -------------
 
-  include "dimensions.h"
-  ! ccc#include "dimphy.h"
   include "YOMCST.h"
   include "YOETHF.h"
@@ -2345,6 +2342,4 @@
   ! -------------
 
-  include "dimensions.h"
-  ! ccc#include "dimphy.h"
   include "YOMCST.h"
   include "YOETHF.h"
@@ -3278,6 +3273,4 @@
   ! -------------
 
-  include "dimensions.h"
-  ! ccc#include "dimphy.h"
   include "YOMCST.h"
 
@@ -4139,7 +4132,4 @@
   ! =======================================================================
 
-  include "dimensions.h"
-  ! ccc#include "dimphy.h"
-
   INTEGER ngrid, nlay
 
@@ -4235,7 +4225,4 @@
 
   ! =======================================================================
-
-  include "dimensions.h"
-  ! ccc#include "dimphy.h"
 
   INTEGER ngrid, nlay
@@ -4342,7 +4329,4 @@
   ! =======================================================================
 
-  include "dimensions.h"
-  ! ccc#include "dimphy.h"
-
   INTEGER ngrid, nlay
 
@@ -4419,7 +4403,4 @@
 
   ! =======================================================================
-
-  include "dimensions.h"
-  ! ccc#include "dimphy.h"
 
   INTEGER ngrid, nlay
@@ -4561,6 +4542,4 @@
   ! -------------
 
-  include "dimensions.h"
-  ! ccc#include "dimphy.h"
   include "YOMCST.h"
 
Index: /LMDZ5/trunk/libf/phylmd/transp.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/transp.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/transp.F90	(revision 2346)
@@ -13,6 +13,4 @@
   ! ======================================================================
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
 
Index: /LMDZ5/trunk/libf/phylmd/transp_lay.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/transp_lay.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/transp_lay.F90	(revision 2346)
@@ -13,6 +13,4 @@
   ! ======================================================================
 
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
 
Index: /LMDZ5/trunk/libf/phylmd/undefSTD.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/undefSTD.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/undefSTD.F90	(revision 2346)
@@ -37,7 +37,4 @@
   ! ====================================================================
 
-  ! ym#include "dimensions.h"
-  ! ym      integer jjmp1
-  ! ym      parameter (jjmp1=jjm+1-1/jjm)
   ! ym#include "dimphy.h"
   ! variables Input
Index: /LMDZ5/trunk/libf/phylmd/ustarhb.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/ustarhb.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/ustarhb.F90	(revision 2346)
@@ -18,6 +18,4 @@
   ! model. J. of Climate, vol. 6, 1825-1842.
   ! ======================================================================
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
   include "YOMCST.h"
 
Index: /LMDZ5/trunk/libf/phylmd/vdif_kcay.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/vdif_kcay.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/vdif_kcay.F90	(revision 2346)
@@ -6,8 +6,4 @@
   USE dimphy
   IMPLICIT NONE
-  ! .......................................................................
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! .......................................................................
 
   ! dt : pas de temps
Index: /LMDZ5/trunk/libf/phylmd/wake.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/wake.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/wake.F90	(revision 2346)
@@ -114,5 +114,4 @@
   ! -------------------------------------------------------------------------
 
-  include "dimensions.h"
   include "YOMCST.h"
   include "cvthermo.h"
Index: /LMDZ5/trunk/libf/phylmd/yamada.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/yamada.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/yamada.F90	(revision 2346)
@@ -6,8 +6,4 @@
   USE dimphy
   IMPLICIT NONE
-  ! .......................................................................
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! .......................................................................
 
   ! dt : pas de temps
Index: /LMDZ5/trunk/libf/phylmd/yamada4.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/yamada4.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/yamada4.F90	(revision 2346)
@@ -7,8 +7,4 @@
   USE print_control_mod, ONLY: prt_level
   IMPLICIT NONE
-  ! .......................................................................
-  ! ym#include "dimensions.h"
-  ! ym#include "dimphy.h"
-  ! .......................................................................
 
   ! dt : pas de temps
@@ -498,8 +494,4 @@
   USE dimphy
   IMPLICIT NONE
-  ! .......................................................................
-  include "dimensions.h"
-  ! ccc#include "dimphy.h"
-  ! .......................................................................
 
   ! dt : pas de temps
@@ -574,8 +566,4 @@
   USE dimphy
   IMPLICIT NONE
-  ! .......................................................................
-  include "dimensions.h"
-  ! ccc#include "dimphy.h"
-  ! .......................................................................
 
   ! dt : pas de temps
Index: /LMDZ5/trunk/libf/phylmd/yamada_c.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/yamada_c.F90	(revision 2345)
+++ /LMDZ5/trunk/libf/phylmd/yamada_c.F90	(revision 2346)
@@ -9,8 +9,4 @@
       IMPLICIT NONE
 #include "YOMCST.h"
-!.......................................................................
-!ym#include "dimensions.h"
-!ym#include "dimphy.h"
-!.......................................................................
 !
 ! timestep : pas de temps
