GEUS-SICE / pySICE

Python and Fortran scripts behind the SICE toolchain for albedo retrieval.
GNU General Public License v2.0
5 stars 1 forks source link

Check with Alex #32

Open BaptisteVandecrux opened 2 years ago

BaptisteVandecrux commented 2 years ago

https://github.com/GEUS-SICE/pySICE/blob/53488af5dd6d6ccce1790fc8ea7055230c491a0f/fortran/version%206.1%202022/s.f#L569

Seems quite drastic

BaptisteVandecrux commented 2 years ago

https://github.com/GEUS-SICE/pySICE/blob/53488af5dd6d6ccce1790fc8ea7055230c491a0f/fortran/version%206.1%202022/s.f#L644-L647

Seems useless because we enter this part of the code only when powe is between 0.9 and 1.2

BaptisteVandecrux commented 2 years ago

fox11 function not used

BaptisteVandecrux commented 2 years ago

Aren't the following line ineffective: https://github.com/GEUS-SICE/pySICE/blob/53488af5dd6d6ccce1790fc8ea7055230c491a0f/fortran/version%206.1%202022/s.f#L459-L474

Because we have: https://github.com/GEUS-SICE/pySICE/blob/53488af5dd6d6ccce1790fc8ea7055230c491a0f/fortran/version%206.1%202022/s.f#L438 looping through all wavelength just above

BaptisteVandecrux commented 2 years ago

when removing this line: https://github.com/GEUS-SICE/pySICE/blob/a6b016def648682d340db9835d9ae2cfdb85bcb6/fortran/version%206.1%202022/s.f#L1155

the output is very different. That is strange because wav is not used in the whole code and alam is not used in func1

BaptisteVandecrux commented 2 years ago

https://github.com/GEUS-SICE/pySICE/blob/a6b016def648682d340db9835d9ae2cfdb85bcb6/fortran/version%206.1%202022/s.f#L331

r0 should be calculated once for each pixel and then its value could be directly used by all the other steps for that pixel. However, when trying to rename rv into r0 and only use r0 then the result is different.

BaptisteVandecrux commented 2 years ago

https://github.com/GEUS-SICE/pySICE/blob/a6b016def648682d340db9835d9ae2cfdb85bcb6/fortran/version%206.1%202022/s.f#L852-L876

Here all these values are calculated again here but they are not used to calculate tozon, TOC, TOX, TVODA further down. Yet when removed, the algorithm produces different output.

BaptisteVandecrux commented 2 years ago

https://github.com/GEUS-SICE/pySICE/blob/a6b016def648682d340db9835d9ae2cfdb85bcb6/fortran/version%206.1%202022/s.f#L814

alam should be replaced by 0.62

BaptisteVandecrux commented 2 years ago

https://github.com/GEUS-SICE/pySICE/blob/a6b016def648682d340db9835d9ae2cfdb85bcb6/fortran/version%206.1%202022/s.f#L743-L748

here ctoa is used to find the fractional pixels, but ctoa was corrected (=brightened up) using that same snow fraction earlier in the code. Additionally, thv0 is a threshold in surface spherical albedo, why is it not compared to the TOA reflectance?

BaptisteVandecrux commented 2 years ago

https://github.com/GEUS-SICE/pySICE/blob/a6b016def648682d340db9835d9ae2cfdb85bcb6/fortran/version%206.1%202022/s.f#L1185

amf not declared! solves it all!

BaptisteVandecrux commented 2 years ago

For the reference here is some info from Alex about the difference between solved spectral albedo:

https://github.com/GEUS-SICE/pySICE/blob/17ea753053add33b1bf124e9d4403311d008dd06/sice.py#L366-L438

This part solves the following equation: image Where Rc is the TOA reflectance measured by OLCI, Ra, Ta, ra are the reflecance, transmittance and spherical albedo of the atmosphere, R0 is the reflectance of the non-absorbing underlying surface reflectance, and rs is the surface spherical albedo.

and the directly calculated spectral albedo: https://github.com/GEUS-SICE/pySICE/blob/17ea753053add33b1bf124e9d4403311d008dd06/sice.py#L522-L533

It is a new formulation presented in https://doi.org/10.3389/fenvs.2021.644551 and reads as: image image

Here is the (rephrased) comment from Alex:

The solved spectral albedo is calculated directly from reflectance avoiding any assumptions on impurities, which can be wrong. I trust the solved spectral albedo more...as compared to the direct calculation of spectral albedo. As a consequence solved spectral albedo is being used for the broadband albedo calculation.

The next point- why I provide directly calculated spectral albedo as spectral output? This is because I can make it for each OLCI wavelength. This is not possible with the solved albedo.

of course we can give 2 possibilities for the users - so they have 2 versions of spectral labedo (for selected wavelengths or for all wavelengths ( but with assumption on the type of impurities))

However, BBA must be always calculated from the (solved) reflectance-spherical albedo chain (not involving impurity assumption).