Index: branches/ORCHIDEE_2_2/ORCHIDEE/src_parallel/ioipsl_para.f90
===================================================================
--- branches/ORCHIDEE_2_2/ORCHIDEE/src_parallel/ioipsl_para.f90	(revision 5805)
+++ branches/ORCHIDEE_2_2/ORCHIDEE/src_parallel/ioipsl_para.f90	(revision 5811)
@@ -751,4 +751,5 @@
   (fid, vname_q, iim, jjm, llm, itau, var, MY_OPERATOR, nbindex, ijndex)
 
+    USE grid, ONLY : grid_type, unstructured, ind_cell_glo
     IMPLICIT NONE
 !-
@@ -761,4 +762,5 @@
     !-----------------------------
     REAL, ALLOCATABLE, DIMENSION(:,:) :: temp_g
+    INTEGER, ALLOCATABLE, DIMENSION(:) :: ind_cell_glo_glo
 
     IF (is_root_prc) THEN
@@ -769,6 +771,11 @@
           
     CALL gather(var,temp_g)
-    IF (is_root_prc) THEN
-       CALL restput &
+    IF (grid_type==unstructured) THEN
+      IF (is_root_prc) ALLOCATE(ind_cell_glo_glo(iim_g*jjm_g))
+      CALL gather_unindexed(ind_cell_glo,ind_cell_glo_glo)
+      IF (is_root_prc) CALL restput(fid, vname_q, iim, jjm, llm, itau, temp_g, MY_OPERATOR, &
+                                     nbindex, ind_cell_glo_glo(ijndex(:)))
+    ELSE  
+       IF (is_root_prc) CALL restput &
             (fid, vname_q, iim, jjm, llm, itau, temp_g, MY_OPERATOR, nbindex, ijndex)
     ENDIF
Index: branches/ORCHIDEE_2_2/ORCHIDEE/src_parallel/xios_orchidee.f90
===================================================================
--- branches/ORCHIDEE_2_2/ORCHIDEE/src_parallel/xios_orchidee.f90	(revision 5805)
+++ branches/ORCHIDEE_2_2/ORCHIDEE/src_parallel/xios_orchidee.f90	(revision 5811)
@@ -164,4 +164,5 @@
     REAL(r_std),ALLOCATABLE        :: bounds_lon_mpi(:,:),bounds_lat_mpi(:,:) 
     INTEGER(i_std),ALLOCATABLE     :: ind_cell_mpi(:) 
+    LOGICAL                        :: xios_remap_output
     !_ ================================================================================================================================
     
@@ -178,4 +179,5 @@
     IF (printlev>=1) WRITE(numout,*)'In xios_orchidee_init, xios_orchidee_ok=',xios_orchidee_ok
 
+    
     ! Coherence test between flag and preprocessing key
 #ifndef XIOS
@@ -198,4 +200,15 @@
       xios_interpolation = .FALSE.
       CALL getin_p('XIOS_INTERPOLATION', xios_interpolation)
+
+
+      !Config Key   = XIOS_REMAP_OUTPUT
+      !Config Desc  = Actiave remaping of diagnostic output files to regular grid
+      !Config If    = XIOS_ORCHIDEE_OK .AND. grid_type=unstructured
+      !Config Def   = True
+      !Config Help  = Set this flag to false to output an unstructured grid on its natvie grid without interpolation
+      !Config Units = [FLAG]
+      xios_remap_output=.TRUE.
+      CALL getin_p("XIOS_REMAP_OUTPUT",xios_remap_output)  
+
    ELSE
       ! Deactivate interpolation with XIOS not possible wihtout having
@@ -316,7 +329,22 @@
           CALL xios_set_domain_attr("domain_landpoints",bounds_lon_1d=RESHAPE(bounds_lon_mpi,(/nvertex,ij_nb/),order=(/2,1/)))
           CALL xios_set_domain_attr("domain_landpoints",bounds_lat_1d=RESHAPE(bounds_lat_mpi,(/nvertex,ij_nb/),order=(/2,1/)))
-          ! Define output grid as domain_landpoints_regular (grid specified in xml files)
-          CALL xios_set_domain_attr("domain_landpoints_out",domain_ref="domain_landpoints_regular")
-          CALL xios_set_fieldgroup_attr("remap_expr",expr="@this_ref")
+
+
+          IF (xios_remap_output) THEN
+             
+             ! Define output grid as domain_landpoints_regular (grid specified in xml files)
+             CALL xios_set_domain_attr("domain_landpoints_out",domain_ref="domain_landpoints_regular")
+             
+             CALL xios_set_fieldgroup_attr("remap_expr",expr="@this_ref")
+             CALL xios_set_fieldgroup_attr("remap_1ts",   freq_op=xios_duration_convert_from_string("1ts"))
+             CALL xios_set_fieldgroup_attr("remap_1800s", freq_op=xios_duration_convert_from_string("1800s"))
+             CALL xios_set_fieldgroup_attr("remap_1h",    freq_op=xios_duration_convert_from_string("1h"))
+             CALL xios_set_fieldgroup_attr("remap_3h",    freq_op=xios_duration_convert_from_string("3h"))
+             CALL xios_set_fieldgroup_attr("remap_6h",    freq_op=xios_duration_convert_from_string("6h"))
+             CALL xios_set_fieldgroup_attr("remap_1d",    freq_op=xios_duration_convert_from_string("1d"))
+             CALL xios_set_fieldgroup_attr("remap_1mo",   freq_op=xios_duration_convert_from_string("1mo"))
+             CALL xios_set_fieldgroup_attr("remap_1y",    freq_op=xios_duration_convert_from_string("1y"))
+          ENDIF
+
        END IF
 
Index: branches/ORCHIDEE_2_2/ORCHIDEE/src_xml/field_def_orchidee.xml
===================================================================
--- branches/ORCHIDEE_2_2/ORCHIDEE/src_xml/field_def_orchidee.xml	(revision 5805)
+++ branches/ORCHIDEE_2_2/ORCHIDEE/src_xml/field_def_orchidee.xml	(revision 5811)
@@ -11,10 +11,20 @@
 
   <!-- ========================================================================================================= -->
-  <!-- Definition of field_group "remap_expr" used to intrepolate output fields.                                 -->
+  <!-- Definition of field_group "remap_expr" used to interpolate output fields.                                 -->
   <!-- expr is set from the fortran source code for the case with unstructured grid, for regular grid it'll      -->
-  <!-- remain empty and no interpolations will be done for output fields.                                        -->
-  <!-- ========================================================================================================= -->
-  <field_group id="remap_expr" expr="_reset_" prec="_reset_" operation="_reset_" freq_op="_reset_" enabled="_reset_" default_value="_reset_" detect_missing_value="_reset_"/>
-  
+  <!-- remain empty and no interpolations will be done for output fields. When runnig the unstructrured grid,    -->
+  <!-- the field_group remap_xx corresponding to the output_freqi=xx should be set in file_def_orchidee.xml.     -->
+  <!-- ========================================================================================================= -->
+  <field_group id="remap_expr" expr="_reset_" prec="_reset_" operation="_reset_" freq_op="_reset_" enabled="_reset_" default_value="_reset_" detect_missing_value="_reset_">
+    <field_group id="remap_1ts" />
+    <field_group id="remap_1800s" />
+    <field_group id="remap_1h" />
+    <field_group id="remap_3h" />
+    <field_group id="remap_6h" />
+    <field_group id="remap_1d" />
+    <field_group id="remap_1mo" />
+    <field_group id="remap_1y" />
+  </field_group>
+
 
   <!-- ========================================================================================================= -->
Index: branches/ORCHIDEE_2_2/ORCHIDEE/src_xml/file_def_orchidee.xml
===================================================================
--- branches/ORCHIDEE_2_2/ORCHIDEE/src_xml/file_def_orchidee.xml	(revision 5805)
+++ branches/ORCHIDEE_2_2/ORCHIDEE/src_xml/file_def_orchidee.xml	(revision 5811)
@@ -23,4 +23,8 @@
 <!-- corresponds to no compression and 4 is a middle compression here set as default.                            -->
 <!--                                                                                                             -->
+<!-- field group "remap_1xx" do only have a meaning for unstructured grid when remapping of output is activated. -->
+<!-- For this case, remap_1xx will set a corresponding freq_op done from the fortran code.                       -->
+<!-- For regular grid, this group do not contain any attributes so it'll not make any difference.                -->
+<!--                                                                                                             -->
 <!-- $HeadURL$               -->
 <!-- $Date$                                                      -->
@@ -39,5 +43,5 @@
   <file id="sechiba1" name="sechiba_history" output_level="_AUTO_" output_freq="_AUTO_" enabled="_AUTO_">
 
-   <field_group freq_op="1ts" grid_ref="grid_landpoints_out" group_ref="remap_expr">
+   <field_group group_ref="remap_1mo" grid_ref="grid_landpoints_out" >
     <!-- level 1 -->
     <field field_ref="areas" level="0"/>
@@ -349,5 +353,5 @@
   <!-- Sechiba file 2 -->
   <file id="sechiba2" name="sechiba_out_2" output_level="_AUTO_" output_freq="_AUTO_" enabled="_AUTO_">
-   <field_group freq_op="1ts" grid_ref="grid_landpoints_out" group_ref="remap_expr" >
+   <field_group group_ref="remap_1mo" grid_ref="grid_landpoints_out" >
     <!-- level 1 -->
     <field field_ref="areas" level="1"/>
@@ -562,5 +566,5 @@
   <!-- This files contains all variables having more than one vertical axis -->
   <file id="sechiba3" name="sechiba_history_4dim" output_level="_AUTO_" output_freq="_AUTO_" enabled="_AUTO_">
-   <field_group  freq_op="1ts" grid_ref="grid_landpoints_out" group_ref="remap_expr" >
+   <field_group group_ref="remap_1mo" grid_ref="grid_landpoints_out" >
     <field field_ref="areas" level="1"/>
     <field field_ref="contfrac" level="1"/>
@@ -576,5 +580,5 @@
   <!-- Sechiba alma file 1 -->
   <file id="sechiba1_alma" name="sechiba_history_alma" output_level="10" output_freq="1mo" enabled=".FALSE.">
-   <field_group  freq_op="1ts" grid_ref="grid_landpoints_out" group_ref="remap_expr" >
+   <field_group group_ref="remap_1mo" grid_ref="grid_landpoints_out" >
     <field field_ref="areas" level="1"/>
     <field field_ref="LandPoints" level="20"/>
@@ -652,5 +656,5 @@
   <!-- Sechiba alma file 2 -->
   <file id="sechiba2_alma" name="sechiba_out_2_alma" output_level="10" output_freq="1d" enabled=".FALSE.">
-   <field_group  freq_op="1ts" grid_ref="grid_landpoints_out" group_ref="remap_expr" >
+   <field_group group_ref="remap_1d" grid_ref="grid_landpoints_out" >
     <field field_ref="areas" level="1"/>
     <field field_ref="LandPoints" level="20"/>
@@ -720,5 +724,5 @@
   <!-- Stomate file 1 -->
   <file id="stomate1" name="stomate_history" output_level="_AUTO_" output_freq="_AUTO_" enabled="_AUTO_">
-   <field_group  freq_op="1ts" grid_ref="grid_landpoints_out" group_ref="remap_expr" >
+   <field_group group_ref="remap_1mo" grid_ref="grid_landpoints_out" >
      
     <!-- level 1 -->
@@ -860,5 +864,5 @@
   <!-- Stomate file 2 -->
   <file id="stomate2" name="stomate_ipcc_history" output_level="_AUTO_" output_freq="_AUTO_" enabled="_AUTO_">
-   <field_group  freq_op="1ts" grid_ref="grid_landpoints_out" group_ref="remap_expr" >
+   <field_group group_ref="remap_1mo" grid_ref="grid_landpoints_out" >
     <!-- level 1 -->
     <field field_ref="RESOLUTION_X" level="1"/>
