mirror of
https://asciireactor.com/otho/cloudy-agn.git
synced 2025-04-12 17:05:45 +00:00
Merge branch 'master' of github.com:othocaes/cloudy-agn
This commit is contained in:
commit
04b1c8e737
26
scripts/meta/bulk_interpolation_fix.sh
Executable file
26
scripts/meta/bulk_interpolation_fix.sh
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
script_dir=$( cd $(dirname $0) ; pwd -P |sed 's@^\(.*\)/scripts.*@\1/scripts@')
|
||||
basedir=`pwd`
|
||||
|
||||
if [[ -x $script_dir/../bin/interpolation_fix ]]
|
||||
then
|
||||
echo "Binary available. Proceeding."
|
||||
else
|
||||
echo "Binary unavailable. Exiting."
|
||||
exit 9
|
||||
fi
|
||||
|
||||
for fortfile in $@
|
||||
do
|
||||
if [[ -e $(basename $fortfile) ]]
|
||||
then
|
||||
mkdir -p uninterpolated
|
||||
mv $fortfile uninterpolated
|
||||
$script_dir/../bin/interpolation_fix uninterpolated/$(basename $fortfile) $fortfile
|
||||
else
|
||||
$script_dir/../bin/interpolation_fix $fortfile $(basename $fortfile)
|
||||
fi
|
||||
echo ""
|
||||
done
|
||||
exit 0
|
12
scripts/meta/create_fort_files_and_interpolate.sh
Normal file
12
scripts/meta/create_fort_files_and_interpolate.sh
Normal file
@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script not generalized. Use with caution.
|
||||
|
||||
mkdir fortfiles
|
||||
cd fortfiles
|
||||
../../../../../bin/create_fort_files ../mpi_grid.out ../../../../../reference/linelist
|
||||
../../../../../scripts/meta/bulk_interpolation_fix.sh fort.* >> interpolation_report
|
||||
tar cf ../fortfiles_4thdex_ngc5548_mehdipour_cldn24.tar fort.*
|
||||
cd ..
|
||||
gzip fortfiles_4thdex_ngc5548_mehdipour_cldn24.tar
|
||||
echo done
|
@ -43,10 +43,46 @@ int main(int argc, char const *argv[]) {
|
||||
fortfilenum++;
|
||||
}
|
||||
|
||||
int num_unconverged = 0;
|
||||
agn::cloudy_grid::iterator result_it = grid.begin();
|
||||
std::ofstream cautionreportfile;
|
||||
cautionreportfile.open("cautions");
|
||||
cautionreportfile
|
||||
<< "The following solutions probably did not converge."
|
||||
<< std::endl << std::endl;
|
||||
while(result_it != grid.end()) {
|
||||
if (result_it->second.iterations >= 40) {
|
||||
num_unconverged++;
|
||||
cautionreportfile
|
||||
<< "hden = "
|
||||
<< std::fixed
|
||||
<< std::setprecision(3)
|
||||
<< result_it->second.hden
|
||||
<< ", phi = "
|
||||
<< result_it->second.phi
|
||||
<< std::endl
|
||||
<< "───────────────────────────"
|
||||
<< std::endl;
|
||||
std::list<std::string>::iterator caution_it = result_it->second.cautions.begin();
|
||||
while(caution_it != result_it->second.cautions.end()) {
|
||||
cautionreportfile
|
||||
<< *caution_it
|
||||
<< std::endl;
|
||||
caution_it++;
|
||||
}
|
||||
cautionreportfile << std::endl << std::endl;
|
||||
}
|
||||
result_it++;
|
||||
}
|
||||
|
||||
std::cout
|
||||
<< "Saved cautions for "
|
||||
<< num_unconverged
|
||||
<< " unconverged solutions."
|
||||
<< std::endl;
|
||||
cautionreportfile.close();
|
||||
|
||||
std::cout << "Done.\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -43,7 +43,7 @@ int main(int argc, char const *argv[]) {
|
||||
outlier_it++;
|
||||
}
|
||||
std::ofstream smoothed_table_file;
|
||||
smoothed_table_file.open("smoothed_eqwidth_table");
|
||||
smoothed_table_file.open(argv[2]);
|
||||
smoothed_table_file << agn::format_eqwidth_table(smooth_table);
|
||||
smoothed_table_file.close();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user