module logging implicit none integer::logunit contains subroutine initialize(filename) implicit none character(*), intent(in)::filename open(newunit=logunit, file=trim(filename), action="write", status="unknown", position="append") end subroutine initialize subroutine shutdown() implicit none close(logunit) end subroutine shutdown subroutine write_log(string) implicit none character(*), intent(in)::string ! GNU Extension... :( write(logunit, *) fdate()//" :: "//string call flush(logunit) end subroutine write_log end module logging