Grid
Handling the grid for TMI.
Missing docstring for TMI.Grid
. Check Documenter's build log for details.
Missing docstring for TMI.Field
. Check Documenter's build log for details.
Missing docstring for TMI.cartesianindex
. Check Documenter's build log for details.
TMI.linearindex
— Functionfunction linearindex(wet)
Read and assemble the grid coordinates.
Arguments
wet
: 3D mask for wet points
Output
R
: array of linear indices, but not a LinearIndices type
Missing docstring for TMI.gridprops
. Check Documenter's build log for details.
Missing docstring for TMI.matrix_zyx2xyz
. Check Documenter's build log for details.
Missing docstring for TMI.updatelinearindex
. Check Documenter's build log for details.
TMI.cellarea
— FunctionHorizontal area of grid cell
TMI.cellvolume
— Functionfunction cellvolume(γ)::Field
Volume of each grid cell.
Missing docstring for TMI.layerthickness
. Check Documenter's build log for details.
Missing docstring for TMI.zonalgriddist
. Check Documenter's build log for details.
TMI.surfacepatch
— Functionfunction surfacepatch
Make a surface boundary condition
with a rectangular patch
Arguments
lonbox
: longitudes of box edgeslatbox
: latitudes of box edgesγ
: TMI.grid
Output
d
: vector that describes surface patch
TMI.depthindex
— Functionfunction depthindex(I)
Get the k-index (depth level) from the Cartesian index
TMI.lonindex
— Functionfunction lonindex(I)
Get the i-index (lon index) from the Cartesian index
TMI.latindex
— Functionfunction latindex(I)
Get the j-index (latitude index) from the Cartesian index
Missing docstring for TMI.findindex
. Check Documenter's build log for details.
TMI.surfaceindex
— Functionfunction surfaceindex(I)
Get the vector-index where depth level == 1 and it is ocean.
TMI.northindex
— Functionfunction northindex(I)
Get the vector index on the northern open boundary
TMI.eastindex
— Functionfunction eastindex(I)
Get the vector index on the northern open boundary
TMI.southindex
— Functionfunction southindex(I)
Get the vector-index on the southern open boundary
TMI.westindex
— Functionfunction westindex(I)
Get the vector index on the western open boundary
TMI.horizontaldistance
— Functionfunction horizontaldistance(loc,γ)
Arguments
loc
: 3-tuple of lon,lat,depth locationγ
: TMI.grid
Output
hordist
: horizontal distance to nearest tracer grid points
TMI.interpindex
— Functionfunction interpindex(loc,γ) Weights for linear interpolation. The derivative of linear interpolation is needed in sensitivity studies. ReverseDiff.jl could find this quantity automatically. Instead we dig into the Interpolations.jl package to find the weights that are effectively the partial derivatives of the function.
Arguments
c
: a temporary tracer field, would be nice to make it unnecessaryloc
: (lon,lat,depth) tuple of a location of interestγ
: TMI grid
Output
δ
: weights on a 3D tracer field grid
TMI.shiftloc
— Functionfunction shiftloc(loc)
sometimes loc longitudes are outside of grid due to different conventions
assumption: 360° shift is enough to get back on grid
TMI.interpweights
— Functionfunction interpweights(loc,γ) Weights for linear interpolation. The derivative of linear interpolation is needed in sensitivity studies. ReverseDiff.jl could find this quantity automatically. Instead we dig into the Interpolations.jl package to find the weights that are effectively the partial derivatives of the function.
Arguments
loc
: (lon,lat,depth) tuple of a location of interestγ
: TMI grid
Output
δ
: weights on a 3D tracer field grid