SNOWPACK  20220825.6abccf6
Getting Started

After you installed a binary package or compiled and installed Snowpack, you can run your first simulation. Please make sure you properly set the proper environement variables for your operating system:

  • on osX: set PATH and DYLD_FALLBACK_LIBRARY_PATH
  • on Linux: set PATH and LD_LIBRARY_PATH if you install the package to a non-standard location
  • on Windows: set PATH How to do this (and much more) is explained in the online documentation at https://snowpack.slf.ch/Getting-started.

Running an example simulation

In order to run an example simulation, please follow the steps below:

  1. First, copy the examples as provided with this documentation (the whole doc/examples directory) to a directory where you have write access.
  2. Open a terminal and go to the directory where you copied the simulation you want to run
  3. Select one of the examples and run its start script, for example ./run_res1exp.sh (on Windows, you have to open the script file and copy the last command line it contains into a terminal). You can also manually run Snowpack, by typing something like snowpack -c {ini file with path} -e {simulation end date in ISO format}.
  4. Once the simulation is finished, the results are available in the output directory. This directory must exist before you run the simulation!
  5. The results can be visualized using the sngui tool by opening the .pro file that was generated in output.

Running your own simulation

Once you have been able to run an example simulation, you can try to run your own simulation. This involves the following steps:

  1. First, gather the meteorological data that you need to drive the simulation. Please have a look at Data requirements;
  2. Then, write the data in a format that meteoio can read for Snowpack, for example SMET (see the file format specification included in the meteoio's documentation and follow it);
  3. Once your data is ready, you can configure your simulation, using inishell. Please keep in mind that the default choices in inishell are such that if you don't change them, a simple simulation should work. And do not change parameters in the SnowpackAdvanced section! (this section is reserved for some specific use cases where a deeper control on the operation of the model is required).
  4. Then, run the simulation from a terminal (after going to the directory where your simulation is) with a command line such as snowpack -c {ini file with path} -e {simulation end date in ISO format}.
  5. Once the simulation is finished, the results are available in the output directory. This directory must exist before you run the simulation!
  6. The results can be visualized using the sngui tool by opening the .pro file that was generated in output.

Simulation workflow

When running a simulation, it is important to keep in mind that the model is organized as several modules that interract together. It is possible to configure some parameters for the various modules and to enable/disable modules. Some modules can be used outside of Snowpack (like MeteoIO that is used in various applications or libSnowpack that is used by Alpine3D) .

Simulation workflow

Spatial resampling

Through MeteoIO, it is possible to force Snowpack with data that has not been measured locally. The forcings are then extracted for example from gridded data (such as the outputs of weather forecasting models or reanalysis models) or by spatially interpolating stations' data to the point of interest. For the data extraction or interpolation, please refer to MeteoIO's documentation section "Spatial resampling" (see for example the current stable release documentation).

Spatial resampling

The SLOPE_FROM_SNO configuration key in the [Input] section controls whether slope angle and azimuth are taken from the sno file or from the meteorological forcings (in this case, automatically extracted from either the gridded data or from the DEM used for the spatial interpolations). Please note that this won't change the meteorological forcings (they are always only valid for their associated coordinates on flat field) but will allow Snowpack to reproject the precipitation and radiation fields on the slope (angle and azimuth) of your choice.

When relying on spatially interpolated values, it is often necessary to first run Snowpack at the real forcing locations in order to generate easier to interpolate fields (such as ISWR, ILWR, PSUM) and then run the virtual stations by spatially interpolating the computed variables. In this case, it is recommended to run the first set of simulations with the following set of keys:

[Output]
TS_WRITE = TRUE
TS_FORMAT = SMET
TS_DAYS_BETWEEN = 0.04166667 ;so we get hourly values
OUT_CANOPY = FALSE
OUT_HAZ = FALSE
OUT_SOILEB = FALSE
OUT_HEAT = FALSE
OUT_T = FALSE
OUT_STAB = FALSE
OUT_LW = TRUE
OUT_SW = TRUE
OUT_MASS = TRUE
OUT_METEO = TRUE
AVGSUM_TIME_SERIES = TRUE
CUMSUM_MASS = FALSE
PRECIP_RATES = FALSE

And the second set of simulations (ie the ones relying on spatially interpolated forcings) with this set of keys:

[Input]
METEO = SMET
PSUM_S::MOVE = MS_Snow
PSUM_L::MOVE = MS_Rain
HS::MOVE = HS_meas ;so we can still compare measured vs modelled snow height
TSG::MOVE = T_bottom ;so we can compare the ground temperatures
TSS::MOVE = TSS_meas ;so we can compare the surface temperatures
WFJ2::KEEP = TA TSS TSG RH ISWR ILWR HS VW DW PSUM_S PSUM_L PSUM PSUM_PH ;so we do not keep all kind of unnecessary parameters
PSUM_PH::create = PRECSPLITTING
PSUM_PH::PRECSPLITTING::type = THRESH
PSUM_PH::PRECSPLITTING::snow = 274.35
PSUM::create = PRECSPLITTING
PSUM::PRECSPLITTING::type = THRESH
PSUM::PRECSPLITTING::snow = 274.35
[SNOWPACK]
ENFORCE_MEASURED_SNOW_HEIGHTS = FALSE