source: BOL/script_install/install_lmdz.sh @ 3560

Last change on this file since 3560 was 3560, checked in by Laurent Fairhead, 5 years ago

Change in intel environnement on ada
Processing AUTO in def/xml files

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/2017.2 ;
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" ] ; then
335  if [ ! "$cosp" = 1 -o "$cosp2" = 1 ] ; then
336   echo "Error, you must use -cosp option when compiling with -xios"
337   echo "You need to call Cosp in physical first step to define axis variables"
338   exit
339  fi
340  opt_makelmdz_xios="-io xios"
341fi
342
343echo '################################################################'
344echo  Choix des options de compilation
345echo '################################################################'
346
347export FC=$compiler
348export F90=$compiler
349export F77=$compiler
350export CPPFLAGS=
351OPTIMNC=$OPTIM
352BASE_LD="$OPT_GPROF"
353OPTPREC="$OPT_GPROF"
354ARFLAGS="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
355
356
357
358if [ "$compiler" = "$gfortran" ] ; then
359   OPTIM='-O3'
360   OPTDEB="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all -fbacktrace -finit-real=nan"
361   OPTDEV="-Wall -fbounds-check"
362   fmod='I '
363   OPTPREC="$OPTPREC -cpp -ffree-line-length-0"
364   if [ $real = r8 ] ; then OPTPREC="$OPTPREC -fdefault-real-8 -DNC_DOUBLE" ; fi
365   export F90FLAGS=" -ffree-form $OPTIMNC"
366   export FFLAGS=" $OPTIMNC"
367   export CC=gcc
368   export CXX=g++
369   export fpp_flags="-P -C -traditional -ffreestanding"
370
371elif [ $compiler = mpif90 ] ; then
372   OPTIM='-O3'
373   OPTDEB="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all"
374   OPTDEV="-Wall -fbounds-check"
375   BASE_LD="$BASE_LD -lblas"
376   fmod='I '
377   if [ $real = r8 ] ; then OPTPREC="$OPTPREC -fdefault-real-8 -DNC_DOUBLE -fcray-pointer" ; fi
378   export F90FLAGS=" -ffree-form $OPTIMNC"
379   export FFLAGS=" $OPTIMNC"
380   export CC=gcc
381   export CXX=g++
382
383elif [ $compiler = pgf90 ] ; then
384   OPTIM='-O2 -Mipa -Munroll -Mnoframe -Mautoinline -Mcache_align'
385   OPTDEB='-g -Mdclchk -Mbounds -Mchkfpstk -Mchkptr -Minform=inform -Mstandard -Ktrap=fp -traceback'
386   OPTDEV='-g -Mbounds -Ktrap=fp -traceback'
387   fmod='module '
388   if [ $real = r8 ] ; then OPTPREC="$OPTPREC -r8 -DNC_DOUBLE" ; fi
389   export CPPFLAGS="-DpgiFortran"
390   export CC=pgcc
391   export CFLAGS="-O2 -Msignextend"
392   export CXX=pgCC
393   export CXXFLAGS="-O2 -Msignextend"
394   export FFLAGS="-O2 $OPTIMNC"
395   export F90FLAGS="-O2 $OPTIMNC"
396   compile_with_fcm=1
397
398elif [ $compiler = ifort ] ; then
399   OPTIM="-O2 -fp-model strict -ip -align all "
400   OPTDEV="-p -g -O2 -traceback -fp-stack-check -ftrapuv -check"
401   OPTDEB="-g -no-ftz -traceback -ftrapuv -fp-stack-check -check"
402   fmod='module '
403   if [ $real = r8 ] ; then OPTPREC="$OPTPREC -real-size 64 -DNC_DOUBLE" ; fi
404   export CPP="icc -E"
405   export FFLAGS="-O2 -ip -fpic -mcmodel=large"
406   export FCFLAGS="-O2 -ip -fpic -mcmodel=large"
407   export CC=icc
408   export CFLAGS="-O2 -ip -fpic -mcmodel=large"
409   export CXX=icpc
410   export CXXFLAGS="-O2 -ip -fpic -mcmodel=large"
411   export fpp_flags="-P -traditional"
412   compile_with_fcm=1
413
414else
415   echo unexpected compiler $compiler ; exit
416fi
417
418OPTIMGCM="$OPTIM $OPTPREC"
419
420hostname=`hostname`
421
422##########################################################################
423# If installing on know machines such as IBM x3750 (Ada)
424# at IDRIS, don't check for available software and don"t install netcdf
425if [ ${hostname:0:5} = ada33 ] ; then
426  netcdf=0 # no need to recompile netcdf, alreday available
427  check_linux=0
428  pclinux=0
429  ioipsl=1 # no need to recompile ioipsl, already available
430  #netcdf="/smplocal/pub/NetCDF/4.1.3"
431  compiler="ifort"
432  fmod='module '
433  if [ $real = r8 ] ; then OPTPREC="$OPTPREC -real-size 64 -DNC_DOUBLE" ; fi
434  OPTIM="-O2 -fp-model strict -ip -axAVX,SSE4.2 -align all "
435  OPTIMGCM="$OPTIM $OPTPREC"
436fi
437##########################################################################
438
439
440
441mkdir -p $MODEL
442echo $MODEL
443MODEL=`( cd $MODEL ; pwd )` # to get absolute path, if necessary
444
445
446
447# Option -fendian=big is only to be used with ARPEGE1D.
448# The -r8 should probably be avoided if running on 32 bit machines
449# Option r8 is not mandatory and generates larger executables.
450# It is however mandatory if using ARPEGE1D
451# Better optimization options might be a better choice (e.g. -O3)
452
453
454echo '################################################################'
455if [ "$check_linux" = 1 ] ; then
456echo   Check if required software is available
457echo '################################################################'
458
459#### Ehouarn: test if ksh and/or bash are available
460use_shell="ksh" # default: use ksh
461if [ "`which ksh`" = "" ] ; then
462  echo "no ksh ... we will use bash"
463  use_shell="bash"
464  if [ "`which bash`" = "" ] ; then
465    echo "ksh (or bash) needed!! Install it!"
466  fi
467fi
468
469
470for logiciel in csh wget tar gzip make $compiler gcc ; do
471if [ "`which $logiciel`" = "" ] ; then
472echo You must first install $logiciel on your system
473exit
474fi
475done
476
477if [ $pclinux = 1 ] ; then
478cd $MODEL
479cat <<eod > tt.f90
480print*,'coucou'
481end
482eod
483$compiler tt.f90 -o a.out
484./a.out >| tt
485if [ "`cat tt | sed -e 's/ //g' `" != "coucou" ] ; then
486echo problem installing with compiler $compiler ; exit ; fi
487\rm tt a.out tt.f90
488fi
489fi
490
491###########################################################################
492if [ $getlmdzor = 1 ] ; then
493echo '##########################################################'
494echo  Download a slightly modified version of  LMDZ
495echo '##########################################################'
496cd $MODEL
497myget src/modipsl.$version.tar.gz
498echo install.sh wget_OK `date`
499gunzip modipsl.$version.tar.gz
500tar xvf modipsl.$version.tar
501\rm modipsl.$version.tar
502
503fi
504
505echo OK1
506
507if [ $netcdf = 1 ] ; then
508cd $MODEL
509netcdflog=`pwd`/netcdf.log
510echo '##########################################################'
511echo Compiling the Netcdf library
512echo '##########################################################'
513echo log file : $netcdflog
514if [ "$with_xios" = "n" ] ; then
515  # keep it simple
516  #wget http://www.lmd.jussieu.fr/~lmdz/Distrib/netcdf-4.0.1.tar.gz
517  myget import/netcdf-4.0.1.tar.gz
518  gunzip netcdf-4.0.1.tar.gz
519  tar xvf netcdf-4.0.1.tar
520  \rm -f netcdf-4.0.1.tar
521
522  cd netcdf-4.0.1
523
524  # seds to possibly use gfortran44 obsolete nowdays (Ehouarn: 10/2017)
525  #sed -e 's/gfortran/'$gfortran'/g' configure >| tmp ; mv -f tmp configure ; chmod +x configure
526  localdir=`pwd -P`
527  ./configure --prefix=$localdir --enable-shared --disable-cxx
528  #sed -e 's/gfortran/'$gfortran'/g' Makefile >| tmp ; mv -f tmp Makefile
529  $make check > $netcdflog 2>&1
530  $make install >> $netcdflog 2>&1
531else
532  # download and compile hdf5 and netcdf, etc. using the install_netcdf4_hdf5.bash script
533  #wget http://www.lmd.jussieu.fr/~lmdz/Distrib/install_netcdf4_hdf5.bash
534  myget import/install_netcdf4_hdf5.bash
535  chmod u=rwx install_netcdf4_hdf5.bash
536  if [ "$compiler" = "gfortran" ] ; then
537  ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC gcc -FC gfortran -CXX g++ -MPI $root_mpi  > $netcdflog 2>&1
538  elif [ "$compiler" = "ifort" ] ; then
539  ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC icc -FC ifort -CXX icpc -MPI $root_mpi  > $netcdflog 2>&1
540  elif [ "$compiler" = "pgf90" ] ; then
541  ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC pgcc -FC pgf90 -CXX pgCC -MPI $root_mpi  > $netcdflog 2>&1
542  else
543    echo "unexpected compiler $compiler" ; exit
544  fi
545fi  # of if [ "$with_xios" = "n" ]
546echo install.sh netcdf_OK `date`
547fi # of if [ $netcdf = 1 ]
548
549
550#=======================================================================================
551echo OK2 ioipsl=$ioipsl
552echo '##########################################################'
553echo 'Installing MODIPSL, the installation package manager for the '
554echo 'IPSL models and tools'
555echo '##########################################################'
556
557if [ $netcdf = 0 -o $netcdf = 1 ] ; then
558  if [ "$with_xios" = "y" ] ; then
559  ncdfdir=$MODEL/netcdf4_hdf5
560  else
561  ncdfdir=$MODEL/netcdf-4.0.1
562  fi
563else
564  ncdfdir=$netcdf
565fi
566
567if [ $ioipsl = 1 ] ; then
568  cd $MODEL/modipsl
569  \rm -rf lib/*
570
571  cd util
572
573  cp AA_make.gdef AA_make.orig
574  F_C="$compiler -c " ; if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then F_C="$compiler -c -cpp " ; fi
575  if [ "$compiler" = "pgf90" ] ; then F_C="$compiler -c -Mpreprocess" ; fi
576  sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp
577  sed -e "s:F_L = g95:F_L = $compiler:" -e "s:F_C = g95 -c -cpp:F_C = $F_C": \
578  -e 's/g95.*.w_w.*.(F_D)/g95      w_w = '"$OPTIMGCM"'/' \
579  -e 's:g95.*.NCDF_INC.*.$:g95      NCDF_INC= '"$ncdfdir"'/include:' \
580  -e 's:g95.*.NCDF_LIB.*.$:g95      NCDF_LIB= -L'"$ncdfdir"'/lib -lnetcdff -lnetcdf:' \
581  -e 's:g95      L_O =:g95      L_O = -Wl,-rpath='"$ncdfdir"'/lib:' \
582  -e "s:-fmod=:-$fmod:" -e 's/-fno-second-underscore//' \
583  -e 's:#-Q- g95      M_K = gmake:#-Q- g95      M_K = make:' \
584  tmp >| AA_make.gdef
585
586  if [ $pcmac == 1 ]
587  then
588      cp AA_make.gdef tmp
589      sed -e 's/rpath=/rpath,/g' tmp > AA_make.gdef
590  fi
591 
592
593# We use lines for g95 even for the other compilers to run ins_make
594  if [ "$use_shell" = "ksh" ] ; then
595    ./ins_make $o_ins_make
596  else # bash
597    sed -e s:/bin/ksh:/bin/bash:g ins_make > ins_make.bash
598    if [ "`grep ada AA_make.gdef`" = "" ] ; then # Bidouille pour compiler sur ada des vieux modipsl.tar
599        \cp -f ~rdzt401/bin/AA_make.gdef .
600    fi
601   
602    chmod u=rwx ins_make.bash
603    ./ins_make.bash $o_ins_make
604  fi # of if [ "$use_shell" = "ksh" ]
605
606#=======================================================================================
607  cd $MODEL/modipsl/modeles/IOIPSL/src
608  ioipsllog=`pwd`/ioipsl.log
609  echo '##########################################################'
610  echo 'Compiling IOIPSL, the interface library with Netcdf'
611  echo '##########################################################'
612  echo log file : $ioipsllog
613
614  if [ "$use_shell" = "bash" ] ; then
615    cp Makefile Makefile.ksh
616    sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile
617  fi
618# if [ "$pclinux" = 1 ] ; then
619    # Build IOIPSL modules and library
620    $make clean
621    $make > $ioipsllog 2>&1
622    if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then # copy module files to lib
623      cp -f *.mod ../../../lib
624    fi
625    # Build IOIPSL tools (ie: "rebuild", if present)
626    if [ -f $MODEL/modipsl/modeles/IOIPSL/tools/rebuild ] ; then
627      cd $MODEL/modipsl/modeles/IOIPSL/tools
628      # adapt Makefile & rebuild script if in bash
629      if [ "$use_shell" = "bash" ] ; then
630        cp Makefile Makefile.ksh
631        sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile
632        cp rebuild rebuild.ksh
633        sed -e 's:/bin/ksh:/bin/bash:g' \
634            -e 's:print -u2:echo:g' \
635            -e 's:print:echo:g' rebuild.ksh > rebuild
636      fi
637      $make clean
638      $make > $ioipsllog 2>&1
639    fi
640# fi # of if [ "$pclinux" = 1 ]
641
642else # of if [ $ioipsl = 1 ]
643  if [ ${hostname:0:5} = ada33 ] ; then
644    cd $MODEL/modipsl
645    cd util
646
647    cp AA_make.gdef AA_make.orig
648    sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp
649    sed -e "s:F_L = g95:F_L = $compiler:" -e "s:F_C = g95 -c:F_C = $compiler -c": \
650    -e 's/g95.*.w_w.*.(F_D)/g95      w_w = '"$OPTIMGCM"'/' \
651    -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:' \
652    -e 's:g95.*.NCDF_LIB.*.$:g95      NCDF_LIB= -L/smplocal/pub/NetCDF/4.1.3/lib -lnetcdff -lnetcdf:' \
653    -e "s:-fmod=:-$fmod:" -e 's/-fno-second-underscore//' \
654    -e 's:#-Q- g95      M_K = gmake:#-Q- g95      M_K = make:' \
655    tmp >| AA_make.gdef
656
657    ./ins_make $o_ins_make # We use lines for g95 even for the other compilers
658
659    # on Ada, IOIPSL is already installed in ~rpsl035/IOIPSL_PLUS
660    # so link it to current settings
661    cd $MODEL/modipsl/modeles/
662    \rm -r -f IOIPSL
663    ln -s ~rpsl035/IOIPSL_PLUS IOIPSL
664    cd ..
665    ln -s ~rpsl035/IOIPSL_PLUS/modipsl_Tagv2_2_3/bin/* bin/
666    ln -s ~rpsl035/IOIPSL_PLUS/modipsl_Tagv2_2_3/lib/* lib/
667
668  fi # of if [ ${hostname:0:5} = ada33 ]
669  echo install.sh ioipsl_OK `date`
670fi # of if [ $ioipsl = 1 ]
671# Saving ioipsl lib for possible parallel compile
672  cd $MODEL/modipsl
673  tar cf ioipsl.tar lib/ bin/
674
675#===========================================================================
676if [ "$with_xios" = "y" ] ; then
677  echo '##########################################################'
678  echo 'Compiling XIOS'
679  echo '##########################################################'
680  cd $MODEL/modipsl/modeles
681  xioslog=`pwd`/xios.log
682  echo "log file: $xioslog"
683  #wget http://www.lmd.jussieu.fr/~lmdz/Distrib/install_xios.bash
684  myget import/install_xios.bash
685  chmod u=rwx install_xios.bash
686  if [ ${hostname:0:5} = ada33 ] ; then
687    ./install_xios.bash \
688    -prefix /workgpfs/rech/gzi/rgzi027/LMDZ20180221.trunk/modipsl/modeles \
689    -netcdf /smplocal/pub/NetCDF/4.1.3/mpi -hdf5 /smplocal/pub/HDF5/1.8.9/par \
690    -MPI /smplocal/intel/compilers_and_libraries_2017.2.174/linux/mpi/intel64/ \
691    -arch X64_ADA > xios.log 2>&1
692   else
693     ./install_xios.bash -prefix $MODEL/modipsl/modeles \
694                      -netcdf ${ncdfdir} -hdf5 ${ncdfdir} \
695                      -MPI $root_mpi -arch $arch > xios.log 2>&1
696   fi
697   if [ -f XIOS/lib/libxios.a ] ; then
698     echo "OK, XIOS library successfully generated"
699   fi
700fi
701
702#============================================================================
703veget_version=false
704if [ "$veget" = 1 ] ; then
705  cd $MODEL/modipsl/modeles/ORCHIDEE
706  orchideelog=`pwd`/orchidee.log
707  echo '########################################################'
708  echo 'Compiling ORCHIDEE, the continental surfaces model '
709  echo '########################################################'
710  echo log file : $orchideelog
711  export ORCHPATH=`pwd`
712  if [ -d tools ] ; then
713###################################################################
714# Pour les experts qui voudraient changer de version d'orchidee.
715# Attention : necessite d'avoir le password pour orchidee
716      set +e ; svn upgrade ; set -e
717      if [ "$orchidee_rev" != "" ] ; then
718         set +e ; svn update -r $orchidee_rev ; set -e
719      fi
720###################################################################
721     veget_version=orchidee2.0
722      cd arch
723      sed -e s:"%COMPILER        .*.$":"%COMPILER            $compiler":1 \
724     -e s:"%LINK            .*.$":"%LINK                $compiler":1 \
725     -e s:"%FPP_FLAGS       .*.$":"%FPP_FLAGS           $fpp_flags":1 \
726     -e s:"%PROD_FFLAGS     .*.$":"%PROD_FFLAGS         $OPTIM":1 \
727     -e s:"%DEV_FFLAGS      .*.$":"%DEV_FFLAGS          $OPTDEV":1 \
728     -e s:"%DEBUG_FFLAGS    .*.$":"%DEBUG_FFLAGS        $OPTDEB":1 \
729     -e s:"%BASE_FFLAGS     .*.$":"%BASE_FFLAGS         $OPTPREC":1 \
730     -e s:"%BASE_LD         .*.$":"%BASE_LD             $BASE_LD":1 \
731     -e s:"%ARFLAGS         .*.$":"%ARFLAGS             $ARFLAGS":1 \
732     arch-gfortran.fcm > arch-local.fcm
733     echo "NETCDF_LIBDIR=\"-L${ncdfdir}/lib -lnetcdff -lnetcdf\"" > arch-local.path
734     echo "NETCDF_INCDIR=${ncdfdir}/include" >> arch-local.path
735     echo "IOIPSL_INCDIR=$ORCHPATH/../../lib" >> arch-local.path
736     echo "IOIPSL_LIBDIR=$ORCHPATH/../../lib" >> arch-local.path
737     echo 'XIOS_INCDIR=${ORCHDIR}/../XIOS/inc' >> arch-local.path
738     echo 'XIOS_LIBDIR="${ORCHDIR}/../XIOS/lib -lxios"' >> arch-local.path
739     cd ../
740# compiling ORCHIDEE sequential mode
741     ./makeorchidee_fcm -j 8 -noxios -prod -parallel none -arch $arch > $orchideelog 2>&1
742     echo ./makeorchidee_fcm -j 8 -noxios -prod -parallel none -arch $arch
743     echo End of the first compilation of orchidee ; pwd
744  else
745     if [ -d src_parallel ] ; then
746       liste_src="parallel parameters global stomate sechiba driver"
747       veget_version=orchidee2.0
748     else
749       # Obsolete, for ORCHIDEE_beton only
750       liste_src="parameters stomate sechiba "
751       # A trick to compile ORCHIDEE depending on if we are using real*4 or real*8
752       cd src_parameters ; \cp reqdprec.$real reqdprec.f90 ; cd ..
753       veget_version=orchidee1.9
754     fi
755     for d in $liste_src ; do src_d=src_$d
756        echo src_d $src_d
757        echo ls ; ls
758        if [ ! -d $src_d ] ; then echo Problem orchidee : no $src_d ; exit ; fi
759        cd $src_d ; \rm -f *.mod make ; $make clean
760        $make > $orchideelog 2>&1 ; if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then cp -f *.mod ../../../lib ; fi
761        cd ..
762     done
763  fi
764  echo install.sh orchidee_OK `date`
765fi # of if [ "$veget" = 1 ]
766
767
768#============================================================================
769# Ehouarn: it may be directory LMDZ4 or LMDZ5 depending on tar file...
770if [ -d $MODEL/modipsl/modeles/LMD* ] ; then
771  echo '##########################################################'
772  echo 'Compiling LMDZ'
773  echo '##########################################################'
774  cd $MODEL/modipsl/modeles/LMD*
775  LMDZPATH=`pwd`
776else
777  echo "ERROR: No LMD* directory !!!"
778  exit
779fi
780
781###########################################################
782# For those who want to use fcm to compile via :
783#  makelmdz_fcm -arch local .....
784############################################################
785
786if [ "$pclinux" = "1" ] ; then
787
788# create local 'arch' files (if on Linux PC):
789cd arch
790# arch-local.path file
791echo "NETCDF_LIBDIR=\"-L${ncdfdir}/lib -lnetcdff -lnetcdf\"" > arch-local.path
792echo "NETCDF_INCDIR=-I${ncdfdir}/include" >> arch-local.path
793echo 'IOIPSL_INCDIR=$LMDGCM/../../lib' >> arch-local.path
794echo 'IOIPSL_LIBDIR=$LMDGCM/../../lib' >> arch-local.path
795echo 'XIOS_INCDIR=$LMDGCM/../XIOS/inc' >> arch-local.path
796echo 'XIOS_LIBDIR=$LMDGCM/../XIOS/lib' >> arch-local.path
797echo 'ORCH_INCDIR=$LMDGCM/../../lib' >> arch-local.path
798echo 'ORCH_LIBDIR=$LMDGCM/../../lib' >> arch-local.path
799
800if [ $pcmac == 1 ] ; then
801    BASE_LD="$BASE_LD -Wl,-rpath,${ncdfdir}/lib"
802else
803    BASE_LD="$BASE_LD -Wl,-rpath=${ncdfdir}/lib"
804fi
805# Arch-local.fcm file (adapted from arch-linux-32bit.fcm)
806
807if [ $real = r8 ] ; then FPP_DEF=NC_DOUBLE ; else FPP_DEF="" ; fi
808sed -e s:"%COMPILER        .*.$":"%COMPILER            $compiler":1 \
809    -e s:"%LINK            .*.$":"%LINK                $compiler":1 \
810    -e s:"%PROD_FFLAGS     .*.$":"%PROD_FFLAGS         $OPTIM":1 \
811    -e s:"%DEV_FFLAGS      .*.$":"%DEV_FFLAGS          $OPTDEV":1 \
812    -e s:"%DEBUG_FFLAGS    .*.$":"%DEBUG_FFLAGS        $OPTDEB":1 \
813    -e s:"%BASE_FFLAGS     .*.$":"%BASE_FFLAGS         $OPTPREC":1 \
814    -e s:"%FPP_DEF         .*.$":"%FPP_DEF             $FPP_DEF":1 \
815    -e s:"%BASE_LD         .*.$":"%BASE_LD             $BASE_LD":1 \
816    -e s:"%ARFLAGS         .*.$":"%ARFLAGS             $ARFLAGS":1 \
817    arch-linux-32bit.fcm > arch-local.fcm
818
819cd ..
820### Adapt "bld.cfg" (add the shell):
821whereisthatshell=$(which ${use_shell})
822echo "bld::tool::SHELL   $whereisthatshell" >> bld.cfg
823
824fi # of if [ "$pclinux" = 1 ]
825
826
827cd $MODEL/modipsl/modeles/LMDZ*
828lmdzlog=`pwd`/lmdz.log
829
830##################################################################
831# Possibly update LMDZ if a specific svn release is requested
832##################################################################
833
834set +e ; svn upgrade ; set -e
835if [ "$svn" = "last" ] ; then svnopt="" ; else svnopt="-r $svn" ; fi
836if [ "$svn" != "" ] ; then svn update $svnopt ; fi
837
838echo '##################################################################'
839echo Compile LMDZ
840echo '##################################################################'
841echo log file : $lmdzlog
842
843echo install.sh avant_compilation `date`
844if [ $compile_with_fcm = 1 ] ; then makelmdz="makelmdz_fcm -arch $arch -j 8" ; else makelmdz="makelmdz -arch $arch" ; fi
845
846# use the orchidee interface that has no z0h
847if [ "$no_z0h_orc" = 1 ] ; then
848veget_version="$veget_version -cpp ORCHIDEE_NOZ0H"
849fi
850
851# sequential compilation and bench
852if [ "$sequential" = 1 ] ; then
853echo "./$makelmdz $OPT_MAKELMDZ -rrtm true $opt_cosp -d ${grid_resolution} -v $veget_version gcm " >> compile.sh
854chmod +x ./compile.sh
855if [ $bench != 0 ] ; then ./compile.sh > $lmdzlog 2>&1 ; fi
856echo install.sh apres_compilation `date`
857
858
859fi # fin sequential
860
861
862
863# compiling in parallel mode
864if [ $parallel != "none" ] ; then
865  echo '##########################################################'
866  echo ' Parallel compile '
867  echo '##########################################################'
868  # saving the sequential libs and binaries
869  cd $MODEL/modipsl
870  tar cf sequential.tar bin/ lib/
871  \rm -rf bin/ lib/
872  tar xf ioipsl.tar
873  #
874  # Orchidee
875  #
876  cd $ORCHPATH
877  if [ -d src_parallel -a $veget = 1 ] ; then
878     cd arch
879     sed  \
880     -e s:"%COMPILER.*.$":"%COMPILER            $par_comp":1 \
881     -e s:"%LINK.*.$":"%LINK                $par_comp":1 \
882     -e s:"%MPI_FFLAG.*.$":"%MPI_FFLAGS          $MPI_FLAGS":1 \
883     -e s:"%OMP_FFLAG.*.$":"%OMP_FFLAGS          $OMP_FLAGS":1 \
884     -e s:"%MPI_LD.*.$":"%MPI_LD              $MPI_LD":1 \
885     -e s:"%OMP_LD.*.$":"%OMP_LD              $OMP_LD":1 \
886     arch-local.fcm > tmp.fcm
887
888     mv tmp.fcm arch-local.fcm
889     cd ../
890     echo compiling ORCHIDEE parallel mode
891     echo logfile $orchideelog
892     ./makeorchidee_fcm -j 8 -clean -noxios -prod -parallel $parallel -arch $arch > $orchideelog 2>&1
893     ./makeorchidee_fcm -j 8 -noxios -prod -parallel $parallel -arch $arch >> $orchideelog 2>&1
894     echo ./makeorchidee_fcm -j 8 -clean -noxios -prod -parallel $parallel -arch $arch
895     echo ./makeorchidee_fcm -j 8 -noxios -prod -parallel $parallel -arch $arch
896  elif [ $veget = 1 ] ; then
897    echo '##########################################################'
898    echo ' Orchidee version too old                                 '
899    echo ' Please update to new version                             '
900    echo '##########################################################'
901    exit
902  fi # of if [ -d src_parallel ]
903  # LMDZ
904  cd $LMDZPATH
905  if [ $arch = local ] ; then
906    cd arch
907    sed -e s:"%COMPILER.*.$":"%COMPILER            $par_comp":1 \
908    -e s:"%LINK.*.$":"%LINK                $par_comp":1 \
909    -e s:"%MPI_FFLAG.*.$":"%MPI_FFLAGS          $MPI_FLAGS":1 \
910    -e s:"%OMP_FFLAG.*.$":"%OMP_FFLAGS          $OMP_FLAGS":1 \
911    -e s:"%ARFLAGS.*.$":"%ARFLAGS          $ARFLAGS":1 \
912    -e s@"%BASE_LD.*.$"@"%BASE_LD             -Wl,-rpath=${root_mpi}/lib:${ncdfdir}/lib"@1 \
913    -e s:"%MPI_LD.*.$":"%MPI_LD              $MPI_LD":1 \
914    -e s:"%OMP_LD.*.$":"%OMP_LD              $OMP_LD":1 \
915    arch-local.fcm > tmp.fcm
916    mv tmp.fcm arch-local.fcm
917    cd ../
918  fi
919  rm -f compile.sh
920  if [ ${hostname:0:5} = ada33 ] ; then echo "module load intel/2017.2" > compile.sh ; fi
921  echo resol=${grid_resolution} >> compile.sh
922  echo ./$makelmdz $OPT_MAKELMDZ -rrtm true $opt_cosp $opt_makelmdz_xios -d \$resol -v $veget_version -mem -parallel $parallel gcm >> compile.sh
923  chmod +x ./compile.sh
924  if [ $bench != 0 ] ; then ./compile.sh > $lmdzlog 2>&1 ; fi
925
926  echo "Compilation finished"
927 
928fi # of if [ $parallel != "none" ]
929
930#echo LLLLLLLLLLLLLLLLLLLLLLLLLLL
931if [ "$gfortran" = "gfortran44" ] ; then
932    echo Your gfortran compiler was too old so that the model was automatically
933    echo compiled with gfortran44 instead. It can not be used in parallel mode.
934    echo You can change the compiler at the begining of the install.sh
935    echo script and reinstall.
936fi
937
938##################################################################
939# Verification du succes de la compilation
940##################################################################
941
942# Recherche de l'executable dont le nom a change au fil du temps ...
943gcm=""
944for 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
945   if [ -f $exe ] ; then gcm=$exe ; fi
946done
947
948if [ "$gcm" = "" ] ; then
949   echo 'Compilation failed !!'
950   # Ehouarn : temporary, do not exit and let job finish (to set up bench case)
951   #exit
952   set +e
953else
954   echo '##########################################################'
955   echo 'Compilation successfull !! '
956   echo '##########################################################'
957   echo The executable is $gcm
958fi
959
960##################################################################
961# Below, we run a benchmark test (if bench=0)
962##################################################################
963
964if [ $bench != 0 ] ; then
965
966echo '##########################################################'
967echo ' Running a test run '
968echo '##########################################################'
969
970\rm -rf BENCH${grid_resolution}
971bench=bench_lmdz_${grid_resolution}
972echo install.sh before bench download  `date`
973#wget http://www.lmd.jussieu.fr/~lmdz/Distrib/$bench.tar.gz
974myget 3DBenchs/$bench.tar.gz
975echo install.sh after bench download  `date`
976tar xvf $bench.tar.gz
977
978if [ "$cosp" = 1 -o "$cosp2" = 1 ] ; then
979  cd BENCH${grid_resolution}
980# copier les fichiers namelist input et output our COSP
981  cp ../DefLists/cosp_input_nl.txt .
982  cp ../DefLists/cosp_output_nl.txt .
983# Activer la cles ok_cosp pour tourner avec COSP
984  sed -e 's@ok_cosp=n@ok_cosp=y@' config.def > tmp
985   \mv -f tmp config.def
986  cd ..
987fi 
988
989if [ "$with_xios" = "y" ] ; then
990  cd BENCH${grid_resolution}
991  cp ../DefLists/iodef.xml .
992  cp ../DefLists/context_lmdz.xml .
993  cp ../DefLists/field_def_lmdz.xml .
994  cp ../DefLists/file_def_hist*xml .
995  # adapt iodef.xml to use attached mode
996  sed -e 's@"using_server" type="bool">true@"using_server" type="bool">false@' iodef.xml > tmp
997  \mv -f tmp iodef.xml
998
999  # and convert all the enabled="_AUTO_" (for libIGCM) to enabled=.FALSE.
1000  # except for histday
1001  for histfile in file_def_hist*xml
1002  do
1003    if [ "$histfile" = "file_def_histday_lmdz.xml" ] ; then
1004    sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".TRUE."@' $histfile > tmp ; \mv -f tmp $histfile
1005    sed -e 's@output_level="_AUTO_"@output_level="5"@' $histfile > tmp ; \mv -f tmp $histfile
1006    sed -e 's@compression_level="2"@compression_level="0"@' $histfile > tmp ; \mv -f tmp $histfile
1007    else
1008    sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".FALSE."@' $histfile > tmp ; \mv -f tmp $histfile
1009    fi
1010  done
1011  # and add option "ok_all_xml=y" in config.def
1012  echo "### XIOS outputs" >> config.def
1013  echo 'ok_all_xml=.true.' >> config.def
1014  cd ..
1015fi
1016
1017cp $gcm BENCH${grid_resolution}/gcm.e
1018
1019cd BENCH${grid_resolution}
1020# On cree le fichier bench.sh au besoin
1021# Dans le cas 48x36x39 le bench.sh existe deja en parallele
1022
1023if [ "$grid_resolution" = "48x36x39" ] ; then
1024   echo On ne touche pas au bench.sh
1025   # But we have to adapt "run_local.sh" for $mpirun
1026   sed -e "s@mpirun@$mpirun@g" run_local.sh > tmp
1027   mv -f tmp run_local.sh
1028   chmod u=rwx run_local.sh
1029elif [ "${parallel:0:3}" = "mpi" ] ; then
1030   # Lancement avec deux procs mpi et 2 openMP
1031   echo "export OMP_STACKSIZE=800M" > bench.sh
1032   if [ "${parallel:4:3}" = "omp" ] ; then
1033     echo "export OMP_NUM_THREADS=2" >> bench.sh
1034   fi
1035   echo "ulimit -s unlimited" >> bench.sh
1036   echo "$mpirun -np 2 gcm.e > listing  2>&1" >> bench.sh
1037else
1038   echo "./gcm.e > listing  2>&1" > bench.sh
1039fi
1040echo EXECUTION DU BENCH
1041set +e
1042date ; ./bench.sh > out.bench 2>&1 ; date
1043set -e
1044tail listing
1045
1046
1047echo '##########################################################'
1048echo 'Simulation finished in' `pwd`
1049   echo 'You have compiled with:'
1050   cat ../compile.sh
1051if [ $parallel = "none" ] ; then
1052  echo 'You may re-run it with : cd ' `pwd` ' ; gcm.e'
1053  echo 'or ./bench.sh'
1054else
1055  echo 'You may re-run it with : '
1056  echo 'cd ' `pwd` '; ./bench.sh'
1057  echo 'ulimit -s unlimited'
1058  echo 'export OMP_NUM_THREADS=2'
1059  echo 'export OMP_STACKSIZE=800M'
1060  echo "$mpirun -np 2 gcm.e "
1061fi
1062echo '##########################################################'
1063
1064fi
1065
1066
1067#################################################################
1068# Installation eventuelle du 1D
1069#################################################################
1070
1071if [ $SCM = 1 ] ; then
1072cd $MODEL
1073#wget http://www.lmd.jussieu.fr/~lmdz/Distrib/1D.tar.gz
1074myget 1D/1D.tar.gz
1075tar xvf 1D.tar.gz
1076cd 1D
1077./run.sh
1078fi
Note: See TracBrowser for help on using the repository browser.