Created
January 28, 2017 03:13
-
-
Save chrisb13/d18a950a4f38e5b0d1b87fbe56ff36ca to your computer and use it in GitHub Desktop.
List of handy one-liners for NCO and CDO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snippet cdo | |
########################################################################### | |
# CDO # | |
########################################################################### | |
#extract a time | |
cdo seltimestep,1,2,5 cordex24_CURLFX-FLUXFCE_3h_20040101_20041231_grid_U_2D.nc test.nc | |
#do simple arithmatic | |
cdo expr,'sum=qsr+qns-qt' cordex24_CURLFX-FLUXFCE_3h_19980101_19981231_grid_T_2D.nc ofile.nc | |
#change a variable name | |
cdo chname,time_average_3h,time_counter sum.nc sum2.nc | |
#add two files together | |
cdo enssum ERAI_high_500/cordex24_CURLFX-FLUXFCE_3h_19970101_19971231_grid_U_2D.nc ERAI_low_500/cordex24_CURLFX-FLUXFCE_3h_19970101_19971231_grid_U_2D.nc sum.nc | |
endsnippet | |
snippet nco | |
########################################################################### | |
# NCO # | |
########################################################################### | |
#extract a variable | |
ncks -v SST in.nc out.nc | |
endsnippet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment