IsopycnalSurfaces

Documentation for IsopycnalSurfaces.

IsopycnalSurfaces.dedup!Method

function dedup!(a,b)

Remove values of a that are duplicates. Remove values of b that have the same location as the duplicates in a. The length of a and b should be identical before and after invoking this function.

Arguments

  • a::Vector{T}: a density variable
  • b::Vector{T}: an accompanying tracer variable

Arguments are mutated by the function.

source
IsopycnalSurfaces.dedupfirst!Method

function dedup!(a,b)

Remove the first duplicate of a. Remove the value of b that is located at the same entry as the first duplicate in a. The length of a and b should be identical before and after invoking this function.

Arguments

  • a::Vector{T}: a density variable
  • b::Vector{T}: an accompanying tracer variable

Arguments are mutated by the function.

source
IsopycnalSurfaces.densityEOS80Method

densityEOS80(S,T,p) and dependent functions from PhysOcean.jl/EOS80.jl, From Alexander Barth

Compute the density of sea-water (kg/m³) at the salinity S (psu, PSS-78), temperature T (degree Celsius, ITS-90) and pressure p (decibar) using the UNESCO 1983 polynomial.

Reference: Fofonoff, N.P.; Millard, R.C. (1983). Algorithms for computation of fundamental properties of seawater. UNESCO Technical Papers in Marine Science, No. 44. UNESCO: Paris. 53 pp. http://web.archive.org/web/20170103000527/http://unesdoc.unesco.org/images/0005/000598/059832eb.pdf

Check value: ρI = `1041.87651kg/m^3` for Θ=`3°Celcius`, Σ=`35.5psu`, Π=`3000dbar`
ρI = densityEOS80(35.5, 3, 3000)

added by Ray, Dec 09, 2021

source
IsopycnalSurfaces.densityJMD95Function

densityJMD95(Θ,Σ,Π,Π0) from MITgcmTools.jl/PhysicalOceanography.jl SeawaterDensity, From Gael Forget

Compute potential density (ρP), in situ density (ρI), and density referenced to PREF (Π0 in decibars) from potential temperature (Θ in °C), salinity (Σ in psu) and pressure (Π in decibars) according to the UNESCO / Jackett & McDougall 1994 equation of state.

Credits: code based on a Matlab implementation by B. Ferron

Reference: https://www.jodc.go.jp/info/iocdoc/UNESCOtech/059832eb.pdf

Check value: ρI = 1041.83267kg/m^3 for Θ=3°Celcius, Σ=35psu, Π=3000dbar

(ρP,ρI,ρR) = densityJMD95(3.,35.5,3000.)
isapprox(ρI,1041.83267, rtol=1e-6)
source
IsopycnalSurfaces.inputcheckMethod

function inputcheck(vars)

 Are all variables available for computing density?
To check, first parse all of variable input names.
source
IsopycnalSurfaces.mixinversions!Method

function mixinversions!(a,b)

For values of a that are not increasing, an inversion is defined. Average these values of a until values of a are sorted. Do the same averaging on the accompanying vector b.

Arguments

  • a::Vector{T}: a density variable
  • b::Vector{T}: an accompanying tracer variable

Arguments are mutated by the function.

source
IsopycnalSurfaces.oceanlistMethod
function oceanlist
A list of variable names for the standard oceanographic variables. 
Multiple variable names are recognized for temperature, for example.
source
IsopycnalSurfaces.parsevarsMethod
function parsevars(vars)
What variables are in the vars Dictionary?
This function relates the IsopycnalSurfaces.jl name for each variable
to the input name that is used.
source
IsopycnalSurfaces.pgridFunction
function pgrid(z,lat=30)
If depth is entered as an input, but not pressure,
transfer depth to pressure using GibbsSeaWater.jl.
Then compute density.
source
IsopycnalSurfaces.secant_bulk_modulusMethod
secant_bulk_modulus(S,T,p)

Compute the secant bulk modulus of sea-water (bars) at the salinity S (psu, PSS-78), temperature T (degree Celsius, ITS-90) and pressure p (decibar) using the UNESCO polynomial 1983. Fofonoff, N.P.; Millard, R.C. (1983). Algorithms for computation of fundamental properties of seawater. UNESCO Technical Papers in Marine Science, No. 44. UNESCO: Paris. 53 pp. http://web.archive.org/web/20170103000527/http://unesdoc.unesco.org/images/0005/000598/059832eb.pdf

source
IsopycnalSurfaces.sigma0columnFunction
function sigma0column(θ,S,p,eos="TEOS10")
σ₀ for a water column
Classic format of the function
Untested for a mix of float values

Arguments

  • θz::Vector{T}: potential temperature
  • Sz::Vector{T}: practical salinity
  • pz::Vector{T}: vertical profile of standard pressures

Output

  • σ₀: sigma-0 for wet points in column
source
IsopycnalSurfaces.sigma1columnFunction
function sigma1column(θ,S,p,eos="TEOS10")
σ₁ for a water column
Classic version of the function that takes potential temperature and practical salinity
Untested for a mix of float values

Arguments

  • θz::Vector{T}: potential temperature
  • Sz::Vector{T}: practical salinity
  • pz::Vector{T}: vertical profile of standard pressures
  • eos::String: optional keyword argument, equation of state

Output

  • σ₁: sigma-1 for wet points in column
source
IsopycnalSurfaces.sigma1gridMethod

function sigma1grid() Standard (from Susan Wijffels, WHOI) choice of sigma1 surfaces

Arguments

  • z: value

Output

  • σ₁grid: list (vector) of σ₁ values
source
IsopycnalSurfaces.sigmacolumnMethod
function sigmacolumn(vars;p₀=0,eos="TEOS10",lon=0.,lat=30.)
σ for a water column

Arguments

  • vars::Dict: collection of relevant variables
  • p₀=0: reference pressure
  • eos:String="TEOS10": optional argument for equation of state, default = "TEOS10"
  • lon=0.0: longitude for absolute salinity calcs
  • lat=30.0: latitude for absolute salinity calcs

Output

  • σ::Vector{T}: sigma for wet points in column
source
IsopycnalSurfaces.sigmacolumnMethod
function sigmacolumn(θ,S,p,p₀,eos="TEOS10")
σ for a water column
Classic version of the function that takes potential temperature and practical salinity

Arguments

  • θz::Vector{T}: potential temperature
  • Sz::Vector{T}: practical salinity
  • pz::Vector{T}: vertical profile of standard pressures in decibar, or ocean depth in meter
  • p₀: reference pressure
  • eos:String: optional argument for equation of state, default = "TEOS10"

Output

  • σ::Vector{T}: sigma for wet points in column
source
IsopycnalSurfaces.temperature68Method
temperature68(T)

Convert temperature T from ITS-90 scale to the IPTS-68 scale following Saunders, 1990. Saunders, P.M. 1990, The International Temperature Scale of 1990, ITS-90. No.10, p.10. https://web.archive.org/web/20170304194831/http://webapp1.dlib.indiana.edu/virtualdisklibrary/index.cgi/4955867/FID474/wocedocs/newsltr/news10/news10.pdf

source
IsopycnalSurfaces.var2sigmacolumnMethod
function var2sigmacolumn(σ,v,σgrid;splorder,linearinterp)
map θ,S, p onto σ₁ surfaces for a water column

Arguments

  • σ::Array{Float,1}}`: sigma values of input variable
  • v::Array{Float,1}}: variable of interest
  • σgrid: σ surface values
  • splorder: optional argument of 1-5, order of spline, default=3
  • linearinterp: optional argument, true to force linear interpolation, default=false

Output

  • θonσ: variable on sigma surfaces
source
IsopycnalSurfaces.vars2sigmaMethod
function vars2sigma(vars,σgrid,p₀;p,z,spline_order,linearinterp,eos,lat,lon)
map variables from regular 3D grid onto sigma surfaces

Arguments

  • vars::Dict{String,Array{T,3}}}: dict of 3d arrays
  • p::Vector{T}: vertical profile of standard pressures
  • p₀: reference pressure
  • σgrid: σ surface values
  • splorder: 1-5, order of spline, optional keyword argument, default=3
  • linearinterp: optional keyword logical argument, default=false
  • eos: optional keyword string for equation of state, default = "EOS80"
  • lon: longitude
  • lat: latitude

Output

  • varsσ::Dict{String,Array{T,3}: dict of 3d arrays of variables on sigma1 surfaces
source
IsopycnalSurfaces.vars2sigma0Method
function vars2sigma1(vars,p,σgrid;spline_order,linearinterp,eos)
map variables from regular 3D grid onto σ₀ surfaces

Arguments

  • vars::Dict{String,Array{T,3}}}: dict of 3d arrays
  • p::Vector{T}: vertical profile of standard pressures
  • σgrid: σ surface values
  • splorder: 1-5, order of spline, optional keyword argument, default=3
  • linearinterp: optional keyword logical argument, default=false
  • eos: optional keyword string for equation of state, default = "EOS80"

Output

  • varsσ::Dict{String,Array{T,3}: dict of 3d arrays of variables on sigma1 surfaces
source
IsopycnalSurfaces.vars2sigma1Method
function vars2sigma1(vars,σgrid;p,spline_order,linearinterp,eos)
map variables from regular 3D grid onto σ₁ surfaces

Arguments

  • vars::Dict{String,Array{T,3}}}: dict of 3d arrays
  • p::Vector{T}: vertical profile of standard pressures
  • σgrid: σ surface values
  • splorder: 1-5, order of spline, optional keyword argument, default=3
  • linearinterp: optional keyword logical argument, default=false
  • eos: optional keyword string for equation of state, default = "EOS80"

Output

  • varsσ::Dict{String,Array{T,3}: dict of 3d arrays of variables on sigma1 surfaces
source
IsopycnalSurfaces.vars2sigma2Method
function vars2sigma2(vars,p,σgrid;spline_order,linearinterp,eos)
map variables from regular 3D grid onto σ₂ surfaces

Arguments

  • vars::Dict{String,Array{T,3}}}: dict of 3d arrays
  • p::Vector{T}: vertical profile of standard pressures
  • σgrid: σ surface values
  • splorder: 1-5, order of spline, optional keyword argument, default=3
  • linearinterp: optional keyword logical argument, default=false
  • eos: optional keyword string for equation of state, default = "EOS80"

Output

  • varsσ::Dict{String,Array{T,3}: dict of 3d arrays of variables on sigma1 surfaces
source