Added implicit none to the fortran code