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

Typo in new RINF function for partially snow covered pixels #22

Closed BaptisteVandecrux closed 2 years ago

BaptisteVandecrux commented 2 years ago
c******************NOT USED for 100% snow cover:**************                    
c    the case of 100% snow cover (R(400nm)>0.65):                    
                    if (bt.ge.THV0) go to 5021
                    NCLASS=3
c     the case of not 100% snow cover:              
c     scaling factor for patchy snow at 400nm                     
                    psi=RINFF(cos_sza,cos_vza,THETA)
c     factor=snow fraction ( SMALLER THAN 1.0):       
                           factor=bt/psi
c          snow TOA corrected for snow fraction                            
        do 2011 MKL=1,21
        ctoa(MKL)=ctoa(MKL)/factor
2011    continue

       FUNCTION RINFF(cos_sza,cos_vza,THETA)
       a=1.247
       b=1.186
       c=5.157
       p=11.1*exp(-0.087*THET)+1.1*exp(-0.014*THETA)
       p=0.0
       rinff=( a+b*(cos_sza+cos_vza)+c*cos_sza*cos_vza+p)/4./ (cos_sza+cos_vza)
       return
       end

Rinff is defined as a function of THETA, but in "p" there is "THET" which is the equivalent of THETA but in radians. I find it surprising that the same variable appears both in degrees and in radians in the same line.

BaptisteVandecrux commented 2 years ago

Just saw that p is reinitialised to 0 just after.

Then rinff does not depend on theta?

BaptisteVandecrux commented 2 years ago

Confirmed with Alex, should be:

       p=11.1*exp(-0.087*THETA)+1.1*exp(-0.014*THETA)