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"))))
Run the code above in your browser using DataLab