Inner computation of longwaves
Mathias had made some recent update of the LW computation in meteoio (see meteoio@b65cc357).
I recently was surprised to realize that snowpack runs smoothly when no LW are provided. Indeed, in Laws_cn.cc:1591:
/**
* @brief Compute the air emissivity
* It relies on mio::ILWR_parametrized to get a parametrized ILWR if no measured ILWR is available.
* This in turn relies either on Brutsaert (clear sky) or Omstedt (cloudiness) or Crawford(cloudiness from ISWR).
* The air temperature and relative humidity should be available for meanigful results.
* In any case, the returned air emissivity will be between min_air_emissivity and 1, min_air_emissivity depending
* on the variant.
* @param md meteorological conditions
* @param variant variant to use for the minimum allowed air emissivity
* @note observed minimum air emissivities:
* - default: 0.55 (from 1993 data at Weissfluhjoch)
* - Antarctica: 0.31 (from 2006/2007 data of Dome C)
* @return air emissivity in range [MIN_AIR_EMISSIVITY,1.] (1)
*/
double SnLaws::AirEmissivity(mio::MeteoData& md, const std::string& variant)
{
const double ILWR = (md(MeteoData::ILWR)>1.)? md(MeteoData::ILWR) : IOUtils::nodata;
if (ILWR!=IOUtils::nodata)
return AirEmissivity(ILWR, md(MeteoData::TA), variant);
else {
const double cloudiness = (md(MeteoData::ILWR)>0. && md(MeteoData::ILWR)<=1.)? md(MeteoData::ILWR) : IOUtils::nodata;
const double ilwr_p = Atmosphere::ILWR_parametrized(md.meta.position.getLat(), md.meta.position.getLon(), md.meta.position.getAltitude(),
md.date.getJulian(), md.date.getTimeZone(),
md(MeteoData::RH), md(MeteoData::TA), md(MeteoData::ISWR), cloudiness);
return AirEmissivity(ilwr_p, md(MeteoData::TA), variant);
}
}
Atmosphere::ILWR_parametrized ia a MIO function whihc is never called in MIO, meaning that it is not used in MIO to generate ILWR. Indeed this functions ignores any parameters provided for LW generation in the ini file.
-
I think this behaviour in Swnopack is not wanted and dangerous. I would recommend to remove this automatic generation of ILWR in Snowpack and force the user to properly parameterize a LW generator through MIO, this is more transparent and ensure to use the latest and updated version of the generator. We can provide an error message indicating to the user how to generate LW if missing. In the current implementation, snowpack will switch between generators depending on the available data at each timestep, and the user has no idea about it
-
I would remove Atmosphere::ILWR_parametrized from MIO since it seems to be used only for this call in Snowpack
-
On the same topic, Varun realized that emissivity is capped to 1 (see SnLaws::AirEmissivity), which physically makes sense, but when we provide measured values that we "trust" we do not want snowpack to play with it. also, we use TA, which is a rough approximation to compute LW, so maybe those checks should be removed. I never understood anyway why we go from LW to ea to go back to LW. (In Snowpack::neumannBoundaryConditions we go back to LW here:
Fe[1] += delta * pow( Mdata.ea, 0.25 ) * T_air;
). So can't we simply always work with LW? We also save some power 0.25 operations, which are really expensive.