701 |
Lgrowth[i] = (growthPar[0] - LgrpDiv->meanLength(i)) * mult; |
Lgrowth[i] = (growthPar[0] - LgrpDiv->meanLength(i)) * mult; |
702 |
} |
} |
703 |
|
|
704 |
|
|
705 |
|
|
706 |
|
void GrowthCalcH::calcGrowth(int area, double* Lgrowth, double* Wgrowth, |
707 |
|
const PopInfoVector& numGrow, const AreaClass* const Area, |
708 |
|
const TimeClass* const TimeInfo, const DoubleVector& Fphi, |
709 |
|
const DoubleVector& MaxCon, const LengthGroupDivision* const LgrpDiv, int size) { |
710 |
|
|
711 |
|
growthPar.Update(TimeInfo); |
712 |
|
//JMB - first some error checking |
713 |
|
if ((handle.getLogLevel() >= LOGWARN) && (growthPar.didChange(TimeInfo))) { |
714 |
|
if (isZero(growthPar[1]) || isZero(growthPar[2])) |
715 |
|
handle.logMessage(LOGWARN, "Warning in growth calculation - growth parameter is zero"); |
716 |
|
if (LgrpDiv->maxLength() > growthPar[0]) |
717 |
|
handle.logMessage(LOGWARN, "Warning in growth calculation - length greater than length infinity"); |
718 |
|
} |
719 |
|
|
720 |
|
double mult = 1.0 - exp(-growthPar[1] * TimeInfo->getTimeStepSize()); |
721 |
|
int i; |
722 |
|
for (i = 0; i < size; i++) |
723 |
|
Lgrowth[i] = (growthPar[0] - LgrpDiv->meanLength(i)) * mult; |
724 |
|
} |
725 |
|
|
726 |
|
|
727 |
|
|
728 |
|
|
729 |
|
|
730 |
// ******************************************************** |
// ******************************************************** |
731 |
// Functions for GrowthCalcI |
// Functions for GrowthCalcI |
732 |
// ******************************************************** |
// ******************************************************** |