dankelley / oce

R package for oceanographic processing
http://dankelley.github.io/oce/
GNU General Public License v3.0
142 stars 42 forks source link

do we need to account for multiple salinity scales? #1298

Closed dankelley closed 7 years ago

dankelley commented 7 years ago

NB. I assigned CR to this one, because I'm focussing on temperature scales now. I think it's just a matter of 10 minutes of web searching, to find an answer...

In working on #1293, which relates to temperature scales, I decided to look at the accessor (in R/ctd.R) for salinity, viz.

              if (i == "salinity" || i == "SP") {
                  if ("salinity" %in% dataNames) {
                      S <- x@data$salinity
                  } else {
                      C <- x@data$conductivity
...

with more code after that for calculation from conductivity. So, clearly, no checking of the unit$scale is being done.

Question: are there multiple salinity scales for us to worry about? If so, I'd like to get some citations in comments below, so I can add code to handle those scales.

richardsc commented 7 years ago

Good question. I'm definitely no expert on this subject, but it's good to have the discussion.

My sense is that any of the other "salinity scales" that predate PSS-78 are not worth the effort to include them (e.g. ppt, Knudsen salinity, etc). As they predate the widespread use of conductivity-based measurements, any users dealing with such historical measurements should be aware of the nature of the units that they are using, rather than put the responsibility on oce to handle nonstandard cases.

That being said, it might be worth thinking about how we handle TEOS-10 quantities (and their units/scales) in oce objects. From the (rather nice) summary on the Salinity wikipedia page (emphasis mine):

In 2010 a new standard for the properties of seawater called the thermodynamic equation of seawater 2010 (TEOS-10) was introduced, advocating absolute salinity as a replacement for practical salinity, and conservative temperature as a replacement for potential temperature.[5] This standard includes a new scale called the reference composition salinity scale. Absolute salinities on this scale are expressed as a mass fraction, in grams per kilogram of solution. Salinities on this scale are determined by combining electrical conductivity measurements with other information that can account for regional changes in the composition of seawater. They can also be determined by making direct density measurements.

In my opinion, we have to this point avoided integrating the TEOS-10/gsw units and scales as defaults in oce objects, because of the "data-derived" nature of the origin of most objects, and the strict recommendation that SA itself should never be archived, but that SP (practical salinity/PSS-78) remains the archival standard.

dankelley commented 7 years ago

Your final in the previous comment is correct. This is why we do not store SA or Sstar, etc. And I don't think we should store them, either, because the TEOS-10 documentation states that data archives ought to continue to save Practical Salinity. And I agree with that recommendation. A problem with storing e.g. SA is that it is calculated based on ion ratios that are stored in a big lat-lon-depth matrix, and that matrix could change as we get more ocean data, or we get new curve fits to the existing data.

Perhaps at some point it will become sensible to store a new salinity scale, and we could certainly do that, but for this issue I'm interested in whether any data archives contain older salinity scales ... and, if so, then I'd like to write code to convert, and set up a "scale" element to handle that. I'd be really pretty surprised if this would make a practical difference to anything; 1978 was a long time ago, and the scale was likely used for years before it was formalized, so data with a previous scale would be really quite old, and my guess is that anyone dealing with such data would know what to do.

It might be worth sniffing around some archives (at BIO maybe) to see if there are data on older scales.

dankelley commented 7 years ago

I've had a skim of the documents provided by UNESCO at the time when PSS-78 was being made. (See Unesco (1981). Background papers and supporting data on the Practical Salinity Scale 1978. Tech. Pap. Mar. Sci., 37; online at http://unesdoc.unesco.org/images/0004/000479/047932eb.pdf). I think the most relevant of the collected may be the one starting at compiled page 113 in the PDF, by Lewis and Perkin (IOS/DFO researchers, by the way). At the end of their paper, they basically argue against trying to convert old data to PSS-78.

They say the best case is to get the original raw data (chlorinity etc) and work from there. Failing that, in their last paragraph, they suggest using the old formula $S=1.80655Cl$ to get Cl, and then using that to get an R15, and then using R15 to get K15 and proceeding from there. I am not being entirely clear, and anyone wanting to do this should really consult there paper, noting that they are hinting at other work to appear. But here's the bottom line, a direct quote from them: "It must be emphasized that the conversion procedure is imporoper in terms of the definition of the PSS 78 and is offered here only as a best solution".

Since the previous paragraphs of this comment offer a pointer to what I think is the definitive statement by the experts, I'm closing this issue: I don't plan to incorporate scales prior to PSS 78, and if in some year or decade it becomes clear that a TEOS-10 (or other) scale is needed, then it can be added. It will be only about 4 lines of code -- a lot less than has been typed in these comments.