subroutine F_Expr(f_source, fun_name, fun_expression)

character(132) f_source
!character(132) line, fun_name, fun_expression
character(*) fun_name; character(132) line, fun_expression
character(1) TAB, sp



open(10, file =f_source, status ='old', form ='formatted', iostat =k_open)

if(k_open /=0) return

TAB =char( ichar("	") )
sp =char(32)

l_n =len_trim(fun_name)


WH_DO: DO WHILE (.not.EOF(10))
read(10, '(a)') line

! Blank line:
if(len_trim(line) ==0) cycle WH_DO

! Contains '=':
ieq =scan(line, '=')
if(ieq ==0) cycle WH_DO

! Supress leading blanks (if any):
line =adjustl(line)

! Replace leading tab(s) by space(s):
i =0
100 i =i+1
if(line(i:i) ==TAB) then
line(i:i) =sp
else
goto 200
endif

goto 100

! Supress leading blanks:
200 line =adjustl(line)

! Comment line:
if(line(1:1) =='!') cycle WH_DO
! End line:
if(line(1:3) =='end' .OR. line(1:3) =='END') cycle WH_DO

! Search in "line" for "fun_name" and "=":
ig1  =index(line, trim(fun_name));

if(ig1 ==0) cycle WH_DO

! Chek for 'fun_name =' or 'fun_name=':
! Line contains '=':
ig2 =index(line, "=");

! Scan back for ' ':
ig0 =index(line(:ig1), ' ', back =.TRUE.)
if(ig0 ==0) ig0 =1

!if(ig2 /=0) then
if(line(ig0:ig2) == trim(fun_name)//'=' .OR. line(ig0:ig2) == trim(fun_name)//' =') then
fun_expression =' '//trim(line(ig1:))
exit wh_do

else
fun_expression =trim(fun_name)
endif

ENDDO WH_DO

close(10)

END
