Index: trunk/LMDZ.GENERIC/deftank/context_lmdz_physics.xml
===================================================================
--- trunk/LMDZ.GENERIC/deftank/context_lmdz_physics.xml	(revision 2647)
+++ trunk/LMDZ.GENERIC/deftank/context_lmdz_physics.xml	(revision 2653)
@@ -2,13 +2,56 @@
 
     <!-- Definition of a calendar is done in code via wxios_set_cal -->
-    
+
     <!-- Definition of domains and groups of domains -->
     <domain_definition>
-        <domain id="dom_glo" data_dim="2" />
+        <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_720_360"/>
+    </domain_definition>
+    <!-- <domain_definition src="./domain_def.xml"/> -->
+
     <!-- Definition of vertical axes 
-         NB: these must be defined and set in code via
-         wxios_add_vaxis -->
+                           NB: these must be defined and set in code via
+         xios_output_mod -->
     <axis_definition>
         <axis id="presnivs" 
@@ -21,135 +64,103 @@
         </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 id="dom_glo" />
-                <!-- <axis id="presnivs" /> -->
-                <axis id="altitude" /> 
+        <grid id="grid_3D">
+            <domain domain_ref="dom_glo" />
+            <axis axis_ref="altitude" />
         </grid>
-        
-        <grid id="grid_2d">
-            <domain id="dom_glo" />
+        <grid id="grid_2D">
+            <domain domain_ref="dom_glo" />
         </grid>
 
+        <!-- grid for interpolated lon-lat outputs -->
         <!-- to output scalars -->
         <grid id="scalarpoint" >
-            <scalar />
+            <scalar scalar_ref="scalar" />
         </grid>
-    </grid_definition>
-    
-    <!-- Definition of model variables -->
-    <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_group>    
-        
-        <!-- 2D variables -->
-        <field_group id="fields_2D" grid_ref="grid_2d">
-            <field id="ps"
-                   long_name="Surface Pressure" 
-                   unit="Pa" />
-            <field id="area"
-                   long_name="Mesh area"
-                   unit="m2" />
-            <field id="ISR"
-                   long_name="Incoming Stellar Radiation"
-                   unit="W/m2" />
-            <field id="OLR"
-                   long_name="Outgoing Longwave Radiation"
-                   unit="W/m2" />
-        </field_group>
+        <!-- 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>                                                                   
+    </grid_definition>                                                            
+                                                                                  
+    <!-- Definition of model variables -->                                        
+    <field_definition src="./field_def_physics.xml" />                            
+                                                                                  
+    <!-- Definition of output files -->                                           
+    <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="40ts" sync_freq="40ts"                                 
+              split_freq="2000ts"                                                 
+              type="one_file"                                                     
+              enabled=".true.">                                                   
+        split_freq does not seem to work                                          
+        -->                                                                       
+        <file id="histins"                                                        
+              name="Xhistins"                                                     
+              output_freq="2ts"                                                   
+              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_group>  
 
-        <!-- 3D variables -->
-        <field_group id="fields_3D" grid_ref="grid_3d">
-            <field id="temperature"
-                   long_name="Atmospheric 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="omega"
-                   long_name="Vertical velocity (>0 when downward)"
-                   unit="Pa/s" />
-            <field id="h2o_vap"
-                   long_name="H2O vapour mass mixing ratio"
-                   unit="kg/kg" />
-            <field id="h2o_ice"
-                   long_name="H2O ice mass mixing ratio"
-                   unit="kg/kg" />
-        </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_definition>
-    
-    <!-- Definition of output files -->
-    <file_definition>
-        <!-- Instantaneous outputs; Here output_freq in physics time steps -->
-        <file id="histins"
-              name="Xhistins"
-              output_freq="1ts" 
-              type="one_file"
-              enabled=".true.">
-                    
-            <!-- VARS 0D -->
-            <field_group operation="instant"
-                         freq_op="1ts">
-                <field field_ref="ls" />
-            </field_group>
-
-            <!-- VARS 2D -->
-            <field_group operation="instant"
-                         freq_op="1ts">
-                <field field_ref="area" operation="once" />
-                <field field_ref="ps" />
-            </field_group>
-
-            <!-- VARS 3D -->
-            <field_group operation="instant"
-                         freq_op="1ts">
-                <field field_ref="temperature" />
-                <field field_ref="u" />
-                <field field_ref="v" />
-            </field_group>
-        </file>
-
-        <!-- diurnal averages outputs; output_freq is every day -->
-        <file id="diurnalave"
-              name="Xdiurnalave"
-              output_freq="1d" 
-              type="one_file"
-              enabled=".true.">
-                    
-            <!-- VARS 0D -->
-            <field_group operation="average"
-                         freq_op="1ts">
-                <field field_ref="ls" />
-            </field_group>
-
-            <!-- VARS 2D -->
-            <field_group operation="average"
-                         freq_op="1ts">
-                <field field_ref="area" operation="once" />
-                <field field_ref="ps" />
-            </field_group>
-
-            <!-- VARS 3D -->
-            <field_group operation="average"
-                         freq_op="1ts">
-                <field field_ref="temperature" />
-                <field field_ref="u" />
-                <field field_ref="v" />
-            </field_group>
-        </file>
-    </file_definition>
-
-</context>
+                  <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>                                                                   
+                                                                                  
+    </file_definition>                                                            
+                                                                                  
+</context>  
Index: trunk/LMDZ.GENERIC/deftank/field_def_physics.xml
===================================================================
--- trunk/LMDZ.GENERIC/deftank/field_def_physics.xml	(revision 2653)
+++ trunk/LMDZ.GENERIC/deftank/field_def_physics.xml	(revision 2653)
@@ -0,0 +1,68 @@
+<!-- =========================================================================================================== -->
+<!-- field_def_physics.xml                                                                                       -->
+<!-- Definition of all existing variables that can be output from Dynamico 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_group>
+
+        <!-- 2D variables -->
+        <field_group id="fields_2D" grid_ref="grid_2D">
+            <field id="ps"
+                   long_name="Surface Pressure" 
+                   unit="Pa" />
+            <field id="area"
+                   long_name="Mesh area"
+                   unit="m2" />
+            <field id="OLR"
+                   long_name="outgoing longwave radiation" 
+                   unit="W/m2" />
+            <field id="ISR"
+                   long_name="incoming solar radiation"  
+                   unit="W/m2" />
+        </field_group>
+
+        <!-- 3D variables -->
+        <field_group id="fields_3D" grid_ref="grid_3D">
+        <!--<field_group id="fields_3D" grid_ref="grid_3d">-->
+            <field id="temperature"
+                   long_name="Atmospheric 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="omega" 
+                   long_name="Downward omega velocity" 
+                   unit="Pa/s" />
+            <field id="h2o_vap" 
+                   long_name="Vapor mass mixing ratio" 
+                   unit="kg/kg" />
+            <field id="h2o_ice" 
+                   long_name="Vapor mass mixing ratio" 
+                   unit="kg/kg" />
+            <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_group>
+
+    </field_definition>
+
+
