source: BOL/script_install/install.sh @ 2242

Last change on this file since 2242 was 2203, checked in by Ehouarn Millour, 9 years ago

Fixes for pgf90. Removed installing C++ netcdf (not needed and causes issues with pgCC). Note that gcm still doesn't work with pgf90 because of erf/derf issues.
EM

File size: 19.3 KB
RevLine 
[1588]1#!/bin/bash
2
3###########################################################################
[1708]4# Author : Frédéric Hourdin/LMD/hourdin@lmd.jussieu.fr
[1588]5# Usage  : install.sh
6#
[1708]7# bash installation script of the LMDZ model on a Linux PC.
8# the model is downloaded in the following direcory tree
[1588]9# $MODEL/modipsl/modeles/...
[1708]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.
[1588]15#
[1708]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.
[1588]19#
[1708]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.
[1588]23#
[1708]24# Prerequisites : g95/pgf90/gfortran, ksh, wget , gunzip, tar, ...
[1588]25#
[1589]26# Modif 18/11/2011
[1708]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.
[1589]31#
[1588]32###########################################################################
33
[2030]34echo install.sh DEBUT `date`
[2031]35
[1911]36set -e
37
[1588]38echo '################################################################'
[1708]39echo  Choice of installation options
[1588]40echo '################################################################'
41
42
[1590]43#real=r4
[1589]44real=r8
45
[1708]46# WARNING !!!! For versions before october 2009, use
47# install.v2.sh instead of install.sh
[1588]48
[2203]49version=trunk
50version=20141127.trunk
[1693]51version=testing
[2203]52
[2031]53compilo=gfortran # compilo=pgf90 or g95 or gfortran or ifort sur PC linux
[1693]54
[1588]55#Chemin pour placer le modele
56MODEL=./LMDZ$version
57
[2031]58
[1588]59getlmdzor=1
60netcdf=1   #  1 for automatic installation
61           #  0 for no installation
62           #  /.../../netcdf-4.0.1 if wanting to link with an already
63           #  compiled netcdf library (implies to check option compatibility)
64check_linux=1
65ioipsl=1
[1693]66veget=1
[1588]67bench=1
68pclinux=1
69
[2031]70# choose the resolution for the bench runs
71# grid_resolution= 32x24x11 or 48x36x19 for tests (test without ORCHIDEE)
72#                  96x71x19  standard configuration
73grid_resolution=48x36x19
[1693]74
[2031]75## compile_with_fcm=1 : use makelmdz_fcm, possible a of version 20111103.trunk (LMDZ5/trunk rev 1578)
76## compile_with_fcm=0 : use makelmdz
[2203]77compile_with_fcm=1
[2031]78
79
[1693]80#####################################################################
81# Test for old gfortran compilers
[2030]82# If the compiler is too old (older than 4.3.x) we test if the
83# temporary gfortran44 patch is available on the computer in which
84# case the compiler is changed from gfortran to gfortran44
85# Must be aware than parallelism can not be activated in this case
86#####################################################################
87
[1693]88if [ $compilo = gfortran ] ; then
[2030]89   gfortran=gfortran
[1693]90   gfortranv=`gfortran --version | \
91   head -1 | awk ' { print $NF } ' | awk -F. ' { print $1 * 10 + $2 } '`
92   if [ $gfortranv -le 43 ] ; then
[1708]93       echo ERROR : Your gfortran compiler is too old
[1693]94       echo 'Please choose a new one (g95, ifort) and change the line'
95       echo compilo=xxx
96       echo in the install.sh script and rerun it
[2030]97       if [ `which gfortran44 | wc -w` -ne 0 ] ; then
98          gfortran=gfortran44
99       else
100          echo gfotran trop vieux ; exit
101       fi
[1693]102   fi
[2030]103   compilo=$gfortran
[1693]104fi
105#####################################################################
106
107
108
[1589]109OPTPREC=""
[1588]110echo '################################################################'
111echo  Choix des options de compilation
112echo '################################################################'
[1589]113
[2031]114OPTIMNC=$OPTIM
115export FC=$compilo
116export F90=$compilo
117export F77=$compilo
118export CPPFLAGS=
119BASE_LD=
[1588]120if [ $compilo = g95 ] ; then
[2031]121# Set the appropriate compilation options
122   OPTIM='-i4 -O3'
123   OPTDEB="-g -O0 -Wall -ftrace=full -fbounds-check -freal=nan"
124   OPTDEV="-g -O1 -Wall"
125   fmod='fmod='
126   BASE_LD=""
[1589]127   if [ $real = r8 ] ; then OPTPREC="-r8 -DNC_DOUBLE" ; fi
[2031]128   export F90FLAGS=" -cpp -ffree-form $OPTIMNC"
129   export FFLAGS=" -cpp $OPTIMNC"
130   export CPPFLAGS=-Df2cFortran
131   export CC=gcc
132   export CXX=g++
[2030]133elif [ $compilo = $gfortran ] ; then
[2031]134   OPTIM='-O3'
135   OPTDEB="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all"
136   OPTDEV="-Wall -fbounds-check"
137   fmod='I '
[2203]138   if [ $real = r8 ] ; then OPTPREC="-fdefault-real-8 -DNC_DOUBLE" ; fi
[2031]139   export F90FLAGS=" -ffree-form $OPTIMNC"
140   export FFLAGS=" $OPTIMNC"
141   export CC=gcc
142   export CXX=g++
143elif [ $compilo = mpif90 ] ; then
[1589]144   OPTIM='-O3'
[2031]145   OPTDEB="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all"
146   OPTDEV="-Wall -fbounds-check"
147   BASE_LD="-lblas"
148   fmod='I '
149   if [ $real = r8 ] ; then OPTPREC="-fdefault-real-8 -DNC_DOUBLE -fcray-pointer" ; fi
150   export F90FLAGS=" -ffree-form $OPTIMNC"
151   export FFLAGS=" $OPTIMNC"
152   export CC=gcc
153   export CXX=g++
[1590]154elif [ $compilo = pgf90 ] ; then
[2203]155   OPTIM='-O2 -Mipa -Munroll -Mnoframe -Mautoinline -Mcache_align'
156   OPTDEB='-g -Mdclchk -Mbounds -Mchkfpstk -Mchkptr -Minform=inform -Mstandard -Ktrap=fp -traceback'
157   OPTDEV='-g -Mbounds -Ktrap=fp -traceback'
[2031]158   fmod='module '
[1590]159   if [ $real = r8 ] ; then OPTPREC="-r8 -DNC_DOUBLE" ; fi
[2203]160   export CPPFLAGS="-DpgiFortran"
[2031]161   export CC=pgcc
[2203]162   export CFLAGS="-O2 -Msignextend"
[2031]163   export CXX=pgCC
[2203]164   export CXXFLAGS="-O2 -Msignextend"
165   export FFLAGS="-O2 $OPTIMNC"
166   export F90FLAGS="-O2 $OPTIMNC"
[1590]167   compile_with_fcm=1
[2031]168elif [ $compilo = ifort ] ; then
169   OPTIM="-O2 -fp-model strict -ip -align all "
170   OPTDEV="-p -g -O2 -traceback -fp-stack-check -ftrapuv -check"
171   OPTDEB="-g -no-ftz -traceback -ftrapuv -fp-stack-check -check"
172   fmod='module '
[1590]173   if [ $real = r8 ] ; then OPTPREC="-real-size 64 -DNC_DOUBLE" ; fi
[2031]174   export CPP="icc -E"
175   export FFLAGS="-O2 -ip -fpic -mcmodel=large"
176   export FCFLAGS="-O2 -ip -fpic -mcmodel=large"
177   export CC=icc
178   export CFLAGS="-O2 -ip -fpic -mcmodel=large"
179   export CXX=icpc
180   export CXXFLAGS="-O2 -ip -fpic -mcmodel=large"
[1590]181   compile_with_fcm=1
[2031]182else
183   echo unexpected compiler $compilo ; exit
[1588]184fi
[2031]185
[1589]186OPTIMGCM="$OPTIM $OPTPREC"
[1588]187
188hostname=`hostname`
189
190##########################################################################
[1731]191# If installing on know machines such as IBM x3750 (Ada)
[1708]192# at IDRIS, don't check for available software and don"t install netcdf
[1777]193if [ ${hostname:0:5} = ada33 ] ; then
[1731]194  netcdf=0 # no need to recompile netcdf, alreday available
195  check_linux=0
196  pclinux=0
197  ioipsl=0 # no need to recompile ioipsl, already available
198  #netcdf="/smplocal/pub/NetCDF/4.1.3"
199  compilo="ifort"
200  fmod='module '
201  if [ $real = r8 ] ; then OPTPREC="-real-size 64 -DNC_DOUBLE" ; fi
202  OPTIM="-O2 -fp-model strict -ip -axAVX,SSE4.2 -align all "
203  OPTIMGCM="$OPTIM $OPTPREC"
[1588]204fi
205##########################################################################
206
207
208mkdir -p $MODEL
209echo $MODEL
[1708]210MODEL=`( cd $MODEL ; pwd )` # to get absolute path, if necessary
[1588]211
212
213
[1708]214# Option -fendian=big is only to be used with ARPEGE1D.
215# The -r8 should probably be avoided if running on 32 bit machines
216# Option r8 is not mandatory and generates larger executables.
217# It is however mandatory if using ARPEGE1D
218# Better optimization options might be a better choice (e.g. -O3)
[1588]219
220
221echo '################################################################'
222if [ "$check_linux" = 1 ] ; then
[1708]223echo   Check if required software is available
[1588]224echo '################################################################'
225
226#### Ehouarn: test if ksh and/or bash are available
227use_shell="ksh" # default: use ksh
228if [ "`which ksh`" = "" ] ; then
[1708]229  echo "no ksh ... we will use bash"
[1588]230  use_shell="bash"
231  if [ "`which bash`" = "" ] ; then
[1708]232    echo "ksh (or bash) needed!! Install it!"
[1588]233  fi
234fi
235
236
237for logiciel in csh wget tar gzip make $compilo gcc ; do
238if [ "`which $logiciel`" = "" ] ; then
[1708]239echo You must first install $logiciel on your system
[1588]240exit
241fi
242done
243
244if [ $pclinux = 1 ] ; then
245cd $MODEL
[2030]246cat <<eod > tt.f90
[1588]247print*,'coucou'
248end
249eod
[1708]250$compilo tt.f90 -o a.out
[1588]251./a.out >| tt
252if [ "`cat tt | sed -e 's/ //g' `" != "coucou" ] ; then
[1708]253echo problem installing with compiler $compilo ; exit ; fi
[1588]254\rm tt a.out tt.f90
255fi
256fi
257
258###########################################################################
259if [ $getlmdzor = 1 ] ; then
260echo '##########################################################'
[1708]261echo  Download a slightly modified version of  LMDZ
[1588]262echo '##########################################################'
263cd $MODEL
264wget http://www.lmd.jussieu.fr/~lmdz/DistribG95/modipsl.$version.tar.gz
[2030]265echo install.sh wget_OK `date`
[1588]266gunzip modipsl.$version.tar.gz
267tar xvf modipsl.$version.tar
268\rm modipsl.$version.tar
269
[1708]270# We download LMDZ and make some modifications to make it
271#compatible with $compilo
272# and we use an old stable but robust and well tested version of ORCHIDEE
273# That version of ORCHIDEE can be obtained using
[1588]274# wget http://www.lmd.jussieu.fr/~lmdz/DistribG95/getlmdzor.x
275fi
276
277echo OK1
278
279if [ $netcdf = 1 ] ; then
280echo '##########################################################'
[1708]281echo Compiling the Netcdf library
[1588]282echo '##########################################################'
283cd $MODEL
284wget http://www.lmd.jussieu.fr/~lmdz/DistribG95/netcdf-4.0.1.tar.gz
285gunzip netcdf-4.0.1.tar.gz
286tar xvf netcdf-4.0.1.tar
287\rm -f netcdf-4.0.1.tar
288
289cd netcdf-4.0.1
290
[2030]291sed -e 's/gfortran/'$gfortran'/g' configure >| tmp ; mv -f tmp configure ; chmod +x configure
[1588]292localdir=`pwd -P`
[2203]293./configure --prefix=$localdir --disable-cxx
[2030]294sed -e 's/gfortran/'$gfortran'/g' Makefile >| tmp ; mv -f tmp Makefile
[1588]295make check
296make install
[2030]297echo install.sh netcdf_OK `date`
[1731]298fi # of if [ $netcdf = 1 ]
[1588]299
[2030]300
[1800]301#=======================================================================================
[1588]302echo OK2 ioipsl=$ioipsl
303echo '##########################################################'
[1731]304echo 'Installing MODIPSL, the installation package manager for the '
305echo 'IPSL models and tools'
[1588]306echo '##########################################################'
307
308if [ $netcdf = 0 -o $netcdf = 1 ] ; then
309ncdfdir=$MODEL/netcdf-4.0.1
310else
311ncdfdir=$netcdf
312fi
313
314if [ $ioipsl = 1 ] ; then
[1731]315  cd $MODEL/modipsl
[2030]316  \rm -rf lib/*
[2031]317
[1731]318  cd util
[1588]319
[1731]320  cp AA_make.gdef AA_make.orig
[2031]321  F_C="$compilo -c " ; if [ "$compilo" = "$gfortran" -o "$compilo" = "mpif90" ] ; then F_C="$compilo -c -cpp " ; fi
[2203]322  if [ "$compilo" = "pgf90" ] ; then F_C="$compilo -c -Mpreprocess" ; fi
[1731]323  sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp
[2203]324  sed -e "s:F_L = g95:F_L = $compilo:" -e "s:F_C = g95 -c -cpp:F_C = $F_C": \
[1731]325  -e 's/g95.*.w_w.*.(F_D)/g95      w_w = '"$OPTIMGCM"'/' \
326  -e 's:g95.*.NCDF_INC.*.$:g95      NCDF_INC= '"$ncdfdir"'/include:' \
327  -e 's:g95.*.NCDF_LIB.*.$:g95      NCDF_LIB= -L'"$ncdfdir"'/lib -lnetcdf:' \
328  -e "s:-fmod=:-$fmod:" -e 's/-fno-second-underscore//' \
329  -e 's:#-Q- g95      M_K = gmake:#-Q- g95      M_K = make:' \
330  tmp >| AA_make.gdef
[1588]331
332
[1731]333  if [ "$use_shell" = "ksh" ] ; then
334    if [ "$pclinux" = 1 ] ; then
335       ./ins_make -t g95 # We use lines for g95 even for the other compilers
336    fi
337  else # bash
338    sed -e s:/bin/ksh:/bin/bash:g ins_make > ins_make.bash
339    chmod u=rwx ins_make.bash
340    if [ "$pclinux" = 1 ] ; then
341    ./ins_make.bash -t g95 # We use lines for g95 even for the other compilers
342    else
343    ./ins_make.bash
344    fi
345  fi # of if [ "$use_shell" = "ksh" ]
346
[2031]347#=======================================================================================
[1731]348  echo '##########################################################'
349  echo 'Compiling IOIPSL, the interface library with Netcdf'
350  echo '##########################################################'
351
352  cd $MODEL/modipsl/modeles/IOIPSL/src
353  if [ "$use_shell" = "bash" ] ; then
354    cp Makefile Makefile.ksh
355    sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile
[1588]356  fi
357  if [ "$pclinux" = 1 ] ; then
[1731]358    # Build IOIPSL modules and library
[1800]359    if [ $compilo = g95 ] ; then
360       cp restcom.f90 restcom.f90.orig
361       sed -e 's:cmode=or(NF90_NOCLOBBER,NF90_64BIT_OFFSET):cmode=NF90_NOCLOBBER:' restcom.f90.orig > restcom.f90 
362    fi
[1731]363    make clean
364    make
[2031]365    if [ "$compilo" = "$gfortran" -o "$compilo" = "mpif90" ] ; then # copy module files to lib
[1731]366      cp -f *.mod ../../../lib
367    fi
368    # Build IOIPSL tools (ie: "rebuild", if present)
369    if [ -f $MODEL/modipsl/modeles/IOIPSL/tools/rebuild ] ; then
370      cd $MODEL/modipsl/modeles/IOIPSL/tools
371      # adapt Makefile & rebuild script if in bash
372      if [ "$use_shell" = "bash" ] ; then
373        cp Makefile Makefile.ksh
374        sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile
375        cp rebuild rebuild.ksh
376        sed -e 's:/bin/ksh:/bin/bash:g' \
377            -e 's:print -u2:echo:g' \
378            -e 's:print:echo:g' rebuild.ksh > rebuild
379      fi
380      make clean
381      make
382    fi
383  fi # of if [ "$pclinux" = 1 ]
[1588]384
[1731]385else # of if [ $ioipsl = 1 ]
[1777]386  if [ ${hostname:0:5} = ada33 ] ; then
[1731]387    cd $MODEL/modipsl
388    cd util
[1588]389
[1731]390    cp AA_make.gdef AA_make.orig
391    sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp
392    sed -e "s:F_L = g95:F_L = $compilo:" -e "s:F_C = g95 -c:F_C = $compilo -c": \
393    -e 's/g95.*.w_w.*.(F_D)/g95      w_w = '"$OPTIMGCM"'/' \
394    -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:' \
395    -e 's:g95.*.NCDF_LIB.*.$:g95      NCDF_LIB= -L/smplocal/pub/NetCDF/4.1.3/lib -lnetcdff -lnetcdf:' \
396    -e "s:-fmod=:-$fmod:" -e 's/-fno-second-underscore//' \
397    -e 's:#-Q- g95      M_K = gmake:#-Q- g95      M_K = make:' \
398    tmp >| AA_make.gdef
399
400    ./ins_make -t g95 # We use lines for g95 even for the other compilers
401
402    # on Ada, IOIPSL is already installed in ~rpsl035/IOIPSL_PLUS
403    # so link it to current settings
404    cd $MODEL/modipsl/modeles/
405    \rm -r -f IOIPSL
406    ln -s ~rpsl035/IOIPSL_PLUS IOIPSL
407    cd ..
408    ln -s ~rpsl035/IOIPSL_PLUS/modipsl/bin/* bin/
409    ln -s ~rpsl035/IOIPSL_PLUS/modipsl/lib/* lib/
410
[1777]411  fi # of if [ ${hostname:0:5} = ada33 ]
[2030]412  echo install.sh ioipsl_OK `date`
[1731]413fi # of if [ $ioipsl = 1 ]
414
[2030]415
[1800]416#============================================================================
[1837]417veget_version=false
[1731]418if [ "$veget" = 1 ] ; then
419  echo '########################################################'
420  echo 'Compiling ORCHIDEE, the continental surfaces model '
421  echo '########################################################'
422  cd $MODEL/modipsl/modeles/ORCHIDEE
[1800]423  echo OKpwd ; pwd
[2203]424  if [ -d src_parallel ] ; then
425     liste_src="parallel parameters global stomate sechiba driver"
[1837]426     veget_version=orchidee2.0
[1800]427  else
[2203]428     # Obsolete, for ORCHIDEE_beton only
429     liste_src="parameters stomate sechiba "
430     # A trick to compile ORCHIDEE depending on if we are using real*4 or real*8
431     cd src_parameters ; \cp reqdprec.$real reqdprec.f90 ; cd ..
432     veget_version=orchidee1.9
[1800]433  fi
[2203]434  echo liste_strc $liste_src
435
436  for d in $liste_src ; do src_d=src_$d
437      echo src_d $src_d
438      echo ls ; ls
439      if [ ! -d $src_d ] ; then echo Problem orchidee : no $src_d ; exit ; fi
440      cd $src_d ; \rm -f *.mod make ; make clean
441      make ; if [ "$compilo" = "$gfortran" -o "$compilo" = "mpif90" ] ; then cp -f *.mod ../../../lib ; fi
442      cd ..
443  done
[2030]444  echo install.sh orchidee_OK `date`
[1731]445fi # of if [ "$veget" = 1 ]
[1588]446
[2030]447
[1800]448#============================================================================
[1588]449# Ehouarn: it may be directory LMDZ4 or LMDZ5 depending on tar file...
[1800]450if [ -d $MODEL/modipsl/modeles/LMDZ[45] ] ; then
[1588]451  echo '##########################################################'
[1800]452  echo 'Compiling LMDZ'
[1588]453  echo '##########################################################'
[1800]454  cd $MODEL/modipsl/modeles/LMDZ[45]
[1588]455else
[1800]456  echo "ERROR: No LMDZ4 (or LMDZ5) directory !!!"
457  exit
[1588]458fi
459
460###########################################################
[1708]461# For those who want to use fcm to compile via :
[1588]462#  makelmdz_fcm -arch local .....
463############################################################
464
[2031]465if [ "$pclinux" = "1" ] ; then
466
[1708]467# create local 'arch' files (if on Linux PC):
[1588]468cd arch
[1708]469# arch-local.path file
[1590]470echo "NETCDF_LIBDIR=\"-L${ncdfdir}/lib -lnetcdf\"" > arch-local.path
471echo "NETCDF_INCDIR=-I${ncdfdir}/include" >> arch-local.path
[1588]472echo 'IOIPSL_INCDIR=$LMDGCM/../../lib' >> arch-local.path
473echo 'IOIPSL_LIBDIR=$LMDGCM/../../lib' >> arch-local.path
474echo 'ORCH_INCDIR=$LMDGCM/../../lib' >> arch-local.path
475echo 'ORCH_LIBDIR=$LMDGCM/../../lib' >> arch-local.path
[1708]476# arch-local.fcm file (adapted from arch-linux-32bit.fcm)
[2031]477
478if [ $real = r8 ] ; then FPP_DEF=NC_DOUBLE ; else FPP_DEF="" ; fi
479sed -e s:"%COMPILER        .*.$":"%COMPILER            $compilo":1 \
480    -e s:"%LINK            .*.$":"%LINK                $compilo":1 \
481    -e s:"%PROD_FFLAGS     .*.$":"%PROD_FFLAGS         $OPTIM":1 \
482    -e s:"%DEV_FFLAGS      .*.$":"%DEV_FFLAGS          $OPTDEV":1 \
483    -e s:"%DEBUG_FFLAGS    .*.$":"%DEBUG_FFLAGS        $OPTDEB":1 \
484    -e s:"%BASE_FFLAGS     .*.$":"%BASE_FFLAGS         $OPTPREC":1 \
[2203]485    -e s:"%FPP_DEF         .*.$":"%FPP_DEF             $FPP_DEF":1 \
[2031]486    arch-linux-32bit.fcm > arch-local.fcm
487
[1588]488cd ..
[1708]489### Adapt "bld.cfg" (add the shell):
[1588]490whereisthatshell=$(which ${use_shell})
491echo "bld::tool::SHELL   $whereisthatshell" >> bld.cfg
492
[1731]493fi # of if [ "$pclinux" = 1 ]
494
495
496cd $MODEL/modipsl/modeles/LMDZ?
497
[1588]498##################################################################
[1708]499# Compile LMDZ
[1588]500##################################################################
[2030]501echo install.sh avant_compilation `date`
[2203]502if [ $compile_with_fcm = 1 ] ; then makelmdz="makelmdz_fcm -arch local" ; else makelmdz=makelmdz ; fi
[2031]503
504./$makelmdz -d ${grid_resolution} -v $veget_version gcm
[2030]505echo install.sh apres_compilation `date`
[1588]506
[2030]507
[1731]508if [ -f gcm.e ] || [ -f bin/gcm_${grid_resolution}_phylmd_seq_orch.e ] || [ -f bin/gcm_${grid_resolution}_phylmd_seq.e ] ; then
[1588]509echo '##########################################################'
[1731]510echo 'Compilation successfull !! '
[1588]511echo '##########################################################'
512else
[1731]513echo 'Compilation failed !!'
[1588]514exit
515fi
516
517##################################################################
[1708]518# Below, we run a benchmark test (if bench=0)
[1588]519##################################################################
520if [ $bench = 0 ] ; then
521                exit
522fi
523
524echo '##########################################################'
[1731]525echo ' Running a test run '
[1588]526echo '##########################################################'
527
[2030]528\rm -rf BENCH${grid_resolution}
[1588]529bench=bench_lmdz_${grid_resolution}
[2030]530echo install.sh avant_chargement_bench  `date`
[1588]531wget http://www.lmd.jussieu.fr/~lmdz/DistribG95/$bench.tar.gz
[2030]532echo install.sh apres_chargement_bench  `date`
[1588]533gunzip $bench.tar.gz
534tar xvf $bench.tar
535
536if [ -f gcm.e ] ; then 
537    cp gcm.e BENCH${grid_resolution}/
538elif [ -f bin/gcm_${grid_resolution}_phylmd_seq_orch.e ] ; then
539    cp bin/gcm_${grid_resolution}_phylmd_seq_orch.e  BENCH${grid_resolution}/gcm.e
540elif [ -f bin/gcm_${grid_resolution}_phylmd_seq.e ] ; then
541    cp bin/gcm_${grid_resolution}_phylmd_seq.e  BENCH${grid_resolution}/gcm.e
542else
543    echo "No gcm.e found"
544    exit
545fi
546
[2030]547
[1588]548cd BENCH${grid_resolution}
549./bench.sh > bench.out  2>&1
550
[2030]551
[1588]552echo '##########################################################'
[1708]553echo ' Bench results '
[1588]554echo '##########################################################'
555
556cat ./bench.out
[2030]557echo install.sh FIN_du_BENCH  `date`
[1588]558
559echo '##########################################################'
[1708]560echo 'Simulation finished in' `pwd`
561echo 'You may re-run it with : cd ' `pwd` ' ; gcm.e'
562echo 'or ./bench.sh'
[1588]563echo '##########################################################'
[2030]564
[2031]565if [ "$gfortran" = "gfortran44" ] ; then
[2030]566    echo Your gfortran compiler was too old so that the model was automatically
567    echo compiled with gfortran44 instead. It can not be used in parallel mode.
568    echo You can change the compiler at the begining of the install.sh
569    echo script and reinstall.
570fi
Note: See TracBrowser for help on using the repository browser.