Index: LMDZ6/trunk/libf/phylmd/sisvat/surf_sisvat_mod.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/sisvat/surf_sisvat_mod.F90	(revision 3513)
+++ LMDZ6/trunk/libf/phylmd/sisvat/surf_sisvat_mod.F90	(revision 3518)
@@ -1540,4 +1540,5 @@
     INTEGER isl, ikl, i, isn
     CHARACTER (len=2) :: str2
+    INTEGER           :: pass
 
       isno(:)       = 0       
@@ -1617,23 +1618,24 @@
 
       CALL open_restartphy(fichnom)
-      CALL put_field("longitude", &
+      DO pass = 1, 2
+        CALL put_field(pass,"longitude", &
                     "Longitudes de la grille physique",rlon)     
-      CALL put_field("latitude","Latitudes de la grille physique",rlat)
-
-      CALL put_field("n_snows", "number of snow/ice layers",isno)
-      CALL put_field("n_ice_top", "number of top ice layers",ispi)
-      CALL put_field("n_ice", "number of ice layers",iice)
-      CALL put_field("IR_soil", "Soil IR flux",IRs)
-      CALL put_field("LMO", "Monin-Obukhov Scale",LMO)
-      CALL put_field("surf_water", "Surficial water",rusn)
-      CALL put_field("snow_buffer", "Snow buffer layer",Bufs)
-      CALL put_field("alb_1", "albedo sw",alb1)
-      CALL put_field("alb_2", "albedo nIR",alb2)
-      CALL put_field("alb_3", "albedo fIR",alb3)
-      CALL put_field("to_ice", "Snow passed to ice",toic)
+        CALL put_field(pass,"latitude","Latitudes de la grille physique",rlat)
+  
+        CALL put_field(pass,"n_snows", "number of snow/ice layers",isno)
+        CALL put_field(pass,"n_ice_top", "number of top ice layers",ispi)
+        CALL put_field(pass,"n_ice", "number of ice layers",iice)
+        CALL put_field(pass,"IR_soil", "Soil IR flux",IRs)
+        CALL put_field(pass,"LMO", "Monin-Obukhov Scale",LMO)
+        CALL put_field(pass,"surf_water", "Surficial water",rusn)
+        CALL put_field(pass,"snow_buffer", "Snow buffer layer",Bufs)
+        CALL put_field(pass,"alb_1", "albedo sw",alb1)
+        CALL put_field(pass,"alb_2", "albedo nIR",alb2)
+        CALL put_field(pass,"alb_3", "albedo fIR",alb3)
+        CALL put_field(pass,"to_ice", "Snow passed to ice",toic)
 
  !     DO i = 1, 5
  !       WRITE(str2,'(i2.2)') i
- !       CALL put_field("turb_veloc"//str2, &
+ !       CALL put_field(pass,"turb_veloc"//str2, &
  !                      "various turbulent velocities"//str2, &
  !                      turb_vel(:,i))
@@ -1641,96 +1643,97 @@
  !     DO i = 1, 9
  !       WRITE(str2,'(i2.2)') i
- !       CALL put_field("rough_length"//str2, &
+ !       CALL put_field(pass,"rough_length"//str2, &
  !                      "various roughness lengths"//str2, &
  !                      rlength(:,i))
  !     ENDDO
-      DO isn = 1,nsno
-        IF (isn.LE.99) THEN
-          WRITE(str2,'(i2.2)') isn
-          CALL put_field("AGESNOW"//str2, &
+        DO isn = 1,nsno
+          IF (isn.LE.99) THEN
+            WRITE(str2,'(i2.2)') isn
+            CALL put_field(pass,"AGESNOW"//str2, &
                          "Age de la neige layer No."//str2, &
                          agsn(:,isn))
-        ELSE
-          PRINT*, "Trop de couches"
-          CALL abort
-        ENDIF
-      ENDDO
-      DO isn = 1,nsno
-        IF (isn.LE.99) THEN
-          WRITE(str2,'(i2.2)') isn
-          CALL put_field("DZSNOW"//str2, &
+          ELSE
+            PRINT*, "Trop de couches"
+            CALL abort
+          ENDIF
+        ENDDO
+        DO isn = 1,nsno
+          IF (isn.LE.99) THEN
+            WRITE(str2,'(i2.2)') isn
+            CALL put_field(pass,"DZSNOW"//str2, &
                          "Snow/ice thickness layer No."//str2, &
                          dzsn(:,isn))
-        ELSE
-          PRINT*, "Trop de couches"
-          CALL abort
-        ENDIF
-      ENDDO
-      DO isn = 1,nsno
-        IF (isn.LE.99) THEN
-          WRITE(str2,'(i2.2)') isn
-          CALL put_field("G2SNOW"//str2, &
+          ELSE
+            PRINT*, "Trop de couches"
+            CALL abort
+          ENDIF
+        ENDDO
+        DO isn = 1,nsno
+          IF (isn.LE.99) THEN
+            WRITE(str2,'(i2.2)') isn
+            CALL put_field(pass,"G2SNOW"//str2, &
                          "Snow Property 2, layer No."//str2, &
                          G2sn(:,isn))
-        ELSE
-          PRINT*, "Trop de couches"
-          CALL abort
-        ENDIF
-      ENDDO
-      DO isn = 1,nsno
-        IF (isn.LE.99) THEN
-          WRITE(str2,'(i2.2)') isn
-          CALL put_field("G1SNOW"//str2, &
+          ELSE
+            PRINT*, "Trop de couches"
+            CALL abort
+          ENDIF
+        ENDDO
+        DO isn = 1,nsno
+          IF (isn.LE.99) THEN
+            WRITE(str2,'(i2.2)') isn
+            CALL put_field(pass,"G1SNOW"//str2, &
                          "Snow Property 1, layer No."//str2, &
                          G1sn(:,isn))
-        ELSE
-          PRINT*, "Trop de couches"
-          CALL abort
-        ENDIF
-      ENDDO
-      DO isn = 1,nsismx
-        IF (isn.LE.99) THEN
-          WRITE(str2,'(i2.2)') isn
-          CALL put_field("ETA"//str2, &
+          ELSE
+            PRINT*, "Trop de couches"
+            CALL abort
+          ENDIF
+        ENDDO
+        DO isn = 1,nsismx
+          IF (isn.LE.99) THEN
+            WRITE(str2,'(i2.2)') isn
+            CALL put_field(pass,"ETA"//str2, &
                          "Soil/snow water content layer No."//str2, &
                          eta(:,isn))
-        ELSE
-          PRINT*, "Trop de couches"
-          CALL abort
-        ENDIF
+          ELSE
+            PRINT*, "Trop de couches"
+            CALL abort
+          ENDIF
+        ENDDO
+        DO isn = 1,nsismx   !nsno
+          IF (isn.LE.99) THEN
+            WRITE(str2,'(i2.2)') isn
+            CALL put_field(pass,"RO"//str2, &
+                           "Snow density layer No."//str2, &
+                           ro(:,isn))
+          ELSE
+            PRINT*, "Trop de couches"
+            CALL abort
+          ENDIF
+        ENDDO
+        DO isn = 1,nsismx
+          IF (isn.LE.99) THEN
+            WRITE(str2,'(i2.2)') isn
+            CALL put_field(pass,"TSS"//str2, &
+                           "Soil/snow temperature layer No."//str2, &
+                           Tsis(:,isn))
+          ELSE
+            PRINT*, "Trop de couches"
+            CALL abort
+          ENDIF
+        ENDDO
+        DO isn = 1,nsno
+          IF (isn.LE.99) THEN
+            WRITE(str2,'(i2.2)') isn
+            CALL put_field(pass,"HISTORY"//str2, &
+                           "Snow history layer No."//str2, &
+                           isto(:,isn))
+          ELSE
+            PRINT*, "Trop de couches"
+            CALL abort
+          ENDIF
+        ENDDO
       ENDDO
-      DO isn = 1,nsismx   !nsno
-        IF (isn.LE.99) THEN
-          WRITE(str2,'(i2.2)') isn
-          CALL put_field("RO"//str2, &
-                         "Snow density layer No."//str2, &
-                         ro(:,isn))
-        ELSE
-          PRINT*, "Trop de couches"
-          CALL abort
-        ENDIF
-      ENDDO
-      DO isn = 1,nsismx
-        IF (isn.LE.99) THEN
-          WRITE(str2,'(i2.2)') isn
-          CALL put_field("TSS"//str2, &
-                         "Soil/snow temperature layer No."//str2, &
-                         Tsis(:,isn))
-        ELSE
-          PRINT*, "Trop de couches"
-          CALL abort
-        ENDIF
-      ENDDO
-      DO isn = 1,nsno
-        IF (isn.LE.99) THEN
-          WRITE(str2,'(i2.2)') isn
-          CALL put_field("HISTORY"//str2, &
-                         "Snow history layer No."//str2, &
-                         isto(:,isn))
-        ELSE
-          PRINT*, "Trop de couches"
-          CALL abort
-        ENDIF
-      ENDDO
 
   END SUBROUTINE sisvatredem
