source: BOL/script_install/install.sh @ 1693

Last change on this file since 1693 was 1693, checked in by Laurent Fairhead, 12 years ago

Mise à jour de la procédure d'installation par install.sh
En particulier, bascule sur la testing par défaut


Updates to the isntall.sh procedure
In particular, switch to the testing branch by default

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