This repository now contains a Julia package port of the Python implementation in src/.
- Python (reference):
src/isqg.py,src/invert.py,src/test_matrix.py - Julia package:
julia/IsQG/julia/IsQG/src/types.jl:ISQGDatatype (Pythonisqg_data)julia/IsQG/src/core.jl:precondition!,solve_sqg!,solve_psii!,solve!julia/IsQG/src/io.jl:invertit(filein, fileout)(.matIO viaMAT.jl)julia/IsQG/src/matrices.jl:construct_matrices(port ofsrc/test_matrix.py)julia/IsQG/src/utils.jl:lonlat2xy,lat2f,gradxy,psi2uv,vorticity,twopave,N2rho,anomaly, fitting helpers
The Julia package uses:
LinearAlgebra,SparseArrays(stdlib)FFTW(FFT acceleration; optional viaIsQGFFTWExt, otherwise a slow pure-Julia fallback is used)MAT(MATLAB.matIO; optional viaIsQGMATExt)Plots(diagnostic plots; optional viaIsQGPlotsExt)
From the repo root:
cd julia/IsQG
julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.test()'The Julia tests can compare against a small embedded reference generated from the Python implementation:
python julia/IsQG/tools/gen_reference_jl.pyThis writes julia/IsQG/test/reference/reference_data.jl.
cd julia/IsQG
julia --project=. examples/minimal.jlIf Plots.jl is available, the example writes horizontal + vertical diagnostic plots to julia/IsQG/examples/output/.
cd julia/IsQG
julia --project=. examples/invertit_cli.jl input.mat output.mat