I am trying extract to a single variable kd_490 from a NetCDF file (over thredds) using NCO.
My code is below:
ncks -v kd_490 -d lat,40.0,70.0 -d lon,-20.0,15.0 https://rsg.pml.ac.uk/thredds/dodsC/cci/v4.2-release/geographic/daily/kd/1998/ESACCI-OC-L3S-K_490-MERGED-1D_DAILY_4km_GEO_PML_KD490_Lee-19980102-fv4.2.nc out.nc
However, along with kd_490 it also extracts kd_490_bias and kd_490_rmsd. I know that ncks extracts "associated" variables. See here. However, I am not clear on why NCO is identifying these as "associated" variable.
I cannot figure out a way to only select the variable kd_490. Adding "-C" to the code results in the grid being wrong. Does anyone know how?
Note: CDO can solve this problem. However, CDO is less efficient at extracting the spatial subset in the code, so NCO is more appropriate.
NCO identifies
kd_490_bias
andkd_490_rmsd
as associated variables because of theancillary_variables
attribute inkd_490
:as documented here. To extract
kd_490
without the ancillary variables, but with the grid variables (which are other "associated" variables), this works for me: