Index: trunk/tools/validation_sim.py
===================================================================
--- trunk/tools/validation_sim.py	(revision 504)
+++ trunk/tools/validation_sim.py	(revision 505)
@@ -730,4 +730,6 @@
         'WRFrh': relative humidty fom WRF variables
         'WRFt': temperature from WRF variables
+        'WRFwds': surface wind direction from WRF variables
+        'WRFwss': surface wind speed from WRF variables
         'WRFz': height from WRF variables
     """
@@ -790,4 +792,15 @@
         varNOcheckv = (ncobj.variables['T'][:] + 300.)*(p/p0)**(2./7.)
         dimensions = ncobj.variables['T'].dimensions
+
+    elif varn == 'WRFwds':
+#        print '    ' + main + ': computing surface wind direction from WRF as ATAN2(V,U) ...'
+        varNOcheckv = np.arctan2(ncobj.variables['V10'][:], ncobj.variables['U10'][:])
+        dimensions = ncobj.variables['V10'].dimensions
+
+    elif varn == 'WRFwss':
+#        print '    ' + main + ': computing surface wind speed from WRF as SQRT(U**2 + V**2) ...'
+        varNOcheckv = np.sqrt(ncobj.variables['U10'][:]*ncobj.variables['U10'][:] +  \
+          ncobj.variables['V10'][:]*ncobj.variables['V10'][:])
+        dimensions = ncobj.variables['U10'].dimensions
 
     elif varn == 'WRFz':
@@ -812,9 +825,15 @@
         'WRFp': pressure from WRF variables
         'WRFrh': relative humidty fom WRF variables
+        'TSrhs': surface relative humidty fom TS variables
+        'WRFrhs': surface relative humidty fom WRF variables
         'WRFT': CF-time from WRF variables
         'WRFt': temperature from WRF variables
         'WRFtd': dew-point temperature from WRF variables
+        'WRFwd': wind direction from WRF variables
+        'TSwds': surface wind direction from TS variables
+        'WRFwds': surface wind direction from WRF variables
         'WRFws': wind speed from WRF variables
-        'WRFwd': wind direction from WRF variables
+        'TSwss': surface wind speed from TS variables
+        'WRFwss': surface wind speed from WRF variables
         'WRFz': height from WRF variables
     """
@@ -872,5 +891,5 @@
                 p0=100000.
                 p=ncobj.variables['P'][:] + ncobj.variables['PB'][:]
-                tk = (ncobj.variables['T'][:] + 300.)*(p/p0)**(2./7.)
+                tk = (ncobj.variables['T'][:])*(p/p0)**(2./7.)
                 qv = ncobj.variables['QVAPOR'][:]
 
@@ -881,4 +900,34 @@
                 dimensions = ncobj.variables['P'].dimensions
                 shape = ncobj.variables['P'].shape
+
+            elif varn == 'TSrhs':
+#        print '    ' + main + ": computing surface relative humidity from TSs as 'Tetens'" +\
+#         ' equation (T,P) ...'
+                p0=100000.
+                p=ncobj.variables['psfc'][:]
+                tk = (ncobj.variables['t'][:])*(p/p0)**(2./7.)
+                qv = ncobj.variables['q'][:]
+
+                data1 = 10.*0.6112*np.exp(17.67*(tk-273.16)/(tk-29.65))
+                data2 = 0.622*data1/(0.01*p-(1.-0.622)*data1)
+
+                varNOcheckv = qv/data2
+                dimensions = ncobj.variables['psfc'].dimensions
+                shape = ncobj.variables['psfc'].shape
+
+            elif varn == 'WRFrhs':
+#        print '    ' + main + ": computing surface relative humidity from WRF as 'Tetens'" +\
+#         ' equation (T,P) ...'
+                p0=100000.
+                p=ncobj.variables['PSFC'][:]
+                tk = (ncobj.variables['T2'][:] + 300.)*(p/p0)**(2./7.)
+                qv = ncobj.variables['Q2'][:]
+
+                data1 = 10.*0.6112*np.exp(17.67*(tk-273.16)/(tk-29.65))
+                data2 = 0.622*data1/(0.01*p-(1.-0.622)*data1)
+
+                varNOcheckv = qv/data2
+                dimensions = ncobj.variables['PSFC'].dimensions
+                shape = ncobj.variables['PSFC'].shape
 
             elif varn == 'WRFT':
@@ -934,4 +983,36 @@
                 dimensions = ncobj.variables['T'].dimensions
                 shape = ncobj.variables['P'].shape
+
+            elif varn == 'WRFwd':
+#        print '    ' + main + ': computing wind direction from WRF as ATAN2PI(V,U) ...' 
+                uwind = ncobj.variables['U'][:]
+                vwind = ncobj.variables['V'][:]
+                dx = uwind.shape[3]
+                dy = vwind.shape[2]
+
+# de-staggering
+                ua = 0.5*(uwind[:,:,:,0:dx-1] + uwind[:,:,:,1:dx])
+                va = 0.5*(vwind[:,:,0:dy-1,:] + vwind[:,:,1:dy,:])
+
+                theta = np.arctan2(ua, va)
+                dimensions = tuple(['Time','bottom_top','south_north','west_east'])
+                shape = ua.shape
+                varNOcheckv = 360.*theta/(2.*np.pi)
+
+            elif varn == 'WRFwds':
+#        print '    ' + main + ': computing surface wind direction from WRF as ATAN2(V,U) ...'
+                theta = np.arctan2(ncobj.variables['V10'][:], ncobj.variables['U10'][:])
+                
+                varNOcheckv = 360.*theta/(2.*np.pi)
+                dimensions = ncobj.variables['V10'].dimensions
+                shape = ncobj.variables['V10'].shape
+
+            elif varn == 'TSwds':
+#        print '    ' + main + ': computing surface wind direction from TSs as ATAN2(v,u) ...'
+                theta = np.arctan2(ncobj.variables['v'][:], ncobj.variables['u'][:])
+
+                varNOcheckv = 360.*theta/(2.*np.pi)
+                dimensions = ncobj.variables['v'].dimensions
+                shape = ncobj.variables['v'].shape
 
             elif varn == 'WRFws':
@@ -950,19 +1031,19 @@
                 shape = ua.shape
 
-            elif varn == 'WRFwd':
-#        print '    ' + main + ': computing wind direction from WRF as ATAN2PI(V,U) ...' 
-                uwind = ncobj.variables['U'][:]
-                vwind = ncobj.variables['V'][:]
-                dx = uwind.shape[3]
-                dy = vwind.shape[2]
-
-# de-staggering
-                ua = 0.5*(uwind[:,:,:,0:dx-1] + uwind[:,:,:,1:dx])
-                va = 0.5*(vwind[:,:,0:dy-1,:] + vwind[:,:,1:dy,:])
-
-                theta = np.arctan2(ua, va)
-                dimensions = tuple(['Time','bottom_top','south_north','west_east'])
-                shape = ua.shape
-                varNOcheckv = 360.*(1. + theta/(2.*np.pi))
+            elif varn == 'TSwss':
+#        print '    ' + main + ': computing surface wind speed from TSs as SQRT(u**2 + v**2) ...'
+                varNOcheckv = np.sqrt(ncobj.variables['u'][:]*                       \
+                  ncobj.variables['u'][:] + ncobj.variables['v'][:]*                 \
+                  ncobj.variables['v'][:]) 
+                dimensions = ncobj.variables['u'].dimensions
+                shape = ncobj.variables['u'].shape
+
+            elif varn == 'WRFwss':
+#        print '    ' + main + ': computing surface wind speed from WRF as SQRT(U**2 + V**2) ...'
+                varNOcheckv = np.sqrt(ncobj.variables['U10'][:]*                     \
+                  ncobj.variables['U10'][:] + ncobj.variables['V10'][:]*             \
+                  ncobj.variables['V10'][:]) 
+                dimensions = ncobj.variables['U10'].dimensions
+                shape = ncobj.variables['U10'].shape
 
             elif varn == 'WRFz':
@@ -1224,12 +1305,19 @@
   '[constant] to variables values; divc,[constant]: divide by [constant] to ' +      \
   'variables values'
-varNOcheck = ['WRFdens', 'WRFght', 'WRFp', 'WRFrh', 'WRFT', 'WRFt', 'WRFtd', 'WRFws',\
-  'WRFwd', 'WRFz']
-varNOcheckinf = "'WRFdens': air density from WRF variables; 'WRFght': geopotential"+ \
-  " height from WRF variables; 'WRFp': pressure from WRF variables; 'WRFrh': " +     \
-  "relative humidty fom WRF variables; 'WRFT': CF-time from WRF variables'WRFt'; " + \
-  " temperature from WRF variables; 'WRFtd': dew-point temperature from WRF " +      \
-  "variables; 'WRFws': wind speed from WRF variables; 'WRFwd': wind speed " +        \
-  "direction from WRF variables; 'WRFz': height from WRF variables"
+varNOcheck = ['WRFdens', 'WRFght', 'WRFp', 'WRFrh', 'TSrhs', 'WRFrhs', 'WRFT',       \
+  'WRFt', 'WRFtd', 'WRFwd', 'TSwds', 'WRFwds', 'WRFws', 'TSwss', 'WRFwss', 'WRFz'] 
+varNOcheckinf = "'WRFdens': air density from WRF variables; " +                      \
+  "'WRFght': geopotentiali height from WRF variables; " +                            \
+  "'WRFp': pressure from WRF variables; " +                                          \
+  "'WRFrh': relative humidty fom WRF variables; " +                                  \
+  "'WRFrhs': surface relative humidity from WRF variables; " +                       \
+  "'WRFT': CF-time from WRF variables; " +                                           \
+  "'WRFt': temperature from WRF variables; " +                                       \
+  "'WRFtd': dew-point temperature from WRF variables; " +                            \
+  "'WRFwd': wind direction from WRF variables; " +                                   \
+  "'WRFwds': surface wind direction from WRF variables; " +                          \
+  "'WRFws': wind speed from WRF variables; " +                                       \
+  "'WRFwss': surface wind speed from WRF variables; " +                              \
+  "'WRFz': height from WRF variables"
 
 dimshelp = "[DIM]@[simdim]@[obsdim] ',' list of couples of dimensions names from " + \
@@ -1239,6 +1327,7 @@
   "no value, WRFdiagnosted variables also available: " + varNOcheckinf + ")"
 varshelp="[simvar]@[obsvar]@[[oper]@[val]] ',' list of couples of variables to " +   \
-  "validate and if necessary operation and value operations: " + opersinf +          \
-  "(WRFdiagnosted variables also available: " + varNOcheckinf + ")"
+  "validate and if necessary operation and value (sim. values) available " +         \
+  "operations: " + opersinf + " (WRFdiagnosted variables also available: " +         \
+  varNOcheckinf + ")"
 statsn = ['minimum', 'maximum', 'mean', 'mean2', 'standard deviation']
 gstatsn = ['bias', 'simobs_mean', 'sim_obsmin', 'sim_obsmax', 'sim_obsmean', 'mae',  \
@@ -1255,5 +1344,5 @@
   help=strkObs, metavar="FILE")
 parser.add_option("-l", "--stationLocation", dest="stloc",  
-  help="name, longitude, latitude and height of the station (only for 'single-station')", 
+  help="name (| for spaces), longitude, latitude and height of the station (only for 'single-station')", 
   metavar="FILE")
 parser.add_option("-o", "--observation", dest="fobs",
@@ -1343,5 +1432,5 @@
             quit(-1)
         else:
-            stationdesc = [opts.stloc.split(',')[0],                                 \
+            stationdesc = [opts.stloc.split(',')[0].replace('|',' '),                \
               np.float(opts.stloc.split(',')[1]), np.float(opts.stloc.split(',')[2]),\
               np.float(opts.stloc.split(',')[3])]
