Index: trunk/UTIL/PYTHON/myplot.py
===================================================================
--- trunk/UTIL/PYTHON/myplot.py	(revision 376)
+++ trunk/UTIL/PYTHON/myplot.py	(revision 382)
@@ -56,6 +56,6 @@
     return field
 
-## Author: AS + TN
-def reducefield (input,d4=None,d3=None,d2=None,d1=None):
+## Author: AS + TN + AC
+def reducefield (input,d4=None,d3=None,d2=None,d1=None,yint=False,alt=None):
     ### we do it the reverse way to be compliant with netcdf "t z y x" or "t y x" or "y x"
     ### it would be actually better to name d4 d3 d2 d1 as t z y x
@@ -97,23 +97,23 @@
         elif max(d2) >= shape[2]: error = True
         elif max(d1) >= shape[3]: error = True
-        elif d4 is not None and d3 is not None and d2 is not None and d1 is not None:  
-            output = mean(input[d4,:,:,:],axis=0); output = mean(output[d3,:,:],axis=0); output = mean(output[d2,:],axis=0); output = mean(output[d1],axis=0)
+        elif d4 is not None and d3 is not None and d2 is not None and d1 is not None:
+             output = mean(input[d4,:,:,:],axis=0); output = reduce_zaxis(output[d3,:,:],ax=0,yint=yint,vert=alt[d3]); output = mean(output[d2,:],axis=0); output = mean(output[d1],axis=0)
         elif d4 is not None and d3 is not None and d2 is not None: 
-            output = mean(input[d4,:,:,:],axis=0); output = mean(output[d3,:,:],axis=0); output = mean(output[d2,:],axis=0)
+            output = mean(input[d4,:,:,:],axis=0); output = reduce_zaxis(output[d3,:,:],ax=0,yint=yint,vert=alt[d3]); output = mean(output[d2,:],axis=0)
         elif d4 is not None and d3 is not None and d1 is not None: 
-            output = mean(input[d4,:,:,:],axis=0); output = mean(output[d3,:,:],axis=0); output = mean(output[:,d1],axis=1)
+            output = mean(input[d4,:,:,:],axis=0); output = reduce_zaxis(output[d3,:,:],ax=0,yint=yint,vert=alt[d3]); output = mean(output[:,d1],axis=1)
         elif d4 is not None and d2 is not None and d1 is not None: 
             output = mean(input[d4,:,:,:],axis=0); output = mean(output[:,d2,:],axis=1); output = mean(output[:,d1],axis=1)
         elif d3 is not None and d2 is not None and d1 is not None: 
-            output = mean(input[:,d3,:,:],axis=1); output = mean(output[:,d2,:],axis=1); output = mean(output[:,d1],axis=1) 
-        elif d4 is not None and d3 is not None:  output = mean(input[d4,:,:,:],axis=0); output = mean(output[d3,:,:],axis=0)
+            output = reduce_zaxis(input[:,d3,:,:],ax=1,yint=yint,vert=alt[d3]); output = mean(output[:,d2,:],axis=1); output = mean(output[:,d1],axis=1) 
+        elif d4 is not None and d3 is not None:  output = mean(input[d4,:,:,:],axis=0); output = reduce_zaxis(output[d3,:,:],ax=0,yint=yint,vert=alt[d3])
         elif d4 is not None and d2 is not None:  output = mean(input[d4,:,:,:],axis=0); output = mean(output[:,d2,:],axis=1)
         elif d4 is not None and d1 is not None:  output = mean(input[d4,:,:,:],axis=0); output = mean(output[:,:,d1],axis=2)
-        elif d3 is not None and d2 is not None:  output = mean(input[:,d3,:,:],axis=1); output = mean(output[:,d2,:],axis=1)
-        elif d3 is not None and d1 is not None:  output = mean(input[:,d3,:,:],axis=1); output = mean(output[:,:,d1],axis=0)
+        elif d3 is not None and d2 is not None:  output = reduce_zaxis(input[:,d3,:,:],ax=1,yint=yint,vert=alt[d3]); output = mean(output[:,d2,:],axis=1)
+        elif d3 is not None and d1 is not None:  output = reduce_zaxis(input[:,d3,:,:],ax=1,yint=yint,vert=alt[d3]); output = mean(output[:,:,d1],axis=0)
         elif d2 is not None and d1 is not None:  output = mean(input[:,:,d2,:],axis=2); output = mean(output[:,:,d1],axis=2)
         elif d1 is not None:                     output = mean(input[:,:,:,d1],axis=3)
         elif d2 is not None:                     output = mean(input[:,:,d2,:],axis=2)
-        elif d3 is not None:                     output = mean(input[:,d3,:,:],axis=1)
+        elif d3 is not None:                     output = reduce_zaxis(input[:,d3,:,:],ax=0,yint=yint,vert=alt[d3])
         elif d4 is not None:                     output = mean(input[d4,:,:,:],axis=0)
     dimension = np.array(output).ndim
@@ -121,4 +121,15 @@
     print 'dim,shape: ',dimension,shape
     return output, error
+
+## Author: AC
+
+def reduce_zaxis (input,ax=None,yint=False,vert=None):
+    from mymath import max,mean
+    from scipy import integrate
+    if yint:
+       output = integrate.trapz(input,x=vert,axis=ax)
+    else:
+       output = mean(input,axis=ax)
+    return output
 
 ## Author: AS + TN
@@ -578,4 +589,5 @@
              "ALBBARE":      "%.2f",\
              "TAU":          "%.1f",\
+             "CO2":          "%.2f",\
              #### T.N.
              "TEMP":         "%.0f",\
@@ -617,4 +629,5 @@
              "ALBBARE":      "spectral",\
              "TAU":          "YlOrBr_r",\
+             "CO2":          "YlOrBr_r",\
              #### T.N.
              "MTOT":         "Jet",\
