Index: src/fortranscanner.l
===================================================================
RCS file: /cygdrive/d/cvs_doxygen/doxygen/doxygen/src/fortranscanner.l,v
retrieving revision 1.9.2.1
diff -u -r1.9.2.1 fortranscanner.l
--- src/fortranscanner.l	16 Feb 2013 15:44:52 -0000	1.9.2.1
+++ src/fortranscanner.l	17 Feb 2013 14:16:20 -0000
@@ -2107,6 +2107,7 @@
 
 static void subrHandleCommentBlock(const QCString &doc,bool brief)
 {
+  QCString loc_doc;
   Entry *tmp_entry = current; 
   current = subrCurrent.first(); // temporarily switch to the entry of the subroutine / function
   if (docBlock.stripWhiteSpace().find("\\param") == 0)
@@ -2120,8 +2121,57 @@
   else 
   {
     int dir1 = modifiers[current_root][argName.lower()].direction;
-    handleCommentBlock(QCString("\n\n@param ") + directionParam[dir1] + " " + 
-	               argName + " " + doc,brief);
+    loc_doc = doc.stripWhiteSpace();
+    if (loc_doc.lower().find(directionParam[SymbolModifiers::IN]) == 0)
+    {
+      if ((directionParam[dir1] == directionParam[SymbolModifiers::NONE_D]) ||
+          (directionParam[dir1] == directionParam[SymbolModifiers::IN]))
+      {
+        handleCommentBlock(QCString("\n\n@param ") + directionParam[SymbolModifiers::IN] + " " + 
+	                   argName + " " + loc_doc.right(loc_doc.length()-strlen(directionParam[SymbolModifiers::IN])),brief);
+      }
+      else
+      {
+        warn(yyFileName,yyLineNr, "warning: inconsistency between intent attribute and documenation for variable: "+argName);
+        handleCommentBlock(QCString("\n\n@param ") + directionParam[dir1] + " " + 
+	                   argName + " " + doc,brief);
+      }
+    }
+    else if (loc_doc.lower().find(directionParam[SymbolModifiers::OUT]) == 0)
+    {
+      if ((directionParam[dir1] == directionParam[SymbolModifiers::NONE_D]) ||
+          (directionParam[dir1] == directionParam[SymbolModifiers::OUT]))
+      {
+        handleCommentBlock(QCString("\n\n@param ") + directionParam[SymbolModifiers::OUT] + " " + 
+	                   argName + " " + loc_doc.right(loc_doc.length()-strlen(directionParam[SymbolModifiers::OUT])),brief);
+      }
+      else
+      {
+        warn(yyFileName,yyLineNr, "warning: inconsistency between intent attribute and documenation for variable: "+argName);
+        handleCommentBlock(QCString("\n\n@param ") + directionParam[dir1] + " " + 
+	                   argName + " " + doc,brief);
+      }
+    }
+    else if (loc_doc.lower().find(directionParam[SymbolModifiers::INOUT]) == 0)
+    {
+      if ((directionParam[dir1] == directionParam[SymbolModifiers::NONE_D]) ||
+          (directionParam[dir1] == directionParam[SymbolModifiers::INOUT]))
+      {
+        handleCommentBlock(QCString("\n\n@param ") + directionParam[SymbolModifiers::INOUT] + " " + 
+	                   argName + " " + loc_doc.right(loc_doc.length()-strlen(directionParam[SymbolModifiers::INOUT])),brief);
+      }
+      else
+      {
+        warn(yyFileName,yyLineNr, "warning: inconsistency between intent attribute and documenation for variable: "+argName);
+        handleCommentBlock(QCString("\n\n@param ") + directionParam[dir1] + " " + 
+	                   argName + " " + doc,brief);
+      }
+    }
+    else
+    {
+      handleCommentBlock(QCString("\n\n@param ") + directionParam[dir1] + " " + 
+	                 argName + " " + doc,brief);
+    }
   }
   current=tmp_entry;
 }
