source: BOL/script_install/install_lmdz.sh @ 3386

Last change on this file since 3386 was 3386, checked in by fhourdin, 6 years ago

Add possibility to install with cosp(v2) and some "svn upgrade" commands to enforce being up-to-date with local svn version.
EM

File size: 38.4 KB
Line 
1#!/bin/bash
2
3###########################################################################
4# Author : Laurent Fairhead et Frédéric Hourdin
5# Usage  : install_lmdz.sh -help
6#
7# bash installation script of the LMDZ model on a Linux PC.
8# the model is downloaded in the following direcory tree
9# $MODEL/modipsl/modeles/...
10# using the "modipsl" infrastructure created by the "IPSL"
11# for coupled (atmosphere/ocean/vegetation/chemistry) climate modeling
12# activities.
13# Here we only download atmospheric (LMDZ) and vegetation (ORCHIDEE)
14# components.
15#
16# The sources of the models can be found in the "modeles" directory.
17# In the present case, LMDZ5, ORCHIDEE and IOIPSL (handling of input-outputs
18# using the NetCDF library.
19#
20# The script downloads various source files (including a version of NetCDF)
21# and utilities, compiles the model, and runs a test simulation in a
22# munimal configuration.
23#
24# Prerequisites : pgf90/gfortran, ksh, wget , gunzip, tar, ...
25#
26# Modif 18/11/2011
27#    changes for option real 8.
28#      We comopile with -r8 (or equivalent) and -DNC_DOUBLE for the GCM
29#      but with -r4 for netcdf. Variable real must be set to
30#      r4 or r8 at the beginning of the script below.
31#
32###########################################################################
33
34echo install.sh DEBUT `date`
35
36set -e
37
38################################################################
39# Choice of installation options
40################################################################
41
42# A function to fetch files either locally or on the internet
43function myget { #1st and only argument should be file name
44  # Path on local computer where to look for the datafile
45  if [ -f /u/lmdz/WWW/LMDZ/pub/$1 ] ; then
46    \cp -f -p /u/lmdz/WWW/LMDZ/pub/$1 .
47  elif [ -f ~/LMDZ/pub/$1 ] ; then
48    \cp -f -p ~/LMDZ/pub/$1 .
49  else
50    wget -nv http://www.lmd.jussieu.fr/~lmdz/pub/$1
51    #dir=~/LMDZ/pub/`dirname $1` ; mkdir -p $dir ; cp -r `basename $1` $dir
52  fi
53}
54
55
56#real=r4
57real=r8
58
59# WARNING !!!! For versions before october 2009, use
60# install.v2.sh instead of install.sh
61
62#########################################################################
63# Valeur par défaut des parametres
64#########################################################################
65svn=""
66version=trunk
67getlmdzor=1
68netcdf=1   #  1 for automatic installation
69           #  0 for no installation
70           #  /.../../netcdf-4.0.1 if wanting to link with an already
71           #  compiled netcdf library (implies to check option compatibility)
72check_linux=1
73ioipsl=1
74veget=1
75orchidee_rev=""  # default revision of ORCHIDEE
76bench=1
77pclinux=1
78pcmac=0 # default: not on a Mac
79compiler=gfortran
80SCM=0
81# use the old orchidee interface without the calculation of z0h
82no_z0h_orc=1
83# choose the resolution for the bench runs
84# grid_resolution= 32x24x11 or 48x36x19 for tests (test without ORCHIDEE)
85#                  96x71x19  standard configuration
86grid_resolution=144x142x79
87grid_resolution=48x36x19
88
89## parallel can take the values none/mpi/omp/mpi_omp
90parallel=mpi_omp
91parallel=none
92OPT_GPROF=""
93OPT_MAKELMDZ=""
94MODEL=""
95
96## also compile XIOS? (and more recent NetCDF/HDF5 libraries) Default=no
97with_xios="n"
98opt_makelmdz_xios=""
99## compile_with_fcm=1 : use makelmdz_fcm (1) or makelmdz (0)
100compile_with_fcm=1
101cosp=0 ; opt_cosp1=""
102cosp=0 ; opt_cosp2=""
103opt_cosp=""
104
105# Check if on a Mac
106if [ `uname` = "Darwin" ]
107then
108    pcmac=1
109    export MAKE=make
110fi
111#echo "pcmac="$pcmac
112
113#########################################################################
114#  Options interactives
115#########################################################################
116while (($# > 0))
117   do
118   case $1 in
119     "-h") cat <<........fin
120    $0 [ -v version ] [ -r svn_release ]
121           [ -parallel PARA ] [ -d GRID_RESOLUTION ] [ -bench 0/1 ]
122           [-name LOCAL_MODEL_NAME] [-gprof] [-opt_makelmdz]
123
124    -v       "version" like 20150828.trunk
125             see http://www.lmd.jussieu.fr/~lmdz/Distrib/LISMOI.trunk
126
127    -r       "svn_release" : either the svn release number or "last"
128   
129    -compiler gfortran|ifort|pgf90 (default: gfortran)
130
131    -parallel PARA : can be mpi_omp (mpi with openMP) or none (for sequential)
132
133    -d        GRID_RESOLUTION should be among the available benchs if -bench 1
134              among which : 48x36x19, 48x36x39
135              if wanting to run a bench simulation in addition to compilation
136              default : 48x36x19
137
138    -bench     activating the bench or not (0/1). Default 1
139
140    -name      LOCAL_MODEL_NAME : default = LMDZversion.release
141
142    -netcdf    PATH : full path to an existing installed NetCDF library
143               (without -netcdf: also download and install the NetCDF library) 
144   
145    -xios      also download and compile the XIOS library
146               (requires the NetCDF4-HDF5 library, also installed by default)
147               (requires to also have -parallel mpi_omp)
148
149    -gprof     to compile with -pg to enable profiling with gprof
150
151    -orchidee_rev "svn_release" : upgrade included ORCHIDEE model to
152               given svn release number (default: $orchidee_rev)
153               (only valid for orchidee2.0 and later)
154
155    -cosp      to compile with cosp(v1)
156 
157    -cosp2      to compile with cosp(v2)
158
159    -nofcm     to compile without fcm
160
161    -SCM        install 1D version automatically
162
163    -opt_makelmdz     to call makelmdz or makelmdz_fcm with additional options
164........fin
165     exit ;;
166     "-v") version=$2 ; shift ; shift ;;
167     "-r") svn=$2 ; shift ; shift ;;
168     "-compiler") compiler=$2
169                  case $compiler in
170                    "gfortran"|"ifort"|"pgf90") compiler=$2 ; shift ; shift ;;
171                    *) echo "Only gfortran , ifort or pgf90 for the compiler option" ; exit
172                  esac ;;
173     "-d") grid_resolution=$2 ; shift ; shift ;;
174     "-gprof") OPT_GPROF="-pg" ; shift ;;
175     "-cosp") cosp=1 ; opt_cosp1="-cosp true" ; shift ;;
176     "-cosp2") cosp2=1 ; opt_cosp2="-cosp2 true" ; shift ;;
177     "-orchidee_rev") orchidee_rev=$2 ; shift ; shift ;;
178     "-nofcm") compile_with_fcm=0 ; shift ;;
179     "-SCM") SCM=1 ; shift ;;
180     "-opt_makelmdz") OPT_MAKELMDZ="$2" ; shift ; shift ;;
181     "-parallel") parallel=$2
182                  case $parallel in
183                    "none"|"mpi"|"omp"|"mpi_omp") parallel=$2 ; shift ; shift ;;
184                    *) echo Only none mpi omp mpi_omp for the parallel option ; exit
185                  esac ;;
186     "-bench") bench=$2 ; shift ; shift ;;
187     "-name") MODEL=$2 ; shift ; shift ;;
188     "-netcdf") netcdf=$2 ; shift ; shift ;;
189     "-xios") with_xios="y" ; shift ;;
190     *) ./install_lmdz.sh -h ; exit
191   esac
192done
193
194if [ $parallel = none ] ; then sequential=1 ; else sequential=0 ; fi 
195
196#Chemin pour placer le modele
197if [ "$MODEL" = "" ] ; then MODEL=./LMDZ$version$svn ; fi
198
199
200arch=local
201
202
203if [ $compiler = g95 ] ; then echo g95 is not supported anymore ; exit ; fi
204
205################################################################
206# Specificite des machines
207################################################################
208
209hostname=`hostname`
210if [ "$pclinux" = 1 ] ; then o_ins_make="-t g95" ; else o_ins_make="" ; fi
211
212case ${hostname:0:5} in
213
214   ada33)   compiler="ifort" ;
215            par_comp="ifort" ;
216            o_ins_make="-t ada" ;
217            make=gmake ;
218            module load intel/2013.0 ;
219            arch=X64_ADA ;;
220
221   cicla|camel)   compiler="gfortran" ;
222            if [ $parallel != none ] ; then
223              module load openmpi/1.6.5-gfortran ;
224              root_mpi=$MPI_HOME ;
225              path_mpi=$root_mpi/bin ;
226              par_comp=${path_mpi}/mpif90 ;
227              mpirun=${path_mpi}/mpirun ;
228            fi ;
229            arch=local  ;
230            make=make ;
231            o_ins_make="-t g95" ;;
232           
233   *)       if [ $parallel = none -o -f /usr/bin/mpif90 ] ; then
234                path_mpi=`which mpif90 | sed -e s:/mpif90::` ;
235                if [ -d /usr/lib64/openmpi ] ; then
236                  root_mpi="/usr/lib64/openmpi"
237                else
238                  root_mpi="/usr"
239                fi
240            # For Scientifique Linux with gfortran at LMD :
241            elif [ -f /usr/lib64/openmpi/1.4.5-gfortran/bin/mpif90 -a $compiler = "gfortran" ] ; then
242                path_mpi=/usr/lib64/openmpi/1.4.5-gfortran/bin ;
243                root_mpi=/usr/lib64/openmpi/1.4.5-gfortran ;
244                export LD_LIBRARY_PATH=${root_mpi}/lib:$LD_LIBRARY_PATH
245            # For Scientifique Linux with ifort at LMD :
246            elif [ -f /usr/lib64/openmpi/1.4.5-ifort/bin/mpif90 -a $compiler = "ifort" ] ; then
247                path_mpi=/usr/lib64/openmpi/1.4.5-ifort/bin ;
248                root_mpi=/usr/lib64/openmpi/1.4.5-ifort ;
249                export LD_LIBRARY_PATH=${root_mpi}/lib:$LD_LIBRARY_PATH
250            # For Scientifique Linux with pgf90 at LMD :
251            elif [ -f /usr/lib64/openmpi/1.4.5-ifort/bin/mpif90 -a $compiler = "pgf90" ] ; then
252                path_mpi=/usr/lib64/openmpi/1.4.5-pgf/bin ;
253                root_mpi=/usr/lib64/openmpi/1.4.5-pgf ;
254                export LD_LIBRARY_PATH=${root_mpi}/lib:$LD_LIBRARY_PATH
255            else
256               echo "Cannot find mpif90" ;
257               exit ;
258            fi ;
259            par_comp=${path_mpi}/mpif90 ;
260            mpirun=${path_mpi}/mpirun ;
261            arch=local  ;
262            make=make ;
263            o_ins_make="-t g95"
264esac
265
266# Flags for parallelism:
267if [ $parallel != none ] ; then
268  # MPI_LD are the flags needed for linking with MPI
269  MPI_LD="-L${root_mpi}/lib -lmpi"
270  if [ "$compiler" = "gfortran" ] ; then
271    # MPI_FLAGS are the flags needed for compilation with MPI
272    MPI_FLAGS="-fcray-pointer"
273    # OMP_FLAGS are the flags needed for compilation with OpenMP
274    OMP_FLAGS="-fopenmp -fcray-pointer"
275    # OMP_LD are the flags needed for linking with OpenMP
276    OMP_LD="-fopenmp"
277  elif [ "$compiler" = "ifort" ] ; then
278    MPI_FLAGS=""
279    OMP_FLAGS="-openmp"
280    OMP_LD="-openmp"
281  else # pgf90
282    MPI_FLAGS=""
283    OMP_FLAGS="-mp"
284    OMP_LD="-mp"
285  fi
286fi
287
288#####################################################################
289# Test for old gfortran compilers
290# If the compiler is too old (older than 4.3.x) we test if the
291# temporary gfortran44 patch is available on the computer in which
292# case the compiler is changed from gfortran to gfortran44
293# Must be aware than parallelism can not be activated in this case
294#####################################################################
295
296if [ "$compiler" = "gfortran" ] ; then
297   gfortran=gfortran
298   gfortranv=`gfortran --version | \
299   head -1 | awk ' { print $NF } ' | awk -F. ' { print $1 * 10 + $2 } '`
300   if [ $gfortranv -le 43 ] ; then
301       echo ERROR : Your gfortran compiler is too old
302       echo 'Please choose a new one (ifort) and change the line'
303       echo compiler=xxx
304       echo in the install.sh script and rerun it
305       if [ `which gfortran44 | wc -w` -ne 0 ] ; then
306          gfortran=gfortran44
307       else
308          echo gfotran trop vieux ; exit
309       fi
310   fi
311   compiler=$gfortran
312fi
313#####################################################################
314
315## if also compiling XIOS, parallel must be mpi_omp
316if [ "$with_xios" = "y" -a "$parallel" != "mpi_omp" ] ; then 
317  echo "Error, you must set -parallel mpi_omp if you want XIOS"
318  exit
319fi
320
321## We can't compile with -cosp and -cosp2
322if [ "$cosp" = 1 -a "$cosp2" = 1 ] ; then
323   echo "Error, you can't run with cosp1 and cosp2"
324   exit
325fi
326if [ "$cosp" = 1 ] ; then
327   opt_cosp="$opt_cosp1"
328fi
329if [ "$cosp2" = 1 ] ; then
330   opt_cosp="$opt_cosp2"
331fi
332
333## if also compiling XIOS, cosp must be activate to define axis in *.xml
334if [ "$with_xios" = "y" -a "$cosp" != "1" ] ; then
335   echo "Error, you must use -cosp option when compiling with -xios"
336   echo "You need to call Cosp in physical first step to define axis variables"
337   exit
338fi
339if [ "$with_xios" = "y" -a "$cosp2" != "1" ] ; then
340   echo "Error, you must use -cosp2 option when compiling with -xios"
341   echo "You need to call Cosp in physical first step to define axis variables"
342   exit
343fi
344
345if [ "$with_xios" = "y" ] ; then
346  opt_makelmdz_xios="-io xios"
347fi
348
349echo '################################################################'
350echo  Choix des options de compilation
351echo '################################################################'
352
353export FC=$compiler
354export F90=$compiler
355export F77=$compiler
356export CPPFLAGS=
357OPTIMNC=$OPTIM
358BASE_LD="$OPT_GPROF"
359OPTPREC="$OPT_GPROF"
360ARFLAGS="rs" ; if [ -f /etc/issue ] ; then if [ "`grep -i ubuntu /etc/issue`" != "" ] ; then if [ "`grep -i ubuntu /etc/issue | awk ' { print $2 } ' | cut -d. -f1`" -ge 16 ] ; then ARFLAGS="rU" ; fi ; fi ; fi
361
362
363
364if [ "$compiler" = "$gfortran" ] ; then
365   OPTIM='-O3'
366   OPTDEB="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all -fbacktrace -finit-real=nan"
367   OPTDEV="-Wall -fbounds-check"
368   fmod='I '
369   OPTPREC="$OPTPREC -cpp -ffree-line-length-0"
370   if [ $real = r8 ] ; then OPTPREC="$OPTPREC -fdefault-real-8 -DNC_DOUBLE" ; fi
371   export F90FLAGS=" -ffree-form $OPTIMNC"
372   export FFLAGS=" $OPTIMNC"
373   export CC=gcc
374   export CXX=g++
375   export fpp_flags="-P -C -traditional -ffreestanding"
376
377elif [ $compiler = mpif90 ] ; then
378   OPTIM='-O3'
379   OPTDEB="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all"
380   OPTDEV="-Wall -fbounds-check"
381   BASE_LD="$BASE_LD -lblas"
382   fmod='I '
383   if [ $real = r8 ] ; then OPTPREC="$OPTPREC -fdefault-real-8 -DNC_DOUBLE -fcray-pointer" ; fi
384   export F90FLAGS=" -ffree-form $OPTIMNC"
385   export FFLAGS=" $OPTIMNC"
386   export CC=gcc
387   export CXX=g++
388
389elif [ $compiler = pgf90 ] ; then
390   OPTIM='-O2 -Mipa -Munroll -Mnoframe -Mautoinline -Mcache_align'
391   OPTDEB='-g -Mdclchk -Mbounds -Mchkfpstk -Mchkptr -Minform=inform -Mstandard -Ktrap=fp -traceback'
392   OPTDEV='-g -Mbounds -Ktrap=fp -traceback'
393   fmod='module '
394   if [ $real = r8 ] ; then OPTPREC="$OPTPREC -r8 -DNC_DOUBLE" ; fi
395   export CPPFLAGS="-DpgiFortran"
396   export CC=pgcc
397   export CFLAGS="-O2 -Msignextend"
398   export CXX=pgCC
399   export CXXFLAGS="-O2 -Msignextend"
400   export FFLAGS="-O2 $OPTIMNC"
401   export F90FLAGS="-O2 $OPTIMNC"
402   compile_with_fcm=1
403
404elif [ $compiler = ifort ] ; then
405   OPTIM="-O2 -fp-model strict -ip -align all "
406   OPTDEV="-p -g -O2 -traceback -fp-stack-check -ftrapuv -check"
407   OPTDEB="-g -no-ftz -traceback -ftrapuv -fp-stack-check -check"
408   fmod='module '
409   if [ $real = r8 ] ; then OPTPREC="$OPTPREC -real-size 64 -DNC_DOUBLE" ; fi
410   export CPP="icc -E"
411   export FFLAGS="-O2 -ip -fpic -mcmodel=large"
412   export FCFLAGS="-O2 -ip -fpic -mcmodel=large"
413   export CC=icc
414   export CFLAGS="-O2 -ip -fpic -mcmodel=large"
415   export CXX=icpc
416   export CXXFLAGS="-O2 -ip -fpic -mcmodel=large"
417   export fpp_flags="-P -traditional"
418   compile_with_fcm=1
419
420else
421   echo unexpected compiler $compiler ; exit
422fi
423
424OPTIMGCM="$OPTIM $OPTPREC"
425
426hostname=`hostname`
427
428##########################################################################
429# If installing on know machines such as IBM x3750 (Ada)
430# at IDRIS, don't check for available software and don"t install netcdf
431if [ ${hostname:0:5} = ada33 ] ; then
432  netcdf=0 # no need to recompile netcdf, alreday available
433  check_linux=0
434  pclinux=0
435  ioipsl=1 # no need to recompile ioipsl, already available
436  #netcdf="/smplocal/pub/NetCDF/4.1.3"
437  compiler="ifort"
438  fmod='module '
439  if [ $real = r8 ] ; then OPTPREC="$OPTPREC -real-size 64 -DNC_DOUBLE" ; fi
440  OPTIM="-O2 -fp-model strict -ip -axAVX,SSE4.2 -align all "
441  OPTIMGCM="$OPTIM $OPTPREC"
442fi
443##########################################################################
444
445
446
447mkdir -p $MODEL
448echo $MODEL
449MODEL=`( cd $MODEL ; pwd )` # to get absolute path, if necessary
450
451
452
453# Option -fendian=big is only to be used with ARPEGE1D.
454# The -r8 should probably be avoided if running on 32 bit machines
455# Option r8 is not mandatory and generates larger executables.
456# It is however mandatory if using ARPEGE1D
457# Better optimization options might be a better choice (e.g. -O3)
458
459
460echo '################################################################'
461if [ "$check_linux" = 1 ] ; then
462echo   Check if required software is available
463echo '################################################################'
464
465#### Ehouarn: test if ksh and/or bash are available
466use_shell="ksh" # default: use ksh
467if [ "`which ksh`" = "" ] ; then
468  echo "no ksh ... we will use bash"
469  use_shell="bash"
470  if [ "`which bash`" = "" ] ; then
471    echo "ksh (or bash) needed!! Install it!"
472  fi
473fi
474
475
476for logiciel in csh wget tar gzip make $compiler gcc ; do
477if [ "`which $logiciel`" = "" ] ; then
478echo You must first install $logiciel on your system
479exit
480fi
481done
482
483if [ $pclinux = 1 ] ; then
484cd $MODEL
485cat <<eod > tt.f90
486print*,'coucou'
487end
488eod
489$compiler tt.f90 -o a.out
490./a.out >| tt
491if [ "`cat tt | sed -e 's/ //g' `" != "coucou" ] ; then
492echo problem installing with compiler $compiler ; exit ; fi
493\rm tt a.out tt.f90
494fi
495fi
496
497###########################################################################
498if [ $getlmdzor = 1 ] ; then
499echo '##########################################################'
500echo  Download a slightly modified version of  LMDZ
501echo '##########################################################'
502cd $MODEL
503myget src/modipsl.$version.tar.gz
504echo install.sh wget_OK `date`
505gunzip modipsl.$version.tar.gz
506tar xvf modipsl.$version.tar
507\rm modipsl.$version.tar
508
509fi
510
511echo OK1
512
513if [ $netcdf = 1 ] ; then
514cd $MODEL
515netcdflog=`pwd`/netcdf.log
516echo '##########################################################'
517echo Compiling the Netcdf library
518echo '##########################################################'
519echo log file : $netcdflog
520if [ "$with_xios" = "n" ] ; then
521  # keep it simple
522  #wget http://www.lmd.jussieu.fr/~lmdz/Distrib/netcdf-4.0.1.tar.gz
523  myget import/netcdf-4.0.1.tar.gz
524  gunzip netcdf-4.0.1.tar.gz
525  tar xvf netcdf-4.0.1.tar
526  \rm -f netcdf-4.0.1.tar
527
528  cd netcdf-4.0.1
529
530  # seds to possibly use gfortran44 obsolete nowdays (Ehouarn: 10/2017)
531  #sed -e 's/gfortran/'$gfortran'/g' configure >| tmp ; mv -f tmp configure ; chmod +x configure
532  localdir=`pwd -P`
533  ./configure --prefix=$localdir --enable-shared --disable-cxx
534  #sed -e 's/gfortran/'$gfortran'/g' Makefile >| tmp ; mv -f tmp Makefile
535  $make check > $netcdflog 2>&1
536  $make install >> $netcdflog 2>&1
537else
538  # download and compile hdf5 and netcdf, etc. using the install_netcdf4_hdf5.bash script
539  #wget http://www.lmd.jussieu.fr/~lmdz/Distrib/install_netcdf4_hdf5.bash
540  myget import/install_netcdf4_hdf5.bash
541  chmod u=rwx install_netcdf4_hdf5.bash
542  if [ "$compiler" = "gfortran" ] ; then
543  ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC gcc -FC gfortran -CXX g++ -MPI $root_mpi
544  elif [ "$compiler" = "ifort" ] ; then
545  ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC icc -FC ifort -CXX icpc -MPI $root_mpi
546  elif [ "$compiler" = "pgf90" ] ; then
547  ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC pgcc -FC pgf90 -CXX pgCC -MPI $root_mpi
548  else
549    echo "unexpected compiler $compiler" ; exit
550  fi
551fi  # of if [ "$with_xios" = "n" ]
552echo install.sh netcdf_OK `date`
553fi # of if [ $netcdf = 1 ]
554
555
556#=======================================================================================
557echo OK2 ioipsl=$ioipsl
558echo '##########################################################'
559echo 'Installing MODIPSL, the installation package manager for the '
560echo 'IPSL models and tools'
561echo '##########################################################'
562
563if [ $netcdf = 0 -o $netcdf = 1 ] ; then
564  if [ "$with_xios" = "y" ] ; then
565  ncdfdir=$MODEL/netcdf4_hdf5
566  else
567  ncdfdir=$MODEL/netcdf-4.0.1
568  fi
569else
570  ncdfdir=$netcdf
571fi
572
573if [ $ioipsl = 1 ] ; then
574  cd $MODEL/modipsl
575  \rm -rf lib/*
576
577  cd util
578
579  cp AA_make.gdef AA_make.orig
580  F_C="$compiler -c " ; if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then F_C="$compiler -c -cpp " ; fi
581  if [ "$compiler" = "pgf90" ] ; then F_C="$compiler -c -Mpreprocess" ; fi
582  sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp
583  sed -e "s:F_L = g95:F_L = $compiler:" -e "s:F_C = g95 -c -cpp:F_C = $F_C": \
584  -e 's/g95.*.w_w.*.(F_D)/g95      w_w = '"$OPTIMGCM"'/' \
585  -e 's:g95.*.NCDF_INC.*.$:g95      NCDF_INC= '"$ncdfdir"'/include:' \
586  -e 's:g95.*.NCDF_LIB.*.$:g95      NCDF_LIB= -L'"$ncdfdir"'/lib -lnetcdff -lnetcdf:' \
587  -e 's:g95      L_O =:g95      L_O = -Wl,-rpath='"$ncdfdir"'/lib:' \
588  -e "s:-fmod=:-$fmod:" -e 's/-fno-second-underscore//' \
589  -e 's:#-Q- g95      M_K = gmake:#-Q- g95      M_K = make:' \
590  tmp >| AA_make.gdef
591
592  if [ $pcmac == 1 ]
593  then
594      cp AA_make.gdef tmp
595      sed -e 's/rpath=/rpath,/g' tmp > AA_make.gdef
596  fi
597 
598
599# We use lines for g95 even for the other compilers to run ins_make
600  if [ "$use_shell" = "ksh" ] ; then
601    ./ins_make $o_ins_make
602  else # bash
603    sed -e s:/bin/ksh:/bin/bash:g ins_make > ins_make.bash
604    if [ "`grep ada AA_make.gdef`" = "" ] ; then # Bidouille pour compiler sur ada des vieux modipsl.tar
605        \cp -f ~rdzt401/bin/AA_make.gdef .
606    fi
607   
608    chmod u=rwx ins_make.bash
609    ./ins_make.bash $o_ins_make
610  fi # of if [ "$use_shell" = "ksh" ]
611
612#=======================================================================================
613  cd $MODEL/modipsl/modeles/IOIPSL/src
614  ioipsllog=`pwd`/ioipsl.log
615  echo '##########################################################'
616  echo 'Compiling IOIPSL, the interface library with Netcdf'
617  echo '##########################################################'
618  echo log file : $ioipsllog
619
620  if [ "$use_shell" = "bash" ] ; then
621    cp Makefile Makefile.ksh
622    sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile
623  fi
624# if [ "$pclinux" = 1 ] ; then
625    # Build IOIPSL modules and library
626    $make clean
627    $make > $ioipsllog 2>&1
628    if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then # copy module files to lib
629      cp -f *.mod ../../../lib
630    fi
631    # Build IOIPSL tools (ie: "rebuild", if present)
632    if [ -f $MODEL/modipsl/modeles/IOIPSL/tools/rebuild ] ; then
633      cd $MODEL/modipsl/modeles/IOIPSL/tools
634      # adapt Makefile & rebuild script if in bash
635      if [ "$use_shell" = "bash" ] ; then
636        cp Makefile Makefile.ksh
637        sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile
638        cp rebuild rebuild.ksh
639        sed -e 's:/bin/ksh:/bin/bash:g' \
640            -e 's:print -u2:echo:g' \
641            -e 's:print:echo:g' rebuild.ksh > rebuild
642      fi
643      $make clean
644      $make > $ioipsllog 2>&1
645    fi
646# fi # of if [ "$pclinux" = 1 ]
647
648else # of if [ $ioipsl = 1 ]
649  if [ ${hostname:0:5} = ada33 ] ; then
650    cd $MODEL/modipsl
651    cd util
652
653    cp AA_make.gdef AA_make.orig
654    sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp
655    sed -e "s:F_L = g95:F_L = $compiler:" -e "s:F_C = g95 -c:F_C = $compiler -c": \
656    -e 's/g95.*.w_w.*.(F_D)/g95      w_w = '"$OPTIMGCM"'/' \
657    -e 's:g95.*.NCDF_INC.*.$:g95      NCDF_INC= -I/smplocal/pub/HDF5/1.8.9/seq/include -I/smplocal/pub/NetCDF/4.1.3/include:' \
658    -e 's:g95.*.NCDF_LIB.*.$:g95      NCDF_LIB= -L/smplocal/pub/NetCDF/4.1.3/lib -lnetcdff -lnetcdf:' \
659    -e "s:-fmod=:-$fmod:" -e 's/-fno-second-underscore//' \
660    -e 's:#-Q- g95      M_K = gmake:#-Q- g95      M_K = make:' \
661    tmp >| AA_make.gdef
662
663    ./ins_make $o_ins_make # We use lines for g95 even for the other compilers
664
665    # on Ada, IOIPSL is already installed in ~rpsl035/IOIPSL_PLUS
666    # so link it to current settings
667    cd $MODEL/modipsl/modeles/
668    \rm -r -f IOIPSL
669    ln -s ~rpsl035/IOIPSL_PLUS IOIPSL
670    cd ..
671    ln -s ~rpsl035/IOIPSL_PLUS/modipsl_Tagv2_2_3/bin/* bin/
672    ln -s ~rpsl035/IOIPSL_PLUS/modipsl_Tagv2_2_3/lib/* lib/
673
674  fi # of if [ ${hostname:0:5} = ada33 ]
675  echo install.sh ioipsl_OK `date`
676fi # of if [ $ioipsl = 1 ]
677# Saving ioipsl lib for possible parallel compile
678  cd $MODEL/modipsl
679  tar cf ioipsl.tar lib/ bin/
680
681#===========================================================================
682if [ "$with_xios" = "y" ] ; then
683  echo '##########################################################'
684  echo 'Compiling XIOS'
685  echo '##########################################################'
686  cd $MODEL/modipsl/modeles
687  xioslog=`pwd`/xios.log
688  echo "log file: $xioslog"
689  #wget http://www.lmd.jussieu.fr/~lmdz/Distrib/install_xios.bash
690  myget import/install_xios.bash
691  chmod u=rwx install_xios.bash
692  if [ ${hostname:0:5} = ada33 ] ; then
693    ./install_xios.bash \
694    -prefix /workgpfs/rech/gzi/rgzi027/LMDZ20180221.trunk/modipsl/modeles \
695    -netcdf /smplocal/pub/NetCDF/4.1.3/mpi -hdf5 /smplocal/pub/HDF5/1.8.9/par \
696    -MPI /smplocal/intel/compilers_and_libraries_2017.2.174/linux/mpi/intel64/ \
697    -arch X64_ADA > xios.log 2>&1
698   else
699     ./install_xios.bash -prefix $MODEL/modipsl/modeles \
700                      -netcdf ${ncdfdir} -hdf5 ${ncdfdir} \
701                      -MPI $root_mpi -arch $arch > xios.log 2>&1
702   fi
703   if [ -f XIOS/lib/libxios.a ] ; then
704     echo "OK, XIOS library successfully generated"
705   fi
706fi
707
708#============================================================================
709veget_version=false
710if [ "$veget" = 1 ] ; then
711  cd $MODEL/modipsl/modeles/ORCHIDEE
712  orchideelog=`pwd`/orchidee.log
713  echo '########################################################'
714  echo 'Compiling ORCHIDEE, the continental surfaces model '
715  echo '########################################################'
716  echo log file : $orchideelog
717  export ORCHPATH=`pwd`
718  if [ -d tools ] ; then
719###################################################################
720# Pour les experts qui voudraient changer de version d'orchidee.
721# Attention : necessite d'avoir le password pour orchidee
722      set +e ; svn upgrade ; set -e
723      if [ "$orchidee_rev" != "" ] ; then
724         set +e ; svn update -r $orchidee_rev ; set -e
725      fi
726###################################################################
727     veget_version=orchidee2.0
728      cd arch
729      sed -e s:"%COMPILER        .*.$":"%COMPILER            $compiler":1 \
730     -e s:"%LINK            .*.$":"%LINK                $compiler":1 \
731     -e s:"%FPP_FLAGS       .*.$":"%FPP_FLAGS           $fpp_flags":1 \
732     -e s:"%PROD_FFLAGS     .*.$":"%PROD_FFLAGS         $OPTIM":1 \
733     -e s:"%DEV_FFLAGS      .*.$":"%DEV_FFLAGS          $OPTDEV":1 \
734     -e s:"%DEBUG_FFLAGS    .*.$":"%DEBUG_FFLAGS        $OPTDEB":1 \
735     -e s:"%BASE_FFLAGS     .*.$":"%BASE_FFLAGS         $OPTPREC":1 \
736     -e s:"%BASE_LD         .*.$":"%BASE_LD             $BASE_LD":1 \
737     -e s:"%ARFLAGS         .*.$":"%ARFLAGS             $ARFLAGS":1 \
738     arch-gfortran.fcm > arch-local.fcm
739     echo "NETCDF_LIBDIR=\"-L${ncdfdir}/lib -lnetcdff -lnetcdf\"" > arch-local.path
740     echo "NETCDF_INCDIR=${ncdfdir}/include" >> arch-local.path
741     echo "IOIPSL_INCDIR=$ORCHPATH/../../lib" >> arch-local.path
742     echo "IOIPSL_LIBDIR=$ORCHPATH/../../lib" >> arch-local.path
743     echo 'XIOS_INCDIR=${ORCHDIR}/../XIOS/inc' >> arch-local.path
744     echo 'XIOS_LIBDIR="${ORCHDIR}/../XIOS/lib -lxios"' >> arch-local.path
745     cd ../
746# compiling ORCHIDEE sequential mode
747     ./makeorchidee_fcm -j 8 -noxios -prod -parallel none -arch $arch > $orchideelog 2>&1
748     echo ./makeorchidee_fcm -j 8 -noxios -prod -parallel none -arch $arch
749     echo Fin de la premiere compilation orchidee ; pwd
750  else
751     if [ -d src_parallel ] ; then
752       liste_src="parallel parameters global stomate sechiba driver"
753       veget_version=orchidee2.0
754     else
755       # Obsolete, for ORCHIDEE_beton only
756       liste_src="parameters stomate sechiba "
757       # A trick to compile ORCHIDEE depending on if we are using real*4 or real*8
758       cd src_parameters ; \cp reqdprec.$real reqdprec.f90 ; cd ..
759       veget_version=orchidee1.9
760     fi
761     for d in $liste_src ; do src_d=src_$d
762        echo src_d $src_d
763        echo ls ; ls
764        if [ ! -d $src_d ] ; then echo Problem orchidee : no $src_d ; exit ; fi
765        cd $src_d ; \rm -f *.mod make ; $make clean
766        $make > $orchideelog 2>&1 ; if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then cp -f *.mod ../../../lib ; fi
767        cd ..
768     done
769  fi
770  echo install.sh orchidee_OK `date`
771fi # of if [ "$veget" = 1 ]
772
773
774#============================================================================
775# Ehouarn: it may be directory LMDZ4 or LMDZ5 depending on tar file...
776if [ -d $MODEL/modipsl/modeles/LMD* ] ; then
777  echo '##########################################################'
778  echo 'Compiling LMDZ'
779  echo '##########################################################'
780  cd $MODEL/modipsl/modeles/LMD*
781  LMDZPATH=`pwd`
782else
783  echo "ERROR: No LMD* directory !!!"
784  exit
785fi
786
787###########################################################
788# For those who want to use fcm to compile via :
789#  makelmdz_fcm -arch local .....
790############################################################
791
792if [ "$pclinux" = "1" ] ; then
793
794# create local 'arch' files (if on Linux PC):
795cd arch
796# arch-local.path file
797echo "NETCDF_LIBDIR=\"-L${ncdfdir}/lib -lnetcdff -lnetcdf\"" > arch-local.path
798echo "NETCDF_INCDIR=-I${ncdfdir}/include" >> arch-local.path
799echo 'IOIPSL_INCDIR=$LMDGCM/../../lib' >> arch-local.path
800echo 'IOIPSL_LIBDIR=$LMDGCM/../../lib' >> arch-local.path
801echo 'XIOS_INCDIR=$LMDGCM/../XIOS/inc' >> arch-local.path
802echo 'XIOS_LIBDIR=$LMDGCM/../XIOS/lib' >> arch-local.path
803echo 'ORCH_INCDIR=$LMDGCM/../../lib' >> arch-local.path
804echo 'ORCH_LIBDIR=$LMDGCM/../../lib' >> arch-local.path
805
806if [ $pcmac == 1 ] ; then
807    BASE_LD="$BASE_LD -Wl,-rpath,${ncdfdir}/lib"
808else
809    BASE_LD="$BASE_LD -Wl,-rpath=${ncdfdir}/lib"
810fi
811# Arch-local.fcm file (adapted from arch-linux-32bit.fcm)
812
813if [ $real = r8 ] ; then FPP_DEF=NC_DOUBLE ; else FPP_DEF="" ; fi
814sed -e s:"%COMPILER        .*.$":"%COMPILER            $compiler":1 \
815    -e s:"%LINK            .*.$":"%LINK                $compiler":1 \
816    -e s:"%PROD_FFLAGS     .*.$":"%PROD_FFLAGS         $OPTIM":1 \
817    -e s:"%DEV_FFLAGS      .*.$":"%DEV_FFLAGS          $OPTDEV":1 \
818    -e s:"%DEBUG_FFLAGS    .*.$":"%DEBUG_FFLAGS        $OPTDEB":1 \
819    -e s:"%BASE_FFLAGS     .*.$":"%BASE_FFLAGS         $OPTPREC":1 \
820    -e s:"%FPP_DEF         .*.$":"%FPP_DEF             $FPP_DEF":1 \
821    -e s:"%BASE_LD         .*.$":"%BASE_LD             $BASE_LD":1 \
822    -e s:"%ARFLAGS         .*.$":"%ARFLAGS             $ARFLAGS":1 \
823    arch-linux-32bit.fcm > arch-local.fcm
824
825cd ..
826### Adapt "bld.cfg" (add the shell):
827whereisthatshell=$(which ${use_shell})
828echo "bld::tool::SHELL   $whereisthatshell" >> bld.cfg
829
830fi # of if [ "$pclinux" = 1 ]
831
832
833cd $MODEL/modipsl/modeles/LMDZ*
834lmdzlog=`pwd`/lmdz.log
835
836##################################################################
837# Possibly update LMDZ if a specific svn release is requested
838##################################################################
839
840set +e ; svn upgrade ; set -e
841if [ "$svn" = "last" ] ; then svnopt="" ; else svnopt="-r $svn" ; fi
842if [ "$svn" != "" ] ; then svn update $svnopt ; fi
843
844echo '##################################################################'
845echo Compile LMDZ
846echo '##################################################################'
847echo log file : $lmdzlog
848
849echo install.sh avant_compilation `date`
850if [ $compile_with_fcm = 1 ] ; then makelmdz="makelmdz_fcm -arch $arch -j 8" ; else makelmdz="makelmdz -arch $arch" ; fi
851
852# use the orchidee interface that has no z0h
853if [ "$no_z0h_orc" = 1 ] ; then
854veget_version="$veget_version -cpp ORCHIDEE_NOZ0H"
855fi
856
857# sequential compilation and bench
858if [ "$sequential" = 1 ] ; then
859echo "./$makelmdz $OPT_MAKELMDZ -rrtm true $opt_cosp -d ${grid_resolution} -v $veget_version gcm " >> compile.sh
860chmod +x ./compile.sh
861if [ $bench != 0 ] ; then ./compile.sh > $lmdzlog 2>&1 ; fi
862echo install.sh apres_compilation `date`
863
864
865fi # fin sequential
866
867
868
869# compiling in parallel mode
870if [ $parallel != "none" ] ; then
871  echo '##########################################################'
872  echo ' Parallel compile '
873  echo '##########################################################'
874  # saving the sequential libs and binaries
875  cd $MODEL/modipsl
876  tar cf sequential.tar bin/ lib/
877  \rm -rf bin/ lib/
878  tar xf ioipsl.tar
879  #
880  # Orchidee
881  #
882  cd $ORCHPATH
883  if [ -d src_parallel -a $veget = 1 ] ; then
884     cd arch
885     sed  \
886     -e s:"%COMPILER.*.$":"%COMPILER            $par_comp":1 \
887     -e s:"%LINK.*.$":"%LINK                $par_comp":1 \
888     -e s:"%MPI_FFLAG.*.$":"%MPI_FFLAGS          $MPI_FLAGS":1 \
889     -e s:"%OMP_FFLAG.*.$":"%OMP_FFLAGS          $OMP_FLAGS":1 \
890     -e s:"%MPI_LD.*.$":"%MPI_LD              $MPI_LD":1 \
891     -e s:"%OMP_LD.*.$":"%OMP_LD              $OMP_LD":1 \
892     arch-local.fcm > tmp.fcm
893
894     mv tmp.fcm arch-local.fcm
895     cd ../
896     echo compiling ORCHIDEE parallel mode
897     echo logfile $orchideelog
898     ./makeorchidee_fcm -j 8 -clean -noxios -prod -parallel $parallel -arch $arch > $orchideelog 2>&1
899     ./makeorchidee_fcm -j 8 -noxios -prod -parallel $parallel -arch $arch >> $orchideelog 2>&1
900     echo ./makeorchidee_fcm -j 8 -clean -noxios -prod -parallel $parallel -arch $arch
901     echo ./makeorchidee_fcm -j 8 -noxios -prod -parallel $parallel -arch $arch
902  elif [ $veget = 1 ] ; then
903    echo '##########################################################'
904    echo ' Orchidee version too old                                 '
905    echo ' Please update to new version                             '
906    echo '##########################################################'
907    exit
908  fi # of if [ -d src_parallel ]
909  # LMDZ
910  cd $LMDZPATH
911  if [ $arch = local ] ; then
912    cd arch
913    sed -e s:"%COMPILER.*.$":"%COMPILER            $par_comp":1 \
914    -e s:"%LINK.*.$":"%LINK                $par_comp":1 \
915    -e s:"%MPI_FFLAG.*.$":"%MPI_FFLAGS          $MPI_FLAGS":1 \
916    -e s:"%OMP_FFLAG.*.$":"%OMP_FFLAGS          $OMP_FLAGS":1 \
917    -e s:"%ARFLAGS.*.$":"%ARFLAGS          $ARFLAGS":1 \
918    -e s@"%BASE_LD.*.$"@"%BASE_LD             -Wl,-rpath=${root_mpi}/lib:${ncdfdir}/lib"@1 \
919    -e s:"%MPI_LD.*.$":"%MPI_LD              $MPI_LD":1 \
920    -e s:"%OMP_LD.*.$":"%OMP_LD              $OMP_LD":1 \
921    arch-local.fcm > tmp.fcm
922    mv tmp.fcm arch-local.fcm
923    cd ../
924  fi
925  rm -f compile.sh
926  if [ ${hostname:0:5} = ada33 ] ; then echo "module load intel/2013.0" > compile.sh ; fi
927  echo resol=${grid_resolution} >> compile.sh
928  echo ./$makelmdz $OPT_MAKELMDZ -rrtm true $opt_cosp $opt_makelmdz_xios -d \$resol -v $veget_version -mem -parallel $parallel gcm >> compile.sh
929  chmod +x ./compile.sh
930  if [ $bench != 0 ] ; then ./compile.sh > $lmdzlog 2>&1 ; fi
931
932  echo "Compilation finished"
933 
934fi # of if [ $parallel != "none" ]
935
936echo LLLLLLLLLLLLLLLLLLLLLLLLLLL
937if [ "$gfortran" = "gfortran44" ] ; then
938    echo Your gfortran compiler was too old so that the model was automatically
939    echo compiled with gfortran44 instead. It can not be used in parallel mode.
940    echo You can change the compiler at the begining of the install.sh
941    echo script and reinstall.
942fi
943
944##################################################################
945# Verification du succes de la compilation
946##################################################################
947
948# Recherche de l'executable dont le nom a change au fil du temps ...
949gcm=""
950for exe in gcm.e bin/gcm_${grid_resolution}_phylmd_seq_orch.e bin/gcm_${grid_resolution}_phylmd_seq.e bin/gcm_${grid_resolution}_phylmd_para_mem_orch.e ; do
951   if [ -f $exe ] ; then gcm=$exe ; fi
952done
953
954if [ "$gcm" = "" ] ; then
955   echo 'Compilation failed !!'
956   # Ehouarn : temporary, do not exit and let job finish (to set up bench case)
957   #exit
958   set +e
959else
960   echo '##########################################################'
961   echo 'Compilation successfull !! '
962   echo '##########################################################'
963   echo The executable is $gcm
964fi
965
966##################################################################
967# Below, we run a benchmark test (if bench=0)
968##################################################################
969
970if [ $bench != 0 ] ; then
971
972echo '##########################################################'
973echo ' Running a test run '
974echo '##########################################################'
975
976\rm -rf BENCH${grid_resolution}
977bench=bench_lmdz_${grid_resolution}
978echo install.sh avant_chargement_bench  `date`
979#wget http://www.lmd.jussieu.fr/~lmdz/Distrib/$bench.tar.gz
980myget 3DBenchs/$bench.tar.gz
981echo install.sh after bench download  `date`
982tar xvf $bench.tar.gz
983
984if [ "$cosp" = 1 -o "$cosp2" = 1 ] ; then
985  cd BENCH${grid_resolution}
986# copier les fichiers namelist input et output our COSP
987  cp ../DefLists/cosp_input_nl.txt .
988  cp ../DefLists/cosp_output_nl.txt .
989# Activer la cles ok_cosp pour tourner avec COSP
990  sed -e 's@ok_cosp=n@ok_cosp=y@' config.def > tmp
991   \mv -f tmp config.def
992  cd ..
993fi 
994
995if [ "$with_xios" = "y" ] ; then
996  cd BENCH${grid_resolution}
997  cp ../DefLists/iodef.xml .
998  cp ../DefLists/context_lmdz.xml .
999  cp ../DefLists/field_def_lmdz.xml .
1000  cp ../DefLists/file_def_hist*xml .
1001  # adapt iodef.xml to use attached mode
1002  sed -e 's@"using_server" type="bool">true@"using_server" type="bool">false@' iodef.xml > tmp
1003  \mv -f tmp iodef.xml
1004
1005  # and convert all the enabled="_AUTO_" (for libIGCM) to enabled=.FALSE.
1006  # except for histday
1007  for histfile in file_def_hist*xml
1008  do
1009    if [ "$histfile" = "file_def_histday_lmdz.xml" ] ; then
1010    sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".TRUE."@' $histfile > tmp ; \mv -f tmp $histfile
1011    else
1012    sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".FALSE."@' $histfile > tmp ; \mv -f tmp $histfile
1013    fi
1014  done
1015  # and add option "ok_all_xml=y" in config.def
1016  echo "### XIOS outputs" >> config.def
1017  echo 'ok_all_xml=.true.' >> config.def
1018  cd ..
1019fi
1020
1021cp $gcm BENCH${grid_resolution}/gcm.e
1022
1023cd BENCH${grid_resolution}
1024# On cree le fichier bench.sh au besoin
1025# Dans le cas 48x36x39 le bench.sh existe deja en parallele
1026
1027if [ "$grid_resolution" = "48x36x39" ] ; then
1028   echo On ne touche pas au bench.sh
1029   # But we have to adapt "run_local.sh" for $mpirun
1030   sed -e "s@mpirun@$mpirun@g" run_local.sh > tmp
1031   mv -f tmp run_local.sh
1032   chmod u=rwx run_local.sh
1033elif [ "${parallel:0:3}" = "mpi" ] ; then
1034   # Lancement avec deux procs mpi et 2 openMP
1035   echo "export OMP_STACKSIZE=800M" > bench.sh
1036   if [ "${parallel:4:3}" = "omp" ] ; then
1037     echo "export OMP_NUM_THREADS=2" >> bench.sh
1038   fi
1039   echo "ulimit -s unlimited" >> bench.sh
1040   echo "$mpirun -np 2 gcm.e > listing  2>&1" >> bench.sh
1041else
1042   echo "./gcm.e > listing  2>&1" > bench.sh
1043fi
1044echo EXECUTION DU BENCH
1045set +e
1046date ; ./bench.sh > out.bench 2>&1 ; date
1047set -e
1048tail listing
1049
1050
1051echo '##########################################################'
1052echo 'Simulation finished in' `pwd`
1053   echo 'You have compiled with:'
1054   cat ../compile.sh
1055if [ $parallel = "none" ] ; then
1056  echo 'You may re-run it with : cd ' `pwd` ' ; gcm.e'
1057  echo 'or ./bench.sh'
1058else
1059  echo 'You may re-run it with : '
1060  echo 'cd ' `pwd` '; ./bench.sh'
1061  echo 'ulimit -s unlimited'
1062  echo 'export OMP_NUM_THREADS=2'
1063  echo 'export OMP_STACKSIZE=800M'
1064  echo "$mpirun -np 2 gcm.e "
1065fi
1066echo '##########################################################'
1067
1068fi
1069
1070
1071#################################################################
1072# Installation eventuelle du 1D
1073#################################################################
1074
1075if [ $SCM = 1 ] ; then
1076cd $MODEL
1077#wget http://www.lmd.jussieu.fr/~lmdz/Distrib/1D.tar.gz
1078myget 1D/1D.tar.gz
1079tar xvf 1D.tar.gz
1080cd 1D
1081./run.sh
1082fi
Note: See TracBrowser for help on using the repository browser.