Hi Faisal,
Attached is a version of terrain.f90 with an added option for 30 levels. You'll find this addition around line 172. The kz=30 option mainly adds resolution in the lower-middle atmosphere (it approximately doubles the number of levels around 1 km in a standard atmosphere). The resolution near the ground (kz=31) is about as high as it can get (delta_sigma = 0.01), and the resolution near the top of the atmosphere is about as low as it should get (delta_sigma = 0.05). You should be able to move levels in the middle of the model around, as long as they fit those constraints.
You may find that you need to decrease the model time step to get it to run stably with these extra levels.
I believe that this should work simply, but please let me know whether it works or not. I may have forgotten to make a change else where, since I back-ported the 30-level option to this v4.0 version of terrain just this morning.
When the University of Washington boundary layer model is released officially in RegCM later this year (it should be in the next few months), it will come with a modification to terrain that allows terrain to choose an arbitrary number of levels, instead of the default 14,18, or 23; the set of sigma levels that I included in the attached version of terrain.f90 comes from choosing kz=30 with the new scheme.
Regards,
-Travis O'Brien-