Skip to content

Commit

Permalink
only use one input file
Browse files Browse the repository at this point in the history
  • Loading branch information
Piyush Sharda authored and Piyush Sharda committed Aug 27, 2024
1 parent 613f38f commit 9aedc9a
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/burn_cell_metal_chem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,25 @@ jobs:
ref_line_number_z10=(1 2 3 5 7 10 17 23 28)
# Original input file
original_input_file="inputs_metal_chem_1"
modified_input_file="inputs_metal_chem_modified"
for Z in "Z=1" "Z=1_z10" "Z=1e-1" "Z=1e-2" "Z=1e-3" "Z=1e-4" "Z=1e-5" "Z=1e-6"; do
input_file="inputs_metal_chem_${Z//Z=/}"
output_file="test_${Z//Z=/}.out"
./main1d.gnu.DEBUG.ex $input_file amrex.fpe_trap_{invalid,zero,overflow}=1 > $output_file
cp $original_input_file $modified_input_file
Z_val=${Z//Z=/}
if [[ "$Z" == "Z=1_z10" ]]; then
# Modify the redshift line for Z=1_z10
sed -i 's/network.redshift = 0.0/network.redshift = 10.0/g' $modified_input_file
else
# Replace the metallicity and dust2gas_ratio values for other Z values
sed -i 's/network.metallicity = .*/network.metallicity = '"$Z_val"'/g' $modified_input_file
sed -i 's/network.dust2gas_ratio = .*/network.dust2gas_ratio = '"$Z_val"'/g' $modified_input_file
fi
output_file="test_${Z_val}.out"
./main1d.gnu.DEBUG.ex $modified_input_file amrex.fpe_trap_{invalid,zero,overflow}=1 > $output_file
line_numbers="${line_numbers_map[$Z]}"
ref_file="${ref_map[$Z]}"
Expand Down

0 comments on commit 9aedc9a

Please sign in to comment.