source: trunk/LMDZ.MARS/deftank/spirit/run_month1 @ 2922

Last change on this file since 2922 was 2922, checked in by emillour, 23 months ago

Mars PCM:
Add illustrative execution job for spirit (aka MESOIPSL cluster) in deftank
EM

File size: 1.9 KB
Line 
1#!/bin/bash
2#SBATCH --ntasks-per-node=15
3#SBATCH --cpus-per-task=4
4#SBATCH --partition=zen4 # zen4: 64cores/node and 240GB of memory
5##SBATCH --partition=zen16 # zen16: 32 cores/node core and 496GB of memory
6#SBATCH -J run_month1
7#SBATCH --time=3:00:00
8#SBATCH --output %x.%j.out
9
10# A few parameters that might need be changed depending on your setup:
11# Path to the arch.env to source
12source ../trunk_ifort/LMDZ.COMMON/arch.env
13# Number of threads to use (must be the same as "#MSUB -c" above)
14export OMP_NUM_THREADS=4
15export OMP_STACKSIZE=400M
16
17set -xv
18ls -al
19
20## set starting month and ending month below:
21num_now=1
22num_end=12
23(( num_previous = $num_now - 1 ))
24
25echo "$num_previous" > num_run
26# next month number
27(( num_next = $num_now + 1 ))
28# true (i.e. modulo 12) month number
29(( true_num = $num_now % 12 ))
30
31\rm -f  error; touch error
32
33case $true_num in
34  1 ) sed s/9999/61/ run.def.ref > run.def ; run0 >> error ;;    #1
35  2 ) sed s/9999/66/ run.def.ref > run.def ; run0 >> error ;;    #2
36  3 ) sed s/9999/66/ run.def.ref > run.def ; run0 >> error ;;    #3
37  4 ) sed s/9999/65/ run.def.ref > run.def ; run0 >> error ;;    #4
38  5 ) sed s/9999/60/ run.def.ref > run.def ; run0 >> error ;;    #5
39  6 ) sed s/9999/54/ run.def.ref > run.def ; run0 >> error ;;    #6
40  7 ) sed s/9999/50/ run.def.ref > run.def ; run0 >> error ;;    #7
41  8 ) sed s/9999/46/ run.def.ref > run.def ; run0 >> error ;;    #8
42  9 ) sed s/9999/47/ run.def.ref > run.def ; run0 >> error ;;    #9
43 10 ) sed s/9999/47/ run.def.ref > run.def ; run0 >> error ;;    #10
44 11 ) sed s/9999/51/ run.def.ref > run.def ; run0 >> error ;;    #11
45  0 ) sed s/9999/56/ run.def.ref > run.def ; run0 >> error ;;    #12
46  * ) echo "error" ;;
47esac
48
49# launch job for next month
50if (( $num_next <= $num_end )) ; then
51  cp -f run_month$num_now tmp
52  sed -e "s@run_month${num_now}@run_month${num_next}@" \
53      -e "s@num_now=${num_now}@num_now=${num_next}@" tmp > run_month$num_next
54  rm tmp
55 
56  sbatch run_month$num_next
57fi
Note: See TracBrowser for help on using the repository browser.