Skip to content

GPEC v1.6.1 hotfix: netcdf units and Jbgradpsi_rmatch - #366

Merged
matt-pharr merged 3 commits into
masterfrom
hotfix-1.6.1
Nov 13, 2026
Merged

matt-pharr merged 3 commits into
masterfrom
hotfix-1.6.1

Conversation

@logan-nc

@logan-nc logan-nc commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Not urgent. Julia work still has priority; review whenever convenient.

Patch release on top of v1.6.0, following the usual hotfix workflow (branch from master; after approval, merge to master, tag v1.6.1, then merge into develop).

Fixes

  • Clebsch displacement units (Fixes Correct units for displacements in netcdf #243). xigradpsi, xigradpsi_dpsi and xigradalpha in gpec_profile_output_n*.nc were labeled m. They are ξ·∇ψ_N and ξ·∇α divided by χ₁, so they have no units. They are now labeled unitless, the spelling already used elsewhere in gpout.f. Only the attribute changes.
  • Jbgradpsi_rmatch was empty in most runs. gpout_xbnormal filled it only when jac_out == jac_type and tmag_out /= 0. In every other run it was written without ever being set; this build happened to leave it zero. It is now converted to the output coordinates the same way Jbgradpsi is. I checked the units of Jbgradpsi, Jbgradpsi_pest and Jbgradpsi_rmatch: all three are area-normalized, so Tesla is correct and was left unchanged.
  • Version bump: release = '1.6.1' in docs/conf.py, and a v1.6.1 section in docs/releases.rst.

Verification

regression_solovev_resistive_example (rdcon → rmatch → gpec). I built v1.6.0 and this branch with identical gfortran settings and compared every netCDF output variable by variable:

variant branch taken data diffs other than Jbgradpsi_rmatch Jbgradpsi_rmatch in v1.6.0 Jbgradpsi_rmatch here
as shipped (jac_out="pest", tmag_out=1) unchanged branch none ‖rmatch − Jbgradpsi‖/‖Jbgradpsi‖ = 2.4e-14 bit-identical to v1.6.0
jac_out="hamada" fixed branch none all zeros finite; ‖rmatch − Jbgradpsi‖/‖Jbgradpsi‖ = 2.3e-14
tmag_out=0 fixed branch none all zeros finite; ‖rmatch − Jbgradpsi‖/‖Jbgradpsi‖ = 2.2e-14
  • In all three variants, the only differences in attributes are the three units changes. I did not compare global attributes, which include the version string.
  • In this example the RMATCH solution matches the ideal one to round-off. So the new output reproducing Jbgradpsi to about 1e-14, the same agreement as on the unchanged branch, is the expected result. The arrays are not bit-identical, which shows they come from the RMATCH data, not from a copy of Jbgradpsi.
  • CI (make_test.yml, started by hand because PRs to master don't trigger it): passed with gfortran and ifort, https://github.com/PrincetonUniversity/GPEC/actions/runs/42634301501

🤖 Generated with Claude Code

https://claude.ai/code/session_01VMDGyfQKRZQMdk3NJXsKQE

logan-nc and others added 3 commits November 9, 2026 09:14
xigradpsi, xigradpsi_dpsi and xigradalpha are xi.grad(psi_N) and
xi.grad(alpha) normalized by chi1, so they are dimensionless, not m.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VMDGyfQKRZQMdk3NJXsKQE
…type

bwpmns_rmatch was only set in the branch that reuses the working
coordinates (jac_out == jac_type and tmag_out /= 0), so other runs
wrote uninitialized memory to Jbgradpsi_rmatch. Convert the RMATCH
solution to output coordinates the same way as Jbgradpsi.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VMDGyfQKRZQMdk3NJXsKQE
@logan-nc

Copy link
Copy Markdown
Contributor Author

@matt-pharr this is just a few lines to check - lets get it in so we don't forget

@matt-pharr matt-pharr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Approving and releasing

@matt-pharr
matt-pharr merged commit 775e263 into master Nov 13, 2026
6 checks passed
@matt-pharr matt-pharr mentioned this pull request Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants