Index: /LMDZ6/trunk/DefLists/context_input_lmdz.xml
===================================================================
--- /LMDZ6/trunk/DefLists/context_input_lmdz.xml	(revision 3474)
+++ /LMDZ6/trunk/DefLists/context_input_lmdz.xml	(revision 3474)
@@ -0,0 +1,464 @@
+<!--- $Id$ -->
+<!-- Context LMDZ -->
+<context id="LMDZ">
+
+<!------------------------------------------------------------------------------------->
+                     <!--  create etat0_limit --> 
+<!------------------------------------------------------------------------------------->
+  <field_definition>
+
+    <field_group id="etat0_limit_read" read_access="false" enabled="false" operation="instant">
+       <field id="ts"           field_ref="ts_reg"      domain_ref="from_ecphy"     />
+       <field id="qs"           field_ref="qs_reg"      domain_ref="from_ecphy"     />
+       <field id="landice"      field_ref="landice_reg" domain_ref="from_landiceref"  />
+       <field id="mask"         field_ref="mask_reg"    domain_ref="from_relief" />
+       <field id="sic_limit"    field_ref="sic_reg"     domain_ref="from_limit_amip"  />
+       <field id="sst_limit"    field_ref="sst_reg"     domain_ref="from_limit_amip" />
+       <field id="rugos_limit"  field_ref="rugos_reg"   domain_ref="from_limit" > exp(this) </field>
+       <field id="albedo_limit" field_ref="albedo_reg"  domain_ref="from_limit"  />
+
+       <field id="zmea" field_ref="zmea_reg"  domain_ref="from_orography"  />
+       <field id="zstd" field_ref="zstd_reg"  domain_ref="from_orography"  />
+       <field id="zsig" field_ref="zsig_reg"  domain_ref="from_orography"  />
+       <field id="zgam" field_ref="zgam_reg"  domain_ref="from_orography"  />
+       <field id="zthe" field_ref="zthe_reg"  domain_ref="from_orography"  />
+
+    </field_group>
+   
+
+
+  </field_definition>
+  
+  
+   <file_definition>
+    
+    <file_group id="etat0_limit_read" type="one_file" mode="read" enabled=".FALSE." output_level="10" output_freq="1y" >
+      
+      <file id="frac_ocean" name="ocean_fraction" enabled=".FALSE.">
+        <field id="frac_ocean_read" name="OceFrac" domain_ref="dom_glo" operation="instant" freq_offset="1ts" />
+      </file>
+      
+      <file id="ECPHY"  name="ECPHY" >
+        <field id="ts_reg"   name="ST"      domain_ref="domain_ecphy" operation="instant"  freq_offset="1ts"/>
+        <field id="qs_reg"   name="CDSW"    domain_ref="domain_ecphy" operation="instant"  freq_offset="1ts"/>
+      </file>
+
+      <file id="landiceref"  name="landiceref" >
+        <field id="landice_reg"   name="landice"   domain_ref="domain_landiceref" operation="instant" freq_offset="1ts"/>
+      </file>
+
+      <file id="relief" name="Relief" >
+        <field id="mask_reg" name="RELIEF" domain_ref="domain_relief" operation="instant" freq_offset="1ts"> this &gt; 1e-5 </field>
+      </file>
+
+
+<!-- Case with amip files --> 
+      <file id="amipbc_sic_1x1" name="amipbc_sic_1x1" >
+        <field id="sic_reg" name="sicbcs" domain_ref="domain_limit_amip" axis_ref="time_sic" operation="instant" freq_offset="1ts"/>
+      </file>
+ 
+      <file id="amipbc_sst_1x1" name="amipbc_sst_1x1" >
+         <field id="sst_reg" name="tosbcs" domain_ref="domain_limit_amip" axis_ref="time_sst" operation="instant" freq_offset="1ts"/> 
+      </file>
+
+<!-- Case with HadISST files --> 
+<!--  
+      <file id="siconc" name="hadisst_siconc" >
+        <field id="sic_reg" name="sicbcs" domain_ref="domain_limit_amip" axis_ref="time_sic" operation="instant" freq_offset="1ts"/>
+      </file>
+ 
+      <file id="tos" name="hadisst_tos" >
+         <field id="sst_reg" name="tosbcs" domain_ref="domain_limit_amip" axis_ref="time_sst" operation="instant" freq_offset="1ts">this+273.15</field> 
+      </file>
+-->
+
+
+      <file id="rugos" name="Rugos" >
+        <field id="rugos_reg" name="RUGOS" domain_ref="domain_limit" axis_ref="time_month" operation="instant" freq_offset="1ts"> log(this) </field> 
+      </file>
+
+      <file id="albedo" name="Albedo" >
+        <field id="albedo_reg" name="ALBEDO" domain_ref="domain_limit" axis_ref="time_month" operation="instant" freq_offset="1ts"/> 
+      </file>
+     
+      <file id="orography" name="orography" >
+
+         <field_group domain_ref="domain_orography" operation="instant" freq_offset="1ts"> 
+            <field id="zmea_reg" name="phi" />
+            <field id="zstd_reg" name="mu" />
+            <field id="zsig_reg" name="sigma" />
+            <field id="zgam_reg" name="gama" />
+            <field id="zthe_reg" name="theta" />
+         </field_group >
+
+      </file>
+
+
+     <file id="grid_atm" type="one_file" output_freq="1y" mode="write" sync_freq="1ts"  >         
+       <field_group domain_ref="dom_glo_p8"  operation="once" prec="8">
+          <field id="area_ce0l"           name="area" long_name="atm cell area" />
+          <field id="fract_oce_ce0l"      name="fract_oce" long_name="ocean fraction" />
+          <field id="fract_sic_ce0l"      name="fract_sic" long_name="sea ice fraction" />
+
+          <field id="fract_oce_sic_ce0l"  name="fract_oce_plus_sic_p8" long_name="ocean + sea ice fraction" > fract_oce_ce0l + fract_sic_ce0l </field>
+          <field field_ref="fract_oce_sic_ce0l"  name="mask_oce_plus_sic" long_name="ocean + sea ice mask" > this &gt; 0  ? 1 : 0 </field>
+       </field_group>
+     </file>
+
+
+     </file_group>
+     
+
+     <file id="limit_write" name="limit" type="one_file" output_freq="1ts" sync_freq="1ts" enabled="false">         
+       <field_group domain_ref="dom_glo" axis_ref="time_year" operation="once">
+          <field id="foce_limout"  name="FOCE" long_name="Fraction ocean"/>
+          <field id="fsic_limout"  name="FSIC" long_name="Fraction glace de mer"/>
+          <field id="fter_limout"  name="FTER" long_name="Fraction terre"/>
+          <field id="flic_limout"  name="FLIC" long_name="Fraction land ice"/>
+          <field id="sst_limout"   name="SST"  long_name="Temperature superficielle de la mer"/>
+          <field id="bils_limout"  name="BILS" long_name="Reference flux de chaleur au sol"/> 
+          <field id="alb_limout"   name="ALB"  long_name="Albedo a la surface"/>
+          <field id="rug_limout"   name="RUG"  long_name="Rugosite" />
+       </field_group>
+     </file>
+
+     <file id="limit_read" name="limit" time_counter_name="time_year" type="one_file" output_freq="1d" mode="read" cyclic="true" enabled="false">         
+       <field_group domain_ref="dom_glo" freq_offset="1ts" operation="instant">
+          <field id="foce_limin"  name="FOCE" long_name="Fraction ocean"/>
+          <field id="fsic_limin"  name="FSIC" long_name="Fraction glace de mer"/>
+          <field id="fter_limin"  name="FTER" long_name="Fraction terre"/>
+          <field id="flic_limin"  name="FLIC" long_name="Fraction land ice"/>
+          <field id="sst_limin"   name="SST"  long_name="Temperature superficielle de la mer"/>
+          <field id="bils_limin"  name="BILS" long_name="Reference flux de chaleur au sol" enabled="false"/> 
+          <field id="alb_limin"   name="ALB"  long_name="Albedo a la surface"/>
+          <field id="rug_limin"   name="RUG"  long_name="Rugosite" />
+       </field_group>
+     </file>
+
+
+  </file_definition> 
+
+  <axis_definition>
+    <axis id="time_sic"/>
+    <axis id="time_sst"/>
+  </axis_definition>
+
+  <!-- Define domains and groups of domains -->
+  <domain_definition>
+
+      <domain id="from_ecphy" domain_ref="dom_glo">
+        <interpolate_domain write_weight="true" mode="read_or_compute"/>
+      </domain>  
+
+      <domain id="from_landiceref" domain_ref="dom_glo">
+        <interpolate_domain write_weight="true" mode="read_or_compute"/>
+      </domain>
+
+      <domain id="from_relief" domain_ref="dom_glo">
+       <interpolate_domain order="1" write_weight="true" mode="read_or_compute" />
+      </domain>
+
+      <domain id="from_orography" domain_ref="dom_glo">
+        <interpolate_domain order="1" write_weight="true" mode="read_or_compute"/>
+      </domain>
+
+      <domain id="from_limit" domain_ref="dom_glo">
+        <interpolate_domain write_weight="true" mode="read_or_compute"/>
+      </domain>
+
+      <domain id="from_limit_amip"domain_ref="dom_glo" >
+        <interpolate_domain write_weight="true" mode="read_or_compute"/>
+      </domain>
+  
+    <domain id="domain_ecphy"  type="rectilinear" >
+       <generate_rectilinear_domain /> 
+    </domain>
+
+    <domain id="domain_landiceref"  type="rectilinear" >
+       <generate_rectilinear_domain /> 
+    </domain>
+
+    <domain id="domain_relief"  type="rectilinear" >
+       <generate_rectilinear_domain /> 
+    </domain>
+ 
+    <domain id="domain_limit"  type="rectilinear" >
+       <generate_rectilinear_domain /> 
+    </domain>
+
+    <domain id="domain_limit_amip"  type="rectilinear" >
+       <generate_rectilinear_domain /> 
+    </domain>
+
+    <domain id="domain_orography" type="rectilinear" >
+       <generate_rectilinear_domain /> 
+    </domain>  
+
+    <domain id="dom_glo_p8" domain_ref="dom_glo" prec="8"/>
+
+  </domain_definition>
+
+
+<!------------------------------------------------------------------------------------->
+                     <!--  etat0 ozone --> 
+<!------------------------------------------------------------------------------------->
+
+ <field_definition>
+
+    <field id="tro3_in"   grid_ref="grid_climoz" enabled="false"/>
+    <field id="tro3_out"  read_access="true"   field_ref="tro3_in"  grid_ref="grid_from_climoz" enabled="false"/>
+
+ </field_definition> 
+
+
+ <file_definition> 
+
+    <file id="test_o3" output_freq="1ts" type="one_file" enabled="false">
+      <field id="o3_out" grid_ref="grid_from_climoz" operation="instant" />
+     </file>
+
+  </file_definition> 
+
+
+  <domain_definition>
+
+    <domain id="domain_climoz" type="rectilinear" />
+
+    <domain id="from_climoz" domain_ref="dom_glo">
+      <interpolate_domain order="1" write_weight="true" mode="read_or_compute"/>
+    </domain>
+  
+  </domain_definition>
+
+  <axis_definition>
+    <axis id="axis_climoz"  unit="millibar" axis_type="Z"/>
+    <axis id="tr_climoz"  />
+    <axis id="time_axis_climoz" />
+  </axis_definition>
+
+
+  <grid_definition>
+
+       <grid id="grid_climoz">
+         <domain domain_ref="domain_climoz" />
+         <axis axis_ref="axis_climoz" />
+         <axis axis_ref="time_axis_climoz" />
+         <axis axis_ref="tr_climoz" />
+       </grid >
+       
+       <grid id="grid_from_climoz">
+         <domain domain_ref="from_climoz" />
+         <axis axis_ref="axis_climoz" />
+         <axis axis_ref="time_axis_climoz" />
+         <axis axis_ref="tr_climoz" />
+       </grid>
+
+  </grid_definition>
+
+
+
+<!------------------------------------------------------------------------------------->
+                     <!--  read aerosol --> 
+<!------------------------------------------------------------------------------------->
+
+  <field_definition>
+
+    <field_group id="aerosols" enabled="false">
+    
+       <field_group id="aerosol_in" grid_ref="grid_aerosol" >
+         <field id="AIPOMM_in"/>
+         <field id="ASBCM_in"/>
+         <field id="AIBCM_in"/>
+         <field id="ASPOMM_in"/>
+         <field id="CSSSM_in"/>
+         <field id="ASSSM_in"/>
+         <field id="CIDUSTM_in"/>
+         <field id="SO4_in"/>
+         <field id="CSSO4M_in"/>
+         <field id="SSSSM_in"/>
+         <field id="ASNO3M_in"/>
+         <field id="CSNO3M_in"/>
+         <field id="CINO3M_in"/>
+         <field id="ASSO4M_in"/>
+         <field id="CSSO4M_in"/>
+       </field_group>
+
+       <field_group id="load_aerosol_in" domain_ref="domain_aerosol" axis_ref="time_month" >
+         <field id="load_AIPOMM_in"/>
+         <field id="load_ASBCM_in"/>
+         <field id="load_AIBCM_in"/>
+         <field id="load_ASPOMM_in"/>
+         <field id="load_CSSSM_in"/>
+         <field id="load_ASSSM_in"/>
+         <field id="load_CIDUSTM_in"/>
+         <field id="load_SO4_in"/>
+         <field id="load_CSSO4M_in"/>
+         <field id="load_SSSSM_in"/>
+         <field id="load_ASNO3M_in"/>
+         <field id="load_CSNO3M_in"/>
+         <field id="load_CINO3M_in"/>
+         <field id="load_ASSO4M_in"/>
+         <field id="load_CSSO4M_in"/>
+       </field_group>
+       
+       <field_group id="aerosol_out" grid_ref="grid_from_aerosol" read_access="true" >
+         <field id="AIPOMM_out" field_ref="AIPOMM_in" />
+         <field id="ASBCM_out"  field_ref="ASBCM_in"  />
+         <field id="AIBCM_out"  field_ref="AIBCM_in"  />
+         <field id="ASPOMM_out" field_ref="ASPOMM_in" />
+         <field id="CSSSM_out"  field_ref="CSSSM_in"  />
+         <field id="ASSSM_out"  field_ref="ASSSM_in"  />
+         <field id="CIDUSTM_out"field_ref="CIDUSTM_in"/>
+         <field id="SO4_out"    field_ref="SO4_in"    />
+         <field id="CSSO4M_out" field_ref="CSSO4M_in" />
+         <field id="SSSSM_out"  field_ref="SSSSM_in"  />
+         <field id="ASNO3M_out" field_ref="ASNO3M_in" />
+         <field id="CSNO3M_out" field_ref="CSNO3M_in" />
+         <field id="CINO3M_out" field_ref="CINO3M_in" />
+         <field id="ASSO4M_out" field_ref="ASSO4M_in" />
+         <field id="CSSO4M_out" field_ref="CSSO4M_in" />
+       </field_group>
+
+       <field_group id="load_aerosol_out" domain_ref="from_aerosol" axis_ref="time_month" read_access="true">
+         <field id="load_AIPOMM_out" field_ref="load_AIPOMM_in" />
+         <field id="load_ASBCM_out"  field_ref="load_ASBCM_in"  />
+         <field id="load_AIBCM_out"  field_ref="load_AIBCM_in"  />
+         <field id="load_ASPOMM_out" field_ref="load_ASPOMM_in" />
+         <field id="load_CSSSM_out"  field_ref="load_CSSSM_in"  />
+         <field id="load_ASSSM_out"  field_ref="load_ASSSM_in"  />
+         <field id="load_CIDUSTM_out"field_ref="load_CIDUSTM_in"/>
+         <field id="load_SO4_out"    field_ref="load_SO4_in"    />
+         <field id="load_CSSO4M_out" field_ref="load_CSSO4M_in" />
+         <field id="load_SSSSM_out"  field_ref="load_SSSSM_in"  />
+         <field id="load_ASNO3M_out" field_ref="load_ASNO3M_in" />
+         <field id="load_CSNO3M_out" field_ref="load_CSNO3M_in" />
+         <field id="load_CINO3M_out" field_ref="load_CINO3M_in" />
+         <field id="load_ASSO4M_out" field_ref="load_ASSO4M_in" />
+         <field id="load_CSSO4M_out" field_ref="load_CSSO4M_in" />
+       </field_group>
+
+     
+       <field id="psurf_aerosol_in"   domain_ref="domain_aerosol" axis_ref="time_month" />
+       <field id="psurf_aerosol_out"  read_access="true"   field_ref="psurf_aerosol_in"  domain_ref="from_aerosol" axis_ref="time_month" />
+
+  </field_group>
+
+</field_definition>
+
+ <domain_definition>
+    
+    <domain id="domain_aerosol" type="rectilinear" />
+    
+    <domain id="from_aerosol" domain_ref="dom_glo">
+       <interpolate_domain order="1" write_weight="true" mode="read_or_compute"/>
+    </domain>
+
+ </domain_definition>
+
+  <axis_definition>
+    <axis id="axis_aerosol"  unit="millibar" axis_type="Z"/>
+  </axis_definition>
+
+  <grid_definition>
+
+       <grid id="grid_aerosol">
+         <domain domain_ref="domain_aerosol" />
+         <axis axis_ref="axis_aerosol" />
+         <axis axis_ref="time_month" />
+       </grid >
+       
+
+       <grid id="grid_from_aerosol">
+         <domain domain_ref="from_aerosol" />
+         <axis axis_ref="axis_aerosol" />
+         <axis axis_ref="time_month" />
+       </grid>
+       
+  </grid_definition>
+
+
+
+
+<!------------------------------------------------------------------------------------->
+                     <!--  read aerosol strato  --> 
+<!------------------------------------------------------------------------------------->
+
+<field_definition>
+
+    <field_group id="aerosol_strato2" enabled="false" >
+       <field id="tauaerstrat_in"   grid_ref="grid_tauswstrat" />
+       <field id="tauaerstrat_out"  read_access="true"   field_ref="tauaerstrat_in"  grid_ref="grid_from_tauswstrat" />
+
+       <field id="pizaerstrat_in"   grid_ref="grid_tauswstrat" />
+       <field id="pizaerstrat_out"  read_access="true"   field_ref="pizaerstrat_in"  grid_ref="grid_from_tauswstrat" />
+
+       <field id="cgaerstrat_in"   grid_ref="grid_tauswstrat" />
+       <field id="cgaerstrat_out"  read_access="true"   field_ref="cgaerstrat_in"  grid_ref="grid_from_tauswstrat" />
+
+       <field id="taulwaerstrat_in"   grid_ref="grid_taulwstrat" />
+       <field id="taulwaerstrat_out"  read_access="true"   field_ref="taulwaerstrat_in"  grid_ref="grid_from_taulwstrat" />
+    </field_group>
+    
+    <field_group id="aerosol_strato1" enabled="false" >
+      <field id="taustrat_in"   domain_ref="domain_taustrat" axis_ref="klev" />
+      <field id="taustrat_out"  read_access="true"   field_ref="taustrat_in"  domain_ref="from_taustrat" axis_ref="klev" />
+    </field_group>
+
+</field_definition>
+
+
+ <domain_definition>
+
+    <domain id="domain_tauswstrat" type="rectilinear" />
+    <domain id="domain_taulwstrat" type="rectilinear" />
+    <domain id="domain_taustrat" type="rectilinear" />
+
+
+      <domain id="from_tauswstrat" domain_ref="dom_glo">
+        <interpolate_domain order="1" write_weight="true" mode="read_or_compute"/>
+      </domain>
+
+      <domain id="from_taulwstrat" domain_ref="dom_glo">
+        <interpolate_domain order="1" write_weight="true" mode="read_or_compute"/>
+      </domain>
+
+      <domain id="from_taustrat" domain_ref="dom_glo">
+        <interpolate_domain order="1" write_weight="true" mode="read_or_compute"/>
+      </domain> 
+
+ </domain_definition>
+
+  <axis_definition>
+    <axis id="nsw"  />
+    <axis id="nlw"  />
+  </axis_definition>
+
+  <grid_definition>
+
+       <grid id="grid_tauswstrat">
+         <domain domain_ref="domain_tauswstrat" />
+         <axis axis_ref="klev" />
+         <axis axis_ref="nsw" />
+       </grid >
+
+       <grid id="grid_from_tauswstrat">
+         <domain domain_ref="from_tauswstrat" />
+         <axis axis_ref="klev" />
+         <axis axis_ref="nsw" />
+       </grid >
+
+       <grid id="grid_taulwstrat">
+         <domain domain_ref="domain_taulwstrat" />
+         <axis axis_ref="klev" />
+         <axis axis_ref="nlw" />
+       </grid >
+
+       <grid id="grid_from_taulwstrat">
+         <domain domain_ref="from_taulwstrat" />
+         <axis axis_ref="klev" />
+         <axis axis_ref="nlw" />
+       </grid >
+
+  </grid_definition>
+
+</context>
Index: /LMDZ6/trunk/DefLists/context_lmdz.xml
===================================================================
--- /LMDZ6/trunk/DefLists/context_lmdz.xml	(revision 3473)
+++ /LMDZ6/trunk/DefLists/context_lmdz.xml	(revision 3474)
@@ -1,2 +1,3 @@
+<!-- $Id$ -->
 <!-- Context LMDZ -->
 <context id="LMDZ">
@@ -12,15 +13,19 @@
   <file_definition src="./file_def_histhf_lmdz.xml"/>
   <file_definition src="./file_def_histins_lmdz.xml"/>
-<!--  <file_definition src="./file_def_histLES_lmdz.xml"/> -->
+  <file_definition src="./file_def_histLES_lmdz.xml"/>
   <file_definition src="./file_def_histmth_lmdz.xml"/>
-<!--  <file_definition src="./file_def_histstn_lmdz.xml"/> -->
+  <file_definition src="./file_def_histstn_lmdz.xml"/>
   <file_definition src="./file_def_histmthNMC_lmdz.xml"/>
   <file_definition src="./file_def_histdayNMC_lmdz.xml"/>
   <file_definition src="./file_def_histhfNMC_lmdz.xml"/>
-<!--  <file_definition src="./file_def_histmthCOSP_lmdz.xml"/> -->
-<!--  <file_definition src="./file_def_histdayCOSP_lmdz.xml"/> -->
-<!--  <file_definition src="./file_def_histhfCOSP_lmdz.xml"/> -->
+  <file_definition src="./file_def_histmthCOSP_lmdz.xml"/>
+  <file_definition src="./file_def_histdayCOSP_lmdz.xml"/> 
+  <file_definition src="./file_def_histhfCOSP_lmdz.xml"/>  
   <file_definition src="./file_def_histstrataer_lmdz.xml"/>
- 
+
+
+
+
+
   <!-- Define domains and groups of domains -->
   <domain_definition>
@@ -32,6 +37,6 @@
     </domain> 
    
-    <domain id="dom_regular" ni_glo="144" nj_glo="142" type="rectilinear"  >
-      <generate_rectilinear_domain/>
+    <domain id="dom_regular" ni_glo="144" nj_glo="143" type="rectilinear"  >
+      <generate_rectilinear_domain lat_start="-90" lat_end="90"/>
       <interpolate_domain order="1"/>
     </domain>
@@ -49,5 +54,5 @@
   <grid_definition>
     <grid id="grid_scalar" >
-    <scalar/>
+      <scalar/>
     </grid>
   </grid_definition>
@@ -78,28 +83,17 @@
 
 <!-- Cosp axis definitions-->
-    <axis id="height" standard_name="Cosp levels" unit="m"> 
-    </axis>
-    <axis id="height_mlev" standard_name="height_mlev" unit="m"> 
-    </axis>
-    <axis id="sza" standard_name="solar_zenith_angle" unit="degrees">
-    </axis>
-    <axis id="pressure2" standard_name="pressure" unit="mb">
-    </axis>
-    <axis id="column" standard_name="column" unit="count"> 
-    </axis> 
-    <axis id="temp" standard_name="temperature" unit="K"> 
-    </axis> 
-    <axis id="cth" standard_name="altitude" unit="m"> 
-    </axis> 
-    <axis id="ReffIce" standard_name="ReffIce" unit="microne" >
-    </axis>
-    <axis id="ReffLiq" standard_name="ReffLiq" unit="microne" >
-    </axis>
-    <axis id="scatratio" standard_name="scatratio" unit="1" >
-    </axis>
-    <axis id="dbze" standard_name="dbze" unit="dBZ" >
-    </axis>
-    <axis id="tau" standard_name="tau" unit="1" >
-    </axis>
+    <axis id="height" standard_name="Cosp levels" unit="m"/> 
+    <axis id="height_mlev" standard_name="height_mlev" unit="m"/> 
+    <axis id="sza" standard_name="solar_zenith_angle" unit="degrees"/>
+    <axis id="pressure2" standard_name="pressure" unit="mb"/>
+    <axis id="column" standard_name="column" unit="count"/> 
+    <axis id="temp" standard_name="temperature" unit="K"/> 
+<!--    <axis id="cth16" standard_name="altitude" unit="m"/>   ym unused now to be in adequation with axis definition from model --> 
+    <axis id="cth" standard_name="altitude" unit="m"/> 
+    <axis id="ReffIce" standard_name="ReffIce" unit="microne" />
+    <axis id="ReffLiq" standard_name="ReffLiq" unit="microne" />
+    <axis id="scatratio" standard_name="scatratio" unit="1" />
+    <axis id="dbze" standard_name="dbze" unit="dBZ" />
+    <axis id="tau" standard_name="tau" unit="1" />
   </axis_definition>
 
@@ -109,4 +103,5 @@
     <grid id="klevp1_bnds"> <axis axis_ref="klevp1" /> <axis axis_ref="bnds" /> </grid>
 
+
      <grid id="grid_glo">
         <domain domain_ref="dom_glo" />
@@ -128,4 +123,5 @@
      </grid>
 
+
      <grid id="grid_glo_plev">
         <domain domain_ref="dom_glo" />
@@ -148,5 +144,5 @@
         <axis axis_ref="spectband" />
      </grid>
-
+     
 
      <grid id="grid_glo_height">
@@ -154,5 +150,4 @@
         <axis axis_ref="height" />
      </grid>
-
      <grid id="grid_out_height">
         <domain domain_ref="dom_out" />
@@ -160,9 +155,9 @@
      </grid>
 
+
      <grid id="grid_glo_heightmlev">
         <domain domain_ref="dom_glo" />
         <axis axis_ref="height_mlev" />
      </grid>
-
      <grid id="grid_out_heightmlev">
         <domain domain_ref="dom_out" />
@@ -170,19 +165,20 @@
      </grid>
 
+
      <grid id="grid_glo_temp">
         <domain domain_ref="dom_glo" />
         <axis axis_ref="temp" />
      </grid>
-
-     <grid id="grid_gloout_temp">
+     <grid id="grid_out_temp">
         <domain domain_ref="dom_out" />
         <axis axis_ref="temp" />
      </grid>
 
+
+
      <grid id="grid_glo_sza">
         <domain domain_ref="dom_glo" />
         <axis axis_ref="sza" />
      </grid>
-
      <grid id="grid_out_sza">
         <domain domain_ref="dom_out" />
@@ -190,9 +186,9 @@
      </grid>
 
+
      <grid id="grid_glo_column">
         <domain domain_ref="dom_glo" />
         <axis axis_ref="column" />
      </grid>
-
      <grid id="grid_out_column">
         <domain domain_ref="dom_out" />
@@ -203,58 +199,101 @@
 <!-- Define 4D grids for Cosp simulator -->
      <grid id="grid4Dcol">
-        <domain id="dom_glo" />
-        <axis id="column" />
-        <axis id="height_mlev" />
+        <domain domain_ref="dom_glo" />
+        <axis axis_ref="column" />
+        <axis axis_ref="height_mlev" />
+     </grid>
+     <grid id="grid4Dcol_out">
+        <domain domain_ref="dom_out" />
+        <axis axis_ref="column" />
+        <axis axis_ref="height_mlev" />
      </grid>
 
      <grid id="grid4Dsrbin">
-        <domain id="dom_glo" />
-        <axis id="height" />
-        <axis id="scatratio" />
-     </grid>
+        <domain domain_ref="dom_glo" />
+        <axis axis_ref="height" />
+        <axis axis_ref="scatratio" />
+     </grid>
+     <grid id="grid4Dsrbin_out">
+        <domain domain_ref="dom_out" />
+        <axis axis_ref="height" />
+        <axis axis_ref="scatratio" />
+     </grid>
+
 
      <grid id="grid4Ddbze">
-        <domain id="dom_glo" />
-        <axis id="height" />
-        <axis id="dbze" />
+        <domain domain_ref="dom_glo" />
+        <axis axis_ref="height" />
+        <axis axis_ref="dbze" />
+     </grid>
+     <grid id="grid4Ddbze_out">
+        <domain domain_ref="dom_out" />
+        <axis axis_ref="height" />
+        <axis axis_ref="dbze" />
      </grid>
 
      <grid id="grid4Dtau">
-        <domain id="dom_glo" />
-        <axis id="tau" />
-        <axis id="pressure2" />
+        <domain domain_ref="dom_glo" />
+        <axis axis_ref="tau" />
+        <axis axis_ref="pressure2" />
+     </grid>
+     <grid id="grid4Dtau_out">
+        <domain domain_ref="dom_out" />
+        <axis axis_ref="tau" />
+        <axis axis_ref="pressure2" />
      </grid>
 
      <grid id="grid4Dmisr">
-        <domain id="dom_glo" />
-        <axis id="cth" />
-        <axis id="tau" />
+        <domain domain_ref="dom_glo" />
+        <axis axis_ref="cth" />
+        <axis axis_ref="tau" />
+     </grid>
+     <grid id="grid4Dmisr_out">
+        <domain domain_ref="dom_out" />
+        <axis axis_ref="cth" />
+        <axis axis_ref="tau" />
      </grid>
 
      <grid id="grid4Dreffi">
-        <domain id="dom_glo" />
-        <axis id="tau" />
-        <axis id="ReffIce" />
+        <domain domain_ref="dom_glo" />
+        <axis axis_ref="tau" />
+        <axis axis_ref="ReffIce" />
+     </grid>
+     <grid id="grid4Dreffi_out">
+        <domain domain_ref="dom_out" />
+        <axis axis_ref="tau" />
+        <axis axis_ref="ReffIce" />
      </grid>
 
      <grid id="grid4Dreffl">
-        <domain id="dom_glo" />
-        <axis id="tau" />
-        <axis id="ReffLiq" />
-     </grid>
+        <domain domain_ref="dom_glo" />
+        <axis axis_ref="tau" />
+        <axis axis_ref="ReffLiq" />
+     </grid>
+     <grid id="grid4Dreffl_out">
+        <domain domain_ref="dom_out" />
+        <axis axis_ref="tau" />
+        <axis axis_ref="ReffLiq" />
+     </grid>
+
+
      <grid id="grid4Dcol2">
-        <domain id="dom_glo" />
-        <axis id="height" />
-        <axis id="column" />
-     </grid>
-
- <!-- Grid definitions to allow summing of a 3D varaible -->    
+        <domain domain_ref="dom_glo" />
+        <axis axis_ref="height" />
+        <axis axis_ref="column" />
+     </grid>
+     <grid id="grid4Dcol2_out">
+        <domain domain_ref="dom_out" />
+        <axis axis_ref="height" />
+        <axis axis_ref="column" />
+     </grid>
+
+ <!-- Grid definitions to allow summing of a 3D variable -->    
       <grid id="grid_3D" >
-         <domain id="dom_glo" />
-         <axis id="lev" />
+         <domain domain_ref="dom_glo" />
+         <axis axis_ref="lev" />
        </grid>
 
        <grid id="grid_sum_axis">
-         <domain id="dom_glo" />
+         <domain domain_ref="dom_glo" />
          <scalar>
             <reduce_axis operation="sum" />
@@ -264,9 +303,8 @@
        <grid id="grid_sum">
          <scalar >
-        <reduce_domain operation="sum" local="true" />
-        <reduce_scalar operation="sum" />
+           <reduce_domain operation="sum" local="true" />
+           <reduce_scalar operation="sum" />
          </scalar>
-         <scalar>
-         </scalar>
+         <scalar/>
        </grid>
 
Index: /LMDZ6/trunk/DefLists/field_def_lmdz.xml
===================================================================
--- /LMDZ6/trunk/DefLists/field_def_lmdz.xml	(revision 3473)
+++ /LMDZ6/trunk/DefLists/field_def_lmdz.xml	(revision 3474)
@@ -13,8 +13,12 @@
 
     <field_group id="coord_hyb">
-        <field id="Ahyb"      axis_ref="klev" />
-        <field id="Ahyb_inter" grid_ref="klev_bnds" />
-        <field id="Bhyb"       axis_ref="klev"  />
-        <field id="Bhyb_inter"  grid_ref="klev_bnds" />
+        <field id="Ahyb" long_name="Ahyb at level interface"     axis_ref="klevp1" />
+        <field id="Ahyb_bounds" long_name="" grid_ref="klevp1_bnds" />
+        <field id="Bhyb" long_name="Bhyb at level interface"       axis_ref="klevp1"  />
+        <field id="Bhyb_bounds" long_name=""  grid_ref="klevp1_bnds" />
+        <field id="Ahyb_mid" long_name="Ahyb at the middle of the level"      axis_ref="klev" />
+        <field id="Ahyb_mid_bounds" long_name="" grid_ref="klev_bnds" />
+        <field id="Bhyb_mid" long_name="Bhyb at the middle of the level"       axis_ref="klev"  />
+        <field id="Bhyb_mid_bounds" long_name=""  grid_ref="klev_bnds" />
     </field_group>
     
Index: /LMDZ6/trunk/DefLists/file_def_histmth_lmdz.xml
===================================================================
--- /LMDZ6/trunk/DefLists/file_def_histmth_lmdz.xml	(revision 3473)
+++ /LMDZ6/trunk/DefLists/file_def_histmth_lmdz.xml	(revision 3474)
@@ -14,7 +14,7 @@
               <field field_ref="io_lat" level="1" />
               <field field_ref="Ahyb" level="1" />
-              <field field_ref="Ahyb_inter" level="1" />
+              <field field_ref="Ahyb_mid" level="1" />
               <field field_ref="Bhyb" level="1" />
-              <field field_ref="Bhyb_inter" level="1" />
+              <field field_ref="Bhyb_mid" level="1" />
             </field_group>
 
Index: /LMDZ6/trunk/libf/phylmd/iophy.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/iophy.F90	(revision 3473)
+++ /LMDZ6/trunk/libf/phylmd/iophy.F90	(revision 3474)
@@ -1037,5 +1037,5 @@
 
     !Et sinon on.... écrit
-    IF (SIZE(field)/=klon .AND. SIZE(field)/=klev) CALL abort_physic('iophy::histwrite2d_phy','Field first DIMENSION not equal to klon/klev',1)    
+    IF (SIZE(field)/=klon .AND. SIZE(field)/=klev .AND. SIZE(field)/=klev+1) CALL abort_physic('iophy::histwrite2d_phy','Field first DIMENSION not equal to klon/klev',1)    
     IF (prt_level >= 10) THEn
       WRITE (lunout,*)"histwrite2d_phy: .not.vars_defined ; time to gather and write ", trim(var%name)
@@ -1215,5 +1215,5 @@
     !Et sinon on.... écrit
 
-    IF (SIZE(field,1)/=klon .AND. SIZE(field,1)/=klev) CALL abort_physic('iophy::histwrite3d_xios','Field first DIMENSION not equal to klon/klev',1)
+    IF (SIZE(field,1)/=klon .AND. SIZE(field,1)/=klev .AND. SIZE(field,1)/=klev+1) CALL abort_physic('iophy::histwrite3d_phy','Field first DIMENSION not equal to klon/klev',1)
 
     nlev=SIZE(field,2)
@@ -1360,8 +1360,8 @@
   IF (prt_level >= 10) WRITE(lunout,*)'Begin histrwrite2d_xios ',field_name
 
-  !Et sinon on.... écrit
-  IF (SIZE(field)/=klon .AND. SIZE(field)/=klev) CALL abort_physic('iophy::histwrite2d_xios','Field first DIMENSION not equal to klon/klev',1)
-    
-  IF (SIZE(field) == klev) then
+    !Et sinon on.... écrit
+    IF (SIZE(field)/=klon .AND. SIZE(field)/=klev .AND. SIZE(field)/=klev+1) CALL abort_physic('iophy::histwrite2d_xios','Field first DIMENSION not equal to klon/klev',1)
+    
+    IF (SIZE(field) == klev .OR. SIZE(field) == klev+1) then
 !$OMP MASTER
         CALL xios_send_field(field_name,field)
@@ -1442,8 +1442,11 @@
   IF (prt_level >= 10) write(lunout,*)'Begin histrwrite3d_xios ',field_name
 
-  !Et on.... écrit
-  IF (SIZE(field,1)/=klon .AND. SIZE(field,1)/=klev) CALL abort_physic('iophy::histwrite3d_xios','Field first DIMENSION not equal to klon/klev',1)
-    
-  IF (SIZE(field,1) == klev) then
+    !Et on.... écrit
+    IF (SIZE(field,1)/=klon .AND. SIZE(field,1)/=klev .AND. SIZE(field,1)/=klev+1) then
+      write(lunout,*)' histrwrite3d_xios ', field_name, SIZE(field)
+      CALL abort_physic('iophy::histwrite3d_xios','Field first DIMENSION not equal to klon/klev',1)
+    ENDIF
+    
+    IF (SIZE(field,1) == klev .OR. SIZE(field,1) == klev+1) then
 !$OMP MASTER
         CALL xios_send_field(field_name,field)
Index: /LMDZ6/trunk/libf/phylmd/phys_output_ctrlout_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/phys_output_ctrlout_mod.F90	(revision 3473)
+++ /LMDZ6/trunk/libf/phylmd/phys_output_ctrlout_mod.F90	(revision 3474)
@@ -24,14 +24,25 @@
     'io_lat', '', '', (/ ('once', i=1, 10) /))
 
-!!! Comosantes de la coordonnee sigma-hybride
+!!! Composantes de la coordonnee sigma-hybride
 !!! Ap et Bp et interfaces
   TYPE(ctrl_out), SAVE :: o_Ahyb = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
-    'Ahyb', '', '', (/ ('once', i=1, 10) /))
+    'Ahyb', 'Ahyb at level interface', '', (/ ('once', i=1, 10) /))
   TYPE(ctrl_out), SAVE :: o_Bhyb = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
-    'Bhyb', '', '', (/ ('once', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_Ahyb_inter = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
-    'Ahyb_inter', '', '', (/ ('once', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_Bhyb_inter = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
-    'Bhyb_inter', '', '', (/ ('once', i=1, 10) /))
+    'Bhyb', 'Bhyb at level interface', '', (/ ('once', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_Ahyb_bounds = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
+    'Ahyb_bounds', '', '', (/ ('once', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_Bhyb_bounds = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
+    'Bhyb_bounds', '', '', (/ ('once', i=1, 10) /))
+!!! Composantes de la coordonnee sigma-hybride  au milieu des couches
+!!! Aps et Bps et interfaces
+  TYPE(ctrl_out), SAVE :: o_Ahyb_mid = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
+    'Ahyb_mid', 'Ahyb at the middle of the level', '', (/ ('once', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_Bhyb_mid = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
+    'Bhyb_mid', 'Bhyb at the middle of the level', '', (/ ('once', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_Ahyb_mid_bounds = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
+    'Ahyb_mid_bounds', '', '', (/ ('once', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_Bhyb_mid_bounds = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
+    'Bhyb_mid_bounds', '', '', (/ ('once', i=1, 10) /))
+
   TYPE(ctrl_out), SAVE :: o_Alt = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
     'Alt', '', '', (/ ('', i=1, 10) /))
Index: /LMDZ6/trunk/libf/phylmd/phys_output_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/phys_output_mod.F90	(revision 3473)
+++ /LMDZ6/trunk/libf/phylmd/phys_output_mod.F90	(revision 3474)
@@ -131,5 +131,5 @@
                                                                        90.,   90.,   90.,   90.,   90. /)
     REAL, DIMENSION(klev,2) :: Ahyb_bounds, Bhyb_bounds
-    REAL, DIMENSION(klev)   :: lev_index
+    REAL, DIMENSION(klev+1)   :: lev_index
                 
 #ifdef CPP_XIOS
@@ -156,4 +156,5 @@
       lev_index(ilev) = REAL(ilev)
     END DO
+      lev_index(klev+1) = REAL(klev+1)
 
     IF (.NOT. ALLOCATED(o_trac)) ALLOCATE(o_trac(nqtot))
@@ -361,4 +362,6 @@
     CALL wxios_add_vaxis("klev", levmax(iff) - levmin(iff) + 1, &
                           lev_index(levmin(iff):levmax(iff)))
+    CALL wxios_add_vaxis("klevp1", klev+1, &
+                          lev_index(1:klev+1))
     CALL wxios_add_vaxis("bnds", 2, (/1.,2./))
 
Index: /LMDZ6/trunk/libf/phylmd/phys_output_write_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/phys_output_write_mod.F90	(revision 3473)
+++ /LMDZ6/trunk/libf/phylmd/phys_output_write_mod.F90	(revision 3474)
@@ -32,5 +32,6 @@
     USE phys_output_ctrlout_mod, ONLY: o_phis, o_aire, is_ter, is_lic, is_oce, &
          o_longitude, o_latitude, &
-         o_Ahyb, o_Bhyb,o_Ahyb_inter, o_Bhyb_inter, & 
+         o_Ahyb, o_Bhyb,o_Ahyb_bounds, o_Bhyb_bounds, & 
+         o_Ahyb_mid, o_Bhyb_mid,o_Ahyb_mid_bounds, o_Bhyb_mid_bounds, & 
          is_ave, is_sic, o_contfracATM, o_contfracOR, &
          o_aireTER, o_flat, o_slp, o_ptstar, o_pt0, o_tsol, &
@@ -418,5 +419,6 @@
     REAL, PARAMETER :: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2
 !   REAL, PARAMETER :: missing_val=nf90_fill_real
-    REAL, DIMENSION(klev,2) :: Ahyb_bounds, Bhyb_bounds
+    REAL, DIMENSION(klev+1,2) :: Ahyb_bounds, Bhyb_bounds
+    REAL, DIMENSION(klev,2) :: Ahyb_mid_bounds, Bhyb_mid_bounds
     INTEGER :: ilev
 #ifndef CPP_XIOS
@@ -451,9 +453,24 @@
 #endif
 
-    DO ilev=1,klev
-      Ahyb_bounds(ilev,1) = ap(ilev)
-      Ahyb_bounds(ilev,2) = ap(ilev+1)
-      Bhyb_bounds(ilev,1) = bp(ilev)
-      Bhyb_bounds(ilev,2) = bp(ilev+1)
+    Ahyb_bounds(1,1) = 0.
+    Ahyb_bounds(1,2) = aps(1)
+    Bhyb_bounds(1,1) = 1.
+    Bhyb_bounds(1,2) = bps(1)    
+    DO ilev=2,klev
+      Ahyb_bounds(ilev,1) = aps(ilev-1)
+      Ahyb_bounds(ilev,2) = aps(ilev)
+      Bhyb_bounds(ilev,1) = bps(ilev-1)
+      Bhyb_bounds(ilev,2) = bps(ilev)
+    ENDDO
+     Ahyb_bounds(klev+1,1) = aps(klev)
+     Ahyb_bounds(klev+1,2) = 0.
+     Bhyb_bounds(klev+1,1) = bps(klev)
+     Bhyb_bounds(klev+1,2) = 0.
+
+    DO ilev=1, klev
+      Ahyb_mid_bounds(ilev,1) = ap(ilev)
+      Ahyb_mid_bounds(ilev,2) = ap(ilev+1)
+      Bhyb_mid_bounds(ilev,1) = bp(ilev)
+      Bhyb_mid_bounds(ilev,2) = bp(ilev+1)
     END DO
 
@@ -570,8 +587,12 @@
        CALL histwrite_phy("R_incl",R_incl)
        CALL histwrite_phy("solaire",solaire)
-       CALL histwrite_phy(o_Ahyb, aps)
-       CALL histwrite_phy(o_Bhyb, bps)
-       CALL histwrite_phy(o_Ahyb_inter, Ahyb_bounds)
-       CALL histwrite_phy(o_Bhyb_inter, Bhyb_bounds)
+       CALL histwrite_phy(o_Ahyb, ap)
+       CALL histwrite_phy(o_Bhyb, bp)
+       CALL histwrite_phy(o_Ahyb_bounds, Ahyb_bounds)
+       CALL histwrite_phy(o_Bhyb_bounds, Bhyb_bounds)
+       CALL histwrite_phy(o_Ahyb_mid, aps)
+       CALL histwrite_phy(o_Bhyb_mid, bps)
+       CALL histwrite_phy(o_Ahyb_mid_bounds, Ahyb_mid_bounds)
+       CALL histwrite_phy(o_Bhyb_mid_bounds, Bhyb_mid_bounds)
        CALL histwrite_phy(o_longitude, longitude_deg)
        CALL histwrite_phy(o_latitude, latitude_deg)
