Index: LMDZ.3.3/branches/rel-LF/libf/phylmd/interface_surf.F90
===================================================================
--- LMDZ.3.3/branches/rel-LF/libf/phylmd/interface_surf.F90	(revision 353)
+++ LMDZ.3.3/branches/rel-LF/libf/phylmd/interface_surf.F90	(revision 360)
@@ -354,5 +354,5 @@
      &  tq_cdrag, petAcoef, peqAcoef, petBcoef, peqBcoef, &
      &  precip_rain, precip_snow, sollwdown, swnet, swdown, &
-     &  tsurf, p1lay/100., ps, radsol, &
+     &  tsurf, p1lay/100., ps/100., radsol, &
      &  evap, fluxsens, fluxlat, &              
      &  tsol_rad, tsurf_new, alb_new, alblw, &
@@ -844,23 +844,4 @@
 ! Attention aux poles
 !
-!!$    do igrid = 1, knon
-!!$      index = ktindex(igrid)
-!!$      ij = index - int((index-1)/iim)*iim - 1
-!!$      jj = 2 + int((index-1)/iim)
-!!$      if (mod(index,iim) == 1 ) then
-!!$        jj = 1 + int((index-1)/iim)
-!!$        ij = iim
-!!$      endif
-!!$      correspond(ij,jj) = igrid
-!!$      write(50,*)'igrid, i, j =',igrid,ij,jj
-!!$    enddo
-! Pb de correspondances de grilles!
-!!$    do igrid = 1, knon
-!!$      index = ktindex(igrid)
-!!$      ij = ig(index)
-!!$      jj = jg(index)
-!!$      correspond(ij,jj) = igrid
-!!$      write(51,*)'igrid, i, j =',igrid,ij,jj
-!!$    enddo
     do igrid = 1, knon
       index = ktindex(igrid)
@@ -869,12 +850,4 @@
       correspond(ij,jj) = igrid
     enddo
-
-!!$    index = 0
-!!$    do jj = 1, jjm+1
-!!$      do ij = 1, iim
-!!$        index = index + 1
-!!$        correspond(ij,jj) = index
-!!$      enddo
-!!$    enddo
 
 ! Allouer et initialiser le tableau de coordonnees du sol
@@ -973,49 +946,11 @@
         index = iglob + offset(i)
         ireal = (min(max(1, index - iim + 1), klon))
-!        if (index <= 1) index = 1
-!        if (index >= klon) index = klon
         if (pctsrf(ireal, is_ter) > EPSFRA) then
           jj = int((index - 1)/iim) + 1
           ij = index - (jj - 1) * iim
-!!$          ij = index - int((index-1)/iim)*iim - 1
-!!$          jj = 2 + int((index-1)/iim)
-!!$          if (mod(index,iim) == 1 ) then
-!!$            jj = 1 + int((index-1)/iim)
-!!$            ij = iim
-!!$          endif
-!!$! Pb de correspondances de grilles!
-!!$      ij = ig(index)
-!!$      jj = jg(index)
-!!$!          write(*,*)'correspond',igrid, ireal,index,ij,jj
-!          if ( ij >= 1 .and. ij <= iim .and. jj >= 1 .and. jj <= jjm) then
-!          write(*,*)'correspond',igrid, ireal,index,ij,jj
             neighbours(igrid, i) = correspond(ij, jj)
-!          endif
         endif
       enddo
     enddo
-
-    write(*,*)'Neighbours = '
-
-    write(*,*)neighbours(1,8), neighbours(1,1),neighbours(1,2)
-    write(*,*)neighbours(1,7), ktindex(1), neighbours(1,3)
-    write(*,*)neighbours(1,6), neighbours(1,5),neighbours(1,4)
-
-    write(*,*)neighbours(250,8), neighbours(250,1),neighbours(250,2)
-    write(*,*)neighbours(250,7), ktindex(250), neighbours(250,3)
-    write(*,*)neighbours(250,6), neighbours(250,5),neighbours(250,4)
-
- OPEN (unit=12, file="neighbours.9671")
-  DO i=1,knon
-     WRITE(12,*) '-----------------------------'
-     WRITE(12,'(I7,f8.5,   "    ",3I6)') knon, contfrac(i), &
-          & neighbours(i,8), neighbours(i,1), neighbours(i,2)
-     WRITE(12,'(f10.5,"         ",3I6)') lalo(i,2), neighbours(i,7), &
-          & ktindex(i), neighbours(i,3)
-     WRITE(12,'(f10.5,"         ",3I6)') lalo(i,1), neighbours(i,6), &
-          & neighbours(i,5), neighbours(i,3)
-  ENDDO
-  CLOSE(12)
-
 
 !
@@ -1064,5 +999,5 @@
      & zlev,  u1_lay, v1_lay, spechum, temp_air, epot_air, ccanopy, &
      & cdrag, petA_orc, peqA_orc, petB_orc, peqB_orc, &
-     & precip_rain, precip_snow, lwdown, swnet, swdown, p1lay, &
+     & precip_rain, precip_snow, lwdown, swnet, swdown, ps, &
      & evap, fluxsens, fluxlat, coastalflow, riverflow, &
      & tsol_rad, tsurf_new, qsurf, albedo_out, emis_new, z0_new, &
@@ -1075,5 +1010,5 @@
      & zlev,  u1_lay, v1_lay, spechum, temp_air, epot_air, ccanopy, &
      & cdrag, petA_orc, peqA_orc, petB_orc, peqB_orc, &
-     & precip_rain, precip_snow, lwdown, swnet, swdown, p1lay, &
+     & precip_rain, precip_snow, lwdown, swnet, swdown, ps, &
      & evap, fluxsens, fluxlat, coastalflow, riverflow, &
      & tsol_rad, tsurf_new, qsurf, albedo_out, emis_new, z0_new, &
@@ -1082,8 +1017,8 @@
     bidule=0.
     bidule(1:knon)=riverflow(1:knon)
-    call gath2cpl(bidule, tmp_rriv, klon, knon,iim,jjm,                  ktindex)
+    call gath2cpl(bidule, tmp_rriv, klon, knon,iim,jjm,ktindex)
     bidule=0.
     bidule(1:knon)=coastalflow(1:knon)
-    call gath2cpl(bidule, tmp_rcoa, klon, knon,iim,jjm,                  ktindex)
+    call gath2cpl(bidule, tmp_rcoa, klon, knon,iim,jjm,ktindex)
     alb_new(1:knon) = albedo_out(1:knon,1) 
     alblw(1:knon) = albedo_out(1:knon,2)
