Changeset 1708


Ignore:
Timestamp:
Jan 11, 2013, 2:45:05 PM (11 years ago)
Author:
Ehouarn Millour
Message:

Install in English please!
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOL/script_install/install.sh

    r1693 r1708  
    22
    33###########################################################################
    4 # Auteur : Frédéric Hourdin/LMD/hourdin@lmd.jussieu.fr
     4# Author : Frédéric Hourdin/LMD/hourdin@lmd.jussieu.fr
    55# Usage  : install.sh
    66#
    7 # Script bash d'installation du modele LMDZ sur un ordinateur PC/Linux
    8 # en utilisant le compilateur g95.
    9 # Le modele est récupéré dans une arborescence
     7# bash installation script of the LMDZ model on a Linux PC.
     8# the model is downloaded in the following direcory tree
    109# $MODEL/modipsl/modeles/...
    11 # en utilisant l'infrastructure "modipsl" mise au point à l'"IPSL" pour
    12 #les besoins de la modélisation couplée du climat
    13 #(atmosphere/ocean/vegetation/chimie)
    14 # On ne récupère ici que les composantes atmosphériques (LMDZ4)
    15 # et végétation (ORCHIDEE).
     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.
    1615#
    17 # Sous le répertoire "modeles", on trouve en fait les sources de différents
    18 # modèles. Ici, LMDZ4, ORCHIDEEet IOIPSL, ensemble de programmes
    19 # d'entrée/sortie faisant appel à la librairie netcdf.
     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.
    2019#
    21 # Le script récupères les différents jeux de sources (y compris une
    22 # version de netcdf) et utilitaires, compile le modèle, et lance une
    23 # simulation de test dans une configuration très légère sur
    24 # $MODEL/modipsl/modeles/LMDZ4/INI
     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.
    2523#
    26 # Pré-requis : g95/pgf90/gfortran, ksh, wget , gunzip, tar, ... (à compléter)
     24# Prerequisites : g95/pgf90/gfortran, ksh, wget , gunzip, tar, ...
    2725#
    2826# Modif 18/11/2011
    29 #    changement pour l'option real 8.
    30 #      On compile avec -r8 (ou équivalent) et -DNC_DOUBLE pour le GCM
    31 #      mais avec -r4 netcdf. La variable real est initialisée à
    32 #      r4 ou r8 en début de script.
     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.
    3331#
    3432###########################################################################
    3533
    3634echo '################################################################'
    37 echo  Choix des options d installation
     35echo  Choice of installation options
    3836echo '################################################################'
    3937
     
    4240real=r8
    4341
    44 # ATTENTION !!!! Pour des versions anterieures a octobre 2009, utiliser
    45 # install.v2.sh au lieu de install.sh
    46 
    47 version=20110921.trunk
     42# WARNING !!!! For versions before october 2009, use
     43# install.v2.sh instead of install.sh
     44
     45#version=20110921.trunk
    4846version=testing
    4947
     
    6159bench=1
    6260pclinux=1
    63 compilo=gfortran # compilo=pgf90 ou g95 ou gfortran ou ifort sur PC linux
     61compilo=gfortran # compilo=pgf90 or g95 or gfortran or ifort sur PC linux
    6462
    6563
     
    7068   head -1 | awk ' { print $NF } ' | awk -F. ' { print $1 * 10 + $2 } '`
    7169   if [ $gfortranv -le 43 ] ; then
    72        echo ERROR : Your gfotran compiler is too old
     70       echo ERROR : Your gfortran compiler is too old
    7371       echo 'Please choose a new one (g95, ifort) and change the line'
    7472       echo compilo=xxx
     
    8179
    8280
    83 ## compile_with_fcm=1 : utilise makelmdz_fcm, possible a partir de la version 20111103.trunk (LMDZ5/trunk rev 1578)
    84 ## compile_with_fcm=0 : utilise makegcm (default)
     81## compile_with_fcm=1 : use makelmdz_fcm, possible a of version 20111103.trunk (LMDZ5/trunk rev 1578)
     82## compile_with_fcm=0 : use makegcm
    8583compile_with_fcm=1
    8684
     
    110108OPTIMGCM="$OPTIM $OPTPREC"
    111109
    112 # choix de la resolution pour le bench
    113 # grid_resolution= 32x24x11 for test (test without ORCHIDEE)
     110# choose the resolution for the bench runs
     111# grid_resolution= 32x24x11 or 48x36x19 for tests (test without ORCHIDEE)
    114112#                  96x71x19  standard configuration
    115113grid_resolution=48x36x19
     
    118116
    119117##########################################################################
    120 # Dans le cas où on installe sur des machines connues comme la NEC
    121 # brodie
    122 # de l'IDRIS, on ne verifie pas les logiciels existants et on n'installe
    123 # pas netcdf.
     118# If installing on know machines such as NEC Brodie
     119# at IDRIS, don't check for available software and don"t install netcdf
    124120if [ $hostname = brodie ] ; then
    125121netcdf=0
     
    132128mkdir -p $MODEL
    133129echo $MODEL
    134 MODEL=`( cd $MODEL ; pwd )` # transformation en chemin absolu si necessaire
    135 
    136 
    137 
    138 # Le -fendian=big n'est à utiliser vraiment utile que pour ARPEGE1D.
    139 # Le -r8 doit sans doute être éviter si on veut tourner rapidement sur
    140 # des machines 32 bits.
    141 # L'option r8 n'est pas forcement indispensable et elle produit
    142 # des executables plus gros.
    143 # Elles est indispensable cependant pour ARPEGE1D
    144 # On doit pouvoir aussi utiliser des optimisations plus fortes (-O3 par
    145 # exemple).
     130MODEL=`( cd $MODEL ; pwd )` # to get absolute path, if necessary
     131
     132
     133
     134# Option -fendian=big is only to be used with ARPEGE1D.
     135# The -r8 should probably be avoided if running on 32 bit machines
     136# Option r8 is not mandatory and generates larger executables.
     137# It is however mandatory if using ARPEGE1D
     138# Better optimization options might be a better choice (e.g. -O3)
    146139
    147140
    148141echo '################################################################'
    149142if [ "$check_linux" = 1 ] ; then
    150 echo   Test sur les logiciels requis
     143echo   Check if required software is available
    151144echo '################################################################'
    152145
     
    154147use_shell="ksh" # default: use ksh
    155148if [ "`which ksh`" = "" ] ; then
    156   echo "pas de ksh ... on va utiliser bash"
     149  echo "no ksh ... we will use bash"
    157150  use_shell="bash"
    158151  if [ "`which bash`" = "" ] ; then
    159     echo "Il faut d\'abord installer ksh (ou bash)"
     152    echo "ksh (or bash) needed!! Install it!"
    160153  fi
    161154fi
     
    164157for logiciel in csh wget tar gzip make $compilo gcc ; do
    165158if [ "`which $logiciel`" = "" ] ; then
    166 echo Il faut installer d\'abord $logiciel
     159echo You must first install $logiciel on your system
    167160exit
    168161fi
     
    175168end
    176169eod
    177 $compilo tt.f90
     170$compilo tt.f90 -o a.out
    178171./a.out >| tt
    179172if [ "`cat tt | sed -e 's/ //g' `" != "coucou" ] ; then
    180 echo probleme avec installation de $compilo ; exit ; fi
     173echo problem installing with compiler $compilo ; exit ; fi
    181174\rm tt a.out tt.f90
    182175fi
     
    189182if [ $getlmdzor = 1 ] ; then
    190183echo '##########################################################'
    191 echo  On recupere une version un peu modifiee de LMDZ
     184echo  Download a slightly modified version of LMDZ
    192185echo '##########################################################'
    193186cd $MODEL
     
    197190\rm modipsl.$version.tar
    198191
    199 # On recupere en fait une version du 01 10 2006 obtenue
    200 # Par un cvs get
    201 # Puis modifiees pour etre compatible avec la compilation $compilo.
    202 # et pour betoner ORCHIDEE
    203 # Cette version est recuperable avec le script
     192# We download LMDZ and make some modifications to make it
     193#compatible with $compilo
     194# and we use an old stable but robust and well tested version of ORCHIDEE
     195# That version of ORCHIDEE can be obtained using
    204196# wget http://www.lmd.jussieu.fr/~lmdz/DistribG95/getlmdzor.x
    205197fi
     
    209201if [ $netcdf = 1 ] ; then
    210202echo '##########################################################'
    211 echo Compilation de netcdf
     203echo Compiling the Netcdf library
    212204echo '##########################################################'
    213205cd $MODEL
     
    221213OPTIMNC=$OPTIM
    222214if [ $compilo = g95 ] ; then
    223 # On modifie les options de compilation
     215# Set the appropriate compilation options
    224216   export FC=g95
    225217   export F90=g95
     
    258250   export CXXFLAGS="-O2 -ip -fpic -mcmodel=large"
    259251else
    260    echo Le compilateur $compilo pas prevu ; exit
     252   echo unexpected compiler $compilo ; exit
    261253fi
    262254## end of if [ $netcdf = 1 ]
    263 cd src
     255#cd src
    264256
    265257### Correction d'un petit probleme de netcdf
     
    278270echo OK2 ioipsl=$ioipsl
    279271echo '##########################################################'
    280 echo Installation de MODIPSL, la procedure d\'installation des
    281 echo modeles de l\'IPSL
     272echo Installing MODIPSL, the installation package manager for the
     273echo IPSL models and tools
    282274echo '##########################################################'
    283275
     
    316308if [ "$use_shell" = "ksh" ] ; then
    317309  if [ "$pclinux" = 1 ] ; then
    318      ./ins_make -t g95 # On utilise les lignes g95 meme pour les autres compilo
     310     ./ins_make -t g95 # We use lines for g95 even for the other compilers
    319311  fi
    320312else # bash
     
    322314  chmod u=rwx ins_make.bash
    323315  if [ "$pclinux" = 1 ] ; then
    324   ./ins_make.bash -t g95 # On utilise les lignes g95 meme pour les autres compilo
     316  ./ins_make.bash -t g95 # We use lines for g95 even for the other compilers
    325317  else
    326318  ./ins_make.bash
     
    329321
    330322echo '##########################################################'
    331 echo Compilation de IOIPSL, bibliotheque d\'interface avec Netcd
     323echo Compiling IOIPSL, the interface library with Netcdf
    332324echo '##########################################################'
    333325
     
    367359if [ "$veget" = 1 ] ; then
    368360echo '########################################################'
    369 echo Compilation de ORCHIDEE, modele des surface continentales
     361echo Compiling ORCHIDEE, the continental surfaces model
    370362echo '########################################################'
    371363cd $MODEL/modipsl/modeles/ORCHIDEE
    372364cd src_parameters
    373 # Une petite astuce pour ORCHIDEE suivant qu'on est en real*4 ou real*8
     365# A trick to compile ORCHIDEE depending on if we are using real*4 or real*8
    374366
    375367
     
    402394  if [[ -d $MODEL/modipsl/modeles/LMDZ5 ]] ; then
    403395    echo '##########################################################'
    404     echo 'Compilation de LMDZ5'
     396    echo 'Compiling LMDZ5'
    405397    echo '##########################################################'
    406398    cd $MODEL/modipsl/modeles/LMDZ5
     
    411403fi
    412404
     405##########################################################
     406# Traitement momentanne a cause d'un bug dans makegcm
     407cp create_make_gcm create_make_gcm.orig
     408nl=`sed -n -e /PROGRAM/= create_make_gcm.orig | tail -1`
     409sed -e "$nl s/      PROGRA/PROGRA/" create_make_gcm.orig >| create_make_gcm
     410
     411#mv -f tmp crea
    413412if [ "$pclinux" = 1 ] ; then
    414413  if [ $compilo = gfortran ] ; then
     
    423422-e 's/-fno-second-underscore//' -e 's/-fstatic//' \
    424423-e 's/-lparallel//' \
     424-e 's/-lnetcdff//g' \
    425425-e 's/-lorglob//' \
    426426-e 's/-ffixed-form//' -e 's/-ffree-form//' \
     
    437437-e 's/-fno-second-underscore//' -e 's/-fstatic//' \
    438438-e 's/-lparallel//' \
     439-e 's/-lnetcdff//g' \
    439440-e 's/-lorglob//' \
    440441-e 's/-ffixed-form//' -e 's/-ffree-form//' \
     
    449450-e 's/-fno-second-underscore//' -e 's/-fstatic//' \
    450451-e 's/-lparallel//' \
     452-e 's/-lnetcdff//g' \
    451453-e 's/-lorglob//' \
    452454-e 's/-ffixed-form//' -e 's/-ffree-form//' \
     
    466468
    467469###########################################################
    468 # Pour ceux qui voudraient utiliser fcm et pouvoir faire :
     470# For those who want to use fcm to compile via :
    469471#  makelmdz_fcm -arch local .....
    470472############################################################
    471473
    472474if [ "$pclinux" = 1 ] ; then
    473 # creation de fichiers 'arch' locaux (si sur PC Linx):
     475# create local 'arch' files (if on Linux PC):
    474476cd arch
    475 # fichier arch-local.path
     477# arch-local.path file
    476478echo "NETCDF_LIBDIR=\"-L${ncdfdir}/lib -lnetcdf\"" > arch-local.path
    477479echo "NETCDF_INCDIR=-I${ncdfdir}/include" >> arch-local.path
     
    480482echo 'ORCH_INCDIR=$LMDGCM/../../lib' >> arch-local.path
    481483echo 'ORCH_LIBDIR=$LMDGCM/../../lib' >> arch-local.path
    482 # fichier arch-local.fcm (adaptation de arch-linux-32bit.fcm)
     484# arch-local.fcm file (adapted from arch-linux-32bit.fcm)
    483485if [ $compilo = g95 ] ; then
    484486sed -e s:"%COMPILER            pgf95":"%COMPILER            g95":1 \
     
    527529   fi
    528530else
    529    echo Le compilateur $compilo pas prevu ; exit
     531   echo Unexpected compiler $compilo ; exit
    530532fi # of if [ $compilo = g95 ] elif [ $compilo = pgf90 ]
    531533cd ..
    532 ### Adaptation de "bld.cfg" (ajout du shell):
     534### Adapt "bld.cfg" (add the shell):
    533535whereisthatshell=$(which ${use_shell})
    534536echo "bld::tool::SHELL   $whereisthatshell" >> bld.cfg
    535537
    536 ### Modification de makelmdz_fcm pour utilisation de ORCHIDEE dans cette bench:
    537 ### on enleve liborglob.a et libparallel.a
     538### Modify makelmdz_fcm to use ORCHIDEE in the bench:
     539### remove liborglob.a and libparallel.a
    538540cp makelmdz_fcm makelmdz_fcm.orig
    539541sed -e "s/-l\${LIBPREFIX}parallel//" \
     
    544546
    545547##################################################################
    546 # Lance compilation de LMDZ
     548# Compile LMDZ
    547549##################################################################
    548550ok_veget=false
    549 if [ "$veget" = 1 ] ; then ok_veget = true; fi
     551if [ "$veget" = 1 ] ; then $ok_veget = true; fi
    550552if [ $compile_with_fcm = 1 ] ; then
    551 # Compilation avec makelmdz_fcm
     553# Compile with makelmdz_fcm
    552554        ./makelmdz_fcm -d ${grid_resolution} -arch local -v $ok_veget gcm
    553555else
    554 # Compilation avec makegcm:
     556# Comple with makegcm:
    555557#       3 times! because some dependecies are not well resolved with makegcm
    556558        ./makegcm -d ${grid_resolution} -v $ok_veget gcm
     
    561563if [ -f gcm.e ] || [ -f bin/gcm_${grid_resolution}_phylmd_seq_orch.e ] || [ -f bin/gcm_${grid_resolution}_phylmd_seq.e ]  ; then
    562564echo '##########################################################'
    563 echo Compilation reussie
    564 echo '##########################################################'
    565 else
    566 echo Probleme de compilation
     565echo Compilation successfull !!
     566echo '##########################################################'
     567else
     568echo Compilation failed !!
    567569exit
    568570fi
    569571
    570572##################################################################
    571 # Ci dessous le lancement eventuel d'un cas test (si bench=0)
     573# Below, we run a benchmark test (if bench=0)
    572574##################################################################
    573575if [ $bench = 0 ] ; then
     
    576578
    577579echo '##########################################################'
    578 echo Lancement d\'une simulation de test
     580echo Running a test run
    579581echo '##########################################################'
    580582
     
    597599
    598600if [ $hostname = brodie ] ; then
    599 echo POUR LANCER LE BENCH, IL FAUT SE LOGUER SUR BRODIE01
    600 echo puis aller sur `pwd`/BENCH${grid_resolution}
    601 echo et lancer le gcm
     601echo to run the bench, you must log on to Brodie01
     602echo and then change directory to `pwd`/BENCH${grid_resolution}
     603echo and run the gcm
    602604exit
    603605fi
     
    607609
    608610echo '##########################################################'
    609 echo ' Resultat du bench '
     611echo ' Bench results '
    610612echo '##########################################################'
    611613
     
    613615
    614616echo '##########################################################'
    615 echo 'La simulation test est terminee sur' `pwd`
    616 echo 'vous pouvez la relancer : cd ' `pwd` ' ; gcm.e'
    617 echo 'ou ./bench.sh'
    618 echo '##########################################################'
    619 
     617echo 'Simulation finished in' `pwd`
     618echo 'You may re-run it with : cd ' `pwd` ' ; gcm.e'
     619echo 'or ./bench.sh'
     620echo '##########################################################'
     621
Note: See TracChangeset for help on using the changeset viewer.