Changeset 6638


Ignore:
Timestamp:
10/05/23 14:27:02 (8 months ago)
Author:
jgipsl
Message:

Add possiblity to compile a sub-configuration of IPSLCM7. By default, the full configuration is compiled. If only a sub-configuration is installed, the compilation will adapte and only compile what is avaiable. It is also possible to install the full IPSLCM7 configuration but compile a smaller forced configuration by using the argument -subconfig.
Indentation will be done in next commit.

Location:
CONFIG/UNIFORM/v7/IPSLCM7
Files:
1 added
1 edited

Legend:

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

    r6629 r6638  
    4444optchimie=GES 
    4545 
     46# subconfig : which sub-configuration to compile. By default, the full extracted configuration is compiled. 
     47subconfig=default 
     48 
    4649# orchversion tells if ORCHIDEE_2_2 or ORCHIDEE_trunk is compiled. This is used as argument and also in the suffix of the executables. 
    4750# orchcomp is the key word needed for LMDZ for the compilation of coherent interface. Only used internal to the compilation script. 
     
    5962 
    6063 
    61 echo "create out_compile_ipslcm7 link " 
    6264rm -f out_compile_ipslcm7 
    6365ln -s ${outfile} out_compile_ipslcm7 
    64  
    6566 
    6667 
     
    8081Options: [-full] Full recompilation of all components. This option can be added to all other options. 
    8182         [-cleannemo] Full recompilation of NEMO component only. 
    82          [-regular_latlon] 
     83         [-regular_latlon XXXxYYYxZZ] Define which regular grid to compile in addition to the icosahedric grid. It is mandatory to specify the grid size. 
    8384         [-debug / -dev / -prod] Level of optimization. One of these can be added to all other compile options. Default: -prod. 
    84  
     85         [-subconfig X] Set this option if you want to compile a sub-configuration. X can be: ICOLMDZORINCA, ICOLMDZOR, LMDZORINCA or LMDZOR.  
     86                        If this option is not set, all extracted components are compiled.  
    8587 
    8688Example 1: Default compilation of IPSLCM7 for resolution LR  
     
    117119        "-prod")       optmode=prod ; shift ;; 
    118120        "-regular_latlon")  regular_latlon=yes ; resol_atm=$2 ; shift ; shift ;; 
     121        "-subconfig")  subconfig=$2 ; shift ; shift ;; 
    119122        "-full")       full_flag="-full"; full_nemo=y ; full_xios="--full" ; full_lmdz="-full" ; full_orch="-full" ; shift ;; 
    120123        "-full_xios")  full_xios="--full" ; shift ;;  # Note only full_xios is using double dash: --full 
     
    133136done 
    134137 
     138 
     139# Define which sub-configuration to compile. By default all extracted source components are compiled. 
     140source define_config.sh 
     141 
    135142echo "Following options are set in current compiling:" >> $outfile 
    136143echo "   regular_latlon=$regular_latlon (if yes, then resol_atm=${resol_atm})" >> $outfile  
     
    138145echo "   optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch " >> $outfile  
    139146echo "   full_flag=$full_flag, full_xios=$full_xios, full_lmdz=$full_lmdz, full_orch=$full_orch, full_nemo=$full_nemo, full_dyna=$full_dyna" >> $outfile  
     147echo "   compinca=$compinca compnemo=$compnemo compoasis=$compoasis compdyna=$compdyna complmdz=y comporch=y compxios=y" >> $outfile 
    140148echo >> $outfile 
     149 
    141150 
    142151### Read host dependent default values 
     
    227236fi 
    228237 
     238if [ $compoasis == y ] ; then 
    229239## 2.2 Compile oasis3-mct 
    230240cd $modipsl/oasis3-mct/util/make_dir 
     
    236246     make -f TopMakefileOasis3 >> $outfile 2>&1 
    237247 
     248else 
     249echo ; echo No compilation of OASIS 
     250fi 
    238251 
    239252## 2.3 Compile xios 
     
    241254echo; echo "NOW COMPILE XIOS" 
    242255echo >> $outfile ; echo " NOW COMPILE XIOS"   >> $outfile  
    243 echo ./make_xios --use_oasis oasis3_mct --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_xios   >> $outfile  
    244      ./make_xios --use_oasis oasis3_mct --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_xios   >> $outfile 2>&1 
     256if [ $compoasis == y ] ; then 
     257argoasis="--use_oasis oasis3_mct " 
     258else 
     259argoasis=" " 
     260fi 
     261echo ./make_xios $argoasis --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_xios   >> $outfile  
     262     ./make_xios $argoasis --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_xios   >> $outfile 2>&1 
    245263# Test if compiling succeded  
    246264if [[ $? != 0 ]] ; then  
     
    300318 
    301319 
     320if [ $compnemo == y ] ; then 
    302321## 2.5 Compile NEMO 
    303322nemo_root=$modipsl/modeles/NEMO 
     
    364383fi 
    365384 
    366  
     385else 
     386echo ; echo No compilation of NEMO 
     387fi 
     388 
     389if [ $compinca == y ] ; then 
    367390##2.6  Compile INCA  
    368391    cd $modipsl/modeles/INCA 
     
    395418    fi 
    396419 
    397  
     420else 
     421echo ; echo No compilation of INCA 
     422fi 
    398423 
    399424## 2.7 Compile LMDZ  
     
    432457if [ $lmdzsvn -le 4185 -a $rad = "ecrad" ] ; then echo "ecrad only available for LMDZ rev starting with 4186 " ; exit ; fi 
    433458 
    434 echo ./makelmdz_fcm -p lmd -c OMCT $opt_rad -$optmode -mem -parallel $parallel -libphy -v $orchcomp -chimie INCA  -io xios -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz    >> $outfile  
    435      ./makelmdz_fcm -p lmd -c OMCT $opt_rad -$optmode -mem -parallel $parallel -libphy -v $orchcomp -chimie INCA  -io xios -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz    >> $outfile 2>&1 
     459if [ $compinca == y ] ; then 
     460    arginca="-chimie INCA " 
     461else 
     462    arginca=" " 
     463fi 
     464 
     465if [ $compoasis == y ] ; then 
     466    argoasis="-c OMCT " 
     467else 
     468    argoasis=" " 
     469fi 
     470    echo ./makelmdz_fcm -p lmd $argoasis $opt_rad -$optmode -mem -parallel $parallel -libphy -v $orchcomp $arginca  -io xios -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz    >> $outfile  
     471         ./makelmdz_fcm -p lmd $argoasis $opt_rad -$optmode -mem -parallel $parallel -libphy -v $orchcomp $arginca  -io xios -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz    >> $outfile 2>&1 
     472 
     473 
    436474# Test if compiling finished 
    437475if [[ $? != 0 ]] ; then 
     
    439477    exit 
    440478fi 
     479 
    441480 
    442481 
     
    446485echo >> $outfile ; echo " NOW COMPILE DYNAMICO"   >> $outfile  
    447486 
    448 echo ./make_icosa -$optmode -with_fcm1 -parallel $parallel -external_ioipsl -with_oasis -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna    >> $outfile  
    449      ./make_icosa -$optmode -with_fcm1 -parallel $parallel -external_ioipsl -with_oasis -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna    >> $outfile 2>&1 
     487if [ $compoasis == y ] ; then 
     488 argoasis="-with_oasis " 
     489else 
     490 argoasis=" " 
     491fi 
     492if [ $compinca == y ] ; then 
     493 arginca="-with_inca " 
     494else 
     495 arginca=" " 
     496fi 
     497 
     498 
     499echo ./make_icosa -$optmode -with_fcm1 -parallel $parallel -external_ioipsl $argoasis -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna    >> $outfile  
     500     ./make_icosa -$optmode -with_fcm1 -parallel $parallel -external_ioipsl $argoasis -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna    >> $outfile 2>&1 
    450501# Test if compiling finished 
    451502if [[ $? != 0 ]] ; then 
     
    460511echo >> $outfile ; echo " NOW COMPILE ICOSA_LMDZ"   >> $outfile  
    461512 
    462 echo ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_oasis -with_orchidee -with_inca -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna    >> $outfile  
    463      ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_oasis -with_orchidee -with_inca -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna    >> $outfile 2>&1 
     513echo ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel $argoasis -with_orchidee $arginca -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna    >> $outfile  
     514     ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel $argoasis -with_orchidee $arginca -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna    >> $outfile 2>&1 
    464515# Test if compiling finished 
    465516if [[ $? != 0 ]] ; then 
     
    469520# Move executables to modipsl/bin 
    470521if [ -f $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe ] ; then  
    471     mv $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe $modipsl/bin/icosa_lmdz_${orchversion}_${optmode}_${optchimie}.exe 
    472     #create link to be use by IPSLCM and LMDZOR without any change in the executable name 
    473     cd  $modipsl/bin 
    474     rm -f icosa_lmdz_${orchversion}_${optmode}.exe 
    475     ln -s icosa_lmdz_${orchversion}_${optmode}_${optchimie}.exe icosa_lmdz_${orchversion}_${optmode}.exe 
     522    if [ $compinca == y ] ; then 
     523        mv $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe $modipsl/bin/icosa_lmdz_${orchversion}_${optmode}_${optchimie}.exe 
     524        # Create link to be use by IPSLCM and LMDZOR without any change in the executable name 
     525        cd  $modipsl/bin 
     526        rm -f icosa_lmdz_${orchversion}_${optmode}.exe 
     527        ln -s icosa_lmdz_${orchversion}_${optmode}_${optchimie}.exe icosa_lmdz_${orchversion}_${optmode}.exe 
     528    else 
     529        mv $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe $modipsl/bin/icosa_lmdz_${orchversion}_${optmode}.exe 
     530    fi 
    476531else 
    477532    echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION EXECUTABLE MISSING - STOP" 
     
    500555        rm -f .lock 
    501556    fi 
    502     echo ./makelmdz_fcm -d ${resol_atm} -c OMCT -p lmd $opt_rad -$optmode -mem -parallel $parallel -chimie INCA  -io xios -v $orchcomp -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile  
    503          ./makelmdz_fcm -d ${resol_atm} -c OMCT -p lmd $opt_rad -$optmode -mem -parallel $parallel -chimie INCA  -io xios -v $orchcomp -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile 2>&1 
     557 
     558    if [ $compinca == y ] ; then 
     559        arginca="-chimie INCA" 
     560    else 
     561        arginca="" 
     562    fi 
     563     
     564    if [ $compoasis == y ] ; then 
     565        argoasis="-c OMCT" 
     566    else 
     567        argoasis="" 
     568    fi 
     569    echo ./makelmdz_fcm -d ${resol_atm} $argoasis -p lmd $opt_rad -$optmode -mem -parallel $parallel $arginca  -io xios -v $orchcomp -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile  
     570         ./makelmdz_fcm -d ${resol_atm} $argoasis -p lmd $opt_rad -$optmode -mem -parallel $parallel $arginca  -io xios -v $orchcomp -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile 2>&1 
    504571    # Test if compiling finished 
    505572    if [[ $? != 0 ]] ; then 
     
    514581        suffix=${suffix}_seq_orch_inca.e 
    515582    else 
    516         suffix=${suffix}_para_mem_orch_couple_inca.e 
     583        if [ $compoasis == y ] ; then 
     584            suffix=${suffix}_para_mem_orch_couple 
     585        else 
     586            suffix=${suffix}_para_mem_orch 
     587        fi 
     588        if [ $compinca == y ] ; then 
     589            suffix=${suffix}_inca.e 
     590        else 
     591            suffix=${suffix}.e 
     592        fi 
    517593    fi 
    518594    echo gcm suffix = $suffix 
     
    521597    echo "Move gcm.e executable to modipsl/bin" 
    522598    if [ -f $modipsl/modeles/LMDZ/bin/gcm${suffix} ] ;  then 
    523         mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${orchversion}_${optmode}_${optchimie}.e 
    524         #create link to be use by IPSLCM and LMDZOR without any change in the executable name 
    525         cd $modipsl/bin 
    526         rm -f gcm_${resol_atm}_${orchversion}_${optmode}.e 
    527         ln -s gcm_${resol_atm}_${orchversion}_${optmode}_${optchimie}.e gcm_${resol_atm}_${orchversion}_${optmode}.e 
     599        if [ $compinca == y ] ; then 
     600            mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${orchversion}_${optmode}_${optchimie}.e 
     601            # Create link to be use by IPSLCM and LMDZOR without any change in the executable name 
     602            cd $modipsl/bin 
     603            rm -f gcm_${resol_atm}_${orchversion}_${optmode}.e 
     604            ln -s gcm_${resol_atm}_${orchversion}_${optmode}_${optchimie}.e gcm_${resol_atm}_${orchversion}_${optmode}.e 
     605        else 
     606            mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${orchversion}_${optmode}.e 
     607        fi 
    528608    else 
    529609        echo "ERROR gcm${suffix} executable does not exist."  
     
    538618        suffix=${suffix}_seq_orch.e 
    539619    else 
    540         suffix=${suffix}_para_mem_orch_couple.e 
     620        if [ $compoasis == y ] ; then 
     621            suffix=${suffix}_para_mem_orch_couple.e 
     622        else 
     623            suffix=${suffix}_para_mem_orch.e 
     624        fi 
    541625    fi 
    542626    echo ce0l suffix = $suffix 
    543   
     627 
    544628    # Compile ce0l initialization program for LMDZ regular lat-lon exectuable 
    545629    cd $modipsl/modeles/LMDZ 
     
    547631    echo >> $outfile ; echo " NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"   >> $outfile  
    548632 
    549     echo ./makelmdz_fcm -d ${resol_atm} -c OMCT -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v $orchcomp -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile  
    550          ./makelmdz_fcm -d ${resol_atm} -c OMCT -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v $orchcomp -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile 2>&1 
     633    echo ./makelmdz_fcm -d ${resol_atm} $argoasis -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v $orchcomp -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile  
     634         ./makelmdz_fcm -d ${resol_atm} $argoasis -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v $orchcomp -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile 2>&1 
    551635    # Test if compiling finished 
    552636    if [[ $? != 0 ]] ; then 
Note: See TracChangeset for help on using the changeset viewer.