Ignore:
Timestamp:
05/21/24 10:22:32 (5 months ago)
Author:
jgipsl
Message:

Enhencement on compression option by tar. Now do not keep the modeles folder in the tar file. Done by Karine Laurent.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CONFIG/UNIFORM/v7/IPSLCM7/compile_ipslcm7.sh

    r6838 r6840  
    188188        echo " Now tar XIOS repository" 
    189189        echo " Now tar XIOS repository" >> $outfile 
    190         tar -cf $modipsl/modeles/XIOS.tar $modipsl/modeles/XIOS 
    191         rm -rf $modipsl/modeles/XIOS 
     190        cd $modipsl/modeles 
     191        tar -cf XIOS.tar XIOS 
     192        rm -rf XIOS 
    192193    else 
    193194        echo " No XIOS repository to compress" 
     
    198199        echo "Now tar LMDZ/libo repository" 
    199200        echo "Now tar LMDZ/libo repository" >> $outfile 
    200         tar -cf $modipsl/modeles/LMDZ/libo.tar $modipsl/modeles/LMDZ/libo 
    201         rm -rf $modipsl/modeles/LMDZ/libo 
     201        cd $modipsl/modeles/LMDZ 
     202        tar -cf libo.tar libo 
     203        rm -rf libo 
    202204    else 
    203205        echo " No LMDZ/libo repository to compress" 
     
    320322 
    321323## 2.3 Compile xios 
     324cd $modipsl/modeles 
    322325echo; echo "NOW DECOMPRESS XIOS IF NEEDED" 
    323326# First check if XIOS needs to be decompressed 
     
    329332    echo >> $outfile 
    330333    echo "Found XIOS_${optmode}.tar -> decompress repository" >> $outfile 
    331     # Do not write "tar -xf ... -C $modipsl/modeles because it's modeles/XIOS that is compressed, not only XIOS/ 
    332     tar -xf $modipsl/modeles/XIOS_${optmode}.tar -C $modipsl/ >> $outfile 2>&1 
     334    tar -xf XIOS_${optmode}.tar >> $outfile 2>&1 
    333335elif [[ -f $modipsl/modeles/XIOS_prod.tar ]]; then 
    334336    echo >> $outfile 
    335337    echo "Found XIOS_prod.tar -> decompress repository" >> $outfile 
    336     tar -xf $modipsl/modeles/XIOS_prod.tar -C $modipsl/ >> $outfile 2>&1 
     338    tar -xf $modipsl/modeles/XIOS_prod.tar >> $outfile 2>&1 
    337339elif [[ -f $modipsl/modeles/XIOS_debug.tar ]]; then 
    338340    echo >> $outfile 
    339341    echo "Found XIOS_debug.tar -> decompress repository" >> $outfile 
    340     tar -xf $modipsl/modeles/XIOS_debug.tar -C $modipsl/ >> $outfile 2>&1 
     342    tar -xf $modipsl/modeles/XIOS_debug.tar >> $outfile 2>&1 
    341343elif [[ -f $modipsl/modeles/XIOS_dev.tar ]]; then 
    342344    echo >> $outfile 
    343345    echo "Found XIOS_dev.tar -> decompress repository" >> $outfile 
    344     tar -xf $modipsl/modeles/XIOS_dev.tar -C $modipsl/ >> $outfile 2>&1 
     346    tar -xf $modipsl/modeles/XIOS_dev.tar >> $outfile 2>&1 
    345347elif [[ -f $modipsl/modeles/XIOS.tar ]]; then 
    346348    echo >> $outfile 
    347349    echo "Found XIOS.tar -> decompress repository" >> $outfile 
    348     tar -xf $modipsl/modeles/XIOS.tar -C $modipsl/ >> $outfile 2>&1 
     350    tar -xf $modipsl/modeles/XIOS.tar >> $outfile 2>&1 
    349351else 
    350352    echo "XIOS source code was not found. Exit" 
     
    537539 
    538540## 2.7 Compile LMDZ  
    539 cd $modipsl/modeles/LMDZ 
    540541 
    541542# First check if LMDZ/libo exist or if it could be decompressed 
     
    548549    echo "Found LMDZ/libo_${optmode}.tar -> decompress repository"; >> $outfile 
    549550    echo >> $outfile 
    550     tar -xf $modipsl/modeles/LMDZ/libo_${optmode}.tar -C $modipsl/ >> $outfile 2>&1 
     551    cd $modipsl/modeles/LMDZ 
     552    tar -xf libo_${optmode}.tar >> $outfile 2>&1 
    551553fi 
    552554 
     
    556558    echo; echo "NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO" 
    557559    echo >> $outfile ; echo " NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO"   >> $outfile  
    558      
     560    cd $modipsl/modeles/LMDZ     
    559561     
    560562    # Check if the compilation of LMDZ was previsouly interupted prematured.  
     
    666668 
    667669    cd $modipsl/modeles/LMDZ 
     670 
    668671    # Compile LMDZ regular lat-lon exectuable 
    669672    echo; echo "NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}" 
     
    789792    echo "Option comp_tar activated, now compress XIOS" 
    790793    echo "Option comp_tar activated, now compress XIOS" >> $outfile 
    791     tar -cf $modipsl/modeles/XIOS_${optmode}.tar $modipsl/modeles/XIOS 
    792     rm -rf $modipsl/modeles/XIOS 
    793 fi 
     794    cd $modipsl/modeles 
     795    tar -cf XIOS_${optmode}.tar XIOS 
     796    rm -rf XIOS 
     797fi 
     798 
    794799if [ $comp_tar == yes ] && [ -d $modipsl/modeles/LMDZ/libo ] ; then 
    795800    echo "Option comp_tar activated, now compress LMDZ/libo" 
    796801    echo "Option comp_tar activated, now compress LMDZ/libo" >> $outfile 
    797     tar -cf $modipsl/modeles/LMDZ/libo_${optmode}.tar $modipsl/modeles/LMDZ/libo 
    798     rm -rf $modipsl/modeles/LMDZ/libo 
    799 fi 
    800  
     802    cd $modipsl/modeles/LMDZ 
     803    tar -cf libo_${optmode}.tar libo 
     804    rm -rf libo 
     805fi 
     806  
    801807echo >>$outfile ; echo "ALL COMPILING FINISHED" >> $outfile 
    802808echo ls -lrt modipsl/bin >> $outfile 
Note: See TracChangeset for help on using the changeset viewer.