Index: trunk/tools/diag_tools.py
===================================================================
--- trunk/tools/diag_tools.py	(revision 2389)
+++ trunk/tools/diag_tools.py	(revision 2390)
@@ -2133,4 +2133,30 @@
 
     return hur
+
+def var_hur_tas_tds(tas, tds, dimns, dimvns):
+    """ Function to compute hur relative humidity from tas and tds
+      tas= surface temperature [K]
+      tds= dew point temperature [K]
+      Magnus formula with D. Bolton, 1980, Mon. Wea. Rev. values:
+            gamma = log(hur/100) + b*tas/(c+tas)
+            tdps = c*gamma/(b-gamma)
+         hur = 100*expr[b(tdps/(c+tdps)-tas/(c+tas))]
+
+    """
+    fname = 'compute_hur_tas_tds'
+
+    dnamesvar = dimns
+    dvnamesvar = dimvns
+
+    tasC = tas - fdef.module_definitions.svpt0
+    tdsC = tds - fdef.module_definitions.svpt0
+
+    # Magnus formula with D. Bolton, 1980, Mon. Wea. Rev. values 
+    b = 17.67
+    c = 243.5
+
+    hur = np.exp(b*(tdsC/(c+tdsC)-tasC/(c+tasC)))
+                
+    return hur, dnamesvar, dvnamesvar
 
 def var_td(t, p, qv):
Index: trunk/tools/diagnostics.inf
===================================================================
--- trunk/tools/diagnostics.inf	(revision 2389)
+++ trunk/tools/diagnostics.inf	(revision 2390)
@@ -20,4 +20,5 @@
 hur, WRFrh, WRFrh@T@P@PB
 hurs, LMDZrhs, psol@t2m@q2m
+hurs, rhs_tas_tds, rhs_tas-tds|tas@tds
 hurs, TSrhs, psfc@t@q
 hurs, WRFrhs, PSFC@T2@Q2
@@ -46,4 +47,5 @@
 tdas, TStdas, psfc@t@q
 tdas, WRFtdas, PSFC@T2@Q2
+tws, tws, tas@hurs
 tws, WRFtws, PSFC@T2@Q2
 ua, WRFua, U@V@SINALPHA@COSALPHA
Index: trunk/tools/diagnostics.py
===================================================================
--- trunk/tools/diagnostics.py	(revision 2389)
+++ trunk/tools/diagnostics.py	(revision 2390)
@@ -90,11 +90,11 @@
     #######
 availdiags = ['ACRAINTOT', 'accum', 'clt', 'cllmh', 'convini', 'deaccum', 'fog_K84', \
-  'fog_RUC', 'LMDZrh', 'mslp', 'OMEGAw', 'RAINTOT', 'range_faces',                   \
-  'rvors', 'td', 'timemax', 'timeoverthres', 'turbulence', 'uavaFROMwswd',           \
+  'fog_RUC', 'rhs_tas_tds', 'LMDZrh', 'mslp', 'OMEGAw', 'RAINTOT', 'range_faces',    \
+  'rvors', 'td', 'timemax', 'timeoverthres', 'turbulence', 'tws', 'uavaFROMwswd',    \
   'WRFbnds', 'WRFcape_afwa', 'WRFclivi', 'WRFclwvi', 'WRF_denszint', 'WRFgeop',      \
   'WRFmrso', 'WRFmrsos', 'WRFpotevap_orPM', 'WRFp', 'WRFpsl_ecmwf',                  \
   'WRFpsl_ptarget', 'WRFrvors', 'WRFslw', 'ws', 'wds', 'wss', 'WRFheight',           \
-  'WRFheightrel', 'WRFtda', 'WRFtdas', 'WRFua', 'WRFva', 'WRFzwind', 'WRFzwind_log', \
-  'WRFzwindMO']
+  'WRFheightrel', 'WRFtda', 'WRFtdas', 'WRFtws', 'WRFua', 'WRFva', 'WRFzwind',       \
+  'WRFzwind_log', 'WRFzwindMO']
 
 methods = ['accum', 'deaccum']
@@ -516,4 +516,7 @@
 varsadd = []
 
+Varns = ncobj.variables.keys()
+Varns.sort()
+
 for idiag in range(Ndiags):
     print '    diagnostic:',diags[idiag]
@@ -535,4 +538,5 @@
                     print '  ' + main + ": file '" + opts.ncfile +                   \
                       "' does not have variable '" + depv + "' !!"
+                    print '    available ones:', Varns
                     quit(-1)
         else:
@@ -544,4 +548,5 @@
                 print '  ' + main + ": file '" + opts.ncfile +                       \
                   "' does not have variable '" + depvars + "' !!"
+                print '    available ones:', Varns
                 quit(-1)
 
@@ -928,11 +933,16 @@
         ncvar.insert_variable(ncobj, 'lat_bnds', cellbndsy, diagoutd, diagoutvd, newnc)
 
-# tws: Bet Wulb temperature following Stull 2011 (tas, hur)
-    elif diagn == 'rws':
-            
-        var0 = ncobj.variables[depvars[0]][:]
-        var1 = ncobj.variables[depvars[1]][:]
-
-        diagout, diagoutd, diagoutvd = diag.var_tws_S11(var0,var1,dnames,dvnames)
+# tws: Bet Wulb temperature following Stull 2011 (tas, hurs)
+    elif diagn == 'tws':
+            
+        var0 = ncobj.variables[depvars[0]][:]
+        var1 = ncobj.variables[depvars[1]][:]
+
+        dnamesvar = list(ncobj.variables[depvars[0]].dimensions)
+        dvnamesvar = ncvar.var_dim_dimv(dnamesvar,dnames,dvnames)
+        diagoutd = dnames
+        diagoutvd = ncvar.var_dim_dimv(dnamesvar,dnames,dvnames)
+
+        diagout = diag.var_tws_S11(var0,var1)
         ncvar.insert_variable(ncobj, 'tws', diagout, diagoutd, diagoutvd, newnc)
 
@@ -1224,4 +1234,18 @@
         ncvar.insert_variable(ncobj, 'hurs', diagout, diagoutd, diagoutvd, newnc)
 
+# rhs (psfc, t, q) from tas, tds
+    elif diagn == 'rhs_tas_tds':
+            
+        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 = diag.var_hur_tas_tds(var0,var1,dnamesvar,     \
+          dvnamesvar)
+
+        ncvar.insert_variable(ncobj, 'hurs', diagout, diagoutd, diagoutvd, newnc)
+
 # slw: total soil liquid water SH2O, DZS
     elif diagn == 'WRFslw':
