Index: src/fortrancode.l
===================================================================
--- src/fortrancode.l	(revision 810)
+++ src/fortrancode.l	(working copy)
@@ -526,35 +526,37 @@
 static void generateLink(CodeOutputInterface &ol, char *lname)
 {
   ClassDef *cd=0;
+  QCString tmp = lname;
+  tmp = tmp.lower();
  
-  // check if lname is a linkable type or interface
-  if ( (getFortranTypeDefs(lname, currentModule, cd, useMembers)) && cd->isLinkable() )
+  // check if lowercase lname is a linkable type or interface
+  if ( (getFortranTypeDefs(tmp, currentModule, cd, useMembers)) && cd->isLinkable() )
   {
     if ( (cd->compoundType() == ClassDef::Class) && // was  Entry::INTERFACE_SEC) &&
-         (getGenericProcedureLink(cd, lname, ol)) ) 
+         (getGenericProcedureLink(cd, tmp, ol)) ) 
     {
       //cout << "=== generic procedure resolved" << endl; 
     } 
     else 
     { // write type or interface link
-      ol.linkableSymbol(g_yyLineNr, lname, cd, g_currentMemberDef?g_currentMemberDef:g_currentDefinition);
-      writeMultiLineCodeLink(ol,cd->getReference(),cd->getOutputFileBase(),cd->anchor(),lname);
-      addToSearchIndex(lname);
+      ol.linkableSymbol(g_yyLineNr, tmp, cd, g_currentMemberDef?g_currentMemberDef:g_currentDefinition);
+      writeMultiLineCodeLink(ol,cd->getReference(),cd->getOutputFileBase(),cd->anchor(),tmp);
+      addToSearchIndex(tmp.data());
     }
   }
   // check for function/variable
-  else if (getLink(useMembers, lname, ol, lname)) 
+  else if (getLink(useMembers, tmp, ol, tmp)) 
   {
-    //cout << "=== found link for " << lname << endl;
+    //cout << "=== found link for lowercase " << lname << endl;
   }
   else 
   {
     // nothing found, just write out the word
-    ol.linkableSymbol(g_yyLineNr, lname, 0, g_currentMemberDef?g_currentMemberDef:g_currentDefinition);
+    ol.linkableSymbol(g_yyLineNr, tmp, 0, g_currentMemberDef?g_currentMemberDef:g_currentDefinition);
     //startFontClass("charliteral"); //test
-    codifyLines(lname);
+    codifyLines(tmp);
     //endFontClass(); //test
-    addToSearchIndex(lname);
+    addToSearchIndex(tmp.data());
   }
 }
 
@@ -838,9 +840,15 @@
 					  endFontClass();
   					}
 <Declaration>{ID}                       { // local var
-					  g_code->codify(yytext);
-					  if (g_currentMemberDef && g_currentMemberDef->isFunction())
-					    addLocalVar(yytext);
+                                          if (g_currentMemberDef && !g_currentMemberDef->isFunction())
+                                          {
+                                            g_code->codify(yytext);
+                                            addLocalVar(yytext);
+                                          }
+                                           else
+                                          {
+                                            generateLink(*g_code, yytext);
+                                          }
 					}
 <Declaration>[(]			{ // start of array specification
 					  bracketCount++;
Index: src/fortranscanner.l
===================================================================
--- src/fortranscanner.l	(revision 810)
+++ src/fortranscanner.l	(working copy)
@@ -767,6 +767,7 @@
                                           //cout << "5=========> got variable: " << argType << "::" << yytext << endl;
  					  /* work around for bug in QCString.replace (QCString works) */
 					  QCString name=yytext;
+                                          name = name.lower();
 					  /* remember attributes for the symbol */
 					  modifiers[current_root][name.lower()] |= currentModifiers;
 					  argName= name;
@@ -853,7 +854,7 @@
 					  QCString name(argName);
 					  QCString attr("dimension");
 					  attr += yytext;
-					  modifiers[current_root][name] |= attr;
+					  modifiers[current_root][name.lower()] |= attr;
 					}
 <Variable>{COMMA}	                { //printf("COMMA: %d<=..<=%d\n", yyColNr-yyleng, yyColNr);
 					  // locate !< comment
@@ -963,7 +964,7 @@
 <Subprog>{BS}                          {   /* ignore white space */   }
 <Subprog>{ID}                          { current->name = yytext;
                                          //cout << "1a==========> got " << current->type << " " << yytext << " " << yyLineNr << endl;
-                                         modifiers[current_root][current->name.lower()].returnName = current->name;
+                                         modifiers[current_root][current->name.lower()].returnName = current->name.lower();
 
                                          if (ifType == IF_ABSTRACT || ifType == IF_SPECIFIC)
                                          {
@@ -1893,6 +1894,7 @@
 static void addCurrentEntry()
 {
   //printf("===Adding entry %s to %s\n", current->name.data(), current_root->name.data());
+  current->name = current->name.lower();
   current_root->addSubEntry(current);
   last_entry = current;
   current = new Entry ;
