If you find yourself using some commands always with the same flags, then it would make sense to define them as alieses, by putting them into your .bashrc file like this (log out and back in for it to take effect):
# .bashrc # Put user specific aliases and functions here alias ls='ls -al --color=auto' alias qstat='qstat -a' alias qsub='qsub -m abe -M myemail@email.com' alias disk="du * -sh | sort -h" -a for ls shows hidden files (files that start with a dot, like .
The NCO (netCDF Operator) command ncks (netCDF Kitchen Sink).
From the documentation:
The nickname “kitchen sink” is a catch-all because ncks combines most features of ncdump and nccopy with extra features to extract, hyperslab, multi-slab, sub-set, and translate into one versatile utility. ncks extracts (a subset of the) data from input-file and and writes (or pastes) it in netCDF format to output-file, and optionally writes it in flat binary format to binary-file, and optionally prints it to screen.
NCO:ncap2 and .total
ncap2 -s 'summed_variable=variable_to_sum.total($lat,$lon)' in.nc out.nc
Make sure to use single quotes.
If your in.nc==out.cnc then adding -A will save you from having to specify “overwrite” (see this).
ncap2 -A -s 'summed_variable=variable_to_sum.total($lat,$lon)' in.nc out.nc