boozer_sub: split chartmap file I/O into its own module#338
Merged
Conversation
export/load_boozer_from_chartmap pulled the NetCDF chartmap reader (boozer_chartmap_io) and netcdf into boozer_sub, so converter-only consumers carried them too. Lift the file I/O out: - boozer_chartmap_types: the boozer_chartmap_data_t record alone (no I/O). - boozer_sub keeps build_boozer_from_chartmap(d), which populates the batch splines from an already-parsed record; its only chartmap reference is now the trivial types module. - new boozer_chartmap module owns load/export_boozer_chartmap: load parses via boozer_chartmap_io then calls build; export gathers through the public splint entry points and writes NetCDF. boozer_sub no longer uses boozer_chartmap_io or netcdf. Callers of load/export_boozer_chartmap switch to `use boozer_chartmap`.
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.
Follow-up to #337. With the field-object graft gone, the only remaining non-converter dependency
boozer_subcarried was the chartmap file I/O:export/load_boozer_from_chartmappulledboozer_chartmap_io(the NetCDF reader) andnetcdfinto the module, so a VMEC→Boozer-only consumer had to compile them too.What
Separate file-I/O from state-access (no submodule — plain modules, compiler-portable):
boozer_chartmap_types(new): theboozer_chartmap_data_trecord alone — no I/O, no deps beyondiso_fortran_env.boozer_subkeepsbuild_boozer_from_chartmap(d)— the spline-building half, which needs the private batch-spline state. Its only chartmap reference is now the trivial types module; it no longerusesboozer_chartmap_ioornetcdf.boozer_chartmap(new) owns the file entry points:load_boozer_from_chartmapparses viaboozer_chartmap_iothen callsbuild_boozer_from_chartmap;export_boozer_chartmapgathers through the publicsplint_boozer_coord/boozer_to_vmecand writes NetCDF.boozer_chartmap_iore-exportsboozer_chartmap_data_tfrom the types module, so existinguse boozer_chartmap_io, only: boozer_chartmap_data_timports are unaffected. The only API change: callers ofload/export_boozer_chartmapswitchuse boozer_sub→use boozer_chartmap(onlytest_boozer_chartmap_roundtripin-tree; updated here).Verification
Converter-only consumers (e.g. RABE's curated build) now compile
boozer_converterwith justboozer_chartmap_types— noboozer_chartmap_io, noboozer_chartmap, no NetCDF-via-chartmap.