Changeset 6080 for CONFIG


Ignore:
Timestamp:
03/02/22 14:54:34 (2 years ago)
Author:
acosce
Message:

update compilation script for ICOLMDZOR_v7 configuration. Add new options

-ico_only : compile only DYN-LMDZ-OR (grid ico)
-reg_only : compile only LMDZ-OR (grid reg)
-ce0l_only : compile only create_etat0_limit for regular grid

Note: for ico grid the executable done both : ce0l and gcm
If we don't put any option we will compile ico / reg and ce0l

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CONFIG/UNIFORM/v7/ICOLMDZOR_v7/compile_icolmdzor.sh

    r5883 r6080  
    1919# Resolution if compiling LMDZ in regular mode without DYNAMICO 
    2020# Use for example following "./compile_icolmdzor.sh -regular_latlon 144x142x79" 
    21 regular_latlon=no 
     21resol_atm=144x142x79 
     22#choose if we want to compile only grid ico, grid reg. If no for both of them, we will compile the two grids 
     23ico_only=no 
     24reg_only=no 
     25#choose if we want to compile only create_etat0_limit 
     26ce0l_only=no 
    2227# fcm_arch 
    2328fcm_arch=default 
     
    5560Options: -full, -regular_latlon, -debug, -dev, -prod(default) 
    5661 
    57 Example 1: Default compilation of DYNAMICO-LMDZ-ORCHIDEE with XIOS and IOIPSL 
     62Example 1: Default compilation of [DYNAMICO-LMDZ-ORCHIDEE with XIOS and IOIPSL] and [LMDZ-ORCHIDEE with XIOS and IOIPSL] and [create_etat0_limit] 
    5863./compile_icolmdzor.sh 
    5964 
     
    6469./compile_icolmdzor.sh -full 
    6570 
    66 Example 4: Compilation of LMDZ in regular lat-lon for dimension 144x142x79.  
    67 The dimension can be changed to any other 3d dimension. DYNAMICO is also compiled as default. 
    68 ./compile_icolmdzor.sh -regular_latlon 144x142x79 
     71Example 4: Define dimension for regular grid (default one is  144x142x79) 
     72The dimension can be changed to any other 3d dimension - in this example DYNAMICO is also compiled as default. 
     73./compile_icolmdzor.sh -regular_latlon 256x256x79 
     74 
     75Example 5: Compile only ico grid  
     76./compile_icolmdzo.sh -ico_only 
     77 
     78Example 6: Compile only regular grid with default resolution (144x142x79) 
     79./compile_icolmdzor.sh -reg_only 
     80 
     81Example 7: compile only create_etat0_limt for reg and ico  
     82./compile_icolmdzor.sh -ce0l_only 
    6983 
    7084end_help 
     
    8397        "-full_orch")       full_orch="-full"  ; shift ;; 
    8498        "-full_dyna")       full_dyna="-full"  ; shift ;; 
     99        "-ico_only")        ico_only=yes  ; shift ;; 
     100        "-reg_only")        reg_only=yes  ; shift ;; 
     101        "-ce0l_only")       ce0l_only=yes  ; shift ;; 
    85102        "-netcdf_lib_seq")  netcdf_lib="--netcdf_lib netcdf4_seq"; shift ;; 
    86103        *)                  echo "unknown option "$1" , exiting..." ;  exit  
     
    89106 
    90107echo "Following options are set in current compiling:" >> $outfile  
    91 echo "   regular_latlon=$regular_latlon (if yes, then resol_atm=${resol_atm})" >> $outfile  
     108echo "   ico_only=${ico_only}, reg_only=${reg_only}, ce0l_only=${ce0l_only}" >> $outfile 
     109echo "   regular_latlon=${resol_atm} (use to create executable on regular grid)" >> $outfile  
    92110echo "   optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch " >> $outfile  
    93111echo "   full_flag=$full_flag, full_xios=$full_xios, full_lmdz=$full_lmdz, full_orch=$full_orch, full_dyna=$full_dyna" >> $outfile  
     
    214232 
    215233## 2.4 Compile lmdz 
    216 cd $modipsl/modeles/LMDZ 
    217 # Compile LMDZ as library to couple to DYNAMICO 
    218 echo; echo "NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO" 
    219 echo >> $outfile ; echo " NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO"   >> $outfile  
    220  
    221 # Check if the compilation of LMDZ was previsouly interupted prematured.  
    222 # In that case, the files dimension.h and .lock exist. If the files exist, they are here removed to avoid makelmdz_fcm  
    223 # to ask question and wait for interactivly answer from the user. 
    224 if [ -f libf/grid/dimensions.h ] || [ -f .lock ] ; then 
    225   echo >> $outfile 
    226   echo " WARNING!! The file LMDZ/libf/grid/dimension.h and/or the LMDZ/.lock exist. "   >> $outfile 
    227   echo "           This means that the compilation is either currently on going in another terminal was previous interupted before the end."   >> $outfile 
    228   echo "           The files dimension.h and .lock will now be removed. "   >> $outfile 
    229   echo >> $outfile 
    230   rm -f libf/grid/dimensions.h 
    231   rm -f .lock 
    232 fi 
    233  
    234 echo ./makelmdz_fcm -p lmd -rrtm true -cosp true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_lmdz    >> $outfile  
    235      ./makelmdz_fcm -p lmd -rrtm true -cosp true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_lmdz    >> $outfile 2>&1 
    236 # Test if compiling finished 
    237 if [[ $? != 0 ]] ; then 
    238     echo "THERE IS A PROBLEM IN LMDZ PHYSICS COMPILATION - STOP" 
    239     exit 
    240 fi 
    241  
    242  
    243 ## 2.5 Compile DYNAMICO 
    244 cd $modipsl/modeles/DYNAMICO 
    245 echo; echo "NOW COMPILE DYNAMICO " 
    246 echo >> $outfile ; echo " NOW COMPILE DYNAMICO"   >> $outfile  
    247  
    248 if [ -d $modipsl/config/ICOLMDZOR_v7/SOURCES/DYNAMICO ] ; then 
    249     cd $modipsl/config/ICOLMDZOR_v7/SOURCES/DYNAMICO 
    250     for dir in $( find . -mindepth 1 -maxdepth 1 -type d ); do 
    251         for file in $( find $dir -type f ! -path '*.svn*' ); do 
    252             echo cp $file $modipsl/modeles/DYNAMICO/$file >> $outfile  
    253             cp $file $modipsl/modeles/DYNAMICO/$file  >> $outfile 2>&1 
    254         done 
    255     done 
    256     cd $modipsl/modeles/DYNAMICO 
    257 fi 
    258  
    259 echo ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna    >> $outfile  
    260      ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna    >> $outfile 2>&1 
    261 # Test if compiling finished 
    262 if [[ $? != 0 ]] ; then 
    263     echo "THERE IS A PROBLEM IN DYNAMICO COMPILATION - STOP" 
    264     exit 
    265 fi 
    266  
    267 ## 2.6 Compile interface ICOSA_LMDZ 
    268 cd $modipsl/modeles/ICOSA_LMDZ 
    269 echo; echo "NOW COMPILE ICOSA_LMDZ " 
    270 echo >> $outfile ; echo " NOW COMPILE ICOSA_LMDZ"   >> $outfile  
    271  
    272 if [ -d $modipsl/config/ICOLMDZOR_v7/SOURCES/ICOSA_LMDZ ] ; then 
    273     cd $modipsl/config/ICOLMDZOR_v7/SOURCES/ICOSA_LMDZ 
    274     for dir in $( find . -mindepth 1 -maxdepth 1 -type d ); do 
    275         for file in $( find $dir -type f ! -path '*.svn*' ); do 
    276             echo cp $file $modipsl/modeles/ICOSA_LMDZ/$file >> $outfile  
    277             cp $file $modipsl/modeles/ICOSA_LMDZ/$file  >> $outfile 2>&1 
    278         done 
    279     done 
    280     cd $modipsl/modeles/ICOSA_LMDZ 
    281 fi 
    282  
    283 echo ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna    >> $outfile  
    284      ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna    >> $outfile 2>&1 
    285 # Test if compiling finished 
    286 if [[ $? != 0 ]] ; then 
    287     echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION - STOP" 
    288     exit 
    289 fi 
    290 # Move executables to modipsl/bin 
    291 if [ $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe ] ; then  
    292     mv $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe $modipsl/bin/icosa_lmdz_${optmode}.exe 
    293 else 
    294     echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION EXECUTABLE MISSING - STOP" 
    295     exit 
    296 fi 
    297  
    298  
    299  
    300 ## 2.7 Compile LMDZ for regular latlon configuration 
    301 if [ $regular_latlon = yes ] ; then 
     234 
     235if [ $reg_only = no ] && [ $ce0l_only = no ]; then  
    302236 
    303237    cd $modipsl/modeles/LMDZ 
    304     # Compile LMDZ regular lat-lon exectuable 
    305     echo; echo "NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}" 
    306     echo >> $outfile ; echo " NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}"   >> $outfile  
     238 
     239    # Compile LMDZ as library to couple to DYNAMICO 
     240    echo; echo "NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO" 
     241    echo >> $outfile ; echo " NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO"   >> $outfile  
    307242 
    308243    # Check if the compilation of LMDZ was previsouly interupted prematured.  
     
    318253        rm -f .lock 
    319254    fi 
     255 
     256    echo ./makelmdz_fcm -p lmd -rrtm true -cosp true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_lmdz    >> $outfile  
     257    ./makelmdz_fcm -p lmd -rrtm true -cosp true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_lmdz    >> $outfile 2>&1 
     258    # Test if compiling finished 
     259    if [[ $? != 0 ]] ; then 
     260        echo "THERE IS A PROBLEM IN LMDZ PHYSICS COMPILATION - STOP" 
     261        exit 
     262    fi 
     263 
     264 
     265    ## 2.5 Compile DYNAMICO 
     266    cd $modipsl/modeles/DYNAMICO 
     267    echo; echo "NOW COMPILE DYNAMICO " 
     268    echo >> $outfile ; echo " NOW COMPILE DYNAMICO"   >> $outfile  
     269     
     270    if [ -d $modipsl/config/ICOLMDZOR_v7/SOURCES/DYNAMICO ] ; then 
     271        cd $modipsl/config/ICOLMDZOR_v7/SOURCES/DYNAMICO 
     272        for dir in $( find . -mindepth 1 -maxdepth 1 -type d ); do 
     273            for file in $( find $dir -type f ! -path '*.svn*' ); do 
     274                echo cp $file $modipsl/modeles/DYNAMICO/$file >> $outfile  
     275                cp $file $modipsl/modeles/DYNAMICO/$file  >> $outfile 2>&1 
     276            done 
     277        done 
     278        cd $modipsl/modeles/DYNAMICO 
     279    fi 
     280 
     281    echo ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna    >> $outfile  
     282    ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna    >> $outfile 2>&1 
     283    # Test if compiling finished 
     284    if [[ $? != 0 ]] ; then 
     285        echo "THERE IS A PROBLEM IN DYNAMICO COMPILATION - STOP" 
     286        exit 
     287    fi 
     288 
     289    ## 2.6 Compile interface ICOSA_LMDZ 
     290    cd $modipsl/modeles/ICOSA_LMDZ 
     291    echo; echo "NOW COMPILE ICOSA_LMDZ " 
     292    echo >> $outfile ; echo " NOW COMPILE ICOSA_LMDZ"   >> $outfile  
     293     
     294    if [ -d $modipsl/config/ICOLMDZOR_v7/SOURCES/ICOSA_LMDZ ] ; then 
     295        cd $modipsl/config/ICOLMDZOR_v7/SOURCES/ICOSA_LMDZ 
     296        for dir in $( find . -mindepth 1 -maxdepth 1 -type d ); do 
     297            for file in $( find $dir -type f ! -path '*.svn*' ); do 
     298                echo cp $file $modipsl/modeles/ICOSA_LMDZ/$file >> $outfile  
     299                cp $file $modipsl/modeles/ICOSA_LMDZ/$file  >> $outfile 2>&1 
     300            done 
     301        done 
     302        cd $modipsl/modeles/ICOSA_LMDZ 
     303    fi 
     304     
     305    echo ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna    >> $outfile  
     306    ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna    >> $outfile 2>&1 
     307    # Test if compiling finished 
     308    if [[ $? != 0 ]] ; then 
     309        echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION - STOP" 
     310        exit 
     311    fi 
     312    # Move executables to modipsl/bin 
     313    if [ $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe ] ; then  
     314        mv $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe $modipsl/bin/icosa_lmdz_${optmode}.exe 
     315    else 
     316        echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION EXECUTABLE MISSING - STOP" 
     317        exit 
     318    fi 
     319     
     320fi  
     321 
     322## 2.7 Compile LMDZ for regular latlon configuration 
     323 
     324# Find executable suffix 
     325if [ $parallel == seq ] || [ $parallel == none ] ; then 
     326    suffix=_${resol_atm}_phylmd_seq_orch.e 
     327else 
     328    suffix=_${resol_atm}_phylmd_para_mem_orch.e 
     329fi 
     330echo gcm suffix = $suffix 
     331 
     332 
     333if [ $ico_only = no ] && [ $ce0l_only = no ]; then 
     334 
     335    cd $modipsl/modeles/LMDZ 
     336    # Compile LMDZ regular lat-lon exectuable 
     337    echo; echo "NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}" 
     338    echo >> $outfile ; echo " NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}"   >> $outfile  
     339 
     340    # Check if the compilation of LMDZ was previsouly interupted prematured.  
     341    # In that case, the files dimension.h and .lock exist. If the files exist, they are here removed to avoid makelmdz_fcm  
     342    # to ask question and wait for interactivly answer from the user. 
     343    if [ -f libf/grid/dimensions.h ] || [ -f .lock ] ; then 
     344        echo >> $outfile 
     345        echo " WARNING!! The file LMDZ/libf/grid/dimension.h and/or the LMDZ/.lock exist. "   >> $outfile 
     346        echo "           This means that the compilation is either currently on going in another terminal was previous interupted before the end."   >> $outfile 
     347        echo "           The files dimension.h and .lock will now be removed. "   >> $outfile 
     348        echo >> $outfile 
     349        rm -f libf/grid/dimensions.h 
     350        rm -f .lock 
     351    fi 
    320352    echo ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_lmdz gcm    >> $outfile  
    321353         ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_lmdz gcm    >> $outfile 2>&1 
     
    326358    fi 
    327359 
     360 
     361    # Move executables to modipsl/bin folder 
     362    echo "Move gcm.e  executable to modipsl/bin" 
     363    if [ -f $modipsl/modeles/LMDZ/bin/gcm${suffix} ] ;  then 
     364        mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${optmode}.e 
     365    else 
     366        echo "ERROR gcm${suffix} executable does not exist."  
     367        echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP" 
     368        exit 
     369    fi 
     370 
     371fi  
     372 
     373 
     374if [ $ce0l_only = yes ] || [ $ico_only = no ] && [ $reg_only = no ] ; then  
     375 
     376    cd $modipsl/modeles/LMDZ 
     377 
    328378    # Compile ce0l initialization program for LMDZ regular lat-lon exectuable 
    329379    echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}" 
     
    338388    fi 
    339389 
    340     # Find executable suffix 
    341     if [ $parallel == seq ] || [ $parallel == none ] ; then 
    342         suffix=_${resol_atm}_phylmd_seq_orch.e 
    343     else 
    344         suffix=_${resol_atm}_phylmd_para_mem_orch.e 
    345     fi 
    346     echo gcm suffix = $suffix 
    347      
    348390    # Move executables to modipsl/bin folder 
    349     echo "Move gcm.e and ce0l executable to modipsl/bin" 
    350     if [ -f $modipsl/modeles/LMDZ/bin/gcm${suffix} ] ;  then 
    351         mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${optmode}.e 
    352     else 
    353         echo "ERROR gcm${suffix} executable does not exist."  
    354         echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP" 
    355         exit 
    356     fi 
    357  
     391    echo "Move ce0l.e  executable to modipsl/bin" 
    358392    if [ -f $modipsl/modeles/LMDZ/bin/ce0l${suffix} ] ;  then 
    359393        mv $modipsl/modeles/LMDZ/bin/ce0l${suffix} $modipsl/bin/ce0l_${resol_atm}_${optmode}.e 
     
    363397        exit 
    364398    fi 
    365 fi 
     399 
     400fi  
     401 
    366402 
    367403 
Note: See TracChangeset for help on using the changeset viewer.