Changeset 8562 for branches/ORCHIDEE_2_2


Ignore:
Timestamp:
2024-05-21T10:03:08+02:00 (6 months ago)
Author:
josefine.ghattas
Message:

Add compression by tar option now also in this branche, as done in the trunk. Done by Karine Laurent

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ORCHIDEE_2_2/ORCHIDEE_OL/compile_orchidee_ol.sh

    r8381 r8562  
    5757netcdf_lib="" 
    5858 
     59## Arguments in order to compress temporary files after compilation 
     60tar=no 
     61comp_tar=yes 
    5962 
    6063#### Read arguments  
     
    8285   When using [-parallel seq], [-without_xios] must as well be set. 
    8386  [-netcdf_lib_seq]: option to tell XIOS that linking with netcdf4 sequential library will be used instead of default netcdf4 parallel library 
     87  [-tar]: option to compress XIOS repository that takes many inodes without compilation 
     88  [-comp_tar]: option to compile and compress XIOS repository if compilation succed 
     89  [-notar]: do not compress XIOS repository 
    8490 
    8591 
     
    113119        "-all_exec")        otherexec="-otherexec" ; shift ;; 
    114120        "-netcdf_lib_seq")  netcdf_lib="--netcdf_lib netcdf4_seq"; shift ;; 
     121        "-tar")             tar=yes ; shift ;; 
     122        "-comp_tar")        comp_tar=yes ; shift ;; 
     123        "-notar")           comp_tar=no ; shift ;; 
    115124        *)                  echo "unknown option "$1" , exiting..." ; exit  
    116125    esac 
     
    128137echo "   optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch " >> $outfile  
    129138echo "   full_flag=$full_flag, full_xios=$full_xios, full_orch=$full_orch" >> $outfile  
     139echo "   tar=$tar, comp_tar=$comp_tar" >> $outfile 
    130140echo >> $outfile 
    131141 
     
    134144    echo "Option -without_xios must be set if option [-parallel seq] is set" 
    135145    echo "Option -without_xios must be set if option [-parallel seq] is set" >> $outfile   
     146    exit 
     147fi 
     148 
     149# Compress XIOS without compiling if tar=yes 
     150if [ $tar == yes ] ; then 
     151    cd $modipsl/modeles 
     152    echo "Option tar activated to compress XIOS. No compilation will be done." 
     153    echo >> $outfile 
     154    echo "option tar activated" >> $outfile 
     155    if [[ -d $modipsl/modeles/XIOS ]] ; then 
     156        tar -cf XIOS.tar XIOS 
     157        rm -rf XIOS 
     158        echo " Tar XIOS repository" 
     159        echo " Tar XIOS repository" >> $outfile 
     160    else 
     161        echo " No XIOS repository to compress" 
     162        echo " No XIOS repository to compress" >> $outfile 
     163    fi 
     164    echo "END OF SCRIPT" 
     165    echo "END OF SCRIPT" >> $outfile 
    136166    exit 
    137167fi 
     
    213243## 2.2 Compile xios 
    214244if [ $xios == xios ] ; then 
     245    cd $modipsl/modeles 
     246    # First check if XIOS needs to be decompressed 
     247    # In priority search for modeles/XIOS_${optmode}.tar but if it doesn't exist take 
     248    # the first which is found.  
     249    echo; echo "NOW DECOMPRESS XIOS IF NEEDED" 
     250    if [[ -d $modipsl/modeles/XIOS ]] ; then 
     251        echo "Found XIOS -> no decompress needs to be done";  >> $outfile 
     252    elif [[ -f $modipsl/modeles/XIOS_${optmode}.tar ]]; then 
     253        echo >> $outfile 
     254        echo "Found XIOS_${optmode}.tar -> decompress repository" >> $outfile 
     255        tar -xf XIOS_${optmode}.tar >> $outfile 2>&1 
     256    elif [[ -f $modipsl/modeles/XIOS_prod.tar ]]; then 
     257        echo >> $outfile 
     258        echo "Found XIOS_prod.tar -> decompress repository" >> $outfile 
     259        tar -xf XIOS_prod.tar >> $outfile 2>&1 
     260    elif [[ -f $modipsl/modeles/XIOS_debug.tar ]]; then 
     261        echo >> $outfile 
     262        echo "Found XIOS_debug.tar -> decompress repository" >> $outfile 
     263        tar -xf XIOS_debug.tar >> $outfile 2>&1 
     264    elif [[ -f $modipsl/modeles/XIOS_dev.tar ]]; then 
     265        echo >> $outfile 
     266        echo "Found XIOS_dev.tar -> decompress repository" >> $outfile 
     267        tar -xf XIOS_dev.tar >> $outfile 2>&1 
     268    elif [[ -f $modipsl/modeles/XIOS.tar ]]; then 
     269        echo >> $outfile 
     270        echo "Found XIOS.tar -> decompress repository" >> $outfile 
     271        tar -xf XIOS.tar >> $outfile 2>&1 
     272    else 
     273        echo "XIOS source code was not found. Exit" 
     274        echo "XIOS source code was not found. Exit" >> $outfile 
     275        exit 
     276    fi 
     277     
    215278    cd $modipsl/modeles/XIOS 
    216279    echo; echo "NOW COMPILE XIOS" 
     
    265328if [ -f $modipsl/bin/teststomate ] ; then mv $modipsl/bin/teststomate  $modipsl/bin/teststomate_${optmode} ; fi 
    266329 
    267  
     330if [ $comp_tar == yes ] && [ -d $modipsl/modeles/XIOS ] ; then 
     331    cd $modipsl/modeles 
     332    echo "Option comp_tar activated, now compress XIOS" 
     333    echo "Option comp_tar activated, now compress XIOS" >> $outfile 
     334    tar -cf XIOS_${optmode}.tar XIOS 
     335    rm -rf XIOS 
     336fi 
    268337 
    269338echo >>$outfile ; echo "ALL COMPILING FINISHED" >> $outfile 
Note: See TracChangeset for help on using the changeset viewer.