-
-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Description
I've written simple toupper() and tolower() functions in Fortran that start like this:
pure function toupper(str)
character(len=*) intent(in) :: str
character(len=len(str)) :: toupper
...When wrapping these with f2py, I get an error looking like this:
/tmp/tmpmrZ5Ra/src.linux-x86_64-2.7/RMCfunctionsmodule.c: In function ‘f2py_rout_RMCfunctions_mod_functions_toupper’:
/tmp/tmpmrZ5Ra/src.linux-x86_64-2.7/RMCfunctionsmodule.c:926:23: error: ‘str_Dims’ undeclared (first use in this function)slen(toupper) = len(str); ^
I guess the len(str) needs to be replaced by slen(str).
This problem occurs with both f2py-2.7 and f2py-3.3
It does not depend on the name of the variable str - I tried a couple of other names.