nesi / APSIM-HPC

Deploy APSIM (Agricultural Production Systems sIMulator - https://www.apsim.info/) on high performance computing clusters.
https://nesi.github.io/APSIM-HPC/
MIT License
0 stars 0 forks source link

Direct split_configfiles_to_sets.sh to make a copy of .met and .apsimx files from current working directory to each `set-x` #38

Closed DininduSenanayake closed 1 month ago

DininduSenanayake commented 1 month ago

split_configfiles_to_sets.sh is working well with respect to splitting the .txt files into multiple directories. However, current iteration requires the user to manually copy the .met and .apsimx master files to each set- directory. Since this is a redundancy as that step can be easily forgotten, it will be ideal to add that instruction to the same script

DininduSenanayake commented 1 month ago

Following will do the trick

# Copy .met and .apsimx files to each set directory
echo "Copying .met and .apsimx files to each set directory..."
for set in {1..4}; do
    cp *.met "set-$set/"
    cp *.apsimx "set-$set/"
done

echo "Copying complete."
echo ".met files copied to each set: $(ls *.met | wc -l)"
echo ".apsimx files copied to each set: $(ls *.apsimx | wc -l)"