diff --git a/desc/magnetic_fields/_core.py b/desc/magnetic_fields/_core.py index ab5f852bdc..760f4e372b 100644 --- a/desc/magnetic_fields/_core.py +++ b/desc/magnetic_fields/_core.py @@ -613,7 +613,7 @@ def save_mgrid( ) bz_001[:] = B_Z - if A_R is not None: + if save_vector_potential: ar_001 = file.createVariable("ar_001", np.float64, ("phi", "zee", "rad")) ar_001.long_name = ( "A_R = radial component of magnetic vector potential "