From e65ed9ee78648b50d1933c1c66688c439f949c78 Mon Sep 17 00:00:00 2001 From: Christopher Albert Date: Mon, 13 Jul 2026 15:30:43 +0200 Subject: [PATCH] Record passing filters in NetCDF results --- src/netcdf_results_output.f90 | 6 ++++++ test/python/test_netcdf_results.py | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/netcdf_results_output.f90 b/src/netcdf_results_output.f90 index 85a40557..f3f08904 100644 --- a/src/netcdf_results_output.f90 +++ b/src/netcdf_results_output.f90 @@ -50,6 +50,7 @@ subroutine write_results_netcdf(filename) canonical_grid_nr, canonical_grid_ntheta, & canonical_grid_nphi, canonical_ode_relerr, & ntimstep, startmode, num_surf, sbeg, & + contr_pp, notrace_passing, & isw_field_type, swcoll, deterministic, ran_seed, & netcdffile, field_input, coord_input, & wall_input, wall_units, wall_hit, wall_hit_cart, & @@ -336,6 +337,11 @@ subroutine write_results_netcdf(filename) call check_nc(status, 'put_att num_surf') status = nf90_put_att(ncid, nf90_global, 'sbeg', sbeg) call check_nc(status, 'put_att sbeg') + status = nf90_put_att(ncid, nf90_global, 'contr_pp', contr_pp) + call check_nc(status, 'put_att contr_pp') + status = nf90_put_att(ncid, nf90_global, 'notrace_passing', & + notrace_passing) + call check_nc(status, 'put_att notrace_passing') status = nf90_put_att(ncid, nf90_global, 'isw_field_type', isw_field_type) call check_nc(status, 'put_att isw_field_type') status = nf90_put_att(ncid, nf90_global, 'swcoll', merge(1, 0, swcoll)) diff --git a/test/python/test_netcdf_results.py b/test/python/test_netcdf_results.py index 6013bc9b..02bd1bcd 100644 --- a/test/python/test_netcdf_results.py +++ b/test/python/test_netcdf_results.py @@ -43,6 +43,8 @@ def test_results_netcdf_created(self, vmec_file: str, tmp_path: Path): ntestpart=8, output_results_netcdf=True, isw_field_type=3, + contr_pp=-1e10, + notrace_passing=0, ) particles = pysimple.sample_surface(8, s=0.5) pysimple.trace_parallel(particles) @@ -89,6 +91,8 @@ def test_results_netcdf_created(self, vmec_file: str, tmp_path: Path): assert ds.canonical_grid_nphi == 64 assert ds.canonical_ode_relerr == 1e-11 assert ds.multharm == 5 + assert ds.contr_pp == -1e10 + assert ds.notrace_passing == 0 finally: os.chdir(original_dir)