WSL/SLF GitLab Repository

Commit 5b558650 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

code cleanup in the soil albedo computation

parent 4f010eb5
......@@ -101,9 +101,7 @@ bool AllSkySWGenerator::generate(const size_t& param, std::vector<MeteoData>& ve
if (HS!=IOUtils::nodata) //no big deal if we can not adapt the albedo
albedo = (HS>=snow_thresh)? snow_albedo : soil_albedo;
} else if (ISWR>0. && RSWR>0.) { //this could happen if the user calls this generator for a copy parameter, etc
albedo = RSWR / ISWR;
if (albedo>=1.) albedo=0.99;
if (albedo<=0.) albedo=0.01;
albedo = std::max(0.01, std::min(0.99, RSWR / ISWR));
}
if (TA==IOUtils::nodata || RH==IOUtils::nodata) {
......
......@@ -46,9 +46,7 @@ bool ClearSkySWGenerator::generate(const size_t& param, MeteoData& md)
if (HS!=IOUtils::nodata) //no big deal if we can not adapt the albedo
albedo = (HS>=snow_thresh)? snow_albedo : soil_albedo;
} else if (ISWR>0. && RSWR>0.) { //this could happen if the user calls this generator for a copy parameter, etc
albedo = RSWR / ISWR;
if (albedo>=1.) albedo=0.99;
if (albedo<=0.) albedo=0.01;
albedo = std::max(0.01, std::min(0.99, RSWR / ISWR));
}
if (TA==IOUtils::nodata || RH==IOUtils::nodata) {
......
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