Avoid duplication of Fortran I/O code