How to call a C-routine from Fortran

There is usually no major problem to call C-routines from Fortran and vice-versa (as long as the parameters are arrays and scalars). This is the way to use fsecond.

program examp
double precision :: fsecond, t

t = fsecond()
! compute ...
t = fsecond() - t

print*, 'time = ', t

end program examp

and this is how you compile and link:
 


Back