eqfor.f90 integrates chi without signgs:
! eqfor.f90:158-163
chi1(1) = zero
DO i = 2, ns
...
chi1(i) = chi1(i-1) + hs*(phip(i)*iotas(i))
END DO
chi = twopi*chi1
The quantities it has to agree with all carry it: phi = (signgs*twopi*hs)*phi (fileout.f90:61), and phipf and chipf go into the wout as twopi*signgs*phipf and twopi*signgs*chipf (wrout.f90:736, 738). chi goes in as is (wrout.f90:737).
With signgs = -1 the file holds chi = -∫ iota dphi. On input.cth_like_fixed_bdy:
| quantity |
value |
phi(ns) |
-0.035000 |
Σ iotas(js) phipf(js) hs over the half grid |
-0.040086 |
trapezoid of chipf over s |
-0.03846 (the axis entry is zero, see #6) |
chi(ns) |
+0.040086 |
chipf(js)/phipf(js) equals iotaf(js) on every surface, so chi is the odd one out, and d(chi)/d(phi) read back from the file has the opposite sign to iotaf. PARVMEC carries the same three lines (eqfor.f:177-183), so this is inherited from 8.52. chi = twopi*signgs*chi1, or accumulating phip the way fileout.f90:61 does, fixes it.
eqfor.f90integrates chi withoutsigngs:The quantities it has to agree with all carry it:
phi = (signgs*twopi*hs)*phi(fileout.f90:61), andphipfandchipfgo into the wout astwopi*signgs*phipfandtwopi*signgs*chipf(wrout.f90:736, 738).chigoes in as is (wrout.f90:737).With
signgs = -1the file holdschi = -∫ iota dphi. Oninput.cth_like_fixed_bdy:phi(ns)Σ iotas(js) phipf(js) hsover the half gridchipfover schi(ns)chipf(js)/phipf(js)equalsiotaf(js)on every surface, sochiis the odd one out, andd(chi)/d(phi)read back from the file has the opposite sign toiotaf. PARVMEC carries the same three lines (eqfor.f:177-183), so this is inherited from 8.52.chi = twopi*signgs*chi1, or accumulatingphipthe way fileout.f90:61 does, fixes it.