% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils-diagnostic-tests.R
\name{test_cec_per_clay}
\alias{test_cec_per_clay}
\title{Test CEC (1M NH4OAc, pH 7) per kg clay <= threshold}
\usage{
test_cec_per_clay(h, max_cmol_per_kg_clay = 16, candidate_layers = NULL)
}
\arguments{
\item{h}{Numeric threshold or option (see Details).}

\item{max_cmol_per_kg_clay}{Numeric threshold or option (see Details).}

\item{candidate_layers}{Numeric threshold or option (see Details).}
}
\description{
Default threshold is 16 cmol_c/kg clay (WRB 2022 ferralic horizon).
}
\section{v0.9.69 ECEC fallback (opt-in)}{

Brazilian / SOTERLAC / BDsolos profiles often record the exchange
complex as separate Ca, Mg, K, Na, Al cmol values without an
explicit "Valor T" CEC column, so \code{cec_cmol} is \code{NA} for
the entire profile. With
\code{options(soilKey.ferralic_ecec_fallback = TRUE)} the test
falls back to the ECEC sum
(\code{ca_cmol + mg_cmol + k_cmol + na_cmol + al_cmol}) on layers
where \code{cec_cmol} is missing but the components are present.
Default is \code{FALSE} (canonical WRB behaviour preserved).

Note: ECEC is typically smaller than CEC at acidic pH because it
omits H+; using ECEC against the same threshold is therefore
conservative (MORE permissive) -- it should not produce false
positives, only recover Latossolos that lacked Valor T.
}

\section{v0.9.86 engine="aqp" auto-enables the ECEC fallback}{

\code{soilKey.diagnostic_engine = "aqp"} now auto-enables the
v0.9.69 ECEC fallback (the user can still suppress it explicitly
by setting \code{soilKey.ferralic_ecec_fallback = FALSE}). The
rationale: the aqp engine is the "data-quality-aware" mode,
designed for field-described datasets like BDsolos / Redape
where Valor T is rarely recorded. Bundling these two opt-ins
lifts BDsolos RJ Latossolo recall from 14.9\\% (canonical) to
28.1\\% with no further configuration.
}

