Get (|grad the|^2, grad the . grad psi, |grad psi|^2)
    on the (the, psi) mesh
   
    gtt = |grad the|^2
    gtp = grad the . grad psi
    gpp = |grad psi|^2
integer, intent(in) :: nt1, ns
real(i2mex_r8), intent(in) :: the(nt1), psi(ns)
real(i2mex_r8), intent(out) :: gtt(nt1, ns), gtp(nt1, ns), gpp(nt1, ns)
integer, intent(out) :: ier
    Get poloidal derivative (d /d the) of metric quantities
    (|grad the|^2, grad the . grad psi, |grad psi|^2)
    on the (the, psi) mesh
   
    gtt = (d /d the) |grad the|^2
    gtp = (d /d the) grad the . grad psi
    gpp = (d /d the) |grad psi|^2
integer, intent(in) :: nt1, ns
real(i2mex_r8), intent(in) :: the(nt1), psi(ns)
real(i2mex_r8), intent(out) :: gtt(nt1, ns), gtp(nt1, ns), gpp(nt1, ns)
integer, intent(out) :: ier
    Get flux derivative (d /d psi) of metric quantities
    (|grad the|^2, grad the . grad psi, |grad psi|^2)
    on the (the, psi) mesh
   
    gtt = (d /d the) |grad the|^2
    gtp = (d /d the) grad the . grad psi
    gpp = (d /d the) |grad psi|^2
integer, intent(in) :: nt1, ns
real(i2mex_r8), intent(in) :: the(nt1), psi(ns)
real(i2mex_r8), intent(out) :: gtt(nt1, ns), gtp(nt1, ns), gpp(nt1, ns)
integer, intent(out) :: ier