About biosnicar
What is biosnicar
?
biosnicar
is a set of Python scripts that predict the spectral albedo of snow and glacier ice between 200nm to 5000nm given information about the illumination conditions, ice structure and the type and concentration of light absorbing particulates (LAPs) externally mixed with the snow/ice. The jumping off point for this model was legacy FORTRAN and Matlab code of the SNICAR model developed by Flanner et al. (2007), which solves the radiative transfer equations simplified into a two-stream scheme after Toon et al. 1989. biosnicar couples SNICAR to a bio-optical model that allows for calculation of optical properties of snow and glacier algae to load into the model as LAPs (Cook et al. 2017, 2020), which were later measured empirically and integrated in the model (Chevrollier et al. 2023). This functionality, along with the vectorized AD solver formulation, the possibility to add liquid water into snow and ice matrices, accessible user interface and applicability to a very wide range of surface conditions are the unique selling points of this implementation.
biosnicar
is available as Python code, or it can be run in a web browser using our app (opens in a new tab). We have designed biosnicar
to be as flexible, offering multiple options for the radiative transfer solver used, a library of ice refractive indices, illumination profiles and impurity types.
We have also made the code as modular and composable as possible so that advanced users can be creative in building biosnicar
applications!
This code is also very actively maintained and we welcome contributions from the community to help make biosnicar
a useful tool for a diverse range of cryosphere scientists.
Theoretical Background
Snow and Ice
The snow and ice single scattering properties (SSPs) are generated from the refractive index of ice from Warren 1984, Warren 2008 or Picard 2016 and all parametrisation is done in the driver of the model. Snow and ice are represented either as a collection of grains, or as a continuous layer with embedded air bubbles. The second option requires to use the AD solver with fresnel layers (layer_type
= 1 in the config file) or without fresnel layers (layer_type
= 3 in the config file). The embedded bubbles are represented as spheres of air surrounded by ice (Whicker et al. 2022). There is also an option to add liquid water in the ice matrix, either as matrix ice or as water pores, using the lwc
and lwc_pct_bbl
parameters in the config file (Lou-Anne Chevrollier, 2024). For the first option, grains can be represented as spheres, spheroids, hexagonal plates or koch snowflakes using calculations adapted from Mie theory (layer_type
= 0 and grain_shp
= 0, 1, 2, 3 in the config file; He et al. 2017, 2018), or hexagonal prisms using geometric optics calculations (layer_type
= 0 and grain_shp
= 4 in the model driver; van Diedenhoven 2014, Cook et al. 2020). The grain option works with both solvers as long as there is no fresnel layer included when using the AD solver. For spherical grains, there is also an option to add liquid water coating around the grains using two-layer coated sphere Mie calculations (water_coating
parameter; Niklas Bohn, 01/05/2020) or interspersed spheres of solid ice and liquid water (layer_type
= 3 and lwc
> 0; Lou-Anne Chevrollier, 2024). The coated grains liquid water option had previously been included in the Matlab version of biosnicar and was deprecated for the Python translation in favour of increasing ice grain radii to simulate interstitial melt water; however, it was subsequently decided that giving the choice of method for incorporating liquid water was a better approach. The impact of colored dissolved organic matter (CDOM) on snow/ice optical properties can be incorporated by toggling on the cdom_layer parameter in the model which essentially replaces the ice absorption by the melted ice with cdom absorption - note that this is only an experimental features and CDOM optical properties are likely to vary considerably. The current parametrisation is based on CDOM absorption measurements carried on samples from south-eastern greenlandic glaciers (Halbach et al. 2022).
NOTE: For the optical properties of ice and snow, this code utilizes the miepython solver (Scott Prahl, https://github.com/scottprahl/miepython/tree/main (opens in a new tab)) by default instead of the Bohren and Huffman 1983 solver as per the original Matlab version, hence slight differences exist in the computed albedo. The rationale for using the miepython solver was mostly due to the time efficiency of the computations, so that users can compute new grain/bubble SSPs for a given effective radius if it is not already available in the model (ssps_spheres_generator.py
). It is however possible to fall back to the BH83 solver by changing the paths to the optical property database (see the inputs documentation).
Light absorbing particles
biosnicar
includes a fairly large library of light absorbing particles that can be incorporated easily into albedo simulations. These built-in impurities include a wide range of biotic and abotic particles whose optical properties were empirically measured and published in the scientific literature.
The biosnicar
repository also includes a separate module for calculating the relevant optical properties for any particle, so that you can create your own particle types.
The impurity library that comes with biosnicar
prioritizes those with empirically-measured optical properties, or impurities whose optical properties are available in the science literature.
However, we also provide a bio-optical
module that includes a model to calculate the single-scattering optical properties of pigmented algae, given user defined shape and pigment concentrations.
Two options for impurity optical property calculations are available: spherical cells as per ice grains using Mie theory, typically used for snow algae, and circular based cylinders using geometric optics typically used for glacier algae that are long chains of cells approximated as cylinders after Lee and Pilon, 2013.
The user needs to feed the bio-optical model with the refractive index and absorption cross section of the cell, along with algae dry and wet density and cell size.
The absorption cross section can be calculated in the model from intracellular pigment concentrations (Cook et al. 2017; pigment absorption coefficients from Bidigare 1990, Halbach 2022, Clementson and Wojtasiewicz 2019)) or loaded directly if they have been measured empirically for real cells.
The model saves the relevant data in file that can be loaded into biosnicar
.
As well as cells, colored dissolved organic matter (CDOM) on snow/ice optical properties can be incorporated in the model too, using absorption data from Halbach et al (2022).
biosnicar
history
biosnicar
began as a straightforward translation of the original SNICAR code (Flanner et al. 2009) into Python.
The motivation was to ensure access to the SNICAR model code in an open source language that didn't require a proprietary license, and also add some new impurity types.
In the first version of biosnicar
, the impurity optical properties were theoretical, based upon a pigment mixing model and values for the mass absorption coefficient of each pigment from the marine phytoplankton literature.
The snow and ice optical properties were based on Mie theory assuming all grains to be relatively small and spherical. The next iteration of the model added support for large grains whose optical properties were calculated using geometric optics instead of Mie theory.
The rationale was that this would be better for simulating the large blocky pieces of ice observed in the porous "weathering crust" on the Greenland Ice Sheet and elsewhere. However, it was later discovered that the most accurate way to simulate the weathered crust was by representing them as solid ice slabs and using an adding-doubling solver (After Whicker et al 2022).
This was added as a third option to the model in 2022. Soon after, empirical values for snow and glacier algae optical properties were measured by Chevrollier et al (2022) and incorporated into the mdoel in place of the original "theoretical" values.
biosnicar
v2 finally shipped after a complete refactor of the code base, deprecating the old model structure inherited from the Matlab code and rewriting it in a more modular style that made the model more flexible and easier to use.
To make biosnicar
accessible to non-coders, a web application was shipped in 2022 that allows users to generate albedo spectra in the browser.
Additional features were then included in early 2024, in particular the incorporation of liquid water in the ice and snow matrix, which is typically present in melting snow and ice environments.
What is biosnicar
used for?
biosnicar
is primarily used to predict the spectral and broadband albedo of snow and ice surfaces with specific configurations of ice and particle optical properties and spatial organization and illumination conditions.
Researchers interested in the effect of certain particles on snow melt could, for example, simulate deposition events in biosnicar
and determine the sensitivity of snow and ice to those particles.
The original use-case for biosnicar
was to do this kind of simulation to determine the impact of snow and glacier algae on melt rates.
However, biosnicar
has also been used in other ways. Running biosnicar
in the default way gives a single albedo spectrum for a given input configuration, but biosnicar
is also highly parallelizable, making it possible to quickly do thousands of simulations.
This is useful for remote sensing applications where large numbers of biosnicar
spectra can be organized into a look-up table for classifying ice surfaces from satellite data, or quantifying particles on the surface.
The model can also be inverted, so that instead of answering the question "what is the albedo with these input values?" you can ask "what input values lead to this albedo?" This is a powerful way to explain observations made in the field or by remote sensing.
It is also possible to output data other than albedo from the model. For example, biosnicar
can be used to model actinic fluxes and absorbed energy with depth in a snowpack or ice column. There are many parameters that can be output from the model that users can explore.
The user guides
directory shows how biosnicar
can be used in these non-standard ways. There are many other potential uses for the biosnicar
code base, we would love to see more creative applications!