Fortran Fits writer/reader I recently inherited some Fortran 77 code that calls the IMFORT interface to write data out to an imh and pix files. I could not get this to compile on a modern compiler and it is not supported. So I decided to set off on writing a Fits writer in Fortran. I was able to make one but is ugly and does not properly handle the end card. I tried googling for a Fortran Fits writer but came up empty. Is there a library for astronomical Frotran codes that contains Fits writer exist out there.

The code may be better suited for stack overflow, but this is specialized to astronomy since no other science seems to use fits, so I figured I would be better off starting here.
It looks like CFITSIO has an interface for F77. 

I'm always thinking about programmer time vs. computation time in research settings. If your data is reasonably small and simple in structure, I'd be very tempted to have Fortran write to a text file, and then use something like astropy to turn the text file into a FITS file. It's slow and icky, but it takes fifteen minutes of thinking if you've used astropy before.