From f64a035d72ce4f4f6a16383a8615e5e018bbab89 Mon Sep 17 00:00:00 2001 From: Timothy Nunn Date: Mon, 6 Jul 2026 15:48:50 +0100 Subject: [PATCH] Allow detailed physics profile output to be switched off --- process/data_structure/global_variables.py | 5 +++++ process/main.py | 10 ++++++++++ process/models/physics/physics.py | 2 ++ 3 files changed, 17 insertions(+) diff --git a/process/data_structure/global_variables.py b/process/data_structure/global_variables.py index f3e9849c3e..1b7e89305d 100644 --- a/process/data_structure/global_variables.py +++ b/process/data_structure/global_variables.py @@ -35,5 +35,10 @@ class GlobalData: convergence_parameter: float = 0.0 """VMCON convergence parameter 'sum'""" + no_profiles: bool = False + """Reduces the amount of output written to the MFile + by stopping detailed physics profiles from being written. + """ + CREATE_DICTS_FROM_DATACLASS = GlobalData diff --git a/process/main.py b/process/main.py index bfe683a62d..bca2df3e93 100644 --- a/process/main.py +++ b/process/main.py @@ -184,6 +184,12 @@ is_flag=True, help="Run all summary plotting scripts for the output", ) +@click.option( + "--no-profiles", + is_flag=True, + help="Reduces the amount of output written to the MFile by removing " + "detailed physics profiles.", +) @click.pass_context def process_cli( ctx, @@ -195,6 +201,7 @@ def process_cli( mfilejson, update_obsolete, full_output, + no_profiles, ): """ \b @@ -223,6 +230,9 @@ def process_cli( indat, solver, update_obsolete=update_obsolete, filepath_out=mfile_path ) + if no_profiles: + runtype.data.globals.no_profiles = True + runtype.run() mfile_path = runtype.mfile_path diff --git a/process/models/physics/physics.py b/process/models/physics/physics.py index 17e9a0bec7..49a4036b7a 100644 --- a/process/models/physics/physics.py +++ b/process/models/physics/physics.py @@ -5895,6 +5895,8 @@ def calculate_spitzer_resistivity( def output_detailed_physics(self): """Outputs detailed physics variables to file.""" + if self.data.globals.no_profiles: + return po.oheadr(self.outfile, "Detailed Plasma") po.osubhd(self.outfile, "Debye lengths:")