source: trunk/LMDZ.MARS/deftank/ciclad/run_month1 @ 2216

Last change on this file since 2216 was 2216, checked in by emillour, 5 years ago

Mars GCM:
Add a README in deftank and some samples scripts to run the gcm in
subdirectories.
EM

File size: 2.0 KB
Line 
1#PBS -S  /bin/bash
2#PBS -N  run_month1
3#PBS -q day
4#PBS -j eo
5#PBS -l nodes=1:ppn=24
6#PBS -l mem=5gb
7#PBS -l vmem=28gb
8#PBS -l walltime=20:00:00
9
10## Script to run chained simulations on Ciclad
11## (uses script "run0" and reference file "run.def.ref")
12## Set values of "num_now" and "num_end" in the script below
13## to set initial month # and final month # of the simulation
14
15# go to directory where the job was launched
16cd $PBS_O_WORKDIR
17
18# source the environment (you might need to adapt this path to your case)
19source ../trunk/LMDZ.COMMON/arch.env
20
21date
22
23## set starting month and ending month below:
24num_now=1
25num_end=12
26(( num_previous = $num_now - 1 ))
27
28echo "$num_previous" > num_run
29# next month number
30(( num_next = $num_now + 1 ))
31# true (i.e. modulo 12) month number
32(( true_num = $num_now % 12 ))
33
34\rm -f  error; touch error
35
36case $true_num in
37  1 ) sed s/9999/61/ run.def.ref > run.def ; run0 >> error ;;    #1
38  2 ) sed s/9999/66/ run.def.ref > run.def ; run0 >> error ;;    #2
39  3 ) sed s/9999/66/ run.def.ref > run.def ; run0 >> error ;;    #3
40  4 ) sed s/9999/65/ run.def.ref > run.def ; run0 >> error ;;    #4
41  5 ) sed s/9999/60/ run.def.ref > run.def ; run0 >> error ;;    #5
42  6 ) sed s/9999/54/ run.def.ref > run.def ; run0 >> error ;;    #6
43  7 ) sed s/9999/50/ run.def.ref > run.def ; run0 >> error ;;    #7
44  8 ) sed s/9999/46/ run.def.ref > run.def ; run0 >> error ;;    #8
45  9 ) sed s/9999/47/ run.def.ref > run.def ; run0 >> error ;;    #9
46 10 ) sed s/9999/47/ run.def.ref > run.def ; run0 >> error ;;    #10
47 11 ) sed s/9999/51/ run.def.ref > run.def ; run0 >> error ;;    #11
48  0 ) sed s/9999/56/ run.def.ref > run.def ; run0 >> error ;;    #12
49  * ) echo "error" ;;
50esac
51
52# launch job for next month
53if (( $num_next <= $num_end )) ; then
54  sed -e "0,/num_now=/{s/num_now=/num_now=$num_next/}" \
55      -e "0,/#PBS -N run_month/{s/#PBS -N run_month/#PBS -N run_month$num_next/}" \
56      -e "0,/num_end=/{s/num_end=/num_end=$num_end/}" run_month > run_month$num_next
57  qsub run_month$num_next
58fi
Note: See TracBrowser for help on using the repository browser.