Hello,

Let me explain the following calculations ...

Lets consider (Rrs) for Modis/Aqua. Calculations follow

https://oceancolor.gsfc.nasa.gov/atbd/chlor_a/#sec_2 (Algorithm Description)

t1 = 0.25

t2 = 0.35

Reflectances:

R1 = 0.006004000856137 (443)

R2 = 0.004496000859945 (488)

R3 = 0.003296000862974 (547)

R4 = 0.002744000864368 (555)

R5 = 0.000502000870028 (667)

1) Calculate CI according to CI = R4-[R1+(555-443)/(667-443)*(R5-R1)]=-5.0900e-04

2) a0ci = -0.4287 e a1ci = 230.47 => chl1 = chlor_a = 10^(a0ci+a1ci*CI) = 0.2844400 > t1 and therefore the "if" at line 261 it is false (see source code) and "else" at line 263 becomes true and line 264 is performed.

3) Following item 2 of the description on

https://oceancolor.gsfc.nasa.gov/atbd/chlor_a/#sec_2 we must perform the chl_ocx calculations.

4) According Table 1 on that page: Rrs(443>488)/Rrs547 with coefficients a(0,1,2,3,4)=[0.26294; -2.64669; 1.28364; 1.08209; -1.76828] and so R = log10(max([R1,R2]/R3)) = 0.2605. According to the polynomial approximation chl2 = chlor_a = 0.469525.

Now lets go back to the source code. At line 264 we obtain, according the above calculations, chlor_a = chl2 = 0.469525. As this value is > 0.0 the "if" at line 265 becomes true. Therefore, the next line (266) is evaluated.

**However here we have a "problem" (maybe...).**
Note that chl1 = 0.2844400 which is greater then t1 but

**not** greater then t2 and so the "if" at line 266 is false because chl1 is less then t2. So "else" at line 268 is performed and a blend chlorophyll is calculated.

**On the other hand, we have chl2 = 0.469525 which is >= t2.**
I think that we must use chl=0.469525 as the correct value and not a blended value (as the algorithm will calculate and give as the answer)....

(See explanation on

https://oceancolor.gsfc.nasa.gov/atbd/chlor_a/#sec_2 after Table 1

For chlorophyll retrievals below 0.25 mg m-3, the CI algorithm is used.

For chlorophyll retrievals above 0.35 mg m-3, the OCx algorithm is used.

In between these values, the CI and OCx algorithm are blended using a weighted approach where:

)

Sorry if my logic isn't true and in this case why we must use a blended value and not the chl2=chlor_a=0.469525 given by chl_ocx??

Thank you in advance.

I considered lambda=667 on the CI equation because Modis/Aqua do not have 670. But if consider lambda=670 and R5 we get chl1 = 0.27900. Which does not chance the explanation above about source code.

Fabio.