started to write C code

@ Georgia, we need to think about how close we want to stay to the
serial structure of the original Fortran code. It is extremely serial.