I have a netcdf file called data.nc
and a masking file called mask.nc
. The data.nc
file has a 3D variable A
with dimensions over (time,long,lat)
, and 4D variable B
with dimensions over (time,depth,long,lat)
.
The mask.nc
file has two masking variables mask_3d
(time,long,lat)
and mask_4d
(time,depth,long,lat)
with 0 and 1 values.
So far, I am masking each variable separately using:
cdo -div -selname,A data.nc -selname,mask_3d mask.nc out.nc
and
cdo -div -selname,B data.nc -selname,mask_4d mask.nc out2.nc
My question is:
How can I mask both variables A
and B
in data.nc
using only one command ?