.. _doc.MUSTANG.layers: Management of sediment layers +++++++++++++++++++++++++++++ * the sediment layers in each mesh (i,j) of the grid are defined by their **thickness** ( *dzs* in meters) and the concentrations of each simulated variable. * The **number of layers** in each mesh varies as a function of time, depending on the deposition and erosion episodes and as the sediment consolidates. The total number of layers is limited to **ksdmax** (parameter given by the user). * the thickness of a layer varies between a minimum value (*dzsmin*) and a maximum value (*dzsmax*). * if the thickness of a layer decreases (by erosion or compaction) below *dzsmin*, it is merged with the layer below. * If the thickness of a layer increases (by deposit) above *dzsmax+5.dzsmin*, a new layer is created. * the value of **dzsmin** is * either constant and defined by the user at initialization (in version V1)(namelist *namlayer* in **paraMUSTANGV1.txt**) * either calculated according to the composition of the sediment (in version V2). The function "*dzsminvar*" evaluates *dzsmin* from the following formulation : :math:`dzsminvar=(1-coeff_{dzsmin})*dzsminuni +coeff_{dzsmin}*SUM( frac_{sed}(1:nvpc)*diam_{sed}(1:nvpc) )` | with *frac_sed* = fraction of each type of sediment | and *diam_sed* = diameter of each type of sediment | and with the parameters given by the user at initialization (namelist *namlayer* in **paraMUSTANGVn.txt**): | *coeff_dzsmin* =0 si dzsmin constant (l_dzsminuni=.TRUE. in paraMUSTANGVn.txt) | or *coeff_dzsmin* =1 if dzsmin varies (l_dzsminuni=.FALSE. in paraMUSTANGVn.txt) | *dzsminuni* given by user * the value of **dzsmax** may vary in space (i,j). Indeed, the discretization of the sediment column can be more or less coarse depending on the dynamic conditions of the area. If the quantities of material involved in the deposition/erosion fluxes are very small, it may be necessary to decrease *dzsmax*, while on the contrary, if there is a lot of deposition, we may want to increase *dzsmax* in order to limit the maximum number of layers. * To limit the maximum number of sediment layers if there is a strong deposit in certain meshes, a "layer fusion" mechanism has been implemented with two new parameters (given by the user at initialization (namelist *namlayer*): * *dzsmax_bottom* : maximum layer thickness in deep layers at the beginning. This value can increase as the height of the sediment increases and the maximum number of layers is exceeded. * *nlayer_surf_sed* : number of surface layers that cannot be merged * The layers are gradually merged two by two from the bottom (see figure below) .. image:: FIG/SEDIM/layers1.jpg * When, after an erosion episode, a bottom layer thicker than *dzsmax* becomes the surface layer, it is cut in order to have always one thin layer at sediment surface. .. image:: FIG/SEDIM/layers2.jpg * It is also possible to always maintain a fixed number (*nlayer_surf_sed*) of surface layers with a given thickness (*dzsmax*). We then use the key CPP (**key_MUSTANG_splitlayersurf**) .. image:: FIG/SEDIM/layers3.jpg