library(oce)
cat("unesco example:",swTheta(35, 13, 1000),"")
cat("bryden example:",swTheta(35, 13, 1000, "bryden"),"")
print(swTheta(40,40,10000,0,"unesco")) # 36.89073 (Fofonoff et al., 1983)
# Demonstrate that the methods agree to a couple of
# millidegrees over a typical span of values
S <- c(30,30,38,38)
T <- c(-2,-2,30,30)
p <- 1000 * runif(n=4)
print(max(abs(swTheta(S,T,p) - swTheta(S,T,p,0,"bryden"))))
# Example from a cross-Atlantic section
data(section)
stn <- section[['station', 70]]
plotProfile(stn, 'theta', ylim=c(6000, 1000))
lines(stn[['temperature']], stn[['pressure']], lty=2)
legend("topleft", lty=1:2,
legend=c("potential", "in-situ"),
bg='white', title="Station 70")
Run the code above in your browser using DataLab