Changeset 4204


Ignore:
Timestamp:
Jul 20, 2022, 5:54:06 PM (2 years ago)
Author:
lguez
Message:

Remove space at end of line

Space at end of line is signalled by Git clients.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOL/script_install/install_lmdz.sh

    r4198 r4204  
    88#
    99# bash installation script of the LMDZ model on different computer types :
    10 # Linux PC, "mesocentre" (IPSL-UPMC, IPSL-X), super-computer (IDRIS) 
     10# Linux PC, "mesocentre" (IPSL-UPMC, IPSL-X), super-computer (IDRIS)
    1111#
    1212# The model is downloaded in the following directory tree
     
    2020# The sources of the models can be found in the "modeles" directory.
    2121# In the present case, LMDZ, ORCHIDEE, and IOIPSL or XIOS (handling of input-outputs
    22 # using the NetCDF library). 
     22# using the NetCDF library).
    2323#
    2424# The script downloads various source files (including a version of NetCDF)
     
    2626# minimal configuration.
    2727#
    28 # Prerequisites : pgf90/gfortran, bash or ksh, wget , gunzip, tar, ... 
     28# Prerequisites : pgf90/gfortran, bash or ksh, wget , gunzip, tar, ...
    2929#
    3030# Modif 18/11/2011
    3131#    changes for option real 8.
    3232#      We compile with -r8 (or equivalent) and -DNC_DOUBLE for the GCM
    33 #      but with -r4 for netcdf. Variable real must be set to 
     33#      but with -r4 for netcdf. Variable real must be set to
    3434#      r4 or r8 at the beginning of the script below.
    3535#
     
    4040
    4141################################################################
    42 # Choice of installation options 
     42# Choice of installation options
    4343################################################################
    4444
     
    149149
    150150    -r       "svn_release" : either the svn release number or "last"
    151    
     151
    152152    -compiler gfortran|ifort|pgf90 (default: gfortran)
    153153
     
    164164
    165165    -netcdf    PATH : full path to an existing installed NetCDF library
    166                (without -netcdf: also download and install the NetCDF library) 
    167    
     166               (without -netcdf: also download and install the NetCDF library)
     167
    168168    -xios      also download and compile the XIOS library
    169169               (requires the NetCDF4-HDF5 library, also installed by default)
     
    173173
    174174    -cosp      to run without our with cospv1 or cospv2 [none/v1/v2]
    175  
     175
    176176    -rad RADIATIF can be oldrad, rrtm or ecrad radiatif code
    177177
     
    201201     "-d") grid_resolution=$2 ; shift ; shift ;;
    202202     "-gprof") OPT_GPROF="-pg" ; shift ;;
    203      "-cosp") cosp=$2 
     203     "-cosp") cosp=$2
    204204              case $cosp in
    205205                  "none"|"v1"|"v2") cosp=$2 ; shift ; shift ;;
     
    246246   v2) opt_cosp="-cospv2 true" ;;
    247247esac
    248  
     248
    249249# Check on veget version
    250250#if [ "$veget" != 'NONE'  -a "$veget" != "CMIP6" -a "$veget" != +([0-9]) ] ; then
     
    252252    re='^[0-9]+$'
    253253    if ! [[ $veget =~ $re ]] ; then
    254         echo 'Valeur de l option veget non valable' 
     254        echo 'Valeur de l option veget non valable'
    255255        exit
    256256    fi
     
    262262    #For use with tutorial, orchidee_rev is also defined (will be written in surface_env at the end of the script)
    263263    orchidee_rev=''
    264 else 
    265     suff_orc='_orch' 
    266 fi
    267 
    268 
    269 if [ $parallel = none ] ; then sequential=1; suff_exe='_seq' ; else sequential=0; suff_exe='_para_mem' ; fi 
     264else
     265    suff_orc='_orch'
     266fi
     267
     268
     269if [ $parallel = none ] ; then sequential=1; suff_exe='_seq' ; else sequential=0; suff_exe='_para_mem' ; fi
    270270
    271271#Chemin pour placer le modele
     
    315315            make=make ;
    316316            o_ins_make="-t g95" ;;
    317            
     317
    318318   *)       if [ $parallel = none -o -f /usr/bin/mpif90 ] ; then
    319319                path_mpi=`which mpif90 | sed -e s:/mpif90::` ;
     
    389389
    390390## if also compiling XIOS, parallel must be mpi_omp
    391 if [ "$with_xios" = "y" -a "$parallel" != "mpi_omp" ] ; then 
     391if [ "$with_xios" = "y" -a "$parallel" != "mpi_omp" ] ; then
    392392  echo "Error, you must set -parallel mpi_omp if you want XIOS"
    393393  exit
     
    517517
    518518#### Ehouarn: test if the required shell is available
    519 #### Maj FH-LF-AS 2021-04 : default=bash ; if bash missing, use ksh 
     519#### Maj FH-LF-AS 2021-04 : default=bash ; if bash missing, use ksh
    520520use_shell="bash" # default
    521521if [ "`which bash`" = "" ] ; then
     
    628628   echo '##########################################################'
    629629   echo `date`
    630    
     630
    631631   cd $MODEL/modipsl
    632632   \rm -rf lib/*
     
    644644   -e 's:#-Q- g95      M_K = gmake:#-Q- g95      M_K = make:' \
    645645   tmp >| AA_make.gdef
    646  
     646
    647647   if [ $pcmac == 1 ]
    648648   then
     
    650650       sed -e 's/rpath=/rpath,/g' tmp > AA_make.gdef
    651651   fi
    652    
    653  
     652
     653
    654654 # We use lines for g95 even for the other compilers to run ins_make
    655655   if [ "$use_shell" = "ksh" ] ; then
     
    662662         exit 1
    663663     fi
    664      
     664
    665665     chmod u=rwx ins_make.bash
    666666     ./ins_make.bash $o_ins_make
    667667   fi # of if [ "$use_shell" = "ksh" ]
    668  
     668
    669669   echo install_lmdz.sh MODIPSL_OK `date`
    670  
     670
    671671   cd $MODEL/modipsl/modeles/IOIPSL/src
    672672   ioipsllog=`pwd`/ioipsl.log
     
    676676   echo `date`
    677677   echo log file : $ioipsllog
    678  
     678
    679679   if [ "$use_shell" = "bash" ] ; then
    680680     cp Makefile Makefile.ksh
     
    703703       $make > $ioipsllog 2>&1
    704704     fi
    705 # fi # of if [ "$pclinux" = 1 ] 
    706  
     705# fi # of if [ "$pclinux" = 1 ]
     706
    707707else # of if [ $ioipsl = 1 ]
    708708   if [ ${hostname:0:5} = jean- ] ; then
     
    720720        cd $MODEL/modipsl/modeles/IOIPSL/tools
    721721        gmake > ioipsl.log
    722    
     722
    723723   fi
    724724   echo install_lmdz.sh ioipsl_OK `date`
     
    763763  set +e ; svn upgrade ; set -e
    764764  if [ "$veget" = "CMIP6" ] ; then
    765     veget_version=orchidee2.0 
     765    veget_version=orchidee2.0
    766766    orchidee_rev=6592
    767   else # specific orchidee revision newer than CMIP6, on 2_1 or 2_2 branches 
     767  else # specific orchidee revision newer than CMIP6, on 2_1 or 2_2 branches
    768768    veget_version=orchidee2.1
    769769    orchidee_rev=$veget
     
    776776     orcbranch=`svn log -v -q svn://forge.ipsl.jussieu.fr/orchidee/ -r $veget |grep ORCHIDEE |head -1| sed -e 's:ORCHIDEE/.*$:ORCHIDEE:' | awk '{print $2}'`
    777777     # switch to that branch
    778      echo IF YOU INSTALL ORCHIDEE THE VERY FIRST TIME, ASK for PASSWORD at orchidee-help@listes.ipsl.fr 
     778     echo IF YOU INSTALL ORCHIDEE THE VERY FIRST TIME, ASK for PASSWORD at orchidee-help@listes.ipsl.fr
    779779     svn switch -r $veget --accept theirs-full svn://forge.ipsl.jussieu.fr/orchidee/$orcbranch
    780780     svn log -r $veget | grep  $veget
     
    784784      fi
    785785      set -e
    786       set +e ; svn update -r $veget ; set -e 
     786      set +e ; svn update -r $veget ; set -e
    787787  fi
    788788  # Correctif suite debug Jean-Zay
     
    811811###################################################################
    812812     if [ "$veget_version" == "false" ] ; then veget_version=orchidee2.0 ; fi
    813       cd arch 
     813      cd arch
    814814      sed -e s:"%COMPILER        .*.$":"%COMPILER            $compiler":1 \
    815815     -e s:"%LINK            .*.$":"%LINK                $compiler":1 \
     
    828828     echo 'XIOS_INCDIR=${ORCHDIR}/../XIOS/inc' >> arch-local.path
    829829     echo 'XIOS_LIBDIR="${ORCHDIR}/../XIOS/lib -lxios"' >> arch-local.path
    830      cd ../ 
     830     cd ../
    831831
    832832     echo ./makeorchidee_fcm -j $xios_orchid $opt_orc -parallel none -arch $arch
     
    846846        cd ..
    847847     done
    848   fi # of "if [ -d tools ]" 
     848  fi # of "if [ -d tools ]"
    849849  echo install_lmdz.sh orchidee_compil_seq_OK `date`
    850 fi # of if [ "$veget" != 'NONE' ] 
     850fi # of if [ "$veget" != 'NONE' ]
    851851
    852852
     
    948948
    949949echo '##################################################################'
    950 echo "Preparing script compile.sh for LMDZ compilation" 
    951 echo "It will only be run automatically if bench=1/tuto" 
     950echo "Preparing script compile.sh for LMDZ compilation"
     951echo "It will only be run automatically if bench=1/tuto"
    952952echo Here bench=$bench
    953953echo '##################################################################'
     
    957957if [ $compile_with_fcm = 1 ] ; then makelmdz="makelmdz_fcm $optim -arch $arch -j 8 " ; else makelmdz="makelmdz $optim -arch $arch" ; fi
    958958
    959 # sequential compilation 
     959# sequential compilation
    960960if [ "$sequential" = 1 ] ; then
    961961  echo Sequential compilation command, saved in compile.sh:
     
    963963  echo "./$makelmdz $optim $OPT_MAKELMDZ $optim $opt_rad $opt_cosp -d ${grid_resolution} -v $veget_version gcm " >> compile.sh
    964964  chmod +x ./compile.sh
    965   if [ $bench = 1 ] ; then 
     965  if [ $bench = 1 ] ; then
    966966    echo install_lmdz.sh start_lmdz_seq_compilation `date`
    967967    echo log file: $lmdzlog
    968     ./compile.sh > $lmdzlog 2>&1 
     968    ./compile.sh > $lmdzlog 2>&1
    969969    echo install_lmdz.sh end_lmdz_seq_compilation `date`
    970970  fi
     
    981981  \rm -rf bin/ lib/
    982982  tar xf ioipsl.tar
    983   # 
     983  #
    984984  # Orchidee
    985985  #
     
    10351035  echo resol=${grid_resolution} >> compile.sh
    10361036  if [ ${hostname:0:5} = jean- -a "$cosp" = "v2" ] ; then
    1037  
    1038   echo LMDZ compilation command in parallel mode, saved in compile.sh, is : 
     1037
     1038  echo LMDZ compilation command in parallel mode, saved in compile.sh, is :
    10391039  echo "(ATTENTION le probleme de cospv2 sur jean-zay en mode prod n est pas corrige ! )"
    10401040# ATTENTION le probleme de cospv2 sur jean-zay en mode prod n est pas corrige
    10411041     echo ./$makelmdz -dev $optim $OPT_MAKELMDZ $opt_rad $opt_cosp $opt_makelmdz_xios -d \$resol -v $veget_version -mem -parallel $parallel gcm >> compile.sh
    1042      echo ./$makelmdz -dev $optim $OPT_MAKELMDZ $opt_rad $opt_cosp $opt_makelmdz_xios -d \$resol -v $veget_version -mem -parallel $parallel gcm 
    1043   else   
     1042     echo ./$makelmdz -dev $optim $OPT_MAKELMDZ $opt_rad $opt_cosp $opt_makelmdz_xios -d \$resol -v $veget_version -mem -parallel $parallel gcm
     1043  else
    10441044    echo ./$makelmdz $optim $OPT_MAKELMDZ $opt_rad $opt_cosp $opt_makelmdz_xios -d \$resol -v $veget_version -mem -parallel $parallel gcm >> compile.sh
    1045     echo ./$makelmdz $optim $OPT_MAKELMDZ $opt_rad $opt_cosp $opt_makelmdz_xios -d \$resol -v $veget_version -mem -parallel $parallel gcm 
    1046   fi 
     1045    echo ./$makelmdz $optim $OPT_MAKELMDZ $opt_rad $opt_cosp $opt_makelmdz_xios -d \$resol -v $veget_version -mem -parallel $parallel gcm
     1046  fi
    10471047  chmod +x ./compile.sh
    10481048
     
    10501050     echo Compiling LMDZ in parallel mode `date`,  LMDZ log file: $lmdzlog ; ./compile.sh > $lmdzlog 2>&1
    10511051  fi
    1052  
     1052
    10531053fi # of if [ $parallel != "none" ]
    10541054
     
    10941094   echo ' Running a test run '
    10951095   echo '##########################################################'
    1096    
     1096
    10971097   \rm -rf BENCH${grid_resolution}
    10981098   bench=bench_lmdz_${grid_resolution}
     
    11021102   echo install_lmdz.sh after bench download  `date`
    11031103   tar xvf $bench.tar.gz
    1104    
     1104
    11051105   if [ "$cosp" = "v1" -o "$cosp" = "v2" ] ; then
    11061106     cd BENCH${grid_resolution}
     
    11121112      \mv -f tmp config.def
    11131113     cd ..
    1114    fi 
    1115    
     1114   fi
     1115
    11161116   if [ -n "$physiq" ]; then
    11171117     cd BENCH${grid_resolution}
     
    11261126     echo using standard physiq.def
    11271127   fi
    1128    
     1128
    11291129   if [ "$with_xios" = "y" ] ; then
    11301130     cd BENCH${grid_resolution}
     
    11391139     sed -e 's@"using_server" type="bool">true@"using_server" type="bool">false@' iodef.xml > tmp
    11401140     \mv -f tmp iodef.xml
    1141    
     1141
    11421142     # and convert all the enabled="_AUTO_" (for libIGCM) to enabled=.FALSE.
    11431143     # except for histday
     
    11551155     echo "### XIOS outputs" >> config.def
    11561156     echo 'ok_all_xml=.true.' >> config.def
    1157    
     1157
    11581158     #activer les sorties pour Cosp
    1159      if [ "$cosp" = "v1" ] ; then 
     1159     if [ "$cosp" = "v1" ] ; then
    11601160      histfile=file_def_histdayCOSP_lmdz.xml
    11611161      sed -e 's@enabled=".FALSE."@enabled=".TRUE."@' $histfile > tmp ; \mv -f tmp $histfile
     
    11731173      sed -e 's@field_def_cosp1.xml@field_def_cospv2.xml@' $fieldfile > tmp ; \mv -f tmp $fieldfile
    11741174     fi
    1175    
     1175
    11761176     cd ..
    11771177   fi
    1178    
     1178
    11791179   # Cas Bensh avec ecrad
    11801180   if [ "$rad" = "ecrad" ] ; then
     
    11901190   \mv tmpdef physiq.def
    11911191   cd ..
    1192    
     1192
    11931193   cp $gcm BENCH${grid_resolution}/gcm.e
    1194    
     1194
    11951195   cd BENCH${grid_resolution}
    11961196   # On cree le fichier bench.sh au besoin
    11971197   # Dans le cas 48x36x39 le bench.sh existe deja en parallele
    1198    
     1198
    11991199   if [ "$grid_resolution" = "48x36x39" ] ; then
    12001200      echo On ne touche pas au bench.sh
     
    12091209        echo "export OMP_NUM_THREADS=2" >> bench.sh
    12101210      fi
    1211       if [ "$cosp" = "v1" -o "$cosp" = "v2" ] ; then 
    1212          if [ ${hostname:0:5} = jean- ] ; then   
     1211      if [ "$cosp" = "v1" -o "$cosp" = "v2" ] ; then
     1212         if [ ${hostname:0:5} = jean- ] ; then
    12131213        chmod +x ../arch.env
    12141214           ../arch.env 
    12151215           echo "ulimit -s 2000000" >> bench.sh
    12161216         else
    1217            echo "ulimit -s 200000" >> bench.sh       
     1217           echo "ulimit -s 200000" >> bench.sh
    12181218         fi     
    12191219      else
     
    12211221      fi
    12221222      if [ ${hostname:0:5} = jean- ] ; then
    1223         . ../arch/arch-${arch}.env 
     1223        . ../arch/arch-${arch}.env
    12241224        echo "srun -n 2 -A $idris_acct@cpu gcm.e > listing  2>&1" >> bench.sh
    12251225      else
     
    12681268   set -e
    12691269   tail listing
    1270    
    1271    
     1270
     1271
    12721272   echo '##########################################################'
    12731273   echo 'Simulation finished in' `pwd`
     
    13101310#echo surface_env file created in $MODEL
    13111311echo 'veget='$veget > surface_env
    1312 #opt_veget="-v $veget_version" 
     1312#opt_veget="-v $veget_version"
    13131313#echo 'opt_veget="'$opt_veget\" >> surface_env
    13141314echo 'opt_veget="'-v $veget_version\" >> surface_env
    13151315echo 'orchidee_rev='$orchidee_rev >> surface_env
    13161316echo 'suforch='$suff_orc >> surface_env
    1317    
    1318 
    1319 
    1320 
     1317
     1318
     1319
     1320
Note: See TracChangeset for help on using the changeset viewer.