#!/usr/bin/env bash # This still isn't really generalized. Need to go to a # specific directory of runs to run this. Feed it a list # of column densities. script_dir=$( cd $(dirname $0) ; pwd -P |sed 's@^\(.*\)/scripts.*@\1/scripts@' ) base_dir=`pwd` bin_dir="$script_dir/../bin" griddir=$1 grid_id=$(echo ${griddir}|sed 's@^\.\/\(.*\)@\1@'|sed 's@.grids@@'|sed 's@\/@.@g') if [[ -e "fortfiles_${grid_id}.tar.gz" ]]; then echo "Package fortfiles_${grid_id}.tar.gz exists." exit 5 else echo "Setting up to compile fortfiles_${grid_id}.tar.gz." fi cd $griddir if [[ -e "mpi_grid.out" ]]; then echo -n "" else echo "mpi_grid.out doesn't exist" cd $base_dir exit 6 fi 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 echo "Applying interpolative smoothing." $script_dir/operations/bulk_interpolation_fix.sh fort.* > interpolation_report grid_id=$(echo ${griddir}|sed 's@^\.\/\(.*\)@\1@'|sed 's@.grids@@'|sed 's@\/@.@g') echo "Saving $grid_id grid" tar cf fortfiles_${grid_id}.tar * gzip fortfiles_${grid_id}.tar mv fortfiles_${grid_id}.tar.gz $base_dir cd $base_dir