- Timestamp:
- Aug 9, 2017, 11:58:51 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
dynamico_lmdz/aquaplanet/OLD_PHYSIC/RUN_AQUAPLANET_DYNAMICO_LMDZ5/example.sh
r3978 r4037 1 1 #!/bin/bash 2 # How to use this script : 3 # 1 Create a directory EXP for your experiment ; ALL commands below must be run from EXP 4 # 2 Create a directory STORE to store the outputs of your experiment ; run "ln -s STORE storedir" 5 # 3 run "BASE/example.sh copy" where BASE is the directory containing this script 6 # 4a (optional) Edit EXP/run_icosa.def to change nbp, dt, itau_physics 7 # 4b (optional) Edit EXP/prepare.sh to change NB_MPI_DYNAMICO 8 # 4c (optional) Edit EXP/example.sh to change ARCH, NB_YEARS 9 # 5 run "./example.sh create" 10 # 6 EXP run "./example.sh submit" 11 12 function fullpath() 13 { 14 echo "$(cd -P $1 ; pwd)" 15 } 16 17 function years() 18 { 19 for ((i=$1;i<=$2;i++)) ; do 20 echo $(printf 'year%02d' $i) 21 done 22 } 2 23 3 24 function cmd_create() 4 25 { 5 export ESM_ROOT="$PWD/../../" 6 export ARCH=X64_CURIE 7 STORE_ROOT="$STOREDIR/aquaplanet" 8 STORE0L="$STORE_ROOT/ce0l" 9 for DIR in ce0l year01 year02 ; do 26 export ESM_ROOT=$(fullpath ESM_ROOT) 27 STORE_ROOT=$( fullpath $PWD/storedir ) 28 YEARS=$(years 1 $NB_YEARS) 29 for DIR in ce0l $YEARS ; do 10 30 rm -rf $DIR $STORE_ROOT/$DIR 11 31 done 12 ./prepare.sh ce0l ce0l "$STORE0L" 13 ./prepare.sh first $STORE0L year01 "$STORE_ROOT/year01" 14 ./prepare.sh next $STORE0L "$STORE_ROOT/year01" year02 "$STORE_ROOT/year02" 32 STORE0L="$STORE_ROOT/ce0l" 33 $BASEDIR/prepare.sh ce0l ce0l "$STORE0L" 34 $BASEDIR/prepare.sh first $STORE0L year01 "$STORE_ROOT/year01" 35 PREV=year01 36 for YEAR in $(years 2 $NB_YEARS) ; do 37 $BASEDIR/prepare.sh next $STORE0L "$STORE_ROOT/$PREV" $YEAR "$STORE_ROOT/$YEAR" 38 PREV=$YEAR 39 done 15 40 } 16 41 … … 29 54 DEP="" 30 55 submit_$ARCH ce0l 31 submit_$ARCH year01 $DEP 32 submit_$ARCH year02 $DEP 56 for YEAR in $(years 1 $NB_YEARS) ; do 57 submit_$ARCH $YEAR $DEP 58 done 59 } 60 61 function cmd_copy() 62 { 63 export ESM_ROOT=$( fullpath $BASEDIR/../../ ) 64 ln -sf $ESM_ROOT ESM_ROOT 65 cp -fp $BASEDIR/*.sh $BASEDIR/*.xml $BASEDIR/*.def . 66 ls -lrh 33 67 } 34 68 … … 38 72 } 39 73 74 NB_YEARS=10 75 BASEDIR=$(dirname ${BASH_SOURCE[0]}) 76 BASEDIR=$( fullpath $BASEDIR ) 40 77 echo "Your command : $0 $*" 41 echo "Usage : $0 [create|submit]" 42 ARCH=X64_CURIE 78 echo "Script base dir : $BASEDIR" 79 echo "Run from : $(fullpath $PWD)" 80 echo "Usage : $0 [copy|create|submit]" 81 export ARCH=X64_CURIE 43 82 cmd_$1
Note: See TracChangeset
for help on using the changeset viewer.