diff --git a/scripts/meta/process_gridoutputs.sh b/scripts/meta/process_gridoutputs.sh index 0e45dc6..616bb92 100755 --- a/scripts/meta/process_gridoutputs.sh +++ b/scripts/meta/process_gridoutputs.sh @@ -7,8 +7,9 @@ script_dir=$( base_dir=`pwd` bin_dir="$script_dir/../bin" -for dir in $(find . -type 'd' -name 'cldn*') +for file in $(find . -type 'f' -name 'mpi_grid.out') do - echo "Processing ${dir}." + echo "Processing ${file}." + dir=$(dirname $file) $script_dir/operations/package_tables.sh $dir done \ No newline at end of file diff --git a/scripts/operations/package_tables.sh b/scripts/operations/package_tables.sh index e6b3ade..94fe27a 100755 --- a/scripts/operations/package_tables.sh +++ b/scripts/operations/package_tables.sh @@ -23,8 +23,11 @@ fi cd $griddir -if [[ -not -e "mpi_grid.out" ]]; then - echo "no mpi_grid.out file" +if [[ -e "mpi_grid.out" ]]; then + echo -n "" +else + echo "mpi_grid.out doesn't exist" + cd $base_dir exit 6 fi @@ -32,6 +35,9 @@ mkdir -p fortfiles cd fortfiles # pwd +cp ../mpi_grid.in . +cp ../*.tab . + echo "Directory ready. Calling fort file creation." $bin_dir/create_fort_files ../mpi_grid.out $script_dir/../reference/linelist.c17 diff --git a/src/create_fort_files.cpp b/src/create_fort_files.cpp index a3bb95c..3e14313 100644 --- a/src/create_fort_files.cpp +++ b/src/create_fort_files.cpp @@ -1,6 +1,10 @@ #include "agn.hpp" #include "spectral_lines.hpp" +// When this number of iterations is achieved, the program flags it +// as a possible failure. +double MAX_ITERATIONS = 15; + int main(int argc, char const *argv[]) { std::ifstream cloudy_result_file; @@ -90,7 +94,7 @@ int main(int argc, char const *argv[]) { << "The following solutions probably did not converge." << std::endl << std::endl; while(result_it != grid.end()) { - if (result_it->second.iterations >= 40) { + if (result_it->second.iterations >= MAX_ITERATIONS) { num_unconverged++; cautionreportfile << "hden = "