Modeling the density variation in the shallow firn layer