source: BOL/Multi_atlas/install_multi_atlas.sh @ 4309

Last change on this file since 4309 was 4307, checked in by musat, 20 months ago

Fusion entre la version commune (compte fabric) et la version perso
du multi-atlas incluant

  • la fiabilisation de la realisation des cartes
  • la correction des coupes (latitude,altitude) pour les biais
  • l'ajout d'une option pour des multi-atlas par rapport a une simulation de reference
  • l'ajout d'options pour un multi-atlas regional
  • la mise a jour des thredds (repertoire & html) pour ciclad

IonelaMusat?

  • 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
75
76# IRENE
77if [ ${hostname:0:5} = irene ] ; then
78cat <<eod > definerep.sh
79MAIN_SE=
80TS_DA=
81TS_MO=
82MULTIDIR=
83groupe=
84eod
85cat <<eod > entete.sh
86######################
87## IRENE   TGCC/CEA ##
88######################
89#MSUB -r multiatlas            # Job name
90#MSUB -o multi.out_%I
91#MSUB -e multi.out_%I
92#MSUB -n 1
93#MSUB -T 36000         # Maximum elapsed time
94#MSUB -q xlarge
95#MSUB -c 8
96#MSUB -Q normal
97#MSUB -A $groupe
98#MSUB -m store,work,scratch
99#
100# Commande pour soumettre en bash
101submit=ccc_msub
102eod
103fi
104
105# JEAN-ZAY
106if [ ${hostname:0:5} = jean- ] ; then
107cat <<eod > definerep.sh
108MAIN_SE=
109TS_DA=
110TS_MO=
111MULTIDIR=
112groupe=
113eod
114cat <<eod > entete.sh
115######################
116## IRENE   TGCC/CEA ##
117######################
118#MSUB -r multiatlas            # Job name
119#MSUB -o multi.out_%I
120#MSUB -e multi.out_%I
121#MSUB -n 1
122#MSUB -T 36000         # Maximum elapsed time
123#MSUB -q xlarge
124#MSUB -c 8
125#MSUB -Q normal
126#MSUB -A $groupe
127#MSUB -m store,work,scratch
128#
129# Commande pour soumettre en bash
130submit=sbash
131eod
132fi
133
134# PC (formation et perso linux)
135# Machines locales lmd
136
137local=`pwd -P`
138
139echo -e "${noir}%%%%%%%%%%%%%%%%%%%%%%% ${rougefonce} LMDZ MULTIATLAS ${noir}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
140echo
141echo -e "${bleufonce}"To create your multi-atlas you needs :
142echo 1.  to create your multiatlas directory "example Multi01" :
143echo     mkdir -p $DODSdir/$login/lmdz/MultiSimu/Multi01
144echo 
145echo 2.  to define some characeristics of your multi-atlas "names, dates, description of simulations and atlas variables" :
146echo     cp Utils/def.txt  Utils/atlas-def ${DODSdir}/$login/lmdz/MultiSimu/Multi01/.
147echo     define "names, date, description" of simulations in file :
148echo     ${DODSdir}/$login/lmdz/MultiSimu/Multi01/def.txt
149echo     define atlas variables in file :
150echo     $DODSdir/$login/lmdz/MultiSimu/Multi01/atlas-def
151echo
152echo 3.   Add the link to the simulation outputs in your file : $local/runs.txt
153echo 
154
155### creer le job principal
156rm -f job_multi.sh
157cat entete.sh >| job_multi.sh
158cat Utils/multi.sh >> job_multi.sh
159chmod +x job_multi.sh
160
161#### scripts pour creer les atlas
162rm -f atlas.sh
163cat entete.sh >| atlas.sh
164cat Utils/atlas0.sh >> atlas.sh
165chmod +x atlas.sh
166\mv atlas.sh atlas/.
167###
168rm -f make_atlas.sh
169cat entete.sh >| make_atlas.sh
170cat Utils/make_atlas0.sh >> make_atlas.sh
171chmod +x make_atlas.sh
172\mv make_atlas.sh atlas/.
173
174fi
175
176cp Utils/lmdz_SE0.py tmp0.py
177sed -e s:ROOT_SIM_DIR:$ROOT_SIM_DIR:g tmp0.py > tmp.py
178sed -e s:ROOT_OBS_DIR:$ROOT_OBS_DIR:g tmp.py > lmdz_SE.py
179rm -f tmp0.py tmp.py
180\mv lmdz_SE.py atlas/.
181
182exit
183echo 4. Then you can run your multiatlas :
184echo ./job_multi.sh Multi01
185echo -e "${noir}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
Note: See TracBrowser for help on using the repository browser.