Index: /codes/icosagcm/devel/Python/src/unstructured.pyx
===================================================================
--- /codes/icosagcm/devel/Python/src/unstructured.pyx	(revision 621)
+++ /codes/icosagcm/devel/Python/src/unstructured.pyx	(revision 622)
@@ -36,7 +36,7 @@
 # if a number n is present in the prototype, the previous type is repeated n times
 kernels.import_funs([
-#                     ['setup_xios',None],
-#                     ['call_xios_set_timestep',c_double],
-#                     ['call_xios_update_calendar',c_int]
+                     ['dynamico_setup_xios',None],
+                     ['dynamico_xios_set_timestep',c_double],
+                     ['dynamico_xios_update_calendar',c_int],
 #                     ['init_params',c_double],
                      ['dynamico_init_mesh',c_void_p,13],
Index: /codes/icosagcm/devel/Python/test/py/test_xios.py
===================================================================
--- /codes/icosagcm/devel/Python/test/py/test_xios.py	(revision 622)
+++ /codes/icosagcm/devel/Python/test/py/test_xios.py	(revision 622)
@@ -0,0 +1,122 @@
+from mpi4py import MPI
+comm = MPI.COMM_WORLD
+mpi_rank, mpi_size = comm.Get_rank(), comm.Get_size()
+print '%d/%d starting'%(mpi_rank,mpi_size)
+
+import sys
+import numpy as np
+#import dynamico.wrap as wrap
+print 'import dynamico.unstructured'
+import dynamico.unstructured as unst
+print 'import dynamico.xios'
+import dynamico.xios as xios
+print 'Done.'
+
+def boundaries(degree,points,lon,lat):
+    n, nvertex = len(degree), degree.max()
+    bnd_lon, bnd_lat = np.zeros((n,nvertex)),np.zeros((n,nvertex))
+    for ij in range(n):
+        nb=degree[ij]
+        for k in range(nb):
+            vertex = points[ij,k]
+            bnd_lon[ij,k]=lon[vertex]
+            bnd_lat[ij,k]=lat[vertex]
+        for k in range(nb,nvertex):   # repeat last vertex if nb<nvertex
+            bnd_lon[ij,k]=bnd_lon[ij,nb-1]
+            bnd_lat[ij,k]=bnd_lat[ij,nb-1]
+    return bnd_lon, bnd_lat
+
+#----------------------------- read MPAS mesh --------------------------------
+
+radian=unst.radian
+grid, llm, nqdyn, nqtot = 10242, 1,1,1 # 2562, 10242, 40962  
+Omega, radius, g, gh0 = 2.*np.pi/86400., 6.4e6, 1., 2.94e4
+N, T, courant = 40, 10800., 1.2 # simulation length = N*T
+print 'Omega, planetary PV', Omega, 2*Omega/gh0
+sys.stdout.flush()
+
+def f(lon,lat): return 2*Omega*np.sin(lat) # Coriolis parameter                                                                                                                
+print 'Reading MPAS mesh ...'
+sys.stdout.flush()
+mesh = unst.MPAS_Mesh('grids/x1.%d.grid.nc'%grid, llm, nqdyn, radius, f)
+print '...Done'
+sys.stdout.flush()
+
+lon_i, lat_i, lon_v, lat_v = [x*radian for x in mesh.lon_i, mesh.lat_i, mesh.lon_v, mesh.lat_v]
+#lon_i, lat_i, lon_v, lat_v = mesh.lon_i, mesh.lat_i, mesh.lon_v, mesh.lat_v
+
+#--------------------------------- initialize XIOS --------------------------
+
+def setup_domain(cat,id, degree,vertex,lon,lat,lon_v,lat_v): # cat in 'domain','domaingroup'
+    bnd_lon, bnd_lat = boundaries(degree, vertex, lon_v, lat_v)
+    ncell_tot, nvertex = bnd_lon.shape
+    mesh = xios.Handle(cat,id)
+    mesh.set_attr(type='unstructured')
+    mesh.set_attr(ni_glo=ncell_tot, ibegin=0, ni=ncell_tot)
+    mesh.set_attr(i_index=np.arange(ncell_tot,dtype=np.int32))
+    mesh.set_attr(lonvalue_1d=lon, latvalue_1d=lat)
+    mesh.set_attr(nvertex=nvertex,bounds_lon_1d=bnd_lon, bounds_lat_1d=bnd_lat)
+
+unst.ker.dynamico_setup_xios()
+
+if True:
+    lev, levp1, nq = [xios.Handle('axis',name) for name in 'lev', 'levp1', 'nq']
+    lev.set_attr(n_glo=llm, value=np.arange(llm))
+    levp1.set_attr(n_glo=llm+1, value=np.arange(llm+1))
+    nq.set_attr(n_glo=nqtot, value=np.arange(nqtot))
+    mesh_i=setup_domain('domaingroup','i', mesh.primal_deg, mesh.primal_vertex-1, lon_i, lat_i, lon_v, lat_v) # primal mesh
+#    mesh_v=setup_domain('domain','v', mesh.dual_deg, mesh.dual_vertex-1, lon_v, lat_v, lon_i, lat_i) # dual mesh
+
+#   CALL xios_set_domain_attr("u",ni_glo=ncell_tot, ibegin=displ, ni=ncell)                                                                              
+#   CALL xios_set_domain_attr("u", data_dim=1, type='unstructured' , nvertex=2, i_index=ind_glo)                                                         
+#   CALL xios_set_domain_attr("u",lonvalue_1d=lon, latvalue_1d=lat, bounds_lon_1d=bounds_lon, bounds_lat_1d=bounds_lat)                                   
+#mesh_e = xios.Handle('domain','u')
+
+# works up to that point !
+
+dtime = xios.Duration(second=3600.)
+
+#   CALL xios_set_timestep(dtime)                                                                                                                        
+if True:
+    calendar=xios.Handle('calendar_wrapper')
+    print (dtime.year, dtime.month, dtime.day, dtime.hour, dtime.second)
+    calendar.set_attr(timestep=dtime)
+    calendar.update_timestep()
+else:
+    unst.ker.dynamico_xios_set_timestep(3600.)
+
+#   CALL xios_set_fieldgroup_attr("standard_output", freq_op=itau_out*xios_timestep, freq_offset=(itau_out-1)*xios_timestep)                             
+if False:
+    std=xios.Handle('fieldgroup','standard_output')
+    std.set_attr(freq_op=dtime)
+    freq_offset = xios.Duration(second=0)
+    std.set_attr(freq_offset=freq_offset)
+
+if True:
+    print 'xios.context_close_definition()'
+    xios.context_close_definition()
+
+no_error=True
+try:
+    for i in range(100):
+        if True:
+            unst.ker.dynamico_xios_update_calendar(i)
+        else:
+            xios.update_calendar(i)
+        print 'send_field', i
+        xios.send_field('ps', lat_i)
+except:
+    print 'An error has occured, trying to close XIOS properly'
+    no_error=False
+# CALL xios_recv_field(name,field)                                                                                                                       
+# CALL xios_send_field(name,field_tmp)                                                                                                                   
+
+print 'xios.context_finalize()'
+xios.context_finalize()
+
+print 'xios.finalize()'
+xios.finalize()
+
+print 'Done'
+
+if not no_error : raise
Index: /codes/icosagcm/devel/Python/test/xml/context_icosa.xml
===================================================================
--- /codes/icosagcm/devel/Python/test/xml/context_icosa.xml	(revision 622)
+++ /codes/icosagcm/devel/Python/test/xml/context_icosa.xml	(revision 622)
@@ -0,0 +1,134 @@
+<context id="icosagcm" >
+
+<!----------------- objects that must be initialized by DYNAMICO ---------------------->
+
+  <axis_definition>
+    <axis id="lev" name="lev" positive="down" standard_name="atmopshere_hybrid_sigma_pressure_coordinate" long_name="hybrid level at midpoints" />
+    <axis id="levp1" name="ilev"  unit="level" positive="down" standard_name="atmopshere_hybride_sigma_pressure_coordinate" long_name="hybrid level at interface" />
+    <axis id="nq" name="nq" n_glo="5" value="(0,4)[1 2 3 4 5]"/>
+  </axis_definition>    
+  
+  <domain_definition>
+
+    <domain_group id="i"> 
+      <domain id="i" name="mesh"/>     
+    </domain_group> 
+
+  </domain_definition>    
+
+<!------------------------------ objects defined in XML -------------------------------->
+
+  <calendar type="d360" start_date="2000-01-01 00:00:00" time_origin="2000-01-01 00:00:00"/>
+  <field_definition src="./field_def.xml" />
+
+  <domain_definition>
+     <domain id="regular_half_degree" type="rectilinear" ni_glo="720" nj_glo="360" >
+       <generate_rectilinear_domain />
+       <interpolate_domain order="1"/>
+     </domain> 
+     
+     <domain id="regular_one_degree" type="rectilinear" ni_glo="360" nj_glo="180" >
+       <generate_rectilinear_domain />
+       <interpolate_domain order="1"/>
+     </domain> 
+     
+     <domain id="regular_two_degree" type="rectilinear" ni_glo="180" nj_glo="90" >
+       <generate_rectilinear_domain />
+       <interpolate_domain order="1"/>
+     </domain> 
+  </domain_definition>    
+     
+  <file_definition src="./filedef_dcmip2016.xml" /> 
+
+<!--  <calendar type="d360" start_date="2000-01-01 00:00:00" time_origin="2000-01-01 00:00:00"/> 
+  
+  <field_definition src="./field_def.xml" />
+
+
+  <file_definition type="one_file" par_access="collective">
+
+    <file id="output" name="output" enabled=".FALSE."  output_freq="2h" sync_freq="2h" output_level="10" >
+      <field_group group_ref="standard_output"/>
+    </file>
+
+    <file id="restart" name="restart" enabled="true">
+       <field_group id="group_restart" operation="once"> 
+          <field id="it_restart" name="iteration"  grid_ref="scalar" />
+          <field id="q_restart" name="q"  grid_ref="grid_q" />
+          <field_group domain_ref="i"> 
+             <field id="ps_restart" name="ps" />
+             <field id="phis_restart" name="phis" />
+             <field_group axis_ref="lev" >
+                <field id="theta_rhodz_restart" name="theta_rhodz" />
+                <field id="u_restart" name="u" domain_ref="u"/>
+                <field id="ulon_restart" name="ulon" />
+                <field id="ulat_restart" name="ulat" />
+             </field_group>
+          </field_group>
+       </field_group>
+    </file>
+
+    <file id="start" name="start" enabled="true">
+       <field_group id="group_start" operation="once"> 
+          <field id="it_start" name="iteration"  grid_ref="scalar" enabled="false"/>
+          <field id="q_start" name="q"  grid_ref="grid_q_read" />
+          <field_group domain_ref="i"> 
+             <field id="ps_start" name="ps" />
+             <field id="phis_start" name="phis" />
+             <field_group axis_ref="lev_read" >
+                <field id="theta_rhodz_start" name="theta_rhodz" />
+                <field id="u_start" name="u" domain_ref="u"/>
+                <field id="ulon_start" name="ulon" />
+                <field id="ulat_start" name="ulat" />
+             </field_group>
+          </field_group>
+       </field_group>
+    </file>
+
+    
+  </file_definition>
+    
+  <axis_definition>
+    <axis id="lev" name="lev" positive="down" standard_name="atmopshere_hybrid_sigma_pressure_coordinate" long_name="hybrid level at midpoints" />
+    <axis id="lev_read" />
+    <axis id="levp1" name="ilev"  unit="level" positive="down" standard_name="atmopshere_hybride_sigma_pressure_coordinate" long_name="hybrid level at interface" />
+    <axis id="lev_pressure" positive="down"  n_glo="2" unit="Pa" value="(0,1)[85000 50000]" >
+      <interpolate_axis order="1" coordinate="p" />
+    </axis>    
+    <axis id="nq" name="nq" n_glo="5" value="(0,4)[1 2 3 4 5]"/>
+  </axis_definition>    
+  
+  <domain_definition>
+    
+     <domain_group id="i"> 
+       <domain id="i" name="mesh"/>     
+     </domain_group> 
+     
+     
+     <domain id="v" />
+     <domain id="u" />
+     
+  </domain_definition>    
+  
+  <grid_definition>    
+    <grid id="scalar">
+      <scalar />
+    </grid>
+    
+    <grid id="grid_q">
+      <domain domain_ref="i" />
+      <axis axis_ref="lev" />
+      <axis axis_ref="nq" />
+    </grid >
+
+    <grid id="grid_q_read">
+      <domain domain_ref="i" />
+      <axis axis_ref="lev_read" />
+      <axis axis_ref="nq" />
+    </grid >
+ 
+  </grid_definition>   
+
+-->
+  
+</context>
Index: /codes/icosagcm/devel/Python/test/xml/context_icosa_simple.xml
===================================================================
--- /codes/icosagcm/devel/Python/test/xml/context_icosa_simple.xml	(revision 622)
+++ /codes/icosagcm/devel/Python/test/xml/context_icosa_simple.xml	(revision 622)
@@ -0,0 +1,42 @@
+<context id="icosagcm" >
+  <calendar type="d360" start_date="2000-01-01 00:00:00" time_origin="2000-01-01 00:00:00"/>
+
+  <field_definition src="./field_def.xml" />
+  <file_definition src="./filedef.xml" /> 
+  
+  <axis_definition>
+    <axis id="lev" name="lev" positive="down" standard_name="atmopshere_hybrid_sigma_pressure_coordinate" long_name="hybrid level at midpoints" />
+    <axis id="levp1" name="ilev"  unit="level" positive="down" standard_name="atmopshere_hybride_sigma_pressure_coordinate" long_name="hybrid level at interface" />
+    <axis id="nq" name="nq" n_glo="5" value="(0,4)[1 2 3 4 5]"/>
+  </axis_definition>    
+  
+  <grid_definition>    
+    <grid id="scalar">
+      <scalar />
+    </grid>
+  </grid_definition>   
+
+  <domain_definition>
+
+     <domain_group id="i">
+       <domain id="i" name="mesh"/>
+     </domain_group>
+
+     <domain id="regular_half_degree" type="rectilinear" ni_glo="720" nj_glo="360" >
+       <generate_rectilinear_domain />
+       <interpolate_domain order="1"/>
+     </domain>
+
+     <domain id="regular_one_degree" type="rectilinear" ni_glo="360" nj_glo="180" >
+       <generate_rectilinear_domain />
+       <interpolate_domain order="1"/>
+     </domain>
+
+     <domain id="regular_two_degree" type="rectilinear" ni_glo="180" nj_glo="90" >
+       <generate_rectilinear_domain />
+       <interpolate_domain order="1"/>
+     </domain>
+
+  </domain_definition>
+  
+</context>
Index: /codes/icosagcm/devel/Python/test/xml/field_def_full.xml
===================================================================
--- /codes/icosagcm/devel/Python/test/xml/field_def_full.xml	(revision 622)
+++ /codes/icosagcm/devel/Python/test/xml/field_def_full.xml	(revision 622)
@@ -0,0 +1,77 @@
+<field_definition level="1" enabled=".TRUE." operation="instant">
+  
+  <field_group id="standard_output"> 
+    
+    <field id="timestep" grid_ref="scalar" unit="s"/>
+    <field id="preff" grid_ref="scalar"    unit="Pa"/>
+    <field id="ap" axis_ref="levp1"   long_name="hybrid A coefficient at layer interface" />
+    <field id="bp" axis_ref="levp1"  long_name="hybrid B coefficient at layer interface" />
+    <field id="mid_ap" axis_ref="lev"   long_name="hybrid A coefficient at midpoints" />
+    <field id="mid_bp" axis_ref="lev"  long_name="hybrid B coefficient at midpoints" />
+    
+    <field_group domain_ref="i">
+      <field id="ps" />
+      <field id="dps"  />
+      <field id="Ai" />
+      <field id="phis" />
+      <field id="phi" />
+      <field id="precl" />
+      <field id="Q1_col_int" />     
+      <field id="Q2_col_int" />     
+      <field id="ps_init" />
+      
+      <field_group axis_ref="lev"> 
+        <field id="mass" />
+        <field id="p" />
+        <field id="dmass"/>
+        <field id="theta" />
+        <field id="dyn_q" />
+        <field id="pk"/>
+        <field id="ulon"/>
+        <field id="ulat"/>
+        <field id="uz"/>
+        <field id="omega"/>
+        <field id="temp"/>
+        
+        <field id="mass_init" />
+        <field id="p_init" />
+        <field id="theta_init" />
+        <field id="dyn_q_init" />
+        <field id="ulon_init"/>
+        <field id="ulat_init"/>
+        <field id="uz_init"/>
+        <field id="temp_init"/>
+        
+      </field_group>
+      <field id="u850" />
+      <field id="v850" />
+      <field id="w850" />
+      <field id="t850" />
+      <field id="omega850"/>                  
+      <field id="u500" />
+      <field id="v500" />
+      <field id="w500" />
+      <field id="t500" />
+      <field id="omega500"/>                  
+      <field id="SST"/>
+      
+      <field id="ulon_850_500" field_ref="p" axis_ref="lev_pressure" />
+      
+      <field_group axis_ref="levp1"> 
+        <field id="geopot"/>
+        <field id="geopot_init"/>
+      </field_group>
+    </field_group> 
+    <field id="q_init" grid_ref="grid_q" />    
+    <field id="q" grid_ref="grid_q" />    
+    
+<!--    <field_group domain_ref="v" axis_ref="lev">
+      <field id="vort" />
+      <field id="pv" />
+    </field_group> -->
+    
+  </field_group>
+  
+  
+</field_definition>
+
Index: /codes/icosagcm/devel/Python/test/xml/field_def_simple.xml
===================================================================
--- /codes/icosagcm/devel/Python/test/xml/field_def_simple.xml	(revision 622)
+++ /codes/icosagcm/devel/Python/test/xml/field_def_simple.xml	(revision 622)
@@ -0,0 +1,23 @@
+<field_definition level="1" enabled=".TRUE." operation="instant">
+  
+  <field_group id="standard_output"> 
+    
+    <field id="timestep" grid_ref="scalar" unit="s"/>
+    <field id="preff" grid_ref="scalar"    unit="Pa"/>
+    <field id="ap" axis_ref="levp1"   long_name="hybrid A coefficient at layer interface" />
+    <field id="bp" axis_ref="levp1"  long_name="hybrid B coefficient at layer interface" />
+    <field id="mid_ap" axis_ref="lev"   long_name="hybrid A coefficient at midpoints" />
+    <field id="mid_bp" axis_ref="lev"  long_name="hybrid B coefficient at midpoints" />
+    
+    <field_group domain_ref="i">
+      <field id="ps" />
+      <field id="dps"  />
+      <field id="Ai" />
+      <field id="phis" />
+      <field id="phi" />
+    </field_group> 
+    
+  </field_group>
+  
+</field_definition>
+
Index: /codes/icosagcm/devel/Python/test/xml/filedef_dcmip2016.xml
===================================================================
--- /codes/icosagcm/devel/Python/test/xml/filedef_dcmip2016.xml	(revision 622)
+++ /codes/icosagcm/devel/Python/test/xml/filedef_dcmip2016.xml	(revision 622)
@@ -0,0 +1,70 @@
+<file_definition > 
+
+  <file id="output_dcmip2016_native" convention="UGRID" enabled="false" output_freq="24h" sync_freq="24h" output_level="10" timeseries="none" description="DCMIP41" > 
+    
+    <field_group id="dcmip2016_output_field_once" operation="once" freq_offset="0ts" ts_enabled="true">
+      <field field_ref="timestep" name="mdt" />
+      <field field_ref="preff" name="P0" long_name="reference pressure" />
+      <field field_ref="ap" name="hyai"   />
+      <field field_ref="bp" name="hybi"   />
+      <field field_ref="mid_ap" name="hyam"   />
+      <field field_ref="mid_bp" name="hybm"   />
+    </field_group>
+    
+    
+    <field_group id="dcmip2016_output_field" ts_enabled="true">
+      <field field_ref="ps" name="PS"       standard_name="surface_pressure" long_name="Surface pressure"         unit="Pa" />
+      <field field_ref="phis" operation="once" freq_offset="0ts" name="PHIS"   standard_name="surface_geopotential" long_name="Surface geopotential" unit="m2/m2"/>
+      <field field_ref="geopot"  name="PHI"   standard_name="geopotential" long_name="geopotential" unit="m2/s2"/>
+      <field field_ref="ulon" name="U"      standard_name="eastward_wind" long_name="Zonal wind"                  unit="m/s"/>
+      <field field_ref="ulat" name="V"      standard_name="northward_wind" long_name="Meridional wind"            unit="m/s"/>
+      <field field_ref="uz" name="W"        standard_name="upward_air_velocity" long_name="Vertical velocity"     unit="m/s"/>
+      <field field_ref="omega" name="OMEGA"        standard_name="lagrangian_tendency_of_air_pressure" long_name="Vertical pressure velocity"     unit="Pa/s"/>
+      <field field_ref="p"  name="P"        standard_name="air_pressure" long_name="Pressure"     unit="Pa"/>
+      <field field_ref="temp"  name="T"        standard_name="air_temperature" long_name="Temperature"     unit="K"/>
+      <field field_ref="precl"  name="PRECT"     standard_name="rainfall_rate"  long_name="Large Scale precipitation rate"  unit="m/s"/>
+      <field field_ref="Q1_col_int"  name="Q1_col_int"      long_name="Single chlorine column integrated mixing ratio"  unit="kg/m2"/> 
+      <field field_ref="Q2_col_int"  name="Q2_col_int"      long_name="Chlorine gas column integrated mixing ratio"  unit="kg/m2"/> 
+      <field field_ref="u850" name="U850"       long_name="Zonal wind at 850 hPa"      unit="m/s"/>
+      <field field_ref="v850" name="V850"       long_name="Meridional wind at 850 hPa"   unit="m/s"/>
+      <field field_ref="w850" name="W850"       long_name="Vertical velocity at 850 hPa"     unit="m/s"/>
+      <field field_ref="t850" name="T850"       long_name="Temperature at 850 hPa"   unit="K"/>
+      <field field_ref="omega850" name="OMEGA850"   long_name="Vertical pressure velocity at 850 hPa"     unit="Pa/s"/>
+      <field field_ref="u500" name="U500"       long_name="Zonal wind at 500 hPa"      unit="m/s"/>
+      <field field_ref="v500" name="V500"       long_name="Meridional wind at 850 hPa"   unit="m/s"/>
+      <field field_ref="w850" name="W500"       long_name="Vertical velocity at 500 hPa"     unit="m/s"/>
+      <field field_ref="t500" name="T500"       long_name="Temperature at 850 hPa"   unit="K"/>
+      <field field_ref="omega500" name="OMEGA500"   long_name="Vertical pressure velocity at 500 hPa"     unit="Pa/s"/>
+      <field field_ref="SST" name="SST"       long_name="Sea surface temperature"   unit="K"/>
+      
+    </field_group>
+
+    <variable name="model" type="string" > dynamico </variable>
+    <variable name="test_case" type="string" > DCMIP41 </variable>
+    <variable name="horizontal_resolution" type="string" > native (grid points : 80x80x10) </variable>
+    <variable name="levels" type="string" > L10 </variable>
+    <variable name="grid" type="string" > hex </variable>
+    <variable name="equation" type="string" > hydro </variable>
+    <variable name="time_frequency" type="string" > 24h </variable>    
+
+  </file>
+
+
+  <file id="output_dcmip2016_regular" enabled="true" output_freq="24h" sync_freq="24h" output_level="10" description="DCMIP41" timeseries="none" > 
+    
+    <field_group group_ref="dcmip2016_output_field_once"/>
+    
+    <field_group group_ref="dcmip2016_output_field" domain_ref="regular_two_degree" />
+
+    <variable name="model" type="string" > dynamico </variable>
+    <variable name="test_case" type="string" > DCMIP41 </variable>
+    <variable name="horizontal_resolution" type="string" > two_degree interpolated (grid points : 80 x 80 x 10) </variable>
+    <variable name="levels" type="string" > L30 </variable>
+    <variable name="grid" type="string" > hex </variable>
+    <variable name="equation" type="string" > hydro </variable>
+    <variable name="time_frequency" type="string" > 24h </variable>    
+
+  </file>
+
+
+</file_definition>
Index: /codes/icosagcm/devel/Python/test/xml/filedef_simple.xml
===================================================================
--- /codes/icosagcm/devel/Python/test/xml/filedef_simple.xml	(revision 622)
+++ /codes/icosagcm/devel/Python/test/xml/filedef_simple.xml	(revision 622)
@@ -0,0 +1,48 @@
+<file_definition > 
+
+  <file id="output_dynamico_native" convention="CF" enabled="true" output_freq="24h" sync_freq="24h" output_level="10" timeseries="none" description="DCMIP41" > 
+    
+    <field_group id="dcmip2016_output_field_once" operation="once" freq_offset="0ts" ts_enabled="false">
+      <field field_ref="timestep" name="mdt" />
+      <field field_ref="preff" name="P0" long_name="reference pressure" />
+      <field field_ref="ap" name="hyai"   />
+      <field field_ref="bp" name="hybi"   />
+      <field field_ref="mid_ap" name="hyam"   />
+      <field field_ref="mid_bp" name="hybm"   />
+    </field_group>
+    
+    
+    <field_group id="dcmip2016_output_field" ts_enabled="false">
+      <field field_ref="ps" name="PS"       standard_name="surface_pressure" long_name="Surface pressure"         unit="Pa" />
+      <field field_ref="phis" operation="once" freq_offset="0ts" name="PHIS"   standard_name="surface_geopotential" long_name="Surface geopotential" unit="m2/m2"/>      
+    </field_group>
+
+    <variable name="model" type="string" > dynamico </variable>
+    <variable name="test_case" type="string" > DCMIP41 </variable>
+    <variable name="horizontal_resolution" type="string" > native (grid points : 80x80x10) </variable>
+    <variable name="levels" type="string" > L10 </variable>
+    <variable name="grid" type="string" > hex </variable>
+    <variable name="equation" type="string" > hydro </variable>
+    <variable name="time_frequency" type="string" > 24h </variable>    
+
+  </file>
+
+
+  <file id="output_dynamico_regular" enabled="true" output_freq="24h" sync_freq="24h" output_level="10" description="DCMIP41" timeseries="none" > 
+    
+    <field_group group_ref="dcmip2016_output_field_once"/>
+    
+    <field_group group_ref="dcmip2016_output_field" domain_ref="regular_two_degree" />
+
+    <variable name="model" type="string" > dynamico </variable>
+    <variable name="test_case" type="string" > DCMIP41 </variable>
+    <variable name="horizontal_resolution" type="string" > two_degree interpolated (grid points : 80 x 80 x 10) </variable>
+    <variable name="levels" type="string" > L30 </variable>
+    <variable name="grid" type="string" > hex </variable>
+    <variable name="equation" type="string" > hydro </variable>
+    <variable name="time_frequency" type="string" > 24h </variable>    
+
+  </file>
+
+
+</file_definition>
Index: /codes/icosagcm/devel/Python/test/xml/iodef.xml
===================================================================
--- /codes/icosagcm/devel/Python/test/xml/iodef.xml	(revision 622)
+++ /codes/icosagcm/devel/Python/test/xml/iodef.xml	(revision 622)
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<simulation> 
+	<context  id="xios">
+		<variable_definition>
+                <variable id="print_file" type="bool"> true </variable> 
+       		<variable_group id="buffer">
+         	</variable_group>
+
+        	<variable_group id="parameters" >
+        		<variable id="using_server" type="bool">false</variable>
+        		<variable id="info_level" type="int">100</variable>
+        	</variable_group>
+		</variable_definition>
+	</context>
+        <context id="icosagcm" src="./context_icosa.xml" /> 
+</simulation>
+
+<!-- symlink either context_icosa_simple.xml or context_icosa_full.xml as context_icosa.xml ,
+             either field_def_simple.xml     or field_def_full.xml     as field_def.xml,
+         and either filedef_simple.xml       or fileddef_dcmip2016.xml as filedef.xml -->
