Location: src/cosp_stats.F90, COSP_DIAG_WARMRAIN (master 5eb05e5), CFODD histogram accumulation:
!! # of samples for CFODD (joint 2d-histogram dBZe vs ICOD)
call hist2d( dbze(i,1:Ncolumns,1:Nlevels), icod(i,1:Ncolumns,1:Nlevels), &
& Ncolumns*Nlevels, ...
The histogram runs over all (subcolumn, level) cells of a screened-in gridpoint, but icod is only assigned along subcolumns that passed the SLWC checks (oslwc = .true. path); everywhere else it keeps its 0 initialization. Since the first ICOD bin spans [0, 2), any cell with dbze >= CFODD_DBZE_MIN (−30 dBZe) belonging to a subcolumn that failed the SLWC screening — e.g. a cold-topped or convective subcolumn of a gridpoint whose MODIS retrieval is liquid — is still counted, landing in ICOD bin 0 with its real reflectivity. These cells are not part of the single-layer-warm-cloud population the CFODD is defined on (Michibata et al. 2019), so the lowest-ICOD column of the histogram is contaminated wherever mixed scenes occur.
Suggested fix: mask dbze to a fill value outside the [kcbtm..kctop] range of SLWC-passing subcolumns before calling hist2d (or histogram only the passing subcolumns).
Found while building a JAX translation of COSP (jax-cosp); its port counts only in-cloud cells of SLWC-passing subcolumns.
Location:
src/cosp_stats.F90,COSP_DIAG_WARMRAIN(master5eb05e5), CFODD histogram accumulation:The histogram runs over all (subcolumn, level) cells of a screened-in gridpoint, but
icodis only assigned along subcolumns that passed the SLWC checks (oslwc = .true.path); everywhere else it keeps its 0 initialization. Since the first ICOD bin spans [0, 2), any cell withdbze >= CFODD_DBZE_MIN(−30 dBZe) belonging to a subcolumn that failed the SLWC screening — e.g. a cold-topped or convective subcolumn of a gridpoint whose MODIS retrieval is liquid — is still counted, landing in ICOD bin 0 with its real reflectivity. These cells are not part of the single-layer-warm-cloud population the CFODD is defined on (Michibata et al. 2019), so the lowest-ICOD column of the histogram is contaminated wherever mixed scenes occur.Suggested fix: mask
dbzeto a fill value outside the [kcbtm..kctop] range of SLWC-passing subcolumns before callinghist2d(or histogram only the passing subcolumns).Found while building a JAX translation of COSP (jax-cosp); its port counts only in-cloud cells of SLWC-passing subcolumns.