WSL/SLF GitLab Repository

Commit d338b905 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Better information message when forcing a null lapse rate on a linear...

Better information message when forcing a null lapse rate on a linear regression (this happens when using "frac" on precipitation for all timesteps without precip)
parent 66829025
......@@ -144,9 +144,15 @@ bool SimpleLinear::fit()
ss << mesg << "Computed regression with " << regname << " model - r=" << r;
} else {
a = fixed_lapse_rate;
Interpol1D::LinRegression(X, Y, a, b, r, mesg, true);
ss << mesg << "Computed regression with " << regname << " model ";
ss << "(fixed lapse rate=" << a << ") - r=" << r;
if (a!=0.) {
Interpol1D::LinRegression(X, Y, a, b, r, mesg, true);
ss << mesg << "Computed regression with " << regname << " model ";
ss << "(fixed lapse rate=" << a << ") - r=" << r;
} else {
a=0.;
b=0.;
ss << mesg << "Computed regression with " << regname << " model (no regression for null lapse rate)";
}
}
Lambda.push_back(a);
Lambda.push_back(b);
......@@ -170,9 +176,15 @@ bool NoisyLinear::fit()
ss << mesg << "Computed regression with " << regname << " model - r=" << r;
} else {
a = fixed_lapse_rate;
Interpol1D::NoisyLinRegression(X, Y, a, b, r, mesg, true);
ss << mesg << "Computed regression with " << regname << " model ";
ss << "(fixed lapse rate=" << a << ") - r=" << r;
if (a!=0.) {
Interpol1D::NoisyLinRegression(X, Y, a, b, r, mesg, true);
ss << mesg << "Computed regression with " << regname << " model ";
ss << "(fixed lapse rate=" << a << ") - r=" << r;
} else {
a=0.;
b=0.;
ss << mesg << "Computed regression with " << regname << " model (no regression for null lapse rate)";
}
}
Lambda.push_back(a);
Lambda.push_back(b);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment