#!/bin/bash #### Run Parameters #### M=25.0 # AD change from 15M Z=0.02 jobname=M25.00Z0.02 #### Run an inlist function, e.g. run_one 1_H_He_burn_1e-2 function run_one { sed 's/inim/'$M'/g' inlists/inlist_$1 > tmp sed 's/iniz/'$Z'/g' tmp > inlist rm tmp echo 'output is being piped to output/log_'$1 if ./re 500000 > output/log_$1; then echo 'sequence ended without error' else error_exit "Could not run inlist_'$1'. Aborting. Check other error messages." fi } #### Link the executable and make the SE dependencies #### echo 'running model with initial mass = '$M' and initial Z = '$Z echo 'linking executable '$jobname if [ -r ${jobname} ]; then echo 'skipping linking step because link exists'; else ln -s star ${jobname}.exe; fi sed 's/jobname/'$jobname'.exe/g' rn > tmp mv tmp rn chmod +x rn sed 's/jobname/'$jobname'/g' se.input > tmp mv tmp se.input if [ -d ${jobname} ]; then echo 'directory for SE files already exists; using existing directory'; else mkdir ${jobname} fi #### Run the model #### echo 'calculating pre-MS to Xc(4He) = 1.e-2' #run_one 1_H_He_burn_1e-2 echo 'calculating Xc(4He) = 1.e-2 to carbon ignition' #run_one 2_endHe_burn_to_ignite_C echo 'calculating carbon ignition to neon ignition' #run_one 3_C_burn_to_ignite_Ne echo 'calculating neon ignition to Xc(20Ne) = 1.e-3' #run_one 4_Ne_burn_to_1e-3 echo 'calculating Xc(20Ne)=1.e-3 to silicon ignition' #run_one 5_O_burn_to_ignite_Si echo 'calculating silicon ignition to collapse' run_one 6_Si_burn_to_collapse #### At end of run concatenate data #### echo 'Assembling data ... ' cp LOGS/star.log.1_H_He_burn_1e-2 LOGS/star.log cat LOGS/star.log.2_endHe_burn_to_ignite_C >> LOGS/star.log cat LOGS/star.log.3_C_burn_to_ignite_Ne >> LOGS/star.log cat LOGS/star.log.4_Ne_burn_to_1e-3 >> LOGS/star.log cat LOGS/star.log.5_O_burn_to_ignite_Si >> LOGS/star.log cat LOGS/star.log.6_Si_burn_to_collapse >> LOGS/star.log echo 'data assembled and run complete'