IsopycnalSurfaces
Documentation for IsopycnalSurfaces.
IsopycnalSurfaces.dedup!
IsopycnalSurfaces.dedupfirst!
IsopycnalSurfaces.densityEOS80
IsopycnalSurfaces.densityJMD95
IsopycnalSurfaces.density_reference_pure_water
IsopycnalSurfaces.inputcheck
IsopycnalSurfaces.mixinversions!
IsopycnalSurfaces.notnanorzero
IsopycnalSurfaces.oceanlist
IsopycnalSurfaces.parsevars
IsopycnalSurfaces.pgrid
IsopycnalSurfaces.secant_bulk_modulus
IsopycnalSurfaces.sigma0column
IsopycnalSurfaces.sigma1column
IsopycnalSurfaces.sigma1grid
IsopycnalSurfaces.sigmacolumn
IsopycnalSurfaces.sigmacolumn
IsopycnalSurfaces.temperature68
IsopycnalSurfaces.var2sigmacolumn
IsopycnalSurfaces.vars2sigma
IsopycnalSurfaces.vars2sigma0
IsopycnalSurfaces.vars2sigma1
IsopycnalSurfaces.vars2sigma2
IsopycnalSurfaces.dedup!
— Methodfunction 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 variableb::Vector{T}
: an accompanying tracer variable
Arguments are mutated by the function.
IsopycnalSurfaces.dedupfirst!
— Methodfunction 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 variableb::Vector{T}
: an accompanying tracer variable
Arguments are mutated by the function.
IsopycnalSurfaces.densityEOS80
— MethoddensityEOS80(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
IsopycnalSurfaces.densityJMD95
— FunctiondensityJMD95(Θ,Σ,Π,Π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)
IsopycnalSurfaces.density_reference_pure_water
— Methoddensity_reference_pure_water(T)
density of pure water at the temperature T
(degree Celsius, ITS-90)
IsopycnalSurfaces.inputcheck
— Methodfunction inputcheck(vars)
Are all variables available for computing density?
To check, first parse all of variable input names.
IsopycnalSurfaces.mixinversions!
— Methodfunction 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 variableb::Vector{T}
: an accompanying tracer variable
Arguments are mutated by the function.
IsopycnalSurfaces.notnanorzero
— Methodfunction notnanorzero
true when argument is not a NaN nor zero
IsopycnalSurfaces.oceanlist
— Methodfunction oceanlist
A list of variable names for the standard oceanographic variables.
Multiple variable names are recognized for temperature, for example.
IsopycnalSurfaces.parsevars
— Methodfunction 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.
IsopycnalSurfaces.pgrid
— Functionfunction pgrid(z,lat=30)
If depth is entered as an input, but not pressure,
transfer depth to pressure using GibbsSeaWater.jl.
Then compute density.
IsopycnalSurfaces.secant_bulk_modulus
— Methodsecant_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
IsopycnalSurfaces.sigma0column
— Functionfunction 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 temperatureSz::Vector{T}
: practical salinitypz::Vector{T}
: vertical profile of standard pressures
Output
σ₀
: sigma-0 for wet points in column
IsopycnalSurfaces.sigma1column
— Functionfunction 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 temperatureSz::Vector{T}
: practical salinitypz::Vector{T}
: vertical profile of standard pressureseos::String
: optional keyword argument, equation of state
Output
σ₁
: sigma-1 for wet points in column
IsopycnalSurfaces.sigma1grid
— Methodfunction sigma1grid() Standard (from Susan Wijffels, WHOI) choice of sigma1 surfaces
Arguments
z
: value
Output
σ₁grid
: list (vector) of σ₁ values
IsopycnalSurfaces.sigmacolumn
— Methodfunction sigmacolumn(vars;p₀=0,eos="TEOS10",lon=0.,lat=30.)
σ for a water column
Arguments
vars::Dict
: collection of relevant variablesp₀=0
: reference pressureeos:String="TEOS10"
: optional argument for equation of state, default = "TEOS10"lon=0.0
: longitude for absolute salinity calcslat=30.0
: latitude for absolute salinity calcs
Output
σ::Vector{T}
: sigma for wet points in column
IsopycnalSurfaces.sigmacolumn
— Methodfunction 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 temperatureSz::Vector{T}
: practical salinitypz::Vector{T}
: vertical profile of standard pressures in decibar, or ocean depth in meterp₀
: reference pressureeos:String
: optional argument for equation of state, default = "TEOS10"
Output
σ::Vector{T}
: sigma for wet points in column
IsopycnalSurfaces.temperature68
— Methodtemperature68(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
IsopycnalSurfaces.var2sigmacolumn
— Methodfunction var2sigmacolumn(σ,v,σgrid;splorder,linearinterp)
map θ,S, p onto σ₁ surfaces for a water column
Arguments
σ
::Array{Float,1}}`: sigma values of input variablev::Array{Float,1}}
: variable of interestσgrid
: σ surface valuessplorder
: optional argument of 1-5, order of spline, default=3linearinterp
: optional argument, true to force linear interpolation, default=false
Output
θonσ
: variable on sigma surfaces
IsopycnalSurfaces.vars2sigma
— Methodfunction 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 arraysp::Vector{T}
: vertical profile of standard pressuresp₀
: reference pressureσgrid
: σ surface valuessplorder
: 1-5, order of spline, optional keyword argument, default=3linearinterp
: optional keyword logical argument, default=falseeos
: optional keyword string for equation of state, default = "EOS80"lon
: longitudelat
: latitude
Output
varsσ::Dict{String,Array{T,3}
: dict of 3d arrays of variables on sigma1 surfaces
IsopycnalSurfaces.vars2sigma0
— Methodfunction 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 arraysp::Vector{T}
: vertical profile of standard pressuresσgrid
: σ surface valuessplorder
: 1-5, order of spline, optional keyword argument, default=3linearinterp
: optional keyword logical argument, default=falseeos
: 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
IsopycnalSurfaces.vars2sigma1
— Methodfunction 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 arraysp::Vector{T}
: vertical profile of standard pressuresσgrid
: σ surface valuessplorder
: 1-5, order of spline, optional keyword argument, default=3linearinterp
: optional keyword logical argument, default=falseeos
: 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
IsopycnalSurfaces.vars2sigma2
— Methodfunction 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 arraysp::Vector{T}
: vertical profile of standard pressuresσgrid
: σ surface valuessplorder
: 1-5, order of spline, optional keyword argument, default=3linearinterp
: optional keyword logical argument, default=falseeos
: 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