This is what one PD at an academic IM program in California says concerning matching into IM:
"To stay in California at a University based program or a strong affiliate, one would need a minimum of 210+ on USMLE Part 1 and a very strong pass in the medicine clerkship with good narratives on the Dean's letter for medicine and all other core rotations. For the top IM programs, think Part I of 230+ and honors in medicine and two other clerkships, plus some other activities which set one apart such as significant research or creative and extensive public service."
IMHO a pass in your third medicine clerkship is not very good. Then again my friend who is a second year medicine resident at Stanford also had a pass in his medicine clerkship. Of course he went to UCSF so the medical school name probably helped out a bit. I am not sure if a top 20 US medical school is going to give you the same type of pull in getting interviews in CA. Anyway doing better in your fourth year is good but it doesn't really make your third year performance disappear. Good luck with interviews, and remember that most competitive academic programs in CA are going to wait until mid november before giving out interviews/rejections.
Peter