From 1004777b5268e88cbbdb32a9b122dd7fffad1291 Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Fri, 11 Oct 2024 09:35:41 +0200 Subject: [PATCH] Footwork for correction of https://github.com/McStasMcXtrace/McCode/issues/1733 --- mcstas-comps/misc/MCPL_input.comp | 2 +- mcxtrace-comps/misc/MCPL_input.comp | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/mcstas-comps/misc/MCPL_input.comp b/mcstas-comps/misc/MCPL_input.comp index 1681770084..ab214f17f6 100644 --- a/mcstas-comps/misc/MCPL_input.comp +++ b/mcstas-comps/misc/MCPL_input.comp @@ -101,7 +101,7 @@ INITIALIZE } mcset_ncount(nparticles); - if(repeat_count>0 && v_smear==0 && pos_smear==0 && dir_smear==0) { + if(repeat_count>1 && v_smear==0 && pos_smear==0 && dir_smear==0) { fprintf(stdout, "\n\n WARNING: You have requested a repeat_count=%i but have left all *_smear parameters at 0!\n --> This is not allowed! Resetting to repeat_count=1!\n",repeat_count); fprintf(stderr, "\n\n WARNING: You have requested a repeat_count=%i but have left all *_smear parameters at 0!\n --> This is not allowed! Resetting to repeat_count=1!\n",repeat_count); repeat_count=1; diff --git a/mcxtrace-comps/misc/MCPL_input.comp b/mcxtrace-comps/misc/MCPL_input.comp index 2ada14debf..135fa78eb7 100644 --- a/mcxtrace-comps/misc/MCPL_input.comp +++ b/mcxtrace-comps/misc/MCPL_input.comp @@ -99,6 +99,16 @@ INITIALIZE printf("Message(%s): MCPL file (%s) produced with %s.\n",NAME_CURRENT_COMP,filename,mcpl_hdr_srcname(inputfile)); printf("Message(%s): MCPL file (%s) contains %lu particles.\n",NAME_CURRENT_COMP,filename,(long unsigned)nparticles); } + mcset_ncount(nparticles); + + if(repeat_count>1 && E_smear==0 && pos_smear==0 && dir_smear==0) { + fprintf(stdout, "\n\n WARNING: You have requested a repeat_count=%i but have left all *_smear parameters at 0!\n --> This is not allowed! Resetting to repeat_count=1!\n",repeat_count); + fprintf(stderr, "\n\n WARNING: You have requested a repeat_count=%i but have left all *_smear parameters at 0!\n --> This is not allowed! Resetting to repeat_count=1!\n",repeat_count); + repeat_count=1; + sleep(10); + } + + if(repeat_count==0) repeat_count=1; repeat_cnt = repeat_count; ismpislave=0; #if defined (USE_MPI)