source: BOL/Multi_atlas/install_multi_atlas.sh @ 3694

Last change on this file since 3694 was 3694, 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.
Corrections.

  • Property svn:executable set to *
File size: 5.1 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=/prodigfs/ipslfs/dods
30# Rep ou sont stockes les multiatlas
31MULTIDIR=$DODSDIR/$login/lmdz/MultiSimu
32if [ ! -d $MULTIDIR ] ; then mkdir -p $MULTIDIR ; fi
33
34# Def entete des job
35cat <<eod >> entete.sh
36#PBS -N atlas
37#PBS -m a
38#PBS -j oe
39#PBS -q h12
40#PBS -o atlasNOMSIMULATION.out
41#PBS -S /bin/bash
42#PBS -l nodes=1:ppn=1
43#PBS -l mem=30gb
44#PBS -l vmem=30gb
45#
46# Commande pour soumettre en bash
47submit=qsub
48
49login=$login
50DODSDIR=$DODSDIR
51eod
52
53# Def env atlas
54cat <<eod >> defatlasenv.sh
55########################################################################################################
56# Environnement
57module list
58which python
59ulimit -s unlimited
60export PYTHONPATH=$PYTHONPATH:/home/fabric/users/denvil/climaf
61export PATH=$PATH:/home/fabric/users/denvil/climaf/bin
62STORAGE=$DODSDIR/$login/lmdz/STORE
63if [ ! -d $DODSDIR/$login/climafCache ] ; then mkdir -p $DODSDIR/$login/climafCache ; fi
64export CLIMAF_CACHE=$DODSDIR/$login/climafCache
65echo CLIMAF_CACHE $CLIMAF_CACHE
66MULTIDIR=$MULTIDIR
67DIRATLAS=$DODSDIR/$login/lmdz/atlas
68ATLAS_DIR=$DODSDIR/$login/lmdz/atlas/Atlas$$
69if [ ! -d $DODSDIR/$login/lmdz/atlas/Atlas$$ ] ; then mkdir -p $DODSDIR/$login/lmdz/atlas/Atlas$$ ; fi
70########################################################################################################
71eod
72
73fi
74
75# CLIMSERV
76if [ ${hostname:0:5} = camel ] ; then
77DODSDIR=/prodigfs/ipslfs/dods
78cat <<eod > entete.sh
79#PBS -N atlas
80#PBS -m a
81#PBS -j oe
82#PBS -q h12
83#PBS -o atlasNOMSIMULATION.out
84#PBS -S /bin/bash
85#PBS -l nodes=1:ppn=1
86#PBS -l mem=30gb
87#PBS -l vmem=30gb
88#
89# Commande pour soumettre en bash
90submit=qsub
91eod
92fi
93
94# IRENE
95if [ ${hostname:0:5} = irene ] ; then
96cat <<eod > definerep.sh
97MAIN_SE=
98TS_DA=
99TS_MO=
100MULTIDIR=
101groupe=
102eod
103cat <<eod > entete.sh
104######################
105## IRENE   TGCC/CEA ##
106######################
107#MSUB -r multiatlas            # Job name
108#MSUB -o multi.out_%I
109#MSUB -e multi.out_%I
110#MSUB -n 1
111#MSUB -T 36000         # Maximum elapsed time
112#MSUB -q xlarge
113#MSUB -c 8
114#MSUB -Q normal
115#MSUB -A $groupe
116#MSUB -m store,work,scratch
117#
118# Commande pour soumettre en bash
119submit=ccc_msub
120eod
121fi
122
123# JEAN-
124if [ ${hostname:0:5} = jean- ] ; then
125cat <<eod > definerep.sh
126MAIN_SE=
127TS_DA=
128TS_MO=
129MULTIDIR=
130groupe=
131eod
132cat <<eod > entete.sh
133######################
134## IRENE   TGCC/CEA ##
135######################
136#MSUB -r multiatlas            # Job name
137#MSUB -o multi.out_%I
138#MSUB -e multi.out_%I
139#MSUB -n 1
140#MSUB -T 36000         # Maximum elapsed time
141#MSUB -q xlarge
142#MSUB -c 8
143#MSUB -Q normal
144#MSUB -A $groupe
145#MSUB -m store,work,scratch
146#
147# Commande pour soumettre en bash
148submit=sbash
149eod
150fi
151
152# PC (formation et perso linux)
153
154# Machines locales lmd
155
156echo -e "${noir}%%%%%%%%%%%%%%%%%%%%%%%%% ${rougefonce} MULTIATLAS LMDZ ${noir}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
157echo -e "${bleufonce}" To create your multi-atlas you needs :
158echo 1.  to create your multiatlas directory "example Multi01" :
159echo    - mkdir -p /prodigfs/ipslfs/dods/$login/lmdz/MultiSimu/Multi01
160echo 2.  to define some characeristics of your multi-atlas "names, dates, description of simulations and atlas variables" :
161echo    - cp Utils/def.txt  Utils/atlas-def /prodigfs/ipslfs/dods/$login/lmdz/MultiSimu/Multi01/.
162echo     define "names, date, description" of simulations in file :
163echo    - /prodigfs/ipslfs/dods/$login/lmdz/MultiSimu/Multi01/def.txt
164echo     define atlas variables in file
165echo    - /prodigfs/ipslfs/dods/$login/lmdz/MultiSimu/Multi01/atlas.def
166
167rm -f job_multi.sh
168cat entete.sh >| job_multi.sh
169cat Utils/multi.sh >> job_multi.sh
170chmod +x job_multi.sh
171
172rm -f atlas.sh
173cat entete.sh >| atlas.sh
174cat defatlasenv.sh >> atlas.sh
175cat Utils/atlas0.sh >> atlas.sh
176chmod +x atlas.sh
177\mv atlas.sh atlas/.
178
179echo Then you can run your multiatlas :
180echo ./job_multi.sh Multi01
181echo -e "${noir}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
Note: See TracBrowser for help on using the repository browser.