C file: stringfunction.f

C subroutine myadd:

	SUBROUTINE func_str(a,b,str,sum)
	real*8 a,b,sum
	character*(*) str
Cf2py   intent(in) a
Cf2py   intent(in) b
Cf2py   intent(in) str
Cf2py   intent(out) sum
	external myadd, mysub_r, mysub_l, mymul

	if (str .eq. 'myadd')then
           call myadd(a,b,sum)
	else if (str. eq. 'mysub_r')then
	   call mysub_r(a,b,sum)
	else if (str. eq. 'mysub_l')then
	   call mysub_l(a,b,sum)
	else if (str. eq. 'mymul')then
	   call mymul(a,b,sum)
	end if
	return
	end

C subroutine myadd:

	SUBROUTINE myadd(a,b,sum)
	real*8 a,b,sum
Cf2py   intent(in) a
Cf2py   intent(in) b
	sum = a+b
	return
	end



C subroutine mysub:

	SUBROUTINE mysub_r(a,b,sum)
	real*8 a,b,sum
Cf2py   intent(in) a
Cf2py   intent(in) b
	sum = b-a
	return
	end


C subroutine mysub:

	SUBROUTINE mysub_l(a,b,sum)
	real*8 a,b,sum
Cf2py   intent(in) a
Cf2py   intent(in) b
	sum = a-b
	return
	end


C subroutine mymul:

	SUBROUTINE mymul(a,b,sum)
	real*8 a,b,sum
Cf2py   intent(in) a
Cf2py   intent(in) b
	sum = a*b
	return
	end