source: BOL/Multi_atlas/install_multi_atlas.sh @ 3915

Last change on this file since 3915 was 3915, checked in by musat, 3 years ago

Corrections pour la realisation et l'acceleration des cartes des multi-atlas
IM

  • Property svn:executable set to *
File size: 4.8 KB
Line 
1#!/bin/bash
2
3#################################################################################
4# A.I  : 1e version : Decembre 2019
5# Reprise Mars 2020
6# installer les scripts de post-traitement multi-atlas pour LMDZ sur une machine
7# le packege sera integre sous svn aux ..../BOL/Multi-Atlas
8# Ce script permet de definir les differents repertoires en fonction de la machine
9# Permet de creer les sscripts job_multi.sh et atlas.sh
10#################################################################################
11#
12#
13# Definition des coleurs d'affichage
14noir='\e[0;30m' gris='\e[1;30m' rougefonce='\e[0;31m' rose='\e[1;31m' vertfonce='\e[0;32m' vertclair='\e[1;32m' orange='\e[0;33m' jaune='\e[1;33m' bleufonce='\e[0;34m' bleuclair='\e[1;34m' violetfonce='\e[0;35m' violetclair='\e[1;35m' cyanfonce='\e[0;36m' cyanclair='\e[1;36m' grisclair='\e[0;37m' blanc='\e[1;37m' neutre='\e[0;m'
15##
16##
17# AI avril 2020 : A FAIRE :
18# Utiliser des fonctions entete, ...
19# A function pour definir l entete du job en fonction de la machine
20#function jobentete { #1er argument doit etre le nom de la machine
21
22#set -x
23# Nom machine et login
24hostname=`hostname`
25login=`whoami`
26
27# Definitions en fonction de la machine
28# CICLAD
29if [ ${hostname:0:5} = cicla ] ; then
30# chemin vers le rep dods de base
31DODSDIR=/thredds/ipsl
32# Rep ou sont stockes les multiatlas
33MULTIDIR=$DODSDIR/$login/lmdz/MultiSimu
34# Rep ou se trouve les sorties cmorizees
35ROOT_SIM_DIR=$DODSDIR/$login/lmdz/SE/ORIG
36ROOT_OBS_DIR=$DODSDIR/fabric/lmdz/SE/CMOR/OBS
37if [ ! -d $MULTIDIR ] ; then mkdir -p $MULTIDIR ; fi
38# Def entete des jobs
39cat <<eod >> entete.sh
40#PBS -N atlas
41#PBS -m a
42#PBS -j oe
43#PBS -q h12
44#PBS -o atlasNOMSIMULATION.out
45#PBS -S /bin/bash
46#PBS -l nodes=1:ppn=1
47#PBS -l mem=30gb
48#PBS -l vmem=30gb
49#
50# Commande pour soumettre en bash
51submit=qsub
52
53login=$login
54DODSDIR=$DODSDIR
55eod
56fi
57
58# CLIMSERV
59if [ ${hostname:0:5} = camel ] ; then
60DODSDIR=/thredds/ipsl
61cat <<eod > entete.sh
62#PBS -N atlas
63#PBS -m a
64#PBS -j oe
65#PBS -q h12
66#PBS -o atlasNOMSIMULATION.out
67#PBS -S /bin/bash
68#PBS -l nodes=1:ppn=1
69#PBS -l mem=30gb
70#PBS -l vmem=30gb
71#
72# Commande pour soumettre en bash
73submit=qsub
74eod
75fi
76
77# IRENE
78if [ ${hostname:0:5} = irene ] ; then
79cat <<eod > definerep.sh
80MAIN_SE=
81TS_DA=
82TS_MO=
83MULTIDIR=
84groupe=
85eod
86cat <<eod > entete.sh
87######################
88## IRENE   TGCC/CEA ##
89######################
90#MSUB -r multiatlas            # Job name
91#MSUB -o multi.out_%I
92#MSUB -e multi.out_%I
93#MSUB -n 1
94#MSUB -T 36000         # Maximum elapsed time
95#MSUB -q xlarge
96#MSUB -c 8
97#MSUB -Q normal
98#MSUB -A $groupe
99#MSUB -m store,work,scratch
100#
101# Commande pour soumettre en bash
102submit=ccc_msub
103eod
104fi
105
106# JEAN-ZAY
107if [ ${hostname:0:5} = jean- ] ; then
108cat <<eod > definerep.sh
109MAIN_SE=
110TS_DA=
111TS_MO=
112MULTIDIR=
113groupe=
114eod
115cat <<eod > entete.sh
116######################
117## IRENE   TGCC/CEA ##
118######################
119#MSUB -r multiatlas            # Job name
120#MSUB -o multi.out_%I
121#MSUB -e multi.out_%I
122#MSUB -n 1
123#MSUB -T 36000         # Maximum elapsed time
124#MSUB -q xlarge
125#MSUB -c 8
126#MSUB -Q normal
127#MSUB -A $groupe
128#MSUB -m store,work,scratch
129#
130# Commande pour soumettre en bash
131submit=sbash
132eod
133fi
134
135# PC (formation et perso linux)
136# Machines locales lmd
137
138local=`pwd -P`
139
140echo -e "${noir}%%%%%%%%%%%%%%%%%%%%%%% ${rougefonce} LMDZ MULTIATLAS ${noir}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
141echo
142echo -e "${bleufonce}"To create your multi-atlas you needs :
143echo 1.  to create your multiatlas directory "example Multi01" :
144echo     mkdir -p $DODSdir/$login/lmdz/MultiSimu/Multi01
145echo 
146echo 2.  to define some characeristics of your multi-atlas "names, dates, description of simulations and atlas variables" :
147echo     cp Utils/def.txt  Utils/atlas-def ${DODSdir}/$login/lmdz/MultiSimu/Multi01/.
148echo     define "names, date, description" of simulations in file :
149echo     ${DODSdir}/$login/lmdz/MultiSimu/Multi01/def.txt
150echo     define atlas variables in file :
151echo     $DODSdir/$login/lmdz/MultiSimu/Multi01/atlas-def
152echo
153echo 3.   Add the link to the simulation outputs in your file : $local/runs.txt
154echo 
155
156### creer le job principal
157rm -f job_multi.sh
158cat entete.sh >| job_multi.sh
159cat Utils/multi.sh >> job_multi.sh
160chmod +x job_multi.sh
161
162#### scripts pour creer les atlas
163rm -f atlas.sh
164cat entete.sh >| atlas.sh
165cat Utils/atlas0.sh >> atlas.sh
166chmod +x atlas.sh
167\mv atlas.sh atlas/.
168###
169rm -f make_atlas.sh
170cat entete.sh >| make_atlas.sh
171cat Utils/make_atlas0.sh >> make_atlas.sh
172chmod +x make_atlas.sh
173\mv make_atlas.sh atlas/.
174
175cp Utils/lmdz_SE0.py tmp0.py
176sed -e s:ROOT_SIM_DIR:$ROOT_SIM_DIR:g tmp0.py > tmp.py
177sed -e s:ROOT_OBS_DIR:$ROOT_OBS_DIR:g tmp.py > lmdz_SE.py
178rm -f tmp0.py tmp.py
179\mv lmdz_SE.py atlas/.
180
181echo 4. Then you can run your multiatlas :
182echo ./job_multi.sh Multi01
183echo -e "${noir}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
Note: See TracBrowser for help on using the repository browser.