D:\Programs\doxygen-svn>diff -u src/.svn/text-base/fortranscanner.l.svn-base src/fortranscanner.l 
--- src/.svn/text-base/fortranscanner.l.svn-base	2010-11-06 20:30:55.797632400 +0100
+++ src/fortranscanner.l	2010-11-11 22:08:29.500890300 +0100
@@ -628,11 +628,55 @@
                                             addCurrentEntry();
                                           } 
 					  else if (!argType.isEmpty())
-					  { // deklaration of parameter list: add type for corr. parameter 
+					  { // declaration of parameter list: add type for corr. parameter 
 					    parameter= addFortranParameter(argType,argName,docBlock);
 					    if (parameter) v_type= V_PARAMETER;
 					    // save, it may be function return type
-					    modifiers[current_root][name.lower()].type = argType;
+                                            if (parameter)
+                                            {
+					      modifiers[current_root][name.lower()].type = argType;
+                                            }
+                                            else
+                                            {
+                                              if ((current_root->name.lower() == argName.lower()) ||
+                                                  (modifiers[current_root->parent()][current_root->name.lower()].returnName == argName.lower()))
+                                              {
+                                                int strt = current_root->type.find("function");
+                                                QString lft;
+                                                QString rght;
+                                                if (strt != -1)
+                                                {
+                                                  lft = "";
+                                                  rght = "";
+                                                  if (strt != 0) lft = current_root->type.left(strt).stripWhiteSpace();
+                                                  if ((current_root->type.length() - strt - strlen("function"))!= 0)
+                                                    rght = current_root->type.right(current_root->type.length() - strt - strlen("function")).stripWhiteSpace();
+                                                   current_root -> type = lft;
+                                                   if (rght.length() > 0)
+                                                   {
+                                                     if (current_root -> type.length() > 0) current_root -> type += " ";
+                                                     current_root -> type += rght;
+                                                   }
+                                                   if (argType.stripWhiteSpace().length() > 0)
+                                                   {
+                                                     if (current_root -> type.length() > 0) current_root -> type += " ";
+                                                     current_root -> type += argType.stripWhiteSpace();
+                                                   }
+                                                   if (current_root -> type.length() > 0) current_root -> type += " ";
+                                                   current_root -> type += "function";
+                                                }
+                                                else
+                                                {
+                                                  current_root->type += " " + argType.stripWhiteSpace();
+                                                }
+                                                current_root->type = current_root->type.stripWhiteSpace();
+                                                modifiers[current_root][name.lower()].type = current_root->type;
+                                              }
+                                              else
+                                              {
+					        modifiers[current_root][name.lower()].type = argType;
+                                              }
+                                            }
 					    // any accumulated doc for argument should be emptied,
 					    // because it is handled other way and this doc can be
 					    // unexpectedly passed to the next member.
@@ -653,12 +697,12 @@
 					  BEGIN(Initialization);
                                         }
 <Variable>"\n"	                        { currentModifiers = SymbolModifiers();
-                                          yy_pop_state(); // end variable deklaration list
+                                          yy_pop_state(); // end variable declaration list
                                           yyLineNr++; yyLineNr+=lineCountPrepass; lineCountPrepass=0;
                                           docBlock.resize(0);
                                         }
 <Variable>";".*"\n"                     { currentModifiers = SymbolModifiers();
-                                          yy_pop_state(); // end variable deklaration list
+                                          yy_pop_state(); // end variable declaration list
                                           docBlock.resize(0);
                                           inputStringSemi =(const char*)(yytext+1);
                                           pushBuffer(inputStringSemi);
@@ -713,7 +757,9 @@
 
 <SubprogPrefix>{BS}{SUBPROG}{BS_}     {
                                          // Fortran subroutine or function found
-                                         addSubprogram(yytext);
+                                           result= yytext;
+                                           result= result.stripWhiteSpace();
+                                         addSubprogram(result);
                                          BEGIN(Subprog);
                                        }
 
@@ -1565,7 +1611,9 @@
   //fprintf(stderr,"1=========> got subprog, type: %s\n",text); 
   current->section = Entry::FUNCTION_SEC ;
   QCString subtype = text; subtype=subtype.lower().stripWhiteSpace();
-  if (!current->type) current->type = subtype;
+  //if (!current->type) current->type = subtype;
+  current->type += " " + subtype;
+  current -> type.stripWhiteSpace();
   current->fileName  = yyFileName;
   current->bodyLine  = yyLineNr; // used for source reference
   current->startLine = -1; // ??? what is startLine for?
