Index: trunk/LMDZ.COMMON/libf/evolution/planet.F90
===================================================================
--- trunk/LMDZ.COMMON/libf/evolution/planet.F90	(revision 4170)
+++ trunk/LMDZ.COMMON/libf/evolution/planet.F90	(revision 4180)
@@ -21,5 +21,5 @@
 ! ------------
 use numerics,         only: dp, qp, k4
-use layered_deposits, only: layering
+use layered_deposits, only: layering, del_layering
 
 ! DECLARATION
@@ -231,4 +231,8 @@
 implicit none
 
+! LOCAL VARIABLES
+! ---------------
+integer :: i, islope
+
 ! CODE
 ! ----
@@ -253,4 +257,10 @@
 delta_h2o_ads(:) = 0._dp
 delta_co2_ads(:) = 0._dp
+do islope = 1,nslope
+    do i = 1,ngrid
+        layerings_map(i,islope)%nb_str = 0
+        nullify(layerings_map(i,islope)%bottom,layerings_map(i,islope)%top)
+    end do
+end do
 
 END SUBROUTINE allocate_startevo_state
@@ -386,7 +396,15 @@
 !-----------------------------------------------------------------------
 
-! DECLARATION
-! -----------
-implicit none
+! DEPENDENCIES
+! ------------
+use geometry, only: ngrid, nslope
+
+! DECLARATION
+! -----------
+implicit none
+
+! LOCAL VARIABLES
+! ---------------
+integer :: i, islope
 
 ! CODE
@@ -407,5 +425,12 @@
 if (allocated(tsoil_ts)) deallocate(tsoil_ts)
 if (allocated(tsoil_ts_old)) deallocate(tsoil_ts_old)
-if (allocated(layerings_map)) deallocate(layerings_map)
+if (allocated(layerings_map)) then
+    do islope = 1,nslope
+        do i = 1,ngrid
+            call del_layering(layerings_map(i,islope))
+        end do
+    end do
+    deallocate(layerings_map)
+end if
 if (allocated(h2o_soildensity_avg)) deallocate(h2o_soildensity_avg)
 if (allocated(delta_co2_ads)) deallocate(delta_co2_ads)
@@ -424,5 +449,4 @@
 if (allocated(d_co2ice_ini)) deallocate(d_co2ice_ini)
 if (allocated(d_h2oice)) deallocate(d_h2oice)
-if (allocated(layerings_map)) deallocate(layerings_map)
 if (allocated(flux_ssice_avg)) deallocate(flux_ssice_avg)
 
