A model for the diurnal variation of the composition of the Martian atmosphere