Commit 9f663c14 authored by Patryk Kiepas's avatar Patryk Kiepas 🐦
Browse files

Semi-automatic execution of the Valentin's configuration on JeanZay with one script

parent 7e297820
temp/
\ No newline at end of file
#!/bin/bash
# This scripts tries to perform the minimal amount of work to run the configuration by Valentin. Give it a try!
# For each stage run this script with the stage id [1..5].
# Some stages create batch jobs, make sure they finish before moving on!
ROOT=$(pwd)
CFG=$ROOT/valentin
case "$1" in
1) # Preparation
echo ">>>> Creating temp directory"
rm temp/ -rf
mkdir temp/
echo ">>>> Downloading TUTORIAL_PROD from an accessible source"
pushd temp/
wget https://www.lmd.jussieu.fr/~lmdz/pub/Training/tutorial_prod_v20220106.tar
tar -xvf tutorial_prod_v20220106.tar
# The TEST_PROD directory must be in the $STORE path, otherwise, running the main.sh script fails
mv TEST_PROD/ $STORE/TEST_PROD
popd
rm temp/ -rf
echo ">>>> Copying scripts, configurations, and other files by Valentin"
pushd $STORE/TEST_PROD
cp $CFG/*.sh .
cp $CFG/script_SIMU .
cp $CFG/DEF/* DEF/
cp $CFG/XMLfilesLMDZ/* DEF/XMLfilesLMDZ/
# If we leave year after >2018, then, we need to perform some additional steps (create_amip.sh)
echo ">>>> Changing simulation period to 201501-201502 in main.sh"
sed -i '128 c\mthini=201501' main.sh
sed -i '129 c\mthend=201502' main.sh
echo ">>>> Changing simulation period to 201501-201502 in era2gcm.sh"
sed -i '22 c\mth_i=201501' era2gcm.sh
sed -i '23 c\mth_f=201502' era2gcm.sh
popd ;;
2) # Installation
pushd $STORE/TEST_PROD
echo ">>>> Preparing main_install.sh script for the LMDZ installation step"
cp main.sh main_install.sh
sed -i '51 c\install="-install"' main_install.sh
sed -i '97 c\init=1' main_install.sh
echo ">>>> Running the installation (wait until the job has finished!)"
./main_install.sh
popd ;;
3) # Initialisation
echo ">>>> Updating the LMDZ to the newest version"
pushd $WORK/LMDZ20210927.trunk/modipsl/modeles/LMDZ/
module load svn/1.9.7
svn update
popd
echo ">>>> Preparing main_init.sh script for the creation of initial data"
pushd $STORE/TEST_PROD
cp main.sh main_init.sh
# Prepare main_init.sh for the initialisation and run it!
sed -i '97 c\init=1' main_init.sh
# Removing INIT files as we want to regenerate them
rm INIT/ -rf
echo ">>>> Running the initialisation"
./main_init.sh
popd ;;
4) # Data preparation
pushd $STORE/TEST_PROD
echo ">>>> Preparing the ERA (or other) data"
./era2gcm.sh
popd ;;
5) # Running simulation
pushd $STORE/TEST_PROD
echo ">>>> Running the configuration"
./main.sh
popd ;;
esac
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment