source: BOL/Multi_atlas/install_multi_atlas.sh @ 3743

Last change on this file since 3743 was 3743, checked in by idelkadi, 4 years ago

Repository under svn of a first version of Multiatlas diagnostics for LMDZ. This version is adapted to be able to run a LMDZ multiatlas on an individual account on the ciclad machine of the IPSL. In this version, the parts to be modified are identified so as to subsequently adapt it to other machines.
(cleaning)

  • Property svn:executable set to *
File size: 4.7 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 integrer sous svn aux sources du modele ..../BOL/
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# Definition des coleurs d'affichage
12noir='\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'
13##
14##
15# AI avril 2020 : A FAIRE :
16# Utiliser des fonctions entete, ...
17# A function pour definir l entete du job en fonction de la machine
18#function jobentete { #1er argument doit etre le nom de la machine
19
20#set -x
21# Nom machine et compte
22hostname=`hostname`
23login=`whoami`
24
25# Definitions en fonction de la machine
26# CICLAD
27if [ ${hostname:0:5} = cicla ] ; then
28# chemin vers le rep dods de base
29DODSDIR=/modfs/ipslfs/dods
30# Rep ou sont stockes les multiatlas
31MULTIDIR=$DODSDIR/$login/lmdz/MultiSimu
32# Rep ou se trouve les sorties cmorizees
33ROOT_SIM_DIR=$DODSDIR/$login/lmdz/SE/ORIG
34ROOT_OBS_DIR=$DODSDIR/$login/lmdz/SE/CMOR/OBS
35if [ ! -d $MULTIDIR ] ; then mkdir -p $MULTIDIR ; fi
36
37# Def entete des job
38cat <<eod >> entete.sh
39#PBS -N atlas
40#PBS -m a
41#PBS -j oe
42#PBS -q h12
43#PBS -o atlasNOMSIMULATION.out
44#PBS -S /bin/bash
45#PBS -l nodes=1:ppn=1
46#PBS -l mem=30gb
47#PBS -l vmem=30gb
48#
49# Commande pour soumettre en bash
50submit=qsub
51
52login=$login
53DODSDIR=$DODSDIR
54eod
55fi
56
57# CLIMSERV
58if [ ${hostname:0:5} = camel ] ; then
59DODSDIR=/modfs/ipslfs/dods
60cat <<eod > entete.sh
61#PBS -N atlas
62#PBS -m a
63#PBS -j oe
64#PBS -q h12
65#PBS -o atlasNOMSIMULATION.out
66#PBS -S /bin/bash
67#PBS -l nodes=1:ppn=1
68#PBS -l mem=30gb
69#PBS -l vmem=30gb
70#
71# Commande pour soumettre en bash
72submit=qsub
73eod
74fi
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-
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
136# Machines locales lmd
137
138local=`pwd -P`
139
140echo -e "${noir}%%%%%%%%%%%%%%%%%%%%%%% ${rougefonce} LMDZ MULTIATLAS ${noir}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
141echo
142echo -e "${vertfonce}"To create your multi-atlas you needs :
143echo 1.  to create your multiatlas directory "example Multi01" :
144echo     mkdir -p /modfs/ipslfs/dods/$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 /modfs/ipslfs/dods/$login/lmdz/MultiSimu/Multi01/.
148echo     define "names, date, description" of simulations in file :
149echo     /modfs/ipslfs/dods/$login/lmdz/MultiSimu/Multi01/def.txt
150echo     define atlas variables in file :
151echo     /modfs/ipslfs/dods/$login/lmdz/MultiSimu/Multi01/atlas-def
152echo
153echo 3.   Add the link to the simulation outputs in your file : $local/runs.txt
154echo 
155rm -f job_multi.sh
156cat entete.sh >| job_multi.sh
157cat Utils/multi.sh >> job_multi.sh
158chmod +x job_multi.sh
159
160#### script pour creer les atlas
161rm -f atlas.sh
162cat entete.sh >| atlas.sh
163cat Utils/atlas0.sh >> atlas.sh
164chmod +x atlas.sh
165\mv atlas.sh atlas/.
166cp Utils/lmdz_SE0.py tmp0.py
167sed -e s:ROOT_SIM_DIR:$ROOT_SIM_DIR:g tmp0.py > tmp.py
168sed -e s:ROOT_OBS_DIR:$ROOT_OBS_DIR:g tmp.py > lmdz_SE.py
169rm -f tmp0.py tmp.py
170\mv lmdz_SE.py atlas/.
171
172
173echo 4. Then you can run your multiatlas :
174echo ./job_multi.sh Multi01
175echo -e "${noir}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
Note: See TracBrowser for help on using the repository browser.