DUCTCALC

Fortran to C code conversion increases efficiency of HVAC application


Another memorable programming project involved FORTRAN and C at Centerline Engineering. Some of our HVAC engineers relied heavily on a home-grown duct sizing/calculation program called DUCTCALC. It was a huge program written in FORTRAN 66 and ran on a DEC Mini-Vax. It required so much computing power that the CAD stations connected to the Mini-Vax bogged down.

Having had some FORTRAN training at Computer Tech, and having recently taught myself C, I convinced management to let me convert the FORTRAN version into a C version using a Windows-compatible C compiler. That way, executables could be run on engineers' desktops and free the Mini-Vax for CAD use. Management agreed to let me do the conversion.

Over a thousand lines of FORTRAN code became 22 modules of C code. An HVAC engineer helped me with the equations--of which there were many. I also replaced the program's batch operation with interactive input screens.

The finished executable file was nearly 5 megabytes in size, but it ran much faster on a PC than it did on the Mini-Vax. The CAD people were happy, the HVAC engineers were happy, and most importantly management was happy.