In the magnetic coordinates (ψ,𝜃,ϕ) used in TEK code, ψ is the normalized poloidal magnetic flux, ψ = (Ψ − Ψaxis)∕(Ψlcfs − Ψaxis), 𝜃 is increasing along the anti-clockwise direction when viewed along ∇ϕ direction, ϕ is the toroidal angle of the right-handed cylindrical coordinates (R,ϕ,Z). In this convention the Jacobian of the (ψ,𝜃,ϕ) coordinate system, 𝒥 = (∇ψ ⋅∇𝜃 ×∇ϕ) is negative, i.e., (ψ,𝜃,ϕ) is a left-handed system. The field-line-following coordinate system (ψ,𝜃,α) is also a left-handed system. The coordinate system (x = ψ,y = α,z = 𝜃) is a right-handed system.
GEM array index system is better than TEK’s because my system is not consistent: sometimes I use 0-based index and sometimes I use 1-based index, sometimes the index ends at n and sometimes ends at n+1. It is important to know accurately the transformation between the two systems.