WSL/SLF GitLab Repository
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
snow-models
Alpine3D
Commits
2734a44e
Commit
2734a44e
authored
May 17, 2021
by
Adrien Michel
Browse files
Merge branch 'master' of
https://gitlabext.wsl.ch/snow-models/alpine3d
parents
b35fff21
89a9beb1
Changes
2
Hide whitespace changes
Inline
Side-by-side
alpine3d/SnowpackInterface.cc
View file @
2734a44e
...
...
@@ -134,20 +134,20 @@ SnowpackInterface::SnowpackInterface(const mio::Config& io_cfg, const size_t& nb
if
(
mpicontrol
.
master
())
{
bool
write_dem_details
=
false
;
io_cfg
.
getValue
(
"WRITE_DEM_DETAILS"
,
"output"
,
write_dem_details
,
IOUtils
::
nothrow
);
if
(
write_dem_details
){
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
.
azi
),
"DEM_AZI"
);
io
.
write2DGrid
(
mio
::
Grid2DObject
(
dem
.
cellsize
,
dem
.
llcorner
,
dem
.
curvature
),
"DEM_CURVATURE"
);
}
bool
write_dem_details
=
false
;
io_cfg
.
getValue
(
"WRITE_DEM_DETAILS"
,
"output"
,
write_dem_details
,
IOUtils
::
nothrow
);
if
(
write_dem_details
){
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
.
azi
),
"DEM_AZI"
);
io
.
write2DGrid
(
mio
::
Grid2DObject
(
dem
.
cellsize
,
dem
.
llcorner
,
dem
.
curvature
),
"DEM_CURVATURE"
);
}
std
::
cout
<<
"[i] SnowpackInterface initializing a total of "
<<
mpicontrol
.
size
();
if
(
mpicontrol
.
size
()
>
1
)
std
::
cout
<<
" processes with "
<<
nbworkers
;
else
std
::
cout
<<
" process with "
<<
nbworkers
;
if
(
nbworkers
>
1
)
std
::
cout
<<
" workers"
;
else
std
::
cout
<<
" worker"
;
else
std
::
cout
<<
" worker"
;
std
::
cout
<<
" each using Snowpack "
<<
snowpack
::
getLibVersion
()
<<
"
\n
"
;
}
...
...
@@ -760,12 +760,12 @@ mio::Grid2DObject SnowpackInterface::getGrid(const SnGrids::Parameters& param) c
return
shortwave
;
case
SnGrids
::
ILWR
:
return
longwave
;
case
SnGrids
::
ISWR_TERRAIN
:
return
terrain_shortwave
;
case
SnGrids
::
ILWR_TERRAIN
:
return
terrain_longwave
;
case
SnGrids
::
ISWR_DIFF
:
return
diffuse
;
case
SnGrids
::
ISWR_TERRAIN
:
return
terrain_shortwave
;
case
SnGrids
::
ILWR_TERRAIN
:
return
terrain_longwave
;
case
SnGrids
::
ISWR_DIFF
:
return
diffuse
;
case
SnGrids
::
ISWR_DIR
:
return
shortwave
-
diffuse
-
terrain_shortwave
;
default:
;
//so compilers do not complain about missing conditions
...
...
alpine3d/SnowpackInterfaceWorker.cc
View file @
2734a44e
...
...
@@ -220,12 +220,12 @@ void SnowpackInterfaceWorker::initGrids(std::vector<std::string>& params,
IOUtils
::
toUpper
(
params
[
ii
]);
//make sure all parameters are upper case
const
size_t
param_idx
=
SnGrids
::
getParameterIndex
(
params
[
ii
]
);
const
auto
position
=
std
::
find
(
grids_not_computed_in_worker
.
begin
(),
grids_not_computed_in_worker
.
end
(),
params
[
ii
]);
if
(
position
<
grids_not_computed_in_worker
.
end
())
{
continue
;
}
const
auto
position
=
std
::
find
(
grids_not_computed_in_worker
.
begin
(),
grids_not_computed_in_worker
.
end
(),
params
[
ii
]);
if
(
position
<
grids_not_computed_in_worker
.
end
())
{
continue
;
}
if
(
param_idx
==
IOUtils
::
npos
)
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
}
else
{
std
::
cout
<<
it
->
first
<<
std
::
endl
;
std
::
cout
<<
it
->
first
<<
std
::
endl
;
throw
InvalidArgumentException
(
"Invalid parameter requested"
,
AT
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment