Open carlomarin opened 2 years ago
All of these are possible in SMRT, but it is important to understand the electromagnetic problem first, to understand how to do it in SMRT and why it may be simple or complex.
What is very important to remember is that SMRT is (currently and mostly) for two-phase porous media. The medium is made of two materials. This is perfect for dry snow, material1=air, material2=ice. Using the current theories in SMRT with 3 phases (air, ice, water) requires some tricks and it is very important to understand the potential caveats. There are three different cases to consider, in fact there are two cases and the second is split in two subcases. Let's call them 1, 2a and 2b.
you want to model wet snow as air and wetice. Wetice is a conceptual material where ice and water are mixed first, and this mixture is used as material2 in SMRT. By default SMRT use Bohren 83 to calculate the permittivity of a mixture of ice and water (wetice.py) for material2. This is why SMRT can handle wet snow by default. However, if you don't like Bohren 83, you can change how ice and water are mixed with your own function: make_snowpack(thickness, microstructure, ...., ice_permittivity_model=my_ice_permittivity_model) where 'my_ice_permittivity_model' is a python function defined in your code. This function will be be called internally by SMRT instead of the function wetice_permittivity_bohren83 (wetice.py). Have a look at this latter function to understand how to declare your own my_ice_permittivity_model (you should never put your own function in the file wetice.py, it should be in your code, outside SMRT to keep the compatibility, and you can distribute our function separately from SMRT if you want to give others access or contact us to integrate it in SMRT if you think it is of general interest). Note that if you want each layer of the snowpack to have a difference my_ice_permittivity_model, just provide a list of functions instead of just one function (this works for any argument in make_snowpack).
A more complex case is when you want to change the mixing formula that compute the effective permittivity in the EM Model (e.g. in IBA or in DMRT). This mixing formula is used to mix material1 and material2 in order to compute the refraction and the absorption in the medium, and is not to be confused with the first step of mixing ice and water to make material2. In principle, the theories (IBA, DMRT and others) are established for a specific mixing formula, and this formula is an integral part of the theory. Changing it breaks the theory (somehow). For instance IBA uses the PvS mixing formula and using IBA without PvS is not really IBA anymore.
However, there are some reasons why changing it anyway, especially when a precise empirical or semi-empirical three-phase mixing formula is available. This is the case of the "MEMLS" permittivity formula and there are many others from Halliakanen, Ulaby, Colbeck etc... (see snow_mixing_formula.py in SMRT).
There are two-sub cases:
2a- if your three-phase mixing approach consists in two steps, and the second mixing formula is PvS (and only this one), then I recommend to let IBA make the second mixing as usual because IBA is self-consistent with PvS. In this case, you just need to call: make_snowpack(thickness, microstructure, ...., ice_permittivity_model=my_wetice_mixture_permittivity_model) which is technically exactly the same as case 1 above. IBA is used in a standard way. No caveat to expect. In fact your have only changed the mixing of the first step to get the permittivity of material2.
2b- if your three-phase mixing approach uses some empirical or user-defined formulae, and/or if the second mixing is not PvS, then it is a problem. It is a problem because IBA really needs the permittivities of each of the two components to compute scattering (Ks) and IBA also uses PvS to mix these two components to compute the absorption (Ka) and the refraction index (note that this is the case in SMRT and in MEMLS code, but in IBA as defined in 1998, Ka was calculated with a simpler, less accurate approach, you can find it in iba_original.py but it is not recommended to use it). Again: for Ks, IBA needs the permittivities of material1 and material2. This fundamental electromagnetic limitation is not specific to SMRT. But it is annoying in the case of wet snow because in my opinion, it is more important to have a precise absorption (so a precise mixing of air, ice and water) than a precise scattering, because the volume scattering is usually negligible compared to the very strong absorption. For this reason, it is interesting to break the consistency. See Picard et al. 2022 TC on "liquid water sensitivity" where I make an extensive use of other effective permittivity formulae. So, if you understand the problem and want to take the risk, SMRT offers a quite elegant way to do it. The solution I implemented is to use the "derived_IBA" function defined in iba.py. This function returns a new IBA class where the absorption is calculated with the mixing formula given by the user. The name “derived_IBA” hopefully suggests that this is not a standard IBA anymore, and that this may break the consistency of the calculation because Ka and Ks.
To sum up:
Case 1 and 2a: sp = make_snowpack(thickness, microstructure, ...., ice_permittivity_model=my_wetice_mixture_permittivity_model) ← this function mixes 2 materials. m = make_model("iba", “dort”)
Case 2b: sp = make_snowpack(thickness, microstructure, ....) m = make_model(derived_IBA(my_wetsnow_permittivity), “dort”) ← this function mixes 3 materials or more.
Thanks Ghislain for publishing this very detailed answer! This is a piece of information that has a great value for the entire community!
In make_snowpack (and make_snow_layer) it is possible to define non standard permittivity formula for ice/wetice and air. How a non-default formula for wetsnow can be used in IBA e.g., the formulation used in MEMLS or Ulaby2014?
thanks, carlo