Index: trunk/LMDZ.PLUTO/deftank/xios/context_pcm_physics.xml
===================================================================
--- trunk/LMDZ.PLUTO/deftank/xios/context_pcm_physics.xml	(revision 3508)
+++ trunk/LMDZ.PLUTO/deftank/xios/context_pcm_physics.xml	(revision 3508)
@@ -0,0 +1,150 @@
+<context id="LMDZ">
+
+    <!-- Definition of a calendar is done in code via wxios_set_cal -->
+
+    <!-- Definition of domains and groups of domains -->
+    <domain_definition>
+        <domain_group id="dom_glo" data_dim="1">
+          <domain id="dom_glo" />
+        </domain_group>
+
+    </domain_definition>
+
+    <domain_definition>
+        <domain id="dom_64_48" type="rectilinear" ni_glo="64" nj_glo="48"   >
+          <generate_rectilinear_domain/>
+          <interpolate_domain order="1"/>
+        </domain>
+
+        <domain id="dom_96_95" type="rectilinear"  ni_glo="96" nj_glo="95"  >
+          <generate_rectilinear_domain/>
+          <interpolate_domain order="1"/>
+        </domain>
+
+        <domain id="dom_144_142" type="rectilinear" ni_glo="144" nj_glo="142"   >
+          <generate_rectilinear_domain/>
+          <interpolate_domain order="1"/>
+        </domain>
+
+        <domain id="dom_512_360" type="rectilinear" ni_glo="512" nj_glo="360"   >
+          <generate_rectilinear_domain/>
+          <interpolate_domain order="1"/>
+        </domain>
+
+        <domain id="dom_720_360" type="rectilinear" ni_glo="720" nj_glo="360" >
+          <generate_rectilinear_domain/>
+          <interpolate_domain order="1"/>
+        </domain>
+
+        <domain id="dom_128_96" type="rectilinear" ni_glo="128" nj_glo="96" >
+          <generate_rectilinear_domain/>
+          <interpolate_domain order="1"/>
+        </domain>
+
+        <domain id="dom_256_192" type="rectilinear" ni_glo="256" nj_glo="192" >
+          <generate_rectilinear_domain/>
+          <interpolate_domain order="1"/>
+        </domain>
+
+        <domain id="dom_out" domain_ref="dom_128_96"/>
+    </domain_definition>
+    <!-- <domain_definition src="./domain_def.xml"/> -->
+
+    <!-- Definition of vertical axes
+                           NB: these must be defined and set in code via
+         xios_output_mod -->
+    <axis_definition>
+        <axis id="presnivs"
+              standard_name="Pseudo-pressure of model vertical levels"
+              unit="Pa">
+        </axis>
+        <axis id="altitude"
+              standard_name="Pseudo-altitude of model vertical levels"
+              unit="km">
+        </axis>
+        <axis id="soil_layers"
+              standard_name="soil layer depth at intermediate level"
+              unit="m">
+        </axis>
+        <axis id="interlayer"
+              standard_name="Levels between layers (altitude+1)"
+              unit="km">
+        </axis>
+        <axis id="controle_axe"
+              standard_name="Controle"
+              n_glo="100">
+        </axis>
+        <!--Added for diagspecIR-->
+        <axis id="IR_Wavenumber"
+               standard_name="Band mid frequency in the infrared"
+               unit="cm-1">
+        </axis>
+        <!--Added for diagspecVI-->
+        <axis id="VI_Wavenumber"
+              standard_name="Band mid frequency in the visible"
+              unit=
+            "cm-1">
+        </axis>
+
+    </axis_definition>
+
+    <scalar_definition>
+           <scalar id="scalar" />
+    </scalar_definition>
+
+    <grid_definition>
+        <!-- toggle axis id below to change output vertical axis -->
+        <grid id="grid_3D">
+            <domain domain_ref="dom_glo" />
+            <axis axis_ref="altitude" />
+        </grid>
+        <grid id="grid_2D">
+            <domain domain_ref="dom_glo" />
+        </grid>
+        <!--Added for diagspecIR-->
+        <grid id='grid_IR_3D'>
+            <domain domain_ref="dom_glo" />
+            <axis axis_ref='IR_Wavenumber'/>
+        </grid>
+        <!-- Added for diagspecVI-->
+        <grid id="grid_VI_3D">
+          <domain domain_ref="dom_glo" />
+          <axis axis_ref="VI_Wavenumber"/>
+        </grid>
+        <!-- grid for interpolated lon-lat outputs -->
+        <!-- to output scalars -->
+        <grid id="scalarpoint" >
+            <scalar scalar_ref="scalar" />
+        </grid>
+        <!-- output grids -->
+        <grid id="grid_3D_out">
+            <domain domain_ref="dom_out" />
+            <axis axis_ref="altitude" />
+        </grid>
+        <grid id="grid_2D_out">
+            <domain domain_ref="dom_out" />
+        </grid>
+        <!--added for diagspecIR-->
+        <grid id="grid_IR_3D_out">
+            <domain domain_ref="dom_out"/>
+            <axis axis_ref="IR_Wavenumber"/>
+        </grid>
+        <grid id="grid_IR">
+            <axis axis_ref="IR_Wavenumber"/>
+        </grid>
+        <!--Added for diagspecVI-->
+        <grid id="grid_VI_3D_out">
+            <domain domain_ref="dom_out"/>
+            <axis axis_ref="VI_Wavenumber"/>
+        </axis>
+        <grid id="grid_VI">
+          <axis axis_ref="VI_Wavenumber"/>
+        </grid>
+    </grid_definition>
+
+    <!-- Definition of model variables -->
+    <field_definition src="./field_def_physics.xml" />
+
+    <!-- Definition of output files -->
+    <file_definition src="./file_def_physics.xml" />
+</context>
Index: trunk/LMDZ.PLUTO/deftank/xios/field_def_physics.xml
===================================================================
--- trunk/LMDZ.PLUTO/deftank/xios/field_def_physics.xml	(revision 3508)
+++ trunk/LMDZ.PLUTO/deftank/xios/field_def_physics.xml	(revision 3508)
@@ -0,0 +1,362 @@
+<!-- ============================================================== -->
+<!-- field_def_physics.xml                                          -->
+<!-- Definition of all existing variables that can be outputed
+     from Generic PCM physics                                       -->
+<!-- ============================================================== -->
+
+    <field_definition prec="4"
+                      freq_op="1ts"
+                      enabled="true">
+
+        <!-- 0D variables -->
+        <field_group id="fields_0D" grid_ref="scalarpoint">
+            <field id="Ls"
+                   long_name="Solar longitude"
+                   unit="degrees" />
+            <field id="RA"
+                   long_name="Right Ascension"
+                   unit="degrees" />
+            <field id="Declin"
+                   long_name="Solar declination"
+                   unit="degrees" />
+            <field id="dist_star"
+                   long_name="Distance to star"
+                   unit="AU" />
+        </field_group>
+
+        <field_group id="fields_controle" grid_ref="controle_grid">
+            <field id="controle"
+                   long_name="controle" />
+        </field_group>
+
+        <field_group id="fields_altitude" grid_ref="altitude_grid">
+            <field id="aps"
+                   long_name="aps" />
+            <field id="bps"
+                   long_name="bps" />
+        </field_group>
+
+        <field_group id="fields_interlayer" grid_ref="interlayer_grid">
+            <field id="ap"
+                   long_name="ap" />
+            <field id="bp"
+                   long_name="bp" />
+        </field_group>
+
+        <!-- 1D variables (spectral)-->
+        <field_group id="IR_fields" grid_ref="grid_IR">
+              <field id="IR_Bandwidth"
+                     long_name="Bandwidth in the infrared"
+                     unit="cm-1"/>
+        </field_group>
+        <field_group id="VI_field" grid_ref="grid_VI">
+              <field id="VI_Bandwidth"
+                     long_name="Bandwith in the visible"
+                     unit="cm-1"/>
+       </field_group>
+        <!-- 2D variables -->
+        <field_group id="fields_2D" grid_ref="grid_2D">
+            <field id="area"
+                   long_name="Mesh area"
+                   unit="m2" />
+            <field id="phisfi"
+                   long_name="Surface geopotential"
+                   unit="m2.s-2" />
+            <field id="emis"
+                   long_name="Surface emissivity"
+                   unit="" />
+            <field id="ALB"
+                   long_name="Surface Albedo"
+                    unit="" />
+
+            <field id="ps"
+                   long_name="Surface Pressure"
+                   unit="Pa" />
+            <field id="tsurf"
+                   long_name="Surface Temperature"
+                   unit="K" />
+
+            <!-- Tracers -->
+            <field id="n2_surf"
+                   long_name="N2 ice thickness"
+                   unit="kg/m2" />
+            <field id="ch4_gas_surf"
+                   long_name="CH4 vapor at surface"
+                   unit="kg/m2" />
+            <field id="ch4_ice_surf"
+                   long_name="CH4 ice at surface"
+                   unit="kg/m2" />
+            <field id="co_gas_surf"
+                   long_name="co vapor at surface"
+                   unit="kg/m2" />
+            <field id="co_ice_surf"
+                   long_name="co ice at surface"
+                   unit="kg/m2" />
+            <field id="haze_surf"
+                   long_name="haze at surface"
+                   unit="kg/m2" />
+            <field id="prec_haze_surf"
+                   long_name="precursor haze at surface"
+                   unit="kg/m2" />
+
+            <field id="n2_col"
+                   long_name="N2 vapor column"
+                   unit="kg/m2" />
+            <field id="ch4_gas_col"
+                   long_name="CH4 vapor column"
+                   unit="kg/m2" />
+            <field id="ch4_ice_col"
+                   long_name="CH4 ice column"
+                   unit="kg/m2" />
+            <field id="co_gas_col"
+                   long_name="co vapor column"
+                   unit="kg/m2" />
+            <field id="co_ice_col"
+                   long_name="co ice column"
+                   unit="kg/m2" />
+            <field id="haze_col"
+                   long_name="haze column"
+                   unit="kg/m2" />
+            <field id="prec_haze_col"
+                   long_name="precursor haze column"
+                   unit="kg/m2" />
+
+            <field id="n2_iceflux"
+                   long_name="N2 flux"
+                   unit="kg/m2/s" />
+            <field id="ch4_iceflux"
+                   long_name="CH4 ice flux"
+                   unit="kg/m2/s" />
+            <field id="co_iceflux"
+                   long_name="co ice flux"
+                   unit="kg/m2/s" />
+
+            <field id="vmr_ch4"
+                   long_name="CH4 volume mixing ratio"
+                   unit="" />
+            <field id="vmr_co"
+                   long_name="CO volume mixing ratio"
+                   unit="" />
+
+            <field id="tau_col"
+                   long_name="Total aerosol optical depth"
+                   unit="opacity" />
+
+            <field id="zdqsdif_ch4_ice"
+                   long_name="zdqsdif ch4"
+                   unit="" />
+            <field id="zdqssed_ch4"
+                   long_name="zdqssed ch4"
+                   unit="" />
+            <field id="zdqssed_haze"
+                   long_name="zdqssed haze"
+                   unit="" />
+
+            <!-- Radiation -->
+            <field id="ASR"
+                   long_name="Absorbed stellar radiation"
+                    unit="W/m2" />
+            <field id="ISR"
+                   long_name="incoming solar radiation"
+                   unit="W/m2" />
+            <field id="OLR"
+                   long_name="outgoing longwave radiation"
+                   unit="W/m2" />
+            <field id="GND"
+                   long_name="Heat flux from ground"
+                   unit="W/m2" />
+            <field id="DYN"
+                   long_name="Dynamical heat input"
+                   unit="W/m2" />
+            <field id="fluxsurf_lw"
+                   long_name="Longwave radiation at the surface"
+                   unit="W.m-2" />
+            <field id="sensibFlux"
+                   long_name="Sensible heat flux"
+                   unit="W/m2" />
+            <field id="lscaledE"
+                   long_name="heat from largescale"
+                   unit="W/m2" />
+            <field id="madjdE"
+                   long_name="heat from moistadj"
+                   unit="W/m2" />
+            <field id="genericconddE"
+                   long_name="heat from generic condensation"
+                   unit="W/m2" />
+
+        </field_group>
+
+        <!-- 3D variables -->
+        <field_group id="fields_3D" grid_ref="grid_3D">
+
+            <field id="zzlay"
+                   long_name="Midlayer altitude"
+                   unit="m" />
+            <field id="zzlev"
+                   long_name="Interlayer altitude"
+                   unit="m" />
+            <field id="pphi"
+                   long_name="Geopotential"
+                   unit="m2.s-2" />
+
+            <field id="temperature"
+                   long_name="Atmospheric temperature"
+                   unit="K" />
+            <field id="teta"
+                   long_name="Potential temperature"
+                   unit="K" />
+            <field id="u"
+                   long_name="Eastward Zonal Wind"
+                   unit="m/s" />
+            <field id="v"
+                   long_name="Northward Meridional Wind"
+                   unit="m/s" />
+            <field id="w"
+                   long_name="Downward Vertical Wind"
+                   unit="m/s" />
+            <field id="omega"
+                   long_name="Downward omega velocity"
+                   unit="Pa/s" />
+            <field id="p"
+                   long_name="Atmospheric pressure"
+                   unit="Pa" />
+            <field id="detr"
+                   long_name="Detrainment"
+                   unit="kg/m2/s" />
+            <field id="entr"
+                   long_name="Entrainment"
+                   unit="kg/m2/s" />
+            <field id="w_plm"
+                   long_name="Plume vertical velocity"
+                   unit="m/s" />
+            <field id="q2"
+                   long_name="turbulent kinetic energy"
+                   unit="J.kg^-1" />
+            <field id="dEzradsw"
+                   long_name="radiative heating"
+                   unit="w.m^-2" />
+            <field id="dEzradlw"
+                   long_name="radiative heating"
+                   unit="w.m^-2" />
+            <field id="qsatatm"
+                   long_name="atm qsat"
+                   unit=" " />
+            <field id="dt_generic_condensation"
+                   long_name="heating from generic condensation"
+                   unit="K s-1" />
+            <field id="zdtsw"
+                   long_name="SW heating"
+                   unit="T s-1" />
+            <field id="zdtlw"
+                   long_name="LW heating"
+                   unit="T s-1" />
+            <field id="dtrad"
+                   long_name="radiative heating"
+                   unit="K s-1" />
+            <field id="zdtdyn"
+                   long_name="Dyn. heating"
+                   unit="T s-1" />
+            <field id="dtmoistadj"
+                   long_name="moist adj heating"
+                   unit="K s-1" />
+            <field id="dtdryadj"
+                   long_name="dry adj heating"
+                   unit="K s-1" />
+
+            <!--Tracers-->
+            <field id="n2"
+                   long_name="N2 mass mixing ratio"
+                   unit="kg/kg" />
+            <field id="ch4_gas"
+                   long_name="CH4 vapor mass mixing ratio"
+                   unit="kg/kg" />
+            <field id="ch4_ice"
+                   long_name="CH4 ice mass mixing ratio"
+                   unit="kg/kg" />
+            <field id="co_gas"
+                   long_name="co vapor mass mixing ratio"
+                   unit="kg/kg" />
+            <field id="co_ice"
+                   long_name="co ice mass mixing ratio"
+                   unit="kg/kg" />
+            <field id="haze"
+                   long_name="haze mass mixing ratio"
+                   unit="kg/kg" />
+            <field id="prec_haze"
+                   long_name="precursor haze mass mixing ratio"
+                   unit="kg/kg" />
+            <field id="zdtc"
+                   long_name="tendancy T cond N2"
+                   unit="K" />
+
+            <field id="zrho_ch4"
+                   long_name="zrho_ch4"
+                   unit="kg/m3" />
+            <field id="zrho_co"
+                   long_name="zrho_co"
+                   unit="kg/m3" />
+            <field id="zrho_haze"
+                   long_name="zrho_haze"
+                   unit="kg/m3" />
+            <field id="zdqcn2_ch4"
+                   long_name="zdq condn2 ch4"
+                   unit="" />
+            <field id="zdqdif_ch4"
+                   long_name="zdqdif_ch4"
+                   unit="" />
+            <field id="zdqadj_ch4"
+                   long_name="zdqadj_ch4"
+                   unit="" />
+            <field id="zdqsed_ch4"
+                   long_name="zdqsed_ch4"
+                   unit="" />
+            <field id="zdtch4cloud"
+                   long_name="ch4 cloud"
+                   unit="T s-1" />
+            <field id="zdqch4cloud"
+                   long_name="ch4 cloud"
+                   unit="T s-1" />
+            <field id="zdqrho_photprec"
+                   long_name="zdqrho_photprec"
+                   unit="kg/m3/s" />
+            <field id="zdqphot_prec"
+                   long_name="zdqphot_prec"
+                   unit="" />
+            <field id="zdqphot_ch4"
+                   long_name="zdqphot_ch4"
+                   unit="" />
+
+            <field id="zdqhaze_ch4"
+                   long_name="zdqhaze_ch4"
+                   unit="" />
+            <field id="zdqhaze_prec"
+                   long_name="zdqhaze_prec"
+                   unit="" />
+            <field id="zdqhaze_haze"
+                   long_name="zdqhaze_haze"
+                   unit="" />
+            <field id="zdqconv_prec"
+                   long_name="zdqconv_prec"
+                   unit="" />
+
+        </field_group>
+
+        <!--Spectral IR 3D variables-->
+        <field_group id="spectral_IR_3D" grid_ref="grid_IR_3D">
+              <field id="OLR3D"
+                     long_name="OLR(lon,lat,band)"
+                     unit="W/m^2/cm^-1" />
+        </field_group>
+
+        <!-- SPectral VI 3D variables-->
+        <field_group id="spectral_VI_3D" grid_ref="grid_VI_3D">
+              <field id="OSR3D"
+                     long_name="OSR(lon,lat,band"
+                     unit="W/m^2/cm^-1"/>
+              <field id="GSR3D"
+                     long_name="GSR(lon,lat,band)"
+                     unit="w/m^2/cm^-1"/>
+        </field_group>
+    </field_definition>
+
+
Index: trunk/LMDZ.PLUTO/deftank/xios/file_def_physics.xml
===================================================================
--- trunk/LMDZ.PLUTO/deftank/xios/file_def_physics.xml	(revision 3508)
+++ trunk/LMDZ.PLUTO/deftank/xios/file_def_physics.xml	(revision 3508)
@@ -0,0 +1,123 @@
+<!-- =================================================================== -->
+<!-- file_def_physics.xml                                                -->
+<!-- Definition of output files for Generic PCM physics                  -->
+<!-- =================================================================== -->
+
+    <file_definition>
+
+        <!-- Instantaneous outputs; Here output_freq in physics time steps -->
+        <!--
+           1 ts == 1 physical ts
+           if physical ts is half a day,
+           10ts   below means every 5 days
+           2000ts below means every 1000 days
+          -->
+        <file id="histins"
+              name="Xhistins"
+              output_freq="1ts"
+              sync_freq="1ts"
+              type="one_file"
+              time_units="days"
+              enabled="true">
+
+
+            <!-- VARS 0D -->
+            <field_group operation="instant"
+                         grid_ref="scalarpoint"
+                         freq_op="1ts">
+                <field field_ref="Ls" />
+            </field_group>
+
+            <!--<field_group domain_ref="dom_glo"> -->
+            <!--<field_group grid_ref="grid_2D_out">-->
+            <!-- toggle domain_ref to output on native or lon-lat domain -->
+
+              <!-- VARS 2D -->
+              <field_group operation="instant" prec="4"
+                           grid_ref="grid_2D_out"
+                           freq_op="1ts">
+                  <field field_ref="area" operation="once" />
+                  <field field_ref="ps" enabled="true" />
+                  <field field_ref="ISR" enabled="true" />
+                  <field field_ref="OLR" enabled="true" />
+                  <field field_ref="ASR" enabled="true" />
+              </field_group>
+
+              <!-- VARS 3D -->
+              <field_group operation="instant"
+                           grid_ref="grid_3D_out"
+                           freq_op="1ts">
+                  <field field_ref="u" />
+                  <field field_ref="v" />
+                  <field field_ref="omega"/>
+                  <field field_ref="temperature" />
+                  <field field_ref="n2" />
+                  <field field_ref="ch4_gas" />
+                  <field field_ref="ch4_ice" />
+                  <field field_ref="co_gas" />
+                  <field field_ref="co_ice" />
+                  <field field_ref="haze" />
+
+                  <!--field field_ref="h2o_vap" />
+                  <field field_ref="h2o_ice" />
+                  <field field_ref="w_plm" />
+                  <field field_ref="detr" />
+                  <field field_ref="entr" /-->
+              </field_group>
+
+            <!--</field_group>-->
+        </file>
+       <!--XspecIR-->
+      <file id="specIR"
+            name="XspecIR"
+            output_freq="400ts"
+            type="one_file"
+            time_units="days"
+            enabled="false">
+          <!--Var 1D ?-->
+          <field_group operation="instant"
+                        grid_ref="grid_IR"
+                        freq_op="1ts">
+              <field field_ref="IR_Bandwidth" operation="once"/>
+          </field_group>
+          <!--Var 2D-->
+          <field_group operation="instant" prec="4"
+                        grid_ref="grid_2D_out"
+                        freq_op="1ts">
+              <field field_ref="area" operation="once" />
+          </field_group>
+          <!--Var 3D-->
+          <field_group operation="instant"
+                        grid_ref="grid_IR_3D_out"
+                        freq_op="1ts">
+              <field field_ref="OLR3D" />
+          </field_group>
+      </file>
+       <!--XspecVI-->
+      <file id="specVI"
+            name="XspecVI"
+            output_freq="400ts"
+            type="one_file"
+            time_units="days"
+            enabled="true">
+          <!--Var 1D -->
+          <field_group operation="instant"
+                        grid_ref="grid_VI"
+                        freq_op="1ts">
+              <field field_ref="VI_Bandwidth" operation="once"/>
+          </field_group>
+          <!--Var 2D-->
+          <field_group operation="instant" prec="4"
+                        grid_ref="grid_2D_out"
+                        freq_op="1ts">
+              <field field_ref="area" operation="once" />
+          </field_group>
+          <!--Var 3D-->
+          <field_group operation="instant"
+                        grid_ref="grid_VI_3D_out"
+                        freq_op="1ts">
+              <field field_ref="OSR3D" />
+              <field field_ref="GSR3D" />
+          </field_group>
+      </file>
+    </file_definition>
Index: trunk/LMDZ.PLUTO/deftank/xios/iodef.xml
===================================================================
--- trunk/LMDZ.PLUTO/deftank/xios/iodef.xml	(revision 3508)
+++ trunk/LMDZ.PLUTO/deftank/xios/iodef.xml	(revision 3508)
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<simulation>
+        <context  id="xios">
+            <variable_definition>
+                <!-- set print_file to true to have XIOS write its
+                     outputs in separate files -->
+                <variable id="print_file" type="bool"> true </variable>
+
+                <variable id="buffer_size_factor" type="double">4</variable>
+                <variable_group id="buffer">
+                buffer_size = 85000000
+                buffer_server_factor_size = 2
+                </variable_group>
+
+                <variable_group id="parameters" >
+                    <!-- set using_server to true to run with XIOS
+                         in detached server/client mode -->
+                    <variable id="using_server" type="bool">false</variable>
+                    <!-- info_level is the verbosity level of XIOS
+                         0 for no messages; 100 for lots -->
+                    <variable id="info_level" type="int">10</variable>
+                </variable_group>
+            </variable_definition>
+        </context>
+
+        <context id="LMDZ" src="./context_pcm_physics.xml"/>
+</simulation>
