Get Started

To create your first MeshArray, open the Julia REPL and type:

using MeshArrays
C=MeshArray(randn(21,10))
1-element MeshArrays.gcmarray{Float64, 1, Matrix{Float64}}:
 [1.099416959176073 -0.0737741951822054 … -0.19661477884953973 0.5057285322063602; -0.7935547012528132 2.030290827007923 … -0.11669205916700354 -0.30265588524149706; … ; -0.14725548569429456 0.11733280531418121 … -0.12491842649628103 -0.5685997967655216; -0.7301913660612507 1.451219758635465 … 1.2992347437629115 -2.931505586457651]

Simple Grids

The above method let's you simply specify the grid axes as ranges :

using CairoMakie
heatmap(C,x=-10:10,y=1:10)
Example block output

Or you can define default grid axes, and maybe split the global grid into subdomains :

nP=10; nQ=5
(Γ,γ)=Grids_simple.UnitGrid( (nP*3,nQ*2) , (nP,nQ) ; option="full")
heatmap(Γ.XC,title="Coordinate 1 (XC)")
Example block output

Global Grids

Three grids are available directly via this package the examples (:LL360, :CS32, and :LLC90).

Lat-lonCube SphereLat-Lon-Cap
Lat-LonCube SphereLat-Lon-Cap

In the example below we read and display a cubed-sphere grid. The Earth surface is projected on the six faces of a cube, and here each face has 32 points (CS32).

using MeshArrays,CairoMakie
γ=GridSpec(ID=:CS32)
Depth=GridLoadVar("Depth",γ)
heatmap(Depth,title="Sea Floor Depth")
Example block output

or

Γ=GridLoad(γ,option=:minimal)
heatmap(Γ.YC,title="grid point latitudes")
Example block output
Note

For more information on grid variable names and conventions, please refer to the MITgcm docs.

Install

To install MeshArrays.jl and verify it works as expected, open the Julia REPL and type:

using Pkg
Pkg.add("MeshArrays")
Pkg.test("MeshArrays")