Dynamics of primary production and sedimentation in a coastal ecosystem