Description Usage Arguments Details Examples
View source: R/CDO__functions.r
Provides an interface for running commands suitable for use with the (externally installed) Climate Data Operators (CDO)
1 2 3 4 5 6 7 |
debug |
Doesn't run the command, but returns the command that would be run. |
defaults |
Character string supplying the defaults to be used by CDO |
Default options for cdo can be set at the system wide level
using the set.cdo.defaults()
command. Two of the most useful
of these include "-O" (to overwrite files by default) and "-s" to
silence the outputs of cdo. See the helpfiles of CDO for more.
csl
converts a set of arguments into a comma separated list
ssl
converts a set of arguments into a space separated list
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # What version of CDO am I running?
cdo("--version")
# Select a variable from a CMIP5 model
# Note, to run this in the wild, remove the debug=TRUE argument
in.fname <- "tos_Omon_IPSL-CM5A-LR_historical_r1i1p1_185001-200512.nc"
out.fname <- "foo.nc"
cdo("selvar",in.fname,out.fname,debug=TRUE)
# Use the defaults and csl to build up a more complex argument
# Note, to run this in the wild, remove the debug=TRUE argument
in.fname <- "tos_Omon_IPSL-CM5A-LR_historical_r1i1p1_185001-200512.nc"
out.fname <- "foo.nc"
set.cdo.defaults("--silent")
yrs <- seq(1950,2005,by=5) #Every fifth year
cdo(csl("selyear",yrs),in.fname,out.fname,debug=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.