WSL/SLF GitLab Repository

Commit 2734a44e authored by Adrien Michel's avatar Adrien Michel
Browse files
parents b35fff21 89a9beb1
...@@ -134,20 +134,20 @@ SnowpackInterface::SnowpackInterface(const mio::Config& io_cfg, const size_t& nb ...@@ -134,20 +134,20 @@ SnowpackInterface::SnowpackInterface(const mio::Config& io_cfg, const size_t& nb
if (mpicontrol.master()) { if (mpicontrol.master()) {
bool write_dem_details=false; bool write_dem_details=false;
io_cfg.getValue("WRITE_DEM_DETAILS", "output", write_dem_details,IOUtils::nothrow); io_cfg.getValue("WRITE_DEM_DETAILS", "output", write_dem_details,IOUtils::nothrow);
if(write_dem_details){ if(write_dem_details){
std::cout << "[i] Writing DEM details grids" << std::endl; std::cout << "[i] Writing DEM details grids" << std::endl;
io.write2DGrid(mio::Grid2DObject(dem.cellsize,dem.llcorner,dem.slope), "DEM_SLOPE"); io.write2DGrid(mio::Grid2DObject(dem.cellsize,dem.llcorner,dem.slope), "DEM_SLOPE");
io.write2DGrid(mio::Grid2DObject(dem.cellsize,dem.llcorner,dem.azi), "DEM_AZI"); io.write2DGrid(mio::Grid2DObject(dem.cellsize,dem.llcorner,dem.azi), "DEM_AZI");
io.write2DGrid(mio::Grid2DObject(dem.cellsize,dem.llcorner,dem.curvature), "DEM_CURVATURE"); io.write2DGrid(mio::Grid2DObject(dem.cellsize,dem.llcorner,dem.curvature), "DEM_CURVATURE");
} }
std::cout << "[i] SnowpackInterface initializing a total of " << mpicontrol.size(); std::cout << "[i] SnowpackInterface initializing a total of " << mpicontrol.size();
if (mpicontrol.size()>1) std::cout << " processes with " << nbworkers; if (mpicontrol.size()>1) std::cout << " processes with " << nbworkers;
else std::cout << " process with " << nbworkers; else std::cout << " process with " << nbworkers;
if (nbworkers>1) std::cout << " workers"; if (nbworkers>1) std::cout << " workers";
else std::cout << " worker"; else std::cout << " worker";
std::cout << " each using Snowpack " << snowpack::getLibVersion() << "\n"; std::cout << " each using Snowpack " << snowpack::getLibVersion() << "\n";
} }
...@@ -760,12 +760,12 @@ mio::Grid2DObject SnowpackInterface::getGrid(const SnGrids::Parameters& param) c ...@@ -760,12 +760,12 @@ mio::Grid2DObject SnowpackInterface::getGrid(const SnGrids::Parameters& param) c
return shortwave; return shortwave;
case SnGrids::ILWR: case SnGrids::ILWR:
return longwave; return longwave;
case SnGrids::ISWR_TERRAIN: case SnGrids::ISWR_TERRAIN:
return terrain_shortwave; return terrain_shortwave;
case SnGrids::ILWR_TERRAIN: case SnGrids::ILWR_TERRAIN:
return terrain_longwave; return terrain_longwave;
case SnGrids::ISWR_DIFF: case SnGrids::ISWR_DIFF:
return diffuse; return diffuse;
case SnGrids::ISWR_DIR: case SnGrids::ISWR_DIR:
return shortwave-diffuse-terrain_shortwave; return shortwave-diffuse-terrain_shortwave;
default: ; //so compilers do not complain about missing conditions default: ; //so compilers do not complain about missing conditions
......
...@@ -220,12 +220,12 @@ void SnowpackInterfaceWorker::initGrids(std::vector<std::string>& params, ...@@ -220,12 +220,12 @@ void SnowpackInterfaceWorker::initGrids(std::vector<std::string>& params,
IOUtils::toUpper(params[ii]); //make sure all parameters are upper case IOUtils::toUpper(params[ii]); //make sure all parameters are upper case
const size_t param_idx = SnGrids::getParameterIndex( params[ii] ); const size_t param_idx = SnGrids::getParameterIndex( params[ii] );
const auto position = std::find(grids_not_computed_in_worker.begin(), const auto position = std::find(grids_not_computed_in_worker.begin(),
grids_not_computed_in_worker.end(), grids_not_computed_in_worker.end(),
params[ii]); params[ii]);
if(position<grids_not_computed_in_worker.end()) { if(position<grids_not_computed_in_worker.end()) {
continue; continue;
} }
if (param_idx==IOUtils::npos) if (param_idx==IOUtils::npos)
throw UnknownValueException("Unknow meteo grid '"+params[ii]+"' selected for gridded output", AT); throw UnknownValueException("Unknow meteo grid '"+params[ii]+"' selected for gridded output", AT);
...@@ -392,7 +392,7 @@ void SnowpackInterfaceWorker::fillGrids(const size_t& ii, const size_t& jj, cons ...@@ -392,7 +392,7 @@ void SnowpackInterfaceWorker::fillGrids(const size_t& ii, const size_t& jj, cons
} }
else else
{ {
std::cout << it->first << std::endl; std::cout << it->first << std::endl;
throw InvalidArgumentException("Invalid parameter requested", AT); throw InvalidArgumentException("Invalid parameter requested", AT);
} }
} }
......
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