diff --git a/couplage/set_repository.sh b/couplage/set_repository.sh new file mode 100644 index 0000000000000000000000000000000000000000..6dcb6a968e04401cd8f3017896531df80e585035 --- /dev/null +++ b/couplage/set_repository.sh @@ -0,0 +1,77 @@ +#!/bin/bash + +#Define your region +reg="EU" +#Define your domain +cod="x" +#Define your country +count="Belgium" +#Define the path to your copy of NESTOR domain +nest="/climato_tmp1/tdethinne/domains/NST.2018.08.01.00.EUa.nc" +#Define the path to your file necessary as Caraib Starting point +str="/climato_tmp1/tdethinne/srv9/init_data" + + +#+++++++++++++++++++++++++++++++++# +# do not edit after here # +#+++++++++++++++++++++++++++++++++# + +# Check if an argument is provided +if [ -z "$1" ]; then + echo "Usage: $0 <0 or 1>" + exit 1 +fi + +dom=$reg$cod + +directory=/climato_tmp1/$USER/MAR/out/$dom/ + +# Perform actions based on the argument +if [ "$1" -eq 0 ]; then + echo "The script will set your MAR/out/$dom/so it match the required shape and move the files" +fi + +if [ "$1" -eq 1 ]; then + echo " The script will set your MAR/out/$dom/so it match the required shape and move the files and compile the model" +fi + +# Copy the code of the coupling +echo "Copy of the code" +mkdir -p $directory/${cod}99/code +scp -r /climato_tmp1/tdethinne/MAR/src/MARCAR/* $directory/${cod}99/code +ln -s MAR_c01.exe MAR_${cod}99.exe + +if [ "$1" -eq 1 ]; then + echo "Compile the code" + $directory/${cod}99/code/COMPILE +fi + +#Recreate the CARAIB directories +mkdir -p $directory/CARAIB_couplage/ +mkdir -p $directory/CARAIB_couplage/clim/$count/ +mkdir -p $directory/CARAIB_couplage/ctrl/ +mkdir -p $directory/CARAIB_couplage/data/ +mkdir -p $directory/CARAIB_couplage/results/$count/ + +#Move the MAR results to a new place +echo "move the MAR results to another place" +mkdir -p $directory/${cod}99/mar/ +mkdir -p $directory/${cod}99/caraib/ + +mv 19* $directory/${cod}99/mar/ +mv 20* $directory/${cod}99/mar/ +mv 21* $directory/${cod}99/mar/ + +echo "Copy the necessary files" +cp $nest $directory/CARAIB_couplage/clim/$count/ + +cp /srv9_tmp1/tdethinne/data_to_coupled/*.dat $directory/CARAIB_couplage/ctrl/ +cp /srv9_tmp1/tdethinne/data_to_coupled/ecotx.1x1 $directory/CARAIB_couplage/data/ +cp -r /srv9_tmp1/tdethinne/data_to_coupled/plantparams $directory/CARAIB_couplage/ + +mv $str/*.dat $directory/CARAIB_couplage/clim/$count/ +mv $str/*.res $directory/CARAIB_couplage/reslts/$count/ +mv $str/plantparams $directory/CARAIB_couplage/ +mv $str/man $directory/CARAIB_couplage/clim/$count/man + +