Call branching for TGGrainRate
For correctly modelling vapour flux in snow, the following may be important:
In Metamorphism.cc L540-548 and L757-765: the if statement may not seem to cover all possible cases correctly (i.e., if e==0, why not use the e+1 gradient)? And is it correct in case soil is present?
Needs verification!
if ( e > 0 && e < nE-1 ) { // inner element rgDotMax = TGGrainRate(EMS[e], T1, T2, EMS[e-1].gradT, EMS[e+1].gradT); } else if ( e == 0 ) {// bottom element: use twice EMS[e].gradT to avoid troubles if nE=1 rgDotMax = TGGrainRate(EMS[e], T1, T2, EMS[e].gradT, EMS[e].gradT); } else {// top element rgDotMax = TGGrainRate(EMS[e], T1, T2, EMS[e-1].gradT, EMS[e].gradT); }