regine / meltmodel

A Distributed Surface Mass Balance Model
regine.github.com/meltmodel
GNU General Public License v3.0
21 stars 16 forks source link

Found one mistake in turbul.c , negenergybalance() #48

Open MachineAi opened 7 years ago

MachineAi commented 7 years ago

found one mistake in: void negenergybalance()

{ 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];