>You'll need to specify that ae_func is a function returning integer, not >real as follows from default implicit rules. So, try > >subroutine pcg_wrapper(ae_func) > external ae_func > integer ae_func > integer:: ok = 0 > > write(*,*) 'ok', ok > ok = ae_func() > write(*,*) 'ok', ok > >end This works. Thanks a lot. Mike