boozer_sub: chartmap export/import spoke#312
Open
krystophny wants to merge 2 commits into
Open
Conversation
Add the Boozer chartmap NetCDF reader (boozer_chartmap_io) and wire two new module routines into boozer_sub: - export_boozer_chartmap writes rho/s/theta/zeta grids, X/Y/Z geometry, A_phi/B_theta/B_phi and Bmod from the active VMEC-derived Boozer splines via boozer_to_vmec + splint_vmec_data + splint_boozer_coord. - load_boozer_from_chartmap reads a chartmap and rebuilds the A_phi, B_theta/B_phi and Bmod batch splines directly, with use_B_r and use_del_tp_B disabled. The 3D field spline carries a zero sqrt_g_ss placeholder so splint_boozer_coord stays valid on the loaded path. Both use the libneo global vmec_field path (no SIMPLE field modules, no GPU boozer_state). test_boozer_chartmap_roundtrip pins |B| field equivalence across export/import below 8e-5.
This was referenced Jun 13, 2026
CI (gfortran on the GitHub runner) showed hcovar(2) at case 5 differing from the SIMPLE reference by 1.07e-11 on a ~1e-5 value (rel 1.06e-6), just over the 1e-6/1e-11 thresholds, while it passes locally. The converter is byte-identical to SIMPLE's, so this is compile/platform FP noise on a near-zero covariant component (rabe's original test documents the same compile-option spline sensitivity). Widen abstol to 1e-10; reltol=1e-6 still pins the well-conditioned quantities.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Third PR in the converter consolidation (stacked on #311 /
feat/boozer-angle-transforms). Adds the Boozer chartmap spoke so libneo can export an extended Boozer chartmap from a VMEC equilibrium and load one back into the converter -- the format SIMPLE consumes at runtime.Scope (additive)
boozer_chartmap_io.f90intosrc/field/(deps:iso_fortran_env,ieee_arithmetic,netcdf-- all libneo-available) and adds it to theneolibrary beforeboozer_converter.F90.export_boozer_chartmap(writes rho/s/theta/zeta, X/Y/Z, A_phi/B_theta/B_phi/Bmod viaboozer_to_vmec+splint_vmec_data+splint_boozer_coord+ netcdf) andload_boozer_from_chartmap(reads viaread_boozer_chartmap, rebuilds the aphi/bcovar_tp/field3d splines withuse_B_r=.false.,use_del_tp_B=.false.). New public exports.vmec_B_scale/vmec_RZ_scaleknobs and the GPUboozer_state/syncpath; uses libneo'sfield3d_batch_splinelayout andsplint_boozer_coordsignature.Verification
Independently rebuilt from the committed branch and run with the LandremanPaul2021 QA wout:
test_boozer_chartmap_roundtrippins VMEC->Boozer->export_boozer_chartmap->load_boozer_from_chartmap->re-evaluate, asserting max relative |B| error over interior points < 8e-5.