source: BOL/script_install/install.sh @ 1640

Last change on this file since 1640 was 1621, checked in by Ehouarn Millour, 12 years ago

Updated install.sh script to also build the 'rebuild' utility, when it is available (which is the case with latest updated versions of modipsl.* sources; i.e. those derived from 'modipsl.v7').
EM

File size: 19.6 KB
Line 
1#!/bin/bash
2
3###########################################################################
4# Auteur : Frédéric Hourdin/LMD/hourdin@lmd.jussieu.fr
5# Usage  : install.sh
6#
7# Script bash d'installation du modele LMDZ sur un ordinateur PC/Linux
8# en utilisant le compilateur g95.
9# Le modele est récupéré dans une arborescence
10# $MODEL/modipsl/modeles/...
11# en utilisant l'infrastructure "modipsl" mise au point à l'"IPSL" pour
12#les besoins de la modélisation couplée du climat
13#(atmosphere/ocean/vegetation/chimie)
14# On ne récupère ici que les composantes atmosphériques (LMDZ4)
15# et végétation (ORCHIDEE).
16#
17# Sous le répertoire "modeles", on trouve en fait les sources de différents
18# modèles. Ici, LMDZ4, ORCHIDEEet IOIPSL, ensemble de programmes
19# d'entrée/sortie faisant appel à la librairie netcdf.
20#
21# Le script récupères les différents jeux de sources (y compris une
22# version de netcdf) et utilitaires, compile le modèle, et lance une
23# simulation de test dans une configuration très légère sur
24# $MODEL/modipsl/modeles/LMDZ4/INI
25#
26# Pré-requis : g95/pgf90/gfortran, ksh, wget , gunzip, tar, ... (à compléter)
27#
28# Modif 18/11/2011
29#    changement pour l'option real 8.
30#      On compile avec -r8 (ou équivalent) et -DNC_DOUBLE pour le GCM
31#      mais avec -r4 netcdf. La variable real est initialisée à
32#      r4 ou r8 en début de script.
33#
34###########################################################################
35
36echo '################################################################'
37echo  Choix des options d installation
38echo '################################################################'
39
40
41#real=r4
42real=r8
43
44# ATTENTION !!!! Pour des versions anterieures a octobre 2009, utiliser
45# install.v2.sh au lieu de install.sh
46
47version=20110921.trunk
48#Chemin pour placer le modele
49MODEL=./LMDZ$version
50
51getlmdzor=1
52netcdf=1   #  1 for automatic installation
53           #  0 for no installation
54           #  /.../../netcdf-4.0.1 if wanting to link with an already
55           #  compiled netcdf library (implies to check option compatibility)
56check_linux=1
57ioipsl=1
58veget=0
59bench=1
60## compilo=pgf90 ou g95 ou gfortran ou ifort sur PC linux
61compilo=gfortran
62pclinux=1
63
64## compile_with_fcm=1 : utilise makelmdz_fcm, possible a partir de la version 20111103.trunk (LMDZ5/trunk rev 1578)
65## compile_with_fcm=0 : utilise makegcm (default)
66compile_with_fcm=0
67
68OPTPREC=""
69echo '################################################################'
70echo  Choix des options de compilation
71echo '################################################################'
72
73if [ $compilo = g95 ] ; then
74   if [ $real = r8 ] ; then OPTPREC="-r8 -DNC_DOUBLE" ; fi
75   OPTIM='-i4 -O3'
76elif [ $compilo = gfortran ] ; then
77   if [ $real = r8 ] ; then OPTPREC="-fdefault-real-8 -DNC_DOUBLE" ; fi
78   OPTIM='-O3'
79elif [ $compilo = pgf90 ] ; then
80   if [ $real = r8 ] ; then OPTPREC="-r8 -DNC_DOUBLE" ; fi
81   OPTIM='-O2 -Munroll -Mnoframe -Mautoinline -Mcache_align'
82   # with pgf90, compile with fcm
83   compile_with_fcm=1
84else 
85   # ifort
86   if [ $real = r8 ] ; then OPTPREC="-real-size 64 -DNC_DOUBLE" ; fi
87   OPTIM="-O2 -ip -mkl=sequential -align all -static "
88   # with ifort, compile with fcm
89   compile_with_fcm=1
90fi
91OPTIMGCM="$OPTIM $OPTPREC"
92
93# choix de la resolution pour le bench
94# grid_resolution= 32x24x11 for test (test without ORCHIDEE)
95#                  96x71x19  standard configuration
96grid_resolution=48x36x19
97
98hostname=`hostname`
99
100##########################################################################
101# Dans le cas où on installe sur des machines connues comme la NEC
102# brodie
103# de l'IDRIS, on ne verifie pas les logiciels existants et on n'installe
104# pas netcdf.
105if [ $hostname = brodie ] ; then
106netcdf=0
107check_linux=0
108pclinux=0
109fi
110##########################################################################
111
112
113mkdir -p $MODEL
114echo $MODEL
115MODEL=`( cd $MODEL ; pwd )` # transformation en chemin absolu si necessaire
116
117
118
119# Le -fendian=big n'est à utiliser vraiment utile que pour ARPEGE1D.
120# Le -r8 doit sans doute être éviter si on veut tourner rapidement sur
121# des machines 32 bits.
122# L'option r8 n'est pas forcement indispensable et elle produit
123# des executables plus gros.
124# Elles est indispensable cependant pour ARPEGE1D
125# On doit pouvoir aussi utiliser des optimisations plus fortes (-O3 par
126# exemple).
127
128
129echo '################################################################'
130if [ "$check_linux" = 1 ] ; then
131echo   Test sur les logiciels requis
132echo '################################################################'
133
134#### Ehouarn: test if ksh and/or bash are available
135use_shell="ksh" # default: use ksh
136if [ "`which ksh`" = "" ] ; then
137  echo "pas de ksh ... on va utiliser bash"
138  use_shell="bash"
139  if [ "`which bash`" = "" ] ; then
140    echo "Il faut d\'abord installer ksh (ou bash)"
141  fi
142fi
143
144
145for logiciel in csh wget tar gzip make $compilo gcc ; do
146if [ "`which $logiciel`" = "" ] ; then
147echo Il faut installer d\'abord $logiciel
148exit
149fi
150done
151
152if [ $pclinux = 1 ] ; then
153cd $MODEL
154cat <<eod> tt.f90
155print*,'coucou'
156end
157eod
158$compilo tt.f90
159./a.out >| tt
160if [ "`cat tt | sed -e 's/ //g' `" != "coucou" ] ; then
161echo probleme avec installation de $compilo ; exit ; fi
162\rm tt a.out tt.f90
163fi
164fi
165
166###########################################################################
167
168
169
170if [ $getlmdzor = 1 ] ; then
171echo '##########################################################'
172echo  On recupere une version un peu modifiee de LMDZ
173echo '##########################################################'
174cd $MODEL
175wget http://www.lmd.jussieu.fr/~lmdz/DistribG95/modipsl.$version.tar.gz
176gunzip modipsl.$version.tar.gz
177tar xvf modipsl.$version.tar
178\rm modipsl.$version.tar
179
180# On recupere en fait une version du 01 10 2006 obtenue
181# Par un cvs get
182# Puis modifiees pour etre compatible avec la compilation $compilo.
183# et pour betoner ORCHIDEE
184# Cette version est recuperable avec le script
185# wget http://www.lmd.jussieu.fr/~lmdz/DistribG95/getlmdzor.x
186fi
187
188echo OK1
189
190if [ $netcdf = 1 ] ; then
191echo '##########################################################'
192echo Compilation de netcdf
193echo '##########################################################'
194cd $MODEL
195wget http://www.lmd.jussieu.fr/~lmdz/DistribG95/netcdf-4.0.1.tar.gz
196gunzip netcdf-4.0.1.tar.gz
197tar xvf netcdf-4.0.1.tar
198\rm -f netcdf-4.0.1.tar
199
200cd netcdf-4.0.1
201
202OPTIMNC=$OPTIM
203if [ $compilo = g95 ] ; then
204# On modifie les options de compilation
205   export FC=g95
206   export F90=g95
207   export F90FLAGS=" -cpp -ffree-form $OPTIMNC"
208   export FFLAGS=" -cpp $OPTIMNC"
209   export CPPFLAGS=-Df2cFortran
210   export CC=gcc
211   export CXX=g++
212elif [ $compilo = gfortran ] ; then
213   export FC=gfortran
214   export F90=gfortran
215   export F90FLAGS=" -ffree-form $OPTIMNC"
216   export FFLAGS=" $OPTIMNC"
217   export CPPFLAGS=
218   export CC=gcc
219   export CXX=g++
220elif [ $compilo = pgf90 ] ; then
221   export CPPFLAGS="-DNDEBUG -DpgiFortran"
222   export CC=pgcc
223   export CFLAGS="-Msignextend"
224   export CXX=pgCC
225   export CXXFLAGS="-Msignextend"
226   export FC=pgf90
227   export FFLAGS="$OPTIMNC"
228   export F90=pgf90
229   export F90FLAGS="$OPTIMNC"
230elif [ $compilo = ifort ] ; then
231   export CPP="icc -E"
232   export F77=ifort
233   export FFLAGS="-O2 -ip -fpic -mcmodel=large"
234   export F90=ifort
235   export FCFLAGS="-O2 -ip -fpic -mcmodel=large"
236   export CC=icc
237   export CFLAGS="-O2 -ip -fpic -mcmodel=large"
238   export CXX=icpc
239   export CXXFLAGS="-O2 -ip -fpic -mcmodel=large"
240else
241   echo Le compilateur $compilo pas prevu ; exit
242fi
243## end of if [ $netcdf = 1 ]
244cd src
245
246### Correction d'un petit probleme de netcdf
247##sed -e '83s/^$/\#define f2cFortran/' cfortran.h >| tmp ; \mv tmp cfortran.h
248
249# Compilation
250# Modif du 6 juillet 2009. Plantage quand on essaie de compiler netcdf avec
251# gcc plutôt que c++
252##sed -e 's/ c++/ gcc/g' configure >| tmp ; mv -f tmp configure ; chmod +x configure
253localdir=`pwd -P`
254./configure --prefix=$localdir
255make check
256make install
257fi
258
259echo OK2 ioipsl=$ioipsl
260echo '##########################################################'
261echo Installation de MODIPSL, la procedure d\'installation des
262echo modeles de l\'IPSL
263echo '##########################################################'
264
265if [ $netcdf = 0 -o $netcdf = 1 ] ; then
266ncdfdir=$MODEL/netcdf-4.0.1
267else
268ncdfdir=$netcdf
269fi
270
271if [ $ioipsl = 1 ] ; then
272cd $MODEL/modipsl
273\rm -r lib/*
274
275cd util
276
277if [ $compilo = pgf90 ] ; then 
278  fmod='module '
279elif [ $compilo = g95 ] ; then
280  fmod='fmod='
281elif [ $compilo = ifort ] ; then
282  fmod='module '
283else # gfortran
284  fmod='I '
285fi
286cp AA_make.gdef AA_make.orig
287sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp
288sed -e "s:F_L = g95:F_L = $compilo:" -e "s:F_C = g95 -c:F_C = $compilo -c": \
289-e 's/g95.*.w_w.*.(F_D)/g95      w_w = '"$OPTIMGCM"'/' \
290-e 's:g95.*.NCDF_INC.*.$:g95      NCDF_INC= '"$ncdfdir"'/include:' \
291-e 's:g95.*.NCDF_LIB.*.$:g95      NCDF_LIB= -L'"$ncdfdir"'/lib -lnetcdf:' \
292-e "s:-fmod=:-$fmod:" -e 's/-fno-second-underscore//' \
293-e 's:#-Q- g95      M_K = gmake:#-Q- g95      M_K = make:' \
294tmp >| AA_make.gdef
295
296
297if [ "$use_shell" = "ksh" ] ; then
298  if [ "$pclinux" = 1 ] ; then
299     ./ins_make -t g95 # On utilise les lignes g95 meme pour les autres compilo
300  fi
301else # bash
302  sed -e s:/bin/ksh:/bin/bash:g ins_make > ins_make.bash
303  chmod u=rwx ins_make.bash
304  if [ "$pclinux" = 1 ] ; then
305  ./ins_make.bash -t g95 # On utilise les lignes g95 meme pour les autres compilo
306  else
307  ./ins_make.bash
308  fi
309fi
310
311echo '##########################################################'
312echo Compilation de IOIPSL, bibliotheque d\'interface avec Netcd
313echo '##########################################################'
314
315cd $MODEL/modipsl/modeles/IOIPSL/src
316if [ "$use_shell" = "bash" ] ; then
317  cp Makefile Makefile.ksh
318  sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile
319fi
320if [ "$pclinux" = 1 ] ; then
321  # Build IOIPSL modules and library
322  make clean
323  make
324  if [ $compilo = gfortran ] ; then # copy module files to lib
325    cp -f *.mod ../../../lib
326  fi
327  # Build IOIPSL tools (ie: "rebuild", if present)
328  if [ -f $MODEL/modipsl/modeles/IOIPSL/tools/rebuild ] ; then
329    cd $MODEL/modipsl/modeles/IOIPSL/tools
330    # adapt Makefile & rebuild script if in bash
331    if [ "$use_shell" = "bash" ] ; then
332      cp Makefile Makefile.ksh
333      sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile
334      cp rebuild rebuild.ksh
335      sed -e 's:/bin/ksh:/bin/bash:g' \
336          -e 's:print -u2:echo:g' \
337          -e 's:print:echo:g' rebuild.ksh > rebuild
338    fi
339    make clean
340    make
341  fi
342else
343  # we're on brodie
344  sxgmake clean
345  sxgmake
346fi
347
348if [ "$veget" = 1 ] ; then
349echo '########################################################'
350echo Compilation de ORCHIDEE, modele des surface continentales
351echo '########################################################'
352cd $MODEL/modipsl/modeles/ORCHIDEE
353cd src_parameters
354# Une petite astuce pour ORCHIDEE suivant qu'on est en real*4 ou real*8
355
356
357\cp reqdprec.$real reqdprec.f90
358make
359if [ $compilo = gfortran ] ; then # copy module files to lib
360  cp -f *.mod ../../../lib
361fi
362cd ../src_stomate
363make
364if [ $compilo = gfortran ] ; then # copy module files to lib
365  cp -f *.mod ../../../lib
366fi
367cd ../src_sechiba
368make
369if [ $compilo = gfortran ] ; then # copy module files to lib
370  cp -f *.mod ../../../lib
371fi
372fi
373fi
374
375
376# Ehouarn: it may be directory LMDZ4 or LMDZ5 depending on tar file...
377if [[ -d $MODEL/modipsl/modeles/LMDZ4 ]] ; then
378  echo '##########################################################'
379  echo 'Compilation de LMDZ4'
380  echo '##########################################################'
381  cd $MODEL/modipsl/modeles/LMDZ4
382else
383  if [[ -d $MODEL/modipsl/modeles/LMDZ5 ]] ; then
384    echo '##########################################################'
385    echo 'Compilation de LMDZ5'
386    echo '##########################################################'
387    cd $MODEL/modipsl/modeles/LMDZ5
388  else
389    echo "ERROR: No LMDZ4 (or LMDZ5) directory !!!"
390    exit
391  fi
392fi
393
394if [ "$pclinux" = 1 ] ; then
395  if [ $compilo = gfortran ] ; then
396sed \
397-e 's:\#setenv NCDFINC.*.$:setenv NCDFINC '"$ncdfdir"'/include:' \
398-e 's:\#setenv NCDFLIB.*.$:setenv NCDFLIB '"$ncdfdir"'/lib:' \
399-e 's:setenv NCDFINC.*.$:setenv NCDFINC '"$ncdfdir"'/include:' \
400-e 's:setenv NCDFLIB.*.$:setenv NCDFLIB '"$ncdfdir"'/lib:' \
401-e 's/set FC_LINUX.*.$/set FC_LINUX='$compilo'/' \
402-e 's/g95/gfortran/g' \
403-e 's/-fmod=/-I/g' \
404-e 's/-fno-second-underscore//' -e 's/-fstatic//' \
405-e 's/-lparallel//' \
406-e 's/-lorglob//' \
407-e 's/-ffixed-form//' -e 's/-ffree-form//' \
408-e 's/set OPT_LINUX.*.$/set OPT_LINUX=\"'"$OPTIMGCM"\"'/' makegcm.orig >| makegcm
409  elif [ $compilo = ifort ] ; then
410sed \
411-e 's:\#setenv NCDFINC.*.$:setenv NCDFINC '"$ncdfdir"'/include:' \
412-e 's:\#setenv NCDFLIB.*.$:setenv NCDFLIB '"$ncdfdir"'/lib:' \
413-e 's:setenv NCDFINC.*.$:setenv NCDFINC '"$ncdfdir"'/include:' \
414-e 's:setenv NCDFLIB.*.$:setenv NCDFLIB '"$ncdfdir"'/lib:' \
415-e 's/set FC_LINUX.*.$/set FC_LINUX='$compilo'/' \
416-e 's/g95/ifort/g' \
417-e 's/-fmod=/-module /g' \
418-e 's/-fno-second-underscore//' -e 's/-fstatic//' \
419-e 's/-lparallel//' \
420-e 's/-lorglob//' \
421-e 's/-ffixed-form//' -e 's/-ffree-form//' \
422-e 's/set OPT_LINUX.*.$/set OPT_LINUX=\"'"$OPTIMGCM"\"'/' makegcm.orig >| makegcm
423  else # g95 or pgf90
424sed \
425-e 's:\#setenv NCDFINC.*.$:setenv NCDFINC '"$ncdfdir"'/include:' \
426-e 's:\#setenv NCDFLIB.*.$:setenv NCDFLIB '"$ncdfdir"'/lib:' \
427-e 's:setenv NCDFINC.*.$:setenv NCDFINC '"$ncdfdir"'/include:' \
428-e 's:setenv NCDFLIB.*.$:setenv NCDFLIB '"$ncdfdir"'/lib:' \
429-e 's/set FC_LINUX.*.$/set FC_LINUX='$compilo'/' \
430-e 's/-fno-second-underscore//' -e 's/-fstatic//' \
431-e 's/-lparallel//' \
432-e 's/-lorglob//' \
433-e 's/-ffixed-form//' -e 's/-ffree-form//' \
434-e 's/set OPT_LINUX.*.$/set OPT_LINUX=\"'"$OPTIMGCM"\"'/' makegcm.orig >| makegcm
435  fi
436else
437sed \
438-e 's/-lparallel//' \
439-e 's/-lorglob//' \
440-e 's/-lsxorglob//' \
441-e 's/-lsxparallel//' \
442-e 's/-lsxioipsl/-lioipsl/g' \
443makegcm.orig >| makegcm
444fi
445
446chmod +x makegcm
447
448###########################################################
449# Pour ceux qui voudraient utiliser fcm et pouvoir faire :
450#  makelmdz_fcm -arch local .....
451############################################################
452
453if [ "$pclinux" = 1 ] ; then
454# creation de fichiers 'arch' locaux (si sur PC Linx):
455cd arch
456# fichier arch-local.path
457echo "NETCDF_LIBDIR=\"-L${ncdfdir}/lib -lnetcdf\"" > arch-local.path
458echo "NETCDF_INCDIR=-I${ncdfdir}/include" >> arch-local.path
459echo 'IOIPSL_INCDIR=$LMDGCM/../../lib' >> arch-local.path
460echo 'IOIPSL_LIBDIR=$LMDGCM/../../lib' >> arch-local.path
461echo 'ORCH_INCDIR=$LMDGCM/../../lib' >> arch-local.path
462echo 'ORCH_LIBDIR=$LMDGCM/../../lib' >> arch-local.path
463# fichier arch-local.fcm (adaptation de arch-linux-32bit.fcm)
464if [ $compilo = g95 ] ; then
465sed -e s:"%COMPILER            pgf95":"%COMPILER            g95":1 \
466    -e s:"%LINK                pgf95":"%LINK                g95":1 \
467    -e s:"%PROD_FFLAGS         -fast":"%PROD_FFLAGS         $OPTIM":1 \
468    -e s:"%BASE_FFLAGS         ":"%BASE_FFLAGS         $OPTPREC":1 \
469   arch-linux-32bit.fcm > arch-local.fcm
470   if [ $real = r8 ] ; then
471     sed -e s:"%FPP_DEF             ":"%FPP_DEF             NC_DOUBLE":1 \
472     arch-local.fcm > arch-local.fcm.new
473     mv -f arch-local.fcm.new arch-local.fcm
474   fi
475elif [ $compilo = gfortran ] ; then
476sed -e s:"%COMPILER            pgf95":"%COMPILER            gfortran":1 \
477    -e s:"%LINK                pgf95":"%LINK                gfortran":1 \
478    -e s:"%PROD_FFLAGS         -fast":"%PROD_FFLAGS         $OPTIM":1 \
479    -e s:"%BASE_FFLAGS         ":"%BASE_FFLAGS         $OPTPREC":1 \
480   arch-linux-32bit.fcm > arch-local.fcm
481   if [ $real = r8 ] ; then
482     sed -e s:"%FPP_DEF             ":"%FPP_DEF             NC_DOUBLE":1 \
483     arch-local.fcm > arch-local.fcm.new
484     mv -f arch-local.fcm.new arch-local.fcm
485   fi
486elif [ $compilo = pgf90 ] ; then
487sed -e s:"-Wl,-Bstatic -L/usr/lib/gcc-lib/i386-linux/2.95.2":" ":1 \
488    -e s:"%PROD_FFLAGS         -fast":"%PROD_FFLAGS         $OPTIM":1 \
489    -e s:"%BASE_FFLAGS         ":"%BASE_FFLAGS         $OPTPREC":1 \
490   arch-linux-32bit.fcm > arch-local.fcm
491   if [ $real = r8 ] ; then
492     sed -e s:"%FPP_DEF             ":"%FPP_DEF             NC_DOUBLE":1 \
493     arch-local.fcm > arch-local.fcm.new
494     mv -f arch-local.fcm.new arch-local.fcm
495   fi
496elif [ $compilo = ifort ] ; then
497sed -e s:"%COMPILER            pgf95":"%COMPILER            ifort":1 \
498    -e s:"%LINK                pgf95":"%LINK                ifort":1 \
499    -e s:"-Wl,-Bstatic -L/usr/lib/gcc-lib/i386-linux/2.95.2":" ":1 \
500    -e s:"%PROD_FFLAGS         -fast":"%PROD_FFLAGS         $OPTIM":1 \
501    -e s:"%BASE_FFLAGS         ":"%BASE_FFLAGS         $OPTPREC":1 \
502    -e s:"%DEBUG_FFLAGS        -g -O0 -Kieee -Ktrap=fp -Mbounds":"%DEBUG_FFLAGS        -g -no-ftz -traceback -ftrapuv -fp-stack-check -check":1 \
503   arch-linux-32bit.fcm > arch-local.fcm
504   if [ $real = r8 ] ; then
505     sed -e s:"%FPP_DEF             ":"%FPP_DEF             NC_DOUBLE":1 \
506     arch-local.fcm > arch-local.fcm.new
507     mv -f arch-local.fcm.new arch-local.fcm
508   fi
509else
510   echo Le compilateur $compilo pas prevu ; exit
511fi # of if [ $compilo = g95 ] elif [ $compilo = pgf90 ]
512cd ..
513### Adaptation de "bld.cfg" (ajout du shell):
514whereisthatshell=$(which ${use_shell})
515echo "bld::tool::SHELL   $whereisthatshell" >> bld.cfg
516
517### Modification de makelmdz_fcm pour utilisation de ORCHIDEE dans cette bench:
518### on enleve liborglob.a et libparallel.a
519cp makelmdz_fcm makelmdz_fcm.orig
520sed -e "s/-l\${LIBPREFIX}parallel//" \
521sed -e "s/-l\${LIBPREFIX}orglob//" \
522    makelmdz_fcm.orig > makelmdz_fcm
523
524fi # of if [ "$pclinux" = 1 ]
525
526##################################################################
527# Lance compilation de LMDZ
528##################################################################
529ok_veget=false
530if [ "$veget" = 1 ] ; then ok_veget = true; fi
531if [ $compile_with_fcm = 1 ] ; then
532# Compilation avec makelmdz_fcm
533        ./makelmdz_fcm -d ${grid_resolution} -arch local -v $ok_veget gcm
534else
535# Compilation avec makegcm:
536#       3 times! because some dependecies are not well resolved with makegcm
537        ./makegcm -d ${grid_resolution} -v $ok_veget gcm
538        ./makegcm -d ${grid_resolution} -v $ok_veget gcm
539        ./makegcm -d ${grid_resolution} -v $ok_veget gcm
540fi
541
542if [ -f gcm.e ] || [ -f bin/gcm_${grid_resolution}_phylmd_seq_orch.e ] || [ -f bin/gcm_${grid_resolution}_phylmd_seq.e ]  ; then
543echo '##########################################################'
544echo Compilation reussie
545echo '##########################################################'
546else
547echo Probleme de compilation
548exit
549fi
550
551##################################################################
552# Ci dessous le lancement eventuel d'un cas test (si bench=0)
553##################################################################
554if [ $bench = 0 ] ; then
555                exit
556fi
557
558echo '##########################################################'
559echo Lancement d\'une simulation de test
560echo '##########################################################'
561
562\rm -r BENCH${grid_resolution}
563bench=bench_lmdz_${grid_resolution}
564wget http://www.lmd.jussieu.fr/~lmdz/DistribG95/$bench.tar.gz
565gunzip $bench.tar.gz
566tar xvf $bench.tar
567
568if [ -f gcm.e ] ; then 
569    cp gcm.e BENCH${grid_resolution}/
570elif [ -f bin/gcm_${grid_resolution}_phylmd_seq_orch.e ] ; then
571    cp bin/gcm_${grid_resolution}_phylmd_seq_orch.e  BENCH${grid_resolution}/gcm.e
572elif [ -f bin/gcm_${grid_resolution}_phylmd_seq.e ] ; then
573    cp bin/gcm_${grid_resolution}_phylmd_seq.e  BENCH${grid_resolution}/gcm.e
574else
575    echo "No gcm.e found"
576    exit
577fi
578
579if [ $hostname = brodie ] ; then
580echo POUR LANCER LE BENCH, IL FAUT SE LOGUER SUR BRODIE01
581echo puis aller sur `pwd`/BENCH${grid_resolution}
582echo et lancer le gcm
583exit
584fi
585
586cd BENCH${grid_resolution}
587./bench.sh > bench.out  2>&1
588
589echo '##########################################################'
590echo ' Resultat du bench '
591echo '##########################################################'
592
593cat ./bench.out
594
595echo '##########################################################'
596echo 'La simulation test est terminee sur' `pwd`
597echo 'vous pouvez la relancer : cd ' `pwd` ' ; gcm.e'
598echo 'ou ./bench.sh'
599echo '##########################################################'
600
Note: See TracBrowser for help on using the repository browser.