source: trunk/LMDZ.MARS/deftank/adastra/run_month1 @ 3567

Last change on this file since 3567 was 3033, checked in by emillour, 16 months ago

Mars PCM:
Add some example scripts for Adastra
EM

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