Index: trunk/tools/diagnostics.inf
===================================================================
--- trunk/tools/diagnostics.inf	(revision 611)
+++ trunk/tools/diagnostics.inf	(revision 612)
@@ -8,4 +8,8 @@
 SPDUV       U@V
 SPDUV10     U10@V10
+TSrhs       psfc@t@q
+TStd        psfc@t@q
+TSwds       u@v
+TSwss       u@v
 WRFbils     HFX@LH
 WRFmslp     WRFp@PSFC@HGT@WRFt@QVAPOR
@@ -17,4 +21,8 @@
 WRFrhs      PSFC@T2@Q2
 WRFrvors    U10@V10@WRFpos
+WRFtd       WRFp@WRFt2@QVAPOR
+WRFtds      PSFC@T2@Q2
 WRFwss      U10@V10
+WRFwds      U10@V10
 wss         U10@V10
+wss         U10@V10
Index: trunk/tools/diagnostics.py
===================================================================
--- trunk/tools/diagnostics.py	(revision 611)
+++ trunk/tools/diagnostics.py	(revision 612)
@@ -578,4 +578,34 @@
     return rh, rhdims, rhvdims
 
+def compute_td(p, temp, qv, dimns, dimvns):
+    """ Function to compute the dew point temperature
+      [p]= pressure [Pa]
+      [temp]= temperature [C]
+      [qv]= mixing ratio [kgkg-1]
+      [dimns]= list of the name of the dimensions of [p]
+      [dimvns]= list of the name of the variables with the values of the 
+        dimensions of [p]
+    """
+    fname = 'compute_td'
+
+#    print '    ' + fname + ': computing dew-point temperature from TS as t and Tetens...'
+# tacking from: http://en.wikipedia.org/wiki/Dew_point
+    tk = temp
+    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)
+
+    rh = qv/data2
+                
+    pa = rh * data1
+    varNOcheckv = 257.44*np.log(pa/6.1121)/(18.678-np.log(pa/6.1121))
+
+    dimensions = ncobj.variables['t'].dimensions
+    shape = ncobj.variables['t'].shape
+
+    tddims = dimns[:]
+    tdvdims = dimvns[:]
+
+    return td, tddims, tdvdims
+
 def turbulence_var(varv, dimvn, dimn):
     """ Function to compute the Taylor's decomposition turbulence term from a a given variable
@@ -627,4 +657,43 @@
 
     return turb, turbdims, turbvdims
+
+def compute_wds(u, v, dimns, dimvns):
+    """ Function to compute the wind direction
+      [u]= W-E wind direction [ms-1, knot, ...]
+      [v]= N-S wind direction [ms-1, knot, ...]
+      [dimns]= list of the name of the dimensions of [u]
+      [dimvns]= list of the name of the variables with the values of the 
+        dimensions of [u]
+    """
+    fname = 'compute_wds'
+
+#    print '    ' + fname + ': computing wind direction as ATAN2(v,u) ...'
+    theta = np.arctan2(v,u)
+    theta = np.where(theta < 0., theta + 2.*np.pi, theta)
+
+    wds = 360.*theta/(2.*np.pi)
+
+    wdsdims = dimns[:]
+    wdsvdims = dimvns[:]
+
+    return wds, wdsdims, wdsvdims
+
+def compute_wss(u, v, dimns, dimvns):
+    """ Function to compute the wind speed
+      [u]= W-E wind direction [ms-1, knot, ...]
+      [v]= N-S wind direction [ms-1, knot, ...]
+      [dimns]= list of the name of the dimensions of [u]
+      [dimvns]= list of the name of the variables with the values of the 
+        dimensions of [u]
+    """
+    fname = 'compute_wss'
+
+#    print '    ' + fname + ': computing wind speed as SQRT(v**2 + u**2) ...'
+    wss = np.sqrt(u*u + v*v)
+
+    wssdims = dimns[:]
+    wssvdims = dimvns[:]
+
+    return wss, wssdims, wssvdims
 
 def timeunits_seconds(dtu):
@@ -673,10 +742,12 @@
     #######
 availdiags = ['ACRAINTOT', 'clt', 'cllmh', 'deaccum', 'LMDZrh', 'mslp', 'RAINTOT',   \
-  'rvors', 'turbulence', 'WRFrvors']
+  'rvors', 'td', 'turbulence', 'WRFrvors', 'wds', 'wss']
 
 # Variables not to check
-NONcheckingvars = ['cllmh', 'deaccum', 'WRFbils', 'WRFdens', 'WRFgeop', 'WRFp',      \
+NONcheckingvars = ['cllmh', 'deaccum', 'TSrhs', 'TStd', 'TSwds', 'TSwss', 'WRFbils', \
+  'WRFdens', 'WRFgeop',                                                              \
+  'WRFp', 'WRFtd',                                                                   \
   'WRFpos', 'WRFprc', 'WRFprls', 'WRFrh', 'LMDZrh', 'LMDZrhs', 'WRFrhs', 'WRFrvors', \
-  'WRFt', 'WRFtime']
+  'WRFt', 'WRFtime', 'WRFwds', 'WRFwss']
 
 ofile = 'diagnostics.nc'
@@ -1010,4 +1081,74 @@
         ncvar.insert_variable(ncobj, 'pr', diagout/dtime, diagoutd, diagoutvd, newnc)
 
+# rhs (psfc, t, q) from TimeSeries files
+    elif diag == 'TSrhs':
+            
+        p0=100000.
+        var0 = ncobj.variables[depvars[0]][:]
+        var1 = (ncobj.variables[depvars[1]][:])*(var0/p0)**(2./7.)
+        var2 = ncobj.variables[depvars[2]][:]
+
+        dnamesvar = ncobj.variables[depvars[0]].dimensions
+        dvnamesvar = ncvar.var_dim_dimv(dnamesvar,dnames,dvnames)
+
+        diagout, diagoutd, diagoutvd = compute_rh(var0,var1,var2,dnamesvar,dvnamesvar)
+
+        ncvar.insert_variable(ncobj, 'huss', diagout, diagoutd, diagoutvd, newnc)
+
+# td (psfc, t, q) from TimeSeries files
+    elif diag == 'TStd' or diag = 'td':
+            
+        var0 = ncobj.variables[depvars[0]][:]
+        var1 = ncobj.variables[depvars[1]][:] - 273.15
+        var2 = ncobj.variables[depvars[2]][:]
+
+        dnamesvar = ncobj.variables[depvars[0]].dimensions
+        dvnamesvar = ncvar.var_dim_dimv(dnamesvar,dnames,dvnames)
+
+        diagout, diagoutd, diagoutvd = compute_td(var0,var1,var2,dnamesvar,dvnamesvar)
+
+        ncvar.insert_variable(ncobj, 'tds', diagout, diagoutd, diagoutvd, newnc)
+
+# td (psfc, t, q) from TimeSeries files
+    elif diag = 'tdC':
+            
+        var0 = ncobj.variables[depvars[0]][:]
+# Temperature is already in degrees Celsius
+        var1 = ncobj.variables[depvars[1]][:]
+        var2 = ncobj.variables[depvars[2]][:]
+
+        dnamesvar = ncobj.variables[depvars[0]].dimensions
+        dvnamesvar = ncvar.var_dim_dimv(dnamesvar,dnames,dvnames)
+
+        diagout, diagoutd, diagoutvd = compute_td(var0,var1,var2,dnamesvar,dvnamesvar)
+
+        ncvar.insert_variable(ncobj, 'tds', diagout, diagoutd, diagoutvd, newnc)
+
+# wds (u, v)
+    elif diag == 'TSwds' or diag == 'wds' :
+ 
+        var0 = ncobj.variables[depvars[0]][:]
+        var1 = ncobj.variables[depvars[1]][:]
+
+        dnamesvar = ncobj.variables[depvars[0]].dimensions
+        dvnamesvar = ncvar.var_dim_dimv(dnamesvar,dnames,dvnames)
+
+        diagout, diagoutd, diagoutvd = compute_wds(var0,var1,dnamesvar,dvnamesvar)
+
+        ncvar.insert_variable(ncobj, 'wds', diagout, diagoutd, diagoutvd, newnc)
+
+# wss (u, v)
+    elif diag == 'TSwss' or diag = 'wss':
+            
+        var0 = ncobj.variables[depvars[0]][:]
+        var1 = ncobj.variables[depvars[1]][:]
+
+        dnamesvar = ncobj.variables[depvars[0]].dimensions
+        dvnamesvar = ncvar.var_dim_dimv(dnamesvar,dnames,dvnames)
+
+        diagout, diagoutd, diagoutvd = compute_wss(var0,var1,dnamesvar,dvnamesvar)
+
+        ncvar.insert_variable(ncobj, 'wss', diagout, diagoutd, diagoutvd, newnc)
+
 # turbulence (var)
     elif diag == 'turbulence':
