if(interactive()){
# read Copernicus netcdf file with one variable
cmems <- read.cmems("global-reanalysis-phy-001-030-monthly_1553098099635.nc")
cmems
str(cmems)
# plotting the first period
plot(cmems)
# plotting the second period
plot(cmems, period = 2)
# read Copernicus netCDF file with several variables and depth levels
cmems2 <- read.cmems("global-reanalysis-phy-001-030-monthly_1553051256930.nc")
cmems2 # it is a list
# readed variables
names(cmems2)
# example plots for potential temperature
thetao <- cmems2$thetao
thetao
thetao$depth # depth levels
plot(thetao) # potential temperature at first depth level (0.49 m) and first month
plot(thetao, period = 2, depth = 5) # for fifth depth level (5.078 m), second month
}
Run the code above in your browser using DataLab