[Taken directly from the mlayer/gj2 docs. Refer to them to understand the commands mentioned herein.]
Here is a stab at a summary of how the RO parameters in GJ2/MLAYER affect the programs. It is a complicated and confusing matter, indeed, but please bear with me and ask lots of questions about the info. We all will learn as a result.
The old criteria of "make sure RO(i) < D(i) and RO(i) < D(i+1)" isn't adequate, because the number of rough layers NRough affects John's algorithm for roughing the interface.
GJ2/MLAYER now lists a ztot parameter on the NRough line. When you select the profile with PR, the program creates a standard profile y(x) (erf or tanh) whose x-axis is a rescaled depth. The parameter ztot is a measure of the total thickness of this rescaled depth. When the program uses the profile to rough an interface i in your structure, it scales the x-axis by RO(i).
You cannot modify ztot, except by modifying NRough. Ztot * RO(1) is also the extra thickness added to your profile for the vacuum gradation. Your nominal structure starts this far deep into the profile when you run commands like PLP.
We care about ztot because it is part of the criteria used to implement two different ways of roughing the interface. For small roughness, the contribution to QCSQ and MU in the roughed layers comes only from the layers on either side of the interface. For large roughness, QCSQ and MU in the layer depend on the values given for the layer and the one above and below. But, with exceedingly large roughness and small thickness, the contribution from two layers away may be significant. But they will never be taken into account, unless you add a layer with indeterminate QCSQ and MU.
For small roughness, your profile y(x) is divided into NRough + 1 (more or less) equally-spaced segments in y; the thickness of the microslab varies accordingly (y is equally spaced for tanh). When large roughness is in effect, the NRough + 1 microslabs are equally thick, and the profile y(x) varies accordingly.
The criteria which selects "small" is the following:
D(i) > ztot * (RO(i) + RO(i+1))
"Large" is that which is not small.
Layers always extend from the middle of interface i to the middle of interface i + 1. We can get into problems when layers of dramatically different roughness are adjacent to layers of dramatically different thickness. We could get the situation in which a "small" layer is adjacent to a "large" layer. In this case, we can get discontinous jumps in both the magnitude and the slope of the profile.
Jumps in magnitude occur because a different rescaled x is being used just at either side of the interface and the number of layers involved at the interface changes. Although significant contribution from layer (i+2) may exist for the interface, the thickness of layer i selects a "small" roughness model in which (i+2) plays no part.
Be advised that in GJ2 the magnetic and chemical profiles have logically distinct roughness and thickness parameters. They are unified into a structure with common microslabs. In the course of doing this unification, a further averaging of the profile takes place between the neighboring microslabs of the individual magnetic and chemical profiles. This may prevent the profile from ever reaching the saturation value displayed by the VE command. The error increases as NRough decreases. This unification is also the reason why RO(1) must equal RM(1), otherwise the vacuum gradations will be of different thickness, and the nominal magnetic structure will start at a different depth from the nominal chemical structure.
In summary, if you keep D(i) > ztot * (RO(i) + RO(i+1)) for all i, the small model will always apply, and the resulting profile will be totally consistent. As an aside, I have needed to implement linear gradations through some very thick layers. I achieved this by dividing the very thick layer into three or more sublayers and using a tanh profile in which RO(i) = 1.25 * D(i) for the inner sublayers, putting us in the "large" roughness regime. Roughness for the outer sublayers is reduced to promote a controlled transition between "large" and "small" models.