Changeset 1800


Ignore:
Timestamp:
Jul 19, 2013, 2:55:54 PM (11 years ago)
Author:
Laurent Fairhead
Message:

Updates and cleanup on install.sh script.
FH

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOL/script_install/install.sh

    r1777 r1800  
    4343# install.v2.sh instead of install.sh
    4444
    45 #version=20110921.trunk
     45version=20130716.trunk
    4646version=testing
    4747
     
    8080
    8181## compile_with_fcm=1 : use makelmdz_fcm, possible a of version 20111103.trunk (LMDZ5/trunk rev 1578)
    82 ## compile_with_fcm=0 : use makegcm
    83 compile_with_fcm=1
     82## compile_with_fcm=0 : use makelmdz
     83compile_with_fcm=0
    8484
    8585OPTPREC=""
     
    259259   echo unexpected compiler $compilo ; exit
    260260fi
    261 ## end of if [ $netcdf = 1 ]
    262 #cd src
    263 
    264 ### Correction d'un petit probleme de netcdf
    265 ##sed -e '83s/^$/\#define f2cFortran/' cfortran.h >| tmp ; \mv tmp cfortran.h
    266 
    267 # Compilation
    268 # Modif du 6 juillet 2009. Plantage quand on essaie de compiler netcdf avec
    269 # gcc plutôt que c++
    270 ##sed -e 's/ c++/ gcc/g' configure >| tmp ; mv -f tmp configure ; chmod +x configure
     261
    271262localdir=`pwd -P`
    272263./configure --prefix=$localdir
     
    275266fi # of if [ $netcdf = 1 ]
    276267
     268#=======================================================================================
    277269echo OK2 ioipsl=$ioipsl
    278270echo '##########################################################'
     
    303295  fi
    304296  cp AA_make.gdef AA_make.orig
     297  F_C="$compilo -c " ; if [ $compilo = gfortran ] ; then F_C="$compilo -c -cpp " ; fi
    305298  sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp
    306   sed -e "s:F_L = g95:F_L = $compilo:" -e "s:F_C = g95 -c:F_C = $compilo -c": \
     299  sed -e "s:F_L = g95:F_L = $compilo:" -e "s:F_C = g95 -c:F_C = $F_C": \
    307300  -e 's/g95.*.w_w.*.(F_D)/g95      w_w = '"$OPTIMGCM"'/' \
    308301  -e 's:g95.*.NCDF_INC.*.$:g95      NCDF_INC= '"$ncdfdir"'/include:' \
     
    338331  if [ "$pclinux" = 1 ] ; then
    339332    # Build IOIPSL modules and library
     333    if [ $compilo = g95 ] ; then
     334       cp restcom.f90 restcom.f90.orig
     335       sed -e 's:cmode=or(NF90_NOCLOBBER,NF90_64BIT_OFFSET):cmode=NF90_NOCLOBBER:' restcom.f90.orig > restcom.f90 
     336    fi
    340337    make clean
    341338    make
     
    389386fi # of if [ $ioipsl = 1 ]
    390387
     388#============================================================================
    391389if [ "$veget" = 1 ] ; then
    392390  echo '########################################################'
     
    394392  echo '########################################################'
    395393  cd $MODEL/modipsl/modeles/ORCHIDEE
    396   cd src_parameters
    397   # A trick to compile ORCHIDEE depending on if we are using real*4 or real*8
    398 
    399   \cp reqdprec.$real reqdprec.f90
    400   make
    401   if [ $compilo = gfortran ] ; then # copy module files to lib
    402     cp -f *.mod ../../../lib
     394  echo OKpwd ; pwd
     395  if [ -d src_parallel ] ; then
     396     liste_src="parallel parameters global stomate sechiba driver"
     397  else
     398     # Obsolete, for ORCHIDEE_beton only
     399     liste_src="parameters stomate sechiba "
     400     # A trick to compile ORCHIDEE depending on if we are using real*4 or real*8
     401     cd src_parameters ; \cp reqdprec.$real reqdprec.f90 ; cd ..
    403402  fi
    404   cd ../src_stomate
    405   make
    406   if [ $compilo = gfortran ] ; then # copy module files to lib
    407     cp -f *.mod ../../../lib
    408   fi
    409   cd ../src_sechiba
    410   make
    411   if [ $compilo = gfortran ] ; then # copy module files to lib
    412     cp -f *.mod ../../../lib
    413   fi
     403  echo liste_strc $liste_src
     404
     405  for d in $liste_src ; do src_d=src_$d
     406      echo src_d $src_d
     407      echo ls ; ls
     408      if [ ! -d $src_d ] ; then echo Problem orchidee : no $src_d ; exit ; fi
     409      cd $src_d ; \rm -f *.mod make ; make clean
     410      make ; if [ $compilo = gfortran ] ; then cp -f *.mod ../../../lib ; fi
     411      cd ..
     412  done
    414413fi # of if [ "$veget" = 1 ]
    415414
     415#============================================================================
    416416# Ehouarn: it may be directory LMDZ4 or LMDZ5 depending on tar file...
    417 if [[ -d $MODEL/modipsl/modeles/LMDZ4 ]] ; then
     417if [ -d $MODEL/modipsl/modeles/LMDZ[45] ] ; then
    418418  echo '##########################################################'
    419   echo 'Compiling LMDZ4'
     419  echo 'Compiling LMDZ'
    420420  echo '##########################################################'
    421   cd $MODEL/modipsl/modeles/LMDZ4
    422 else
    423   if [[ -d $MODEL/modipsl/modeles/LMDZ5 ]] ; then
    424     echo '##########################################################'
    425     echo 'Compiling LMDZ5'
    426     echo '##########################################################'
    427     cd $MODEL/modipsl/modeles/LMDZ5
    428   else
    429     echo "ERROR: No LMDZ4 (or LMDZ5) directory !!!"
    430     exit
    431   fi
    432 fi
    433 
    434 ##########################################################
     421  cd $MODEL/modipsl/modeles/LMDZ[45]
     422else
     423  echo "ERROR: No LMDZ4 (or LMDZ5) directory !!!"
     424  exit
     425fi
     426
     427#============================================================================
    435428# Traitement momentanne a cause d'un bug dans makegcm
    436429cp create_make_gcm create_make_gcm.orig
     
    592585ok_veget=false
    593586if [ "$veget" = 1 ] ; then $ok_veget = true ; fi
    594 if [ $compile_with_fcm = 1 ] ; then
    595 # Compile with makelmdz_fcm
    596    if [ "$pclinux" = 1 ] ; then
    597         ./makelmdz_fcm -d ${grid_resolution} -arch local -v $ok_veget gcm
    598    else
     587if [ $compile_with_fcm = 1 ] ; then makelmdz=makelmdz_fcm ; else makelmdz=makelmdz ; fi
     588if [ "$pclinux" = 1 ] ; then
     589        ./$makelmdz -d ${grid_resolution} -arch local -v $ok_veget gcm
     590else
    599591   # we are on Ada
    600         ./makelmdz_fcm -d ${grid_resolution} -arch X64_ADA -v $ok_veget gcm
    601    fi
    602 else
    603 # Comple with makegcm:
    604 #       3 times! because some dependecies are not well resolved with makegcm
    605         ./makegcm -d ${grid_resolution} -v $ok_veget gcm
    606         ./makegcm -d ${grid_resolution} -v $ok_veget gcm
    607         ./makegcm -d ${grid_resolution} -v $ok_veget gcm
     592    ./$makelmdz -d ${grid_resolution} -arch X64_ADA -v $ok_veget gcm
    608593fi
    609594
     
    659644echo 'or ./bench.sh'
    660645echo '##########################################################'
    661 
Note: See TracChangeset for help on using the changeset viewer.