diff --git a/utilities/bash/dot_profile b/utilities/bash/dot_profile index 068fe00..1c57675 100755 --- a/utilities/bash/dot_profile +++ b/utilities/bash/dot_profile @@ -685,6 +685,26 @@ sixdeskAllTunes(){ tunesYY=( ${tunesYY} ) inttunesYY=( ${inttunesYY} ) } +sixdeskAllAmplitudes_fort13(){ + ## This function splits the fort.13 file according to the number of pairs set in sixdeskenv. A new directory fort13_jobs in the work directory is created which contains all the fort.13 jobs. The amplitude steps are named after the number of the job. + pairs_per_job=$((sixdeskpairs*15)) ## each pair correspons to 15 lines + if [ -d "${sixdeskjobs_logs}/fort.13_jobs" ]; then + rm -rf ${sixdeskjobs_logs}/fort.13_jobs/* + else + mkdir ${sixdeskjobs_logs}/fort.13_jobs + fi + split -a 6 -d -l $pairs_per_job fort.13 ${sixdeskjobs_logs}/fort.13_jobs/fort.13. + fort13_jobs=( $(find ${sixdeskjobs_logs}/fort.13_jobs/ -type f -name 'fort.13.*') ) + nb_fort13_jobs=${#fort13_jobs[@]} + echo Fort.13 will be split in $nb_fort13_jobs jobs + allAmplitudeSteps=( $(seq 1 1 $nb_fort13_jobs) ) + fAmpStarts=("${allAmplitudeSteps[@]}") + fAmpEnds=("${allAmplitudeSteps[@]}") + ampstart=${fAmpStarts[0]} + let __iLast=${#fAmpEnds[@]}-1 + ampfinish=${fAmpEnds[${__iLast}]} +} + sixdeskAllAmplitudes(){ # A.Mereghetti, 2017-04-08 # new function, to generate all amplitude steps diff --git a/utilities/bash/mad6t.sh b/utilities/bash/mad6t.sh index 3b0173b..ddd59dc 100755 --- a/utilities/bash/mad6t.sh +++ b/utilities/bash/mad6t.sh @@ -150,9 +150,13 @@ function submit(){ # Loop over seeds mad6tjob=$lsfFilesPath/mad6t1.sh for (( iMad=$istamad ; iMad<=$iendmad ; iMad++ )) ; do - + if [ "${lflag_fort13}" = true ] ; then + files="2 8 13 16 34" ## fort.13 is also included in sixtrack_input + else + files="2 8 16 34" + fi # clean away any existing results for this seed - for f in 2 8 16 34 ; do + for f in files ; do rm -f $sixtrack_input/fort.$f"_"$iMad.gz done @@ -168,6 +172,8 @@ function submit(){ -e 's?%FORT_34%?'$fort_34'?g' \ -e 's?%MADX_PATH%?'$MADX_PATH'?g' \ -e 's?%MADX%?'$MADX'?g' \ + -e 's?%lflag_fort13%?'$lflag_fort13'?g' \ + -e 's?%sixdeskstudy%?'$sixdeskstudy'?g' \ -e 's?%SIXTRACK_INPUT%?'$sixtrack_input'?g' $mad6tjob > mad6t_"$iMad".sh chmod 755 mad6t_"$iMad".sh diff --git a/utilities/bash/run_six.sh b/utilities/bash/run_six.sh index 9ed7549..16610c6 100755 --- a/utilities/bash/run_six.sh +++ b/utilities/bash/run_six.sh @@ -264,23 +264,43 @@ function preProcessFort3(){ local __dp1=.0 local __dp2=.0 fi - sed -e 's/%turnss/%turnsl/g' \ - -e 's/%nss/'$sixdeskpairs'/g' \ - -e 's/%imc/'$__imc'/g' \ - -e 's/%iclo6/'$__iclo6'/g' \ - -e 's/%ax0s/%ax0l/g' \ - -e 's/%ax1s/%ax1l/g' \ - -e 's/%writebins/%writebinl/g' \ - -e 's/%ratios/%ratiol/g' \ - -e 's/%dp1/'$__dp1'/g' \ - -e 's/%dp2/'$__dp2'/g' \ - -e 's/%e0/'$e0'/g' \ - -e 's/%ition/'$__ition'/g' \ - -e 's/%idfor/'$idfor'/g' \ - -e 's/%ibtype/'$ibtype'/g' \ - -e 's/%bunch_charge/'$bunch_charge'/g' \ - -e 's?%Runnam?%Runnam '"$sixdeskTitle"'?g' \ - $sixdeskjobs_logs/fort.3.mother1 > $sixdeskjobs_logs/fortl.3.mask + ## if fort.13 flag is on keep %nss. There could be an unequal number of pairs in each fort.13 jobs + if $lflag_fort13; then + sed -e 's/%turnss/%turnsl/g' \ + -e 's/%imc/'$__imc'/g' \ + -e 's/%iclo6/'$__iclo6'/g' \ + -e 's/%ax0s/%ax0l/g' \ + -e 's/%ax1s/%ax1l/g' \ + -e 's/%writebins/%writebinl/g' \ + -e 's/%ratios/%ratiol/g' \ + -e 's/%dp1/'$__dp1'/g' \ + -e 's/%dp2/'$__dp2'/g' \ + -e 's/%e0/'$e0'/g' \ + -e 's/%ition/'$__ition'/g' \ + -e 's/%idfor/'$idfor'/g' \ + -e 's/%ibtype/'$ibtype'/g' \ + -e 's/%bunch_charge/'$bunch_charge'/g' \ + -e 's?%Runnam?%Runnam '"$sixdeskTitle"'?g' \ + $sixdeskjobs_logs/fort.3.mother1 > $sixdeskjobs_logs/fortl.3.mask + else + sed -e 's/%turnss/%turnsl/g' \ + -e 's/%nss/'$sixdeskpairs'/g' \ + -e 's/%imc/'$__imc'/g' \ + -e 's/%iclo6/'$__iclo6'/g' \ + -e 's/%ax0s/%ax0l/g' \ + -e 's/%ax1s/%ax1l/g' \ + -e 's/%writebins/%writebinl/g' \ + -e 's/%ratios/%ratiol/g' \ + -e 's/%dp1/'$__dp1'/g' \ + -e 's/%dp2/'$__dp2'/g' \ + -e 's/%e0/'$e0'/g' \ + -e 's/%ition/'$__ition'/g' \ + -e 's/%idfor/'$idfor'/g' \ + -e 's/%ibtype/'$ibtype'/g' \ + -e 's/%bunch_charge/'$bunch_charge'/g' \ + -e 's?%Runnam?%Runnam '"$sixdeskTitle"'?g' \ + $sixdeskjobs_logs/fort.3.mother1 > $sixdeskjobs_logs/fortl.3.mask + fi let __lerr+=$? # - multipole blocks cat $sixdeskjobs_logs/fort.3.mad >> $sixdeskjobs_logs/fortl.3.mask @@ -508,7 +528,11 @@ function preProcessBoinc(){ function submitChromaJobs(){ local __destination=$1 - local __GLOBIGNORE='fort.[2,8]:fort.16:fort*.3.*:fort.10*:sixdesklock:chromaJob0?:lin*:betaJob' + if ${lflag_fort13}; then + local __GLOBIGNORE='fort.[2,8]:fort.16:fort*.3.*:fort.10*:fort.13*:sixdesklock:chromaJob0?:lin*:betaJob' + else + local __GLOBIGNORE='fort.[2,8]:fort.16:fort*.3.*:fort.10*:sixdesklock:chromaJob0?:lin*:betaJob' + fi # -------------------------------------------------------------------------- # generate appropriate fort.3 files as: fort.3.tx + fort.3.mad + fort.3.m2 @@ -579,6 +603,9 @@ function submitChromaJobs(){ sixdeskmess 1 "Running the first one turn job for chromaticity" cat fort.3.t1 fort.3.mad fort.3.m2 > fort.3 rm -f fort.10 + if ${lflag_fort13}; then + cp $sixdeskhome/fort.13 . + fi $SIXTRACKEXE > first_oneturn if test $? -ne 0 -o ! -s fort.10 ; then sixdeskmess -1 "The first turn Sixtrack for chromaticity FAILED!!!" @@ -589,18 +616,24 @@ function submitChromaJobs(){ # save all interesting files from first job rm -rf chromaJob01 mkdir chromaJob01 - cp fort.2 fort.3 fort.8 fort.16 fort.10 first_oneturn chromaJob01 + if ${lflag_fort13}; then + cp fort.2 fort.3 fort.8 fort.16 fort.10 fort.13 first_oneturn chromaJob01 + else + cp fort.2 fort.3 fort.8 fort.16 fort.10 first_oneturn chromaJob01 + fi gzip -f chromaJob01/* mv fort.10 fort.10_first_oneturn # clean dir export GLOBIGNORE=${__GLOBIGNORE} rm -f * export GLOBIGNORE= - # - second job sixdeskmess 1 "Running the second one turn job for chromaticity" cat fort.3.t2 fort.3.mad fort.3.m2 > fort.3 rm -f fort.10 + if ${lflag_fort13}; then + cp $sixdeskhome/fort.13 . + fi $SIXTRACKEXE > second_oneturn if test $? -ne 0 -o ! -s fort.10 ; then sixdeskmess -1 "The second turn Sixtrack for chromaticity FAILED!!!" @@ -611,7 +644,11 @@ function submitChromaJobs(){ # save all interesting files from second job rm -rf chromaJob02 mkdir chromaJob02 - cp fort.2 fort.3 fort.8 fort.16 fort.10 second_oneturn chromaJob02 + if ${lflag_fort13}; then + cp fort.2 fort.3 fort.8 fort.16 fort.10 fort.13 second_oneturn chromaJob02 + else + cp fort.2 fort.3 fort.8 fort.16 fort.10 second_oneturn chromaJob02 + fi gzip -f chromaJob02/* mv fort.10 fort.10_second_oneturn # clean dir @@ -633,8 +670,11 @@ function submitChromaJobs(){ function submitBetaJob(){ local __destination=$1 - local __GLOBIGNORE='fort.[2,8]:fort.16:fort*.3.*:fort.10*:sixdesklock:chromaJob0?:lin*:betaJob' - + if ${lflag_fort13};then + local __GLOBIGNORE='fort.[2,8]:fort.16:fort*.3.*:fort.10*:fort.13*:sixdesklock:chromaJob0?:lin*:betaJob' + else + local __GLOBIGNORE='fort.[2,8]:fort.16:fort*.3.*:fort.10*:sixdesklock:chromaJob0?:lin*:betaJob' + fi # -------------------------------------------------------------------------- # generate appropriate fort.3 files as: fort.3.m1 + fort.3.mad + fort.3.m2 sed -e 's/%turnss/'1'/g' \ @@ -681,6 +721,9 @@ function submitBetaJob(){ # -------------------------------------------------------------------------- # actually run rm -f fort.10 + if ${lflag_fort13};then + cp $sixdeskhome/fort.13 . + fi $SIXTRACKEXE > lin if test $? -ne 0 -o ! -s fort.10 ; then sixdeskmess -1 "The one turn Sixtrack for betavalues FAILED!!!" @@ -691,7 +734,11 @@ function submitBetaJob(){ # save all interesting files from beta job rm -rf betaJob mkdir betaJob - cp fort.2 fort.3 fort.8 fort.16 fort.10 lin betaJob + if ${lflag_fort13};then + cp fort.2 fort.3 fort.8 fort.16 fort.10 fort.13 lin betaJob + else + cp fort.2 fort.3 fort.8 fort.16 fort.10 fort.13 lin betaJob + fi gzip -f betaJob/* mv lin lin_old cp fort.10 fort.10_old @@ -759,19 +806,27 @@ function submitCreateFinalFort3Short(){ } function submitCreateFinalFort3Long(){ - - local __lerr=0 - - # returns ratio - sixdeskRatio $kang $lbackcomp - [ -n "${ratio}" ] || let __lerr+=1 - # returns ax0 and ax1 - sixdeskax0 $factor $beta_x $beta_x2 $beta_y $beta_y2 $ratio $kang $square $fampstart $fampend $lbackcomp - [ -n "${ax0}" ] || let __lerr+=1 - [ -n "${ax1}" ] || let __lerr+=1 - # + if $lflag_fort13; then + ax0=0.0 + ax1=0.0 + cp ${fort13_jobs[${nConsidered} -1]} $sixdeskjobs_logs/fort.13 + fort13_current=$sixdeskjobs_logs/fort.13 + n_lines_fort13_current=$(cat $fort13_current | wc -l ) + sixdeskpairs_current=$(echo $n_lines_fort13_current 15 | awk '{printf ("%.f", ($1/$2))}') + else + local __lerr=0 + # returns ratio + sixdeskRatio $kang $lbackcomp + [ -n "${ratio}" ] || let __lerr+=1 + # returns ax0 and ax1 + sixdeskax0 $factor $beta_x $beta_x2 $beta_y $beta_y2 $ratio $kang $square $fampstart $fampend $lbackcomp + [ -n "${ax0}" ] || let __lerr+=1 + [ -n "${ax1}" ] || let __lerr+=1 + fi + ## if fort.13 flag is on %nss will now be substituted with the number of pairs in the current fort.13 job otherwise %nss does not exist anymore sed -e 's/%turnsl/'$turnsl'/g' \ -e 's/%ax0l/'$ax0'/g' \ + -e 's/%nss/'$sixdeskpairs_current'/g' \ -e 's/%ax1l/'$ax1'/g' \ -e 's/%ratiol/'$ratio'/g' \ -e 's/%tunex/'$tunexx'/g' \ @@ -800,8 +855,12 @@ function submitCreateFinalInputs(){ sixdeskmess 1 "Taking care of SIXTRACK fort.2/fort.3/fort.8/fort.16 in $RundirFullPath" # fort.3 - gzip -c $sixdeskjobs_logs/fort.3 > $RundirFullPath/fort.3.gz - + if $lflag_fort13;then + gzip -c $fort13_current > $RundirFullPath/fort.13.gz + gzip -c $sixdeskjobs_logs/fort.3 > $RundirFullPath/fort.3.gz + else + gzip -c $sixdeskjobs_logs/fort.3 > $RundirFullPath/fort.3.gz + fi # input from MADX: fort.2/.8/.16 for iFort in 2 8 16 ; do [ ! -e $RundirFullPath/fort.${iFort}.gz ] || rm -f $RundirFullPath/fort.${iFort}.gz @@ -1435,9 +1494,12 @@ function treatLong(){ # separate output for current case from previous one echo "" - - sixdeskmess -1 "Considering amplitude step: $Ampl" - + + if $lflag_fort13;then + sixdeskmess -1 "Considering job #$Ampl from fort.13" + else + sixdeskmess -1 "Considering amplitude step: $Ampl" + fi if ${lReduceAngsWithAmplitude}; then jAmple=${iAmple} else @@ -1546,7 +1608,6 @@ function treatLong(){ sixdeskmess 1 "Carrying on with next WU" continue fi - # final preparation of all SIXTRACK files # NB: for boinc, it returns workunitName submitCreateFinalInputs @@ -2173,7 +2234,12 @@ if ${lgenerate} || ${lfix} ; then echo "$emit $gamma" > $sixdesktrackStudy/general_input let __lerr+=$? # - set up of fort.3 - for tmpFile in fort.3.mad fort.3.mother1 fort.3.mother2 ; do + if $lflag_fort13; then + tmpFiles=(fort.3.mad fort.3.mother1 fort.3.mother2 fort.13) + else + tmpFiles=(fort.3.mad fort.3.mother1 fort.3.mother2) + fi + for tmpFile in ${tmpFiles[@]}; do cp ${sixtrack_input}/${tmpFile} $sixdeskjobs_logs if [ $? -ne 0 ] ; then sixdeskmess -1 "unable to copy ${sixtrack_input}/${tmpFile} to $sixdeskjobs_logs" @@ -2378,30 +2444,41 @@ else sixdeskmess -1 " --> along a line in (Qx,Qy) - total: ${iTotalTunes} pairs;" fi fi - if [ $long -eq 1 ] ; then - # generate array of amplitudes (it returns allAmplitudeSteps, fAmpStarts, fAmpEnds, ampstart, ampfinish) - sixdeskAllAmplitudes - iTotalAmplitudeSteps=${#allAmplitudeSteps[@]} - sixdeskmess -1 "- Amplitudes: from $ns1l to $ns2l by $nsincl - total: ${iTotalAmplitudeSteps} amplitude steps;" - # generate array of angles (it returns KKs, Angles and kAngs, and KKs_ampl) - sixdeskAllAngles $kinil $kendl $kmaxl $kstep $ampstart $ampfinish $lbackcomp ${lReduceAngsWithAmplitude} ${totAngle} ${ampFactor} - iTotalAngles=${#KKs[@]} - sixdeskmess -1 "- Angles: $kinil, $kendl, $kmaxl by $kstep - total: ${iTotalAngles} angles" - if ${lReduceAngsWithAmplitude} ; then - sixdeskmess -1 " --> reduced angles with amplitude functionality active" - let iTotal=${iTotalMad}*${iTotalTunes}*${iTotalAngles} - else - let iTotal=${iTotalMad}*${iTotalTunes}*${iTotalAmplitudeSteps}*${iTotalAngles} - fi - elif [ $short -eq 1 ] || [ $da -eq 1 ] ; then - iTotalAmplitudeSteps=1 - sixdeskmess -1 "- Amplitudes: from $ns1s to $ns2s by $nss - total: ${iTotalAmplitudeSteps} amplitude steps;" - # generate array of angles (it returns KKs, Angles and kAngs, and KKs_ampl) - sixdeskAllAngles $kini $kend $kmax $kstep $ampstart $ampfinish $lbackcomp ${lReduceAngsWithAmplitude} ${totAngle} ${ampFactor} - iTotalAngles=${#KKs[@]} - sixdeskmess -1 "- Angles: $kini, $kend, $kmax by $kstep - total: ${iTotalAngles} angles" - let iTotal=${iTotalMad}*${iTotalTunes}*${iTotalAmplitudeSteps}*${iTotalAngles} - fi + if [ "$lflag_fort13" = false ]; then + if [ $long -eq 1 ] ; then + # generate array of amplitudes (it returns allAmplitudeSteps, fAmpStarts, fAmpEnds, ampstart, ampfinish) + sixdeskAllAmplitudes + iTotalAmplitudeSteps=${#allAmplitudeSteps[@]} + sixdeskmess -1 "- Amplitudes: from $ns1l to $ns2l by $nsincl - total: ${iTotalAmplitudeSteps} amplitude steps;" + # generate array of angles (it returns KKs, Angles and kAngs, and KKs_ampl) + sixdeskAllAngles $kinil $kendl $kmaxl $kstep $ampstart $ampfinish $lbackcomp ${lReduceAngsWithAmplitude} ${totAngle} ${ampFactor} + iTotalAngles=${#KKs[@]} + sixdeskmess -1 "- Angles: $kinil, $kendl, $kmaxl by $kstep - total: ${iTotalAngles} angles" + if ${lReduceAngsWithAmplitude} ; then + sixdeskmess -1 " --> reduced angles with amplitude functionality active" + let iTotal=${iTotalMad}*${iTotalTunes}*${iTotalAngles} + else + let iTotal=${iTotalMad}*${iTotalTunes}*${iTotalAmplitudeSteps}*${iTotalAngles} + fi + elif [ $short -eq 1 ] || [ $da -eq 1 ] ; then + iTotalAmplitudeSteps=1 + sixdeskmess -1 "- Amplitudes: from $ns1s to $ns2s by $nss - total: ${iTotalAmplitudeSteps} amplitude steps;" + # generate array of angles (it returns KKs, Angles and kAngs, and KKs_ampl) + sixdeskAllAngles $kini $kend $kmax $kstep $ampstart $ampfinish $lbackcomp ${lReduceAngsWithAmplitude} ${totAngle} ${ampFactor} + iTotalAngles=${#KKs[@]} + sixdeskmess -1 "- Angles: $kini, $kend, $kmax by $kstep - total: ${iTotalAngles} angles" + let iTotal=${iTotalMad}*${iTotalTunes}*${iTotalAmplitudeSteps}*${iTotalAngles} + sixdeskmess -1 "for a total of ${iTotal} points." + fi + else + echo "-> Flag for fort.13 input is active" + ## To be changed!! + sixdeskAllAmplitudes_fort13 + sixdeskAllAngles $kinil $kendl $kmaxl $kstep $ampstart $ampfinish $lbackcomp ${lReduceAngsWithAmplitude} ${totAngle} ${ampFactor} + iTotalAmplitudeSteps=${#allAmplitudeSteps[@]} + iTotalAngles=${#KKs[@]} + fi + let iTotal=${iTotalMad}*${iTotalTunes}*${iTotalAmplitudeSteps}*${iTotalAngles} sixdeskmess -1 "for a total of ${iTotal} points." fi @@ -2430,7 +2507,11 @@ else echo "" sixdeskmess -1 "MADX seed $iMad" if ${lgenerate} || ${lfix} ; then - iForts="2 8 16" + if ${lflag_fort13}; then + iForts="2 8 13 16" + else + iForts="2 8 16" + fi if [ "$fort_34" != "" ] ; then iForts="${iForts} 34" fi diff --git a/utilities/bash/set_env.sh b/utilities/bash/set_env.sh index 751a511..3e1c7d3 100755 --- a/utilities/bash/set_env.sh +++ b/utilities/bash/set_env.sh @@ -139,35 +139,74 @@ function setFurtherEnvs(){ # set exes sixdeskSetExes # scan angles: - lReduceAngsWithAmplitude=false - - if [ -n "${reduce_angs_with_aplitude}" ] ; then - sixdeskmess -1 "wrong spelling of reduce_angs_with_amplitude. Please correct it for future use" - reduce_angs_with_amplitude=${reduce_angs_with_aplitude} - fi - - if [ -z "${reduce_angs_with_amplitude}" ]; then - reduce_angs_with_amplitude=0 - elif (( $(echo "${reduce_angs_with_amplitude}" | awk '{print ($1 >=0)}') )); then - if [ ${long} -ne 1 ]; then - sixdeskmess -1 "reduced angles with amplitudes available only for long simulations!" + lflag_fort13=false + ## if flag exists in sixdeskenv + if [ -n "${flag_fort13}" ]; then + ### if flag is > 0 + if (( $(echo "${flag_fort13}" | awk '{print ($1 > 0)}'))); then + ## if fort.13 exists in sixjobs and it is not empty + if [ -s $sixdeskhome/fort.13 ]; then + n_lines_fort13=$(cat ${sixdeskhome}/fort.13 | wc -l ) + ## if the number of lines is divided by 15 + if (( $n_lines_fort13 % 15 == 0 ));then + ## if it is a long run + if [ ${long} -eq 1 ] ; then + lflag_fort13=true + idfor=2 + ## lock at 1 angle + kinil=1 + kendl=1 + kmaxl=1 + sixdeskmess="Flag for fort.13 is ON. The initial distribution will be created from the fort.13 file. idfor is set to 2" + sixdeskmess + else + sixdeskmess -1 "Fort.13 input is implemented only for long runs" + sixdeskexit 9 + fi + else + sixdeskmess -1 "The format of the fort.13 is not correct" sixdeskexit 9 + fi else - if [ ${kinil} -ne 1 ] || [ ${kendl} -ne ${kmaxl} ] || [ ${kstep} -ne 1 ]; then - sixdeskmess -1 "reduced angles with amplitudes available only for kmin=1, kend=kmax and kstep=1" - sixdeskexit 10 - elif (( $(echo "${reduce_angs_with_amplitude} ${ns2l}" | awk '{print ($1 >= $2)}') )); then - sixdeskmess -1 "reduced angles with amplitudes flag greater than maximum amplitude. Please de-activate the flag" - sixdeskexit 11 - else - lReduceAngsWithAmplitude=true - fi + sixdeskmess -1 "Flag for fort.13 is activated but fort.13 file was not found in ${sixdeskhome} or is empty. Either de-activate the flag or include a fort.13 " + sixdeskexit 9 fi - else - sixdeskmess -1 "reduced angles with amplitudes set to negative value. Flag de-activated" + fi + fi + + lReduceAngsWithAmplitude=false + if [ "$lflag_fort13" = false ]; then + if [ -n "${reduce_angs_with_aplitude}" ] ; then + sixdeskmess -1 "wrong spelling of reduce_angs_with_amplitude. Please correct it for future use" + reduce_angs_with_amplitude=${reduce_angs_with_aplitude} + fi + + if [ -z "${reduce_angs_with_amplitude}" ]; then + reduce_angs_with_amplitude=0 + elif (( $(echo "${reduce_angs_with_amplitude}" | awk '{print ($1 >=0)}') )); then + if [ ${long} -ne 1 ]; then + sixdeskmess -1 "reduced angles with amplitudes available only for long simulations!" + sixdeskexit 9 + else + if [ ${kinil} -ne 1 ] || [ ${kendl} -ne ${kmaxl} ] || [ ${kstep} -ne 1 ]; then + sixdeskmess -1 "reduced angles with amplitudes available only for kmin=1, kend=kmax and kstep=1" + sixdeskexit 10 + elif (( $(echo "${reduce_angs_with_amplitude} ${ns2l}" | awk '{print ($1 >= $2)}') )); then + sixdeskmess -1 "reduced angles with amplitudes flag greater than maximum amplitude. Please de-activate the flag" + sixdeskexit 11 + else + lReduceAngsWithAmplitude=true + fi + fi + else + sixdeskmess -1 "reduced angles with amplitudes set to negative value. Flag de-activated" + fi + fi + export totAngle=90 export lReduceAngsWithAmplitude + export lflag_fort13 } # ============================================================================== @@ -481,6 +520,9 @@ else if ${llocalfort3} ; then cp ${envFilesPath}/fort.3.local studies/${LHCDescrip} fi + if ${lflag_fort13} ; then + cp ${envFilesPath}/fort.13 studies/${LHCDescrip} + fi if ${__lnew} ; then # new study sixdeskmess -1 "Created a NEW study $LHCDescrip" @@ -494,6 +536,9 @@ else if ${llocalfort3} ; then cp ${envFilesPath}/fort.3.local . fi + if ${lflag_fort13} ; then + cp ${envFilesPath}/fort.13 . + fi sixdeskmess -1 "Switched to study $LHCDescrip" fi fi diff --git a/utilities/templates/lsf/mad6t1.sh b/utilities/templates/lsf/mad6t1.sh index fb55cb0..3312783 100644 --- a/utilities/templates/lsf/mad6t1.sh +++ b/utilities/templates/lsf/mad6t1.sh @@ -7,6 +7,8 @@ export CORR_TEST=%CORR_TEST% export fort_34=%FORT_34% export MADX_PATH=%MADX_PATH% export MADX=%MADX% +export lflag_fort13=%lflag_fort13% +export sixdeskstudy=%sixdeskstudy% echo "Calling madx version $MADX in $MADX_PATH" $MADX_PATH/$MADX < $junktmp/$filejob."$i" > $filejob.out."$i" cp -f $filejob.out."$i" $junktmp @@ -115,7 +117,12 @@ touch fc.34 mv fc.2 fort.2 mv fc.16 fort.16 mv fc.8 fort.8 -for fil in fort.2 fort.8 fort.16 +if $lflag_fort13; then + fils=(fort.2 fort.8 fort.13 fort.16) +else + fils=(fort.2 fort.8 fort.16) +fi +for fil in ${fils[@]} do if test -s $sixtrack_input/"$fil"_"$i".gz then @@ -131,9 +138,15 @@ do cat diffs >> $sixtrack_input/WARNINGS fi fi - mv "$fil" "$fil"_"$i" - gzip "$fil"_"$i" - cp "$fil"_"$i".gz $sixtrack_input + if [ $fil = "fort.13" ];then + cp $sixdeskstudy/fort.13 $sixtrack_input + cp $sixtrack_input/fort.13 $sixtrack_input/fort.13_$i + gzip $sixtrack_input/fort.13_$i + else + mv "$fil" "$fil"_"$i" + gzip "$fil"_"$i" + cp "$fil"_"$i".gz $sixtrack_input + fi done if test "$CORR_TEST" -ne 0 then