GithubHelp home page GithubHelp logo

fabien-roquet / polyteos Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 34 KB

polynomial versions of TEOS-10 seawater equation of state

License: GNU General Public License v3.0

Python 40.07% MATLAB 38.69% Fortran 21.25%

polyteos's Introduction

polyTEOS

Polynomial versions of TEOS-10 seawater equation of state (Fortran, Matlab and Python)

Motivation

A new set of approximations to the standard TEOS-10 equation of state has recently been proposed. These follow a polynomial form, making it computationally efficient for use in numerical ocean models. Two versions are provided, the first polyTEOS10_bsq being a fit of density for Boussinesq ocean models, and the second polyTEOS10_55t fitting specific volume which is more suitable for compressible models.

Both versions are given as the sum of a vertical reference profile (6th-order polynomial) and an anomaly (52-term polynomial, cubic in pressure), with relative errors of 0.1% on the thermal expansion coefficients.

A 75-term polynomial expression polyTEOS10_75t is also presented for computing specific volume, with a better accuracy than the existing TEOS-10 48-term rational approximation, especially regarding the sound speed. This version is now used (since 2015) as the standard approximation of the TEOS-10 equation of state.

Finally, a stiffened version polyTEOS10_stif of the equation of state is also proposed.

More details on these approximations of the TEOS-10 equation of state are available in Roquet et al. (2016).

Reference: Roquet, F., Madec, G., McDougall, T. J., and Barker, P. M., 2015. Accurate polynomial expressions for the density and specific volume of seawater using the TEOS-10 standard. Ocean Modelling, 90:29-43.

Fortran code

The file polyTEOS10_bsq.F90 includes fortran procedures to compute in-situ density, thermal expansion and haline contraction coefficients. It also provides an approximation to convert conservative temperature into potential temperature, useful in ocean models to compute air-sea fluxes.

We propose only the polyTEOS10_bsq approximation in Fortran, as this is the one that is generally most well suited for most ocean models. Note that the ocean model NEMO uses this equation of state as the standard since version 3.6.

A fortran version of polyTEOS10_75t is also available as part of the standard TEOS-10 package.

Python code

The four versions of polyTEOS10 are coded in the python script polyTEOS10.py.

Matlab code

Each version of polyTEOS10 is also distributed for Matlab:

  • polyTEOS10_bsq.m
  • polyTEOS10_55t.m
  • polyTEOS10_75t.m
  • polyTEOS10_stif.m

Contributors

Fabien Roquet (Department of Meteorology at Stockholm University). More information on the author on his personal webpage

License

This software is distributed under the terms of the GNU GENERAL PUBLIC LICENSE v3. The GNU General Public License is a free, copyleft license for software and other kinds of works.

polyteos's People

Contributors

fabien-roquet avatar

Stargazers

Christopher Bull avatar 2907 avatar  avatar

Watchers

 avatar Glenn Hyland avatar

Forkers

chanjeunlam

polyteos's Issues

Python version issues

Hi Fabien,

I noticed two things in the Python version. First, the 75-term EOS uses a salinity offset of 32 g/kg instead of 24, so its results don't match the reference values. Second, there are some slight inconsistencies between the expansion and contraction coefficients calculated with the given polynomial coefficients versus directly calculating the density/volume polynomial derivatives. This could just be floating point errors made when these coefficients were copied, but it can affect the physical quantities by a few percent or more.

I've been interested in Python versions of TEOS10 for a while, and posted my take on polyTEOS10 here. Let me know what you think; I would be more than happy to merge it here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.