Index: trunk/tools/drawing.py
===================================================================
--- trunk/tools/drawing.py	(revision 775)
+++ trunk/tools/drawing.py	(revision 776)
@@ -3668,7 +3668,11 @@
     draw_topo_geogrid(ncfile, values, varn)
       ncfile= file to use
-      values= [zlog]:[dzlog]:[title]:[graphic_kind]:[legloc]
+      values= [zlogs]:[plogs]:[title]:[graphic_kind]:[legloc]
+        zlogs= zlog,dzlog
         zlog: to use logarithmic scale on the height axis ('true/false')
         dzlog: to use logarithmic scale on the difference of height between levels axis ('true/false')
+        plogs= plog,dplog
+        plog: to use logarithmic scale on the height axis ('true/false')
+        dplog: to use logarithmic scale on the difference of height between levels axis ('true/false')
         title: title of the graph ('!' for spaces)
         graphic_kind: kind of figure (jpg, pdf, png)
@@ -3677,6 +3681,9 @@
           5: 'right', 6: 'center left', 7: 'center right', 8: 'lower center',
           9: 'upper center', 10: 'center'      kfig= kind of figure
-      varn= name of the variable with the vertical levels
-        'WRFz': for WRF z-levels (computed as (PH + PHB)/g, from a PHB(0,i,j) = 0)
+      varn= [varnheight],[varnpres]
+        varnheight: name of the variable with the height of the vertical levels
+          'WRFz': for WRF z-levels (computed as (PH + PHB)/g, from a PHB(0,i,j) = 0)
+        varnpres: name of the variable with the pressure of the vertical levels ('None', for no pressure plot)
+          'WRFp': for WRF p-levels (computed as P + PB, from a PHB(0,i,j) = 0)
     """
     fname = 'draw_vertical_levels'
@@ -3687,14 +3694,29 @@
         quit()
 
-    expectargs = '[zlog]:[dzlog]:[title]:[graphic_kind]:[legloc]'
+    expectargs = '[zlogs]:[plogs]:[title]:[graphic_kind]:[legloc]'
  
     drw.check_arguments(fname,values,expectargs,':')
 
-    zlog = values.split(':')[0]
-    dzlog = values.split(':')[1]
+    zlog = values.split(':')[0].split(',')[0]
+    dzlog = values.split(':')[0].split(',')[1]
+    plog = values.split(':')[1].split(',')[0]
+    dplog = values.split(':')[1].split(',')[1]
     title = values.split(':')[2].replace('!',' ')
     kindfig = values.split(':')[3]
     legloc = int(values.split(':')[4])
 
+    if varn.find(',') == -1:
+        varnheight = varn
+        varnpres = None
+        pvals = None
+        print warnmsg
+        print '  ' + fname + ': assuming no pressure variable!!'
+    else:
+        varnheight = varn.split(',')[0]
+        varnpres = varn.split(',')[1]
+        if varnpres == 'None': 
+            varnpres = None
+            pvals = None
+
     if not os.path.isfile(ncfile):
         print errormsg
@@ -3704,5 +3726,5 @@
     objf = NetCDFFile(ncfile, 'r')
 
-    if varn == 'WRFz': 
+    if varnheight == 'WRFz': 
         if not gen.searchInlist(objf.variables,'PH'):
             print errormsg
@@ -3723,14 +3745,14 @@
         zvals = geop[0, :, ijz0[0], ijz0[1]] / 9.8
     else:
-        if not gen.searchInlist(objf.variables, varn):
+        if not gen.searchInlist(objf.variables, varnheight):
             print errormsg
-            print '  ' + fname + ": file '" + ncfile + "' does not have variable '" +\
-              varn + "' !!"
+            print '  ' + fname + ": file '" + ncfile + "' does not have height " +   \
+              " variable '" + varnheight + "' !!"
             quit(-1)
         objvar = objf.variables[varn]
         if len(objvar.shape) == 4:
             print warnmsg
-            print '  ' + fname + ": assuming that variable '" + varn + "' with " +   \
-              "shape: dt,dz,dy,dx. Tacking first time-step"
+            print '  ' + fname + ": assuming that height variable '" + varnheight +  \
+              "' with shape: dt,dz,dy,dx. Tacking first time-step"
 
             ijz0 = gen.index_mat(objvar[0,0,], 0.)
@@ -3738,6 +3760,6 @@
         elif len(objvar.shape) == 3:
             print warnmsg
-            print '  ' + fname + ": assuming that variable '" + varn + "' with " +   \
-              "shape: dz,dy,dx"
+            print '  ' + fname + ": assuming that height variable '" + varnheight +  \
+              "' with shape: dz,dy,dx"
 
             ijz0 = gen.index_mat(objvar[0,], 0.)
@@ -3746,6 +3768,6 @@
         elif len(objvar.shape) == 2:
             print warnmsg
-            print '  ' + fname + ": assuming that variable '" + varn + "' with " +   \
-              "shape: dz,dyx"
+            print '  ' + fname + ": assuming that height variable '" + varnheight +  \
+              "' with shape: dz,dyx"
 
             ijz0 = gen.index_mat(objvar[0,], 0.)
@@ -3754,4 +3776,53 @@
             zvals = objvar[:]
 
+# Pressure
+    if varnpres is not None:
+        if varnpres == 'WRFp': 
+            if not gen.searchInlist(objf.variables,'P'):
+                print errormsg
+                print '  ' + fname + ": WRF file '" + ncfile + "' does not have " +      \
+                  "variable 'P' !!"
+                quit(-1)
+            if not gen.searchInlist(objf.variables,'PB'):
+                print errormsg
+                print '  ' + fname + ": WRF file '" + ncfile + "' does not have " +      \
+                  "variable 'PB' !!"
+                quit(-1)
+
+            objph = objf.variables['P']
+            objphb = objf.variables['PB']
+            pres = objph[:] + objphb[:]
+
+            pvals = pres[0, :, ijz0[0], ijz0[1]]
+        else:
+            if not gen.searchInlist(objf.variables, varnpres):
+                print errormsg
+                print '  ' + fname + ": file '" + ncfile + "' does not have pressure " + \
+                  " variable '" + varnpres + "' !!"
+                quit(-1)
+            objvar = objf.variables[varnpres]
+            if len(objvar.shape) == 4:
+                print warnmsg
+                print '  ' + fname + ": assuming that pressure variable '" + varnpres +  \
+                  "' with shape: dt,dz,dy,dx. Tacking first time-step"
+    
+                pvals = objvar[0, :, ijz0[0], ijz0[1]]
+            elif len(objvar.shape) == 3:
+                print warnmsg
+                print '  ' + fname + ": assuming that pressure variable '" + varnpres +  \
+                  "' with shape: dz,dy,dx"
+    
+                pvals = objvar[:, ijz0[0], ijz0[1]]
+            
+            elif len(objvar.shape) == 2:
+                print warnmsg
+                print '  ' + fname + ": assuming that pressure variable '" + varnpres +  \
+                  "' with shape: dz,dyx"
+    
+                pvals = objvar[:, ijz0[0]]
+            else:
+                pvals = objvar[:]
+
+# Logarithmic axes
     if zlog == 'true':
         zlogv = True
@@ -3763,4 +3834,5 @@
         print "    must be either: 'true' or 'false'"
         quit(-1)
+
     if dzlog == 'true':
         dzlogv = True
@@ -3773,5 +3845,25 @@
         quit(-1)
 
-    drw.plot_vertical_lev(zvals, zlogv, dzlogv, title, kindfig, legloc)
+    if pvals is not None:
+        if plog == 'true':
+            plogv = True
+        elif plog == 'false':
+            plogv = False
+        else:
+            print errormsg
+            print '  ' + fname + ": wrong value for plog: '" + plog + "' !!"
+            print "    must be either: 'true' or 'false'"
+            quit(-1)
+        if dplog == 'true':
+            dplogv = True
+        elif dplog == 'false':
+            dplogv = False
+        else:
+            print errormsg
+            print '  ' + fname + ": wrong value for dplog: '" + dplog + "' !!"
+            print "    must be either: 'true' or 'false'"
+            quit(-1)
+
+    drw.plot_vertical_lev(zvals, pvals, zlogv, dzlogv, plogv, dplogv, title, kindfig, legloc)
 
     objf.close()
Index: trunk/tools/drawing_tools.py
===================================================================
--- trunk/tools/drawing_tools.py	(revision 775)
+++ trunk/tools/drawing_tools.py	(revision 776)
@@ -1484,8 +1484,10 @@
         elif u == 'C': lu='$^{\circ}C$'
         elif u == 'days': lu='$day$'
+        elif u == 'degrees_East': lu='$degrees\ East$'
         elif u == 'degrees_east': lu='$degrees\ East$'
         elif u == 'degree_east': lu='$degrees\ East$'
         elif u == 'degrees longitude': lu='$degrees\ East$'
         elif u == 'degrees latitude': lu='$degrees\ North$'
+        elif u == 'degrees_North': lu='$degrees\ North$'
         elif u == 'degrees_north': lu='$degrees\ North$'
         elif u == 'degree_north': lu='$degrees\ North$'
@@ -6562,10 +6564,13 @@
 
 
-def plot_vertical_lev(vertz, zlog, dzlog, gtit, kfig, lloc):
+def plot_vertical_lev(vertz, vertp, zlog, dzlog, plog, dplog, gtit, kfig, lloc):
     """ plotting vertical levels distribution
     plot_vertical_lev(vertz, gtit, kfig, lloc)
       vertz= distribution of vertical heights [z]
+      vertp= distribution of vertical pressures [Pa]
       zlog: to use logarithmic scale on the height axis ('true/false')
       dzlog: to use logarithmic scale on the difference of height between levels axis ('true/false')
+      plog: to use logarithmic scale on the pressure axis ('true/false')
+      pzlog: to use logarithmic scale on the difference of pressure between levels axis ('true/false')
       gtit= title of the graph ('!' for spaces)
       kfig= kind of figure (jpg, pdf, png)
@@ -6590,14 +6595,19 @@
 
     plt.rc('text', usetex=True)
-
-    fig, ax1 = plt.subplots()
+# Height plot
+##
+    if vertp is not None: 
+        print plt.subplots.__doc__
+        fig, (ax1, ax3) = plt.subplots(nrows=2, ncols=1, sharex=True)
+    else:
+        fig, ax1 = plt.subplots()
     ax2 = ax1.twinx()
 
     plt.xlim(0,Nlev)
-
+ 
     l1 = ax1.plot(range(Nlev), vertz, 'r-x', label='height')
     l2 = ax2.plot(range(1,Nlev), dvertz, 'b-x', label='dheight')
 
-    ax1.set_xlabel('level (\#)')
+#    ax1.set_xlabel('level (\#)')
     ax1.set_ylabel('height (m)', color='r')
     ax1.set_ylim(1,np.max(vertz))
@@ -6605,8 +6615,36 @@
     ax2.set_ylabel('difference between levels (m)', color='b')
 
-    plt.title(gtit)
+    if vertp is not None: ax1.set_title('height')
     if zlog: ax1.set_yscale('log')
     if dzlog: ax2.set_yscale('log')
 
+# Pressure plot
+##
+    if vertp is not None:
+
+        Nlev = len(vertp)
+        dvertp = vertp[0:Nlev-1] - vertp[1:Nlev]
+
+        ax4 = ax3.twinx()
+
+        l3 = ax3.plot(range(Nlev), vertp, 'r-o', label='pressure')
+        l4 = ax4.plot(range(1,Nlev), dvertp, 'b-o', label='dpressure')
+
+        ax3.set_xlim(0, Nlev)
+        ax3.set_xlabel('level (\#)')
+        ax3.set_ylabel('pressure (Pa)', color='r')
+        ax3.set_ylim(np.min(vertp), np.max(vertp))
+        ax3.grid()
+        ax4.set_ylabel('difference between levels (Pa)', color='b')
+
+        if plog: ax3.set_yscale('log')
+        if dplog: ax4.set_yscale('log')
+
+    if vertp is not None:
+        fig.suptitle(gtit)
+        ax3.set_title('pressure')
+    else:
+        plt.title(gtit)
+
     output_kind(kfig, figname, True)
 
