From a27e56933cf587fd25b59028ba8a1513eda865fc Mon Sep 17 00:00:00 2001 From: Michele Guerini Rocco Date: Sun, 2 Apr 2023 16:18:43 +0200 Subject: [PATCH] src/main.f90: give priority to cli over beamdata.txt --- src/main.f90 | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main.f90 b/src/main.f90 index 20293b8..2575b33 100644 --- a/src/main.f90 +++ b/src/main.f90 @@ -57,16 +57,20 @@ program main call exit(1) end if - ! Apply CLI overrides and copy the parameters into - ! global variables exported by the gray_params module + ! Initialise antenna parameters before parsing the + ! cli arguments, so antenna%pos can be overriden + call init_antenna(params%antenna, err) + if (err /= 0) call exit(err) + + ! Apply CLI overrides to the parameters call parse_param_overrides(params) + + ! Copy the parameters into global variables + ! exported by the gray_params module call params_set_globals(params) ! Read the input data and set the global variables ! of the respective module. Note: order matters. - call init_antenna(params%antenna, err) - if (err /= 0) call exit(err) - call init_equilibrium(params, data, err) if (err /= 0) call exit(err)