{
float factornegbal=1.0; /ONLY PART OF NEGBAL NEEDS TO BE COMPENSATED/
/0.1 = only 10%, 1= all/
/*NEGBAL is initialized to 0 in ##initial.c*/
if(ENBAL[i][j] < 0) /*no energy for melt*/
NEGBAL[i][j] += ENBAL[i][j]*factornegbal; /*NEGBAL turns negative if ENBAL neg*/
else {
if(ENBAL[i][j] > fabs(NEGBAL[i][j])) { /*surface back to zero and some melt*/
lessmelt = NEGBAL[i][j];
NEGBAL[i][j] = 0;
} else { /*still not enough energy to eliminate cold surface, no melt*/
NEGBAL[i][j] += ENBAL[i][j];
lessmelt = NEGBAL[i][j];
}
} /*end else energy for melt*/
return;
}
Line 918 NEGBAL[i][j] += ENBAL[i][j];
Line 919 lessmelt = NEGBAL[i][j];
should be
Line 918 NEGBAL[i][j] += ENBAL[i][j];
Line 919 lessmelt = ENBAL[i][j];
found one mistake in: void negenergybalance()
{ float factornegbal=1.0; /ONLY PART OF NEGBAL NEEDS TO BE COMPENSATED/ /0.1 = only 10%, 1= all/
}
Line 918 NEGBAL[i][j] += ENBAL[i][j]; Line 919 lessmelt = NEGBAL[i][j];
should be Line 918 NEGBAL[i][j] += ENBAL[i][j]; Line 919 lessmelt = ENBAL[i][j];