SNOWPACK  SNOWPACK-3.6.0
Snowpack Class Reference

#include <Snowpack.h>

Public Types

enum  BoundaryCondition { NEUMANN_BC , DIRICHLET_BC }
 Specifies what kind of boundary condition is to be implemented at the top surface. Either use surface fluxes (NEUMANN_BC) or use a prescribed surface temperature (DIRICHLET_BC) More...
 

Public Member Functions

 Snowpack (const SnowpackConfig &i_cfg)
 
void runSnowpackModel (CurrentMeteo Mdata, SnowStation &Xdata, double &cumu_precip, BoundCond &Bdata, SurfaceFluxes &Sdata)
 The near future (s. below) has arrived on Wednesday Feb. 6, when it was finally snowing in Davos and Sergey, Michael and Perry were working furiously on SNOWPACK again. Michael prepared the coupling of the model to the energy balance model of Olivia and his own snow drift model. He found it therefore necessary to move the time loop into the Main.c frame. He also cleaned the data structure handling, i.e. made sure that all variables are handed to the subroutines and that there is no longer a global referencing. In the meantime, Perry and Sergey prepared the introduction of a vapor transport equation. While Sergey was sad that his family had to go back, Perry was exchanging a lot of wet kisses with his new women probably causing some of his confusion about vapor and heat transport. Driving routine for the 1d-snowpack model. The main program will probably be replaced in future – or, at least modified. For now, it is responsible for several tasks: More...
 
void snowPreparation (const mio::Date &currentDate, SnowStation &Xdata) const
 Perform snow preparation (grooming, etc) on a given snowpack. More...
 
void setUseSoilLayers (const bool &value)
 
double getSnDt () const
 
void setSnDt (const double &snDt)
 
double getParameterizedAlbedo (const SnowStation &Xdata, const CurrentMeteo &Mdata) const
 
double getModelAlbedo (const SnowStation &Xdata, CurrentMeteo &Mdata) const
 

Static Public Attributes

static const double min_ice_content = SnLaws::min_hn_density / Constants::density_ice
 Min volumetric ice content allowed. More...
 

Protected Member Functions

bool compTemperatureProfile (const CurrentMeteo &Mdata, SnowStation &Xdata, BoundCond &Bdata, const bool &ThrowAtNoConvergence)
 Computes the snow temperatures which are given by the following formula:
. More...
 

Protected Attributes

BoundaryCondition surfaceCode
 

Member Enumeration Documentation

◆ BoundaryCondition

Specifies what kind of boundary condition is to be implemented at the top surface. Either use surface fluxes (NEUMANN_BC) or use a prescribed surface temperature (DIRICHLET_BC)

Enumerator
NEUMANN_BC 
DIRICHLET_BC 

Constructor & Destructor Documentation

◆ Snowpack()

Snowpack::Snowpack ( const SnowpackConfig i_cfg)

Member Function Documentation

◆ compTemperatureProfile()

bool Snowpack::compTemperatureProfile ( const CurrentMeteo Mdata,
SnowStation Xdata,
BoundCond Bdata,
const bool &  ThrowAtNoConvergence 
)
protected

Computes the snow temperatures which are given by the following formula:
.

dT d^2T rho*c(T)*-— - k(T)*---— = Q dt dz^2
with initial and Dirichlet and/or Neumann boundary conditions.

T(z,t) = temperature (K); rho = snow density (kg m-3); c = specific heat capacity (J K-1 kg-1); k = heat conductivity (W K-1 m-1); t = time (s);
Note: The equations are solved with a fully implicit time-integration scheme and the system of finite element matrices are solved using a sparse matrix solver.

Parameters
XdataSnow profile data
[in]MdataMeteorological forcing
BdataBoundary conditions
[in]ThrowAtNoConvergenceIf true, throw exception when temperature equation does not converge; if false, function will return false after non convergence and true otherwise.
Returns
true when temperature equation converged, false if it did not.

◆ getModelAlbedo()

double Snowpack::getModelAlbedo ( const SnowStation Xdata,
CurrentMeteo Mdata 
) const

◆ getParameterizedAlbedo()

double Snowpack::getParameterizedAlbedo ( const SnowStation Xdata,
const CurrentMeteo Mdata 
) const

◆ getSnDt()

double Snowpack::getSnDt ( ) const
inline

◆ runSnowpackModel()

void Snowpack::runSnowpackModel ( CurrentMeteo  Mdata,
SnowStation Xdata,
double &  cumu_precip,
BoundCond Bdata,
SurfaceFluxes Sdata 
)

The near future (s. below) has arrived on Wednesday Feb. 6, when it was finally snowing in Davos and Sergey, Michael and Perry were working furiously on SNOWPACK again. Michael prepared the coupling of the model to the energy balance model of Olivia and his own snow drift model. He found it therefore necessary to move the time loop into the Main.c frame. He also cleaned the data structure handling, i.e. made sure that all variables are handed to the subroutines and that there is no longer a global referencing. In the meantime, Perry and Sergey prepared the introduction of a vapor transport equation. While Sergey was sad that his family had to go back, Perry was exchanging a lot of wet kisses with his new women probably causing some of his confusion about vapor and heat transport. Driving routine for the 1d-snowpack model. The main program will probably be replaced in future – or, at least modified. For now, it is responsible for several tasks:

  1. In the next step the program enters the time-integration, or, time-stepping loop. Moreover, we find the solution at TimeN = Time0 + sn_dt. For now, we will assume that sn_dt = 15min and Time0 = 0.0. These restrictions can be later relaxed. The program must then "check" three modules before finding the temperature distribution and creep deformations, these are:
    1. Determine the METEO parameters at time TimeN. (The METEO parameters include air temperature, relative humidity, short wave radiation, incoming longwave radiation, etc. as well as the ground temperature) >>>>>> METEO MODULE <<<<<<< Change: ML, 06.02.02: Mdata needs to be handed to the function
    2. Determine if a SNOWFALL event as occcured. (This implies that the dynamically allocated data structures must be reallocated and the new material defined. The mesh connectivies (sn_NewMesh=TRUE) must be rebuilt for the numerical solution and the energy exchanges at the top surface initialized.) >>>>>> SNOWFALL MODULE <<<<<<<
    3. Determine if SNOWDRIFT is occuring. Note that SNOWFALL distributes mass equally at ALL EXPOSITIONS. SNOWDRIFT can occur in conjunction WITH SNOWFALL or WITHOUT SNOWFALL. Mass is redistributed between the expositions. (Again, the internal data structures must be reinitialized.) >>>>>> SNOWDRIFT MODULE <<<<<<<
  2. The phase change module can generate water; this water is moved downwards by the WATER TRANSPORT module. At present, a simple, mass conserving scheme is employed to move the water; when the water content is greater than the residual water content then the excess water is moved to the next element. If the element reaches the bottom of the snowpack water is removed – this is called MELTWATER RUNOFF. Also, elements which do not contain any ice are removed from the finite element mesh.
  3. In the next step the TEMPERATURE distribution within the snowpack at each exposition is found. If SNOWFALL and SNOWDRIFT has occured then the finite element matrices must be rebuilt. >>>>> TEMPERATURE MODULE <<<<<<<<
  4. If the computed temperatures are above zero degrees then PHASECHANGES are occuring. This means that the volumetric contents of the elements must be updated. >>>>>> PHASE CHANGE MODULE <<<<<
  5. In the next step the CREEPING deformations and 1d state of stress within the snowpack at each exposition are found. If SNOWFALL and SNOWDRIFT has occured then the finite element matrices (connectivities) must be rebuilt. >>>>CREEP MODULE<<<<<
    Parameters
    MdataThe Meteorological forcing is now passed by copy so changes won't propagate to the caller
    Xdata
    cumu_precipVariable to store amount of precipitation (kg m-2)
    Bdata
    Sdata

◆ setSnDt()

void Snowpack::setSnDt ( const double &  snDt)
inline

◆ setUseSoilLayers()

void Snowpack::setUseSoilLayers ( const bool &  value)

◆ snowPreparation()

void Snowpack::snowPreparation ( const mio::Date &  currentDate,
SnowStation Xdata 
) const

Perform snow preparation (grooming, etc) on a given snowpack.

Parameters
currentDatethe current date, to determine if grooming should be performed
Xdatasnowpack to work on

Member Data Documentation

◆ min_ice_content

const double Snowpack::min_ice_content = SnLaws::min_hn_density / Constants::density_ice
static

Min volumetric ice content allowed.

◆ surfaceCode

BoundaryCondition Snowpack::surfaceCode
protected

The documentation for this class was generated from the following files: