Changeset 4643


Ignore:
Timestamp:
08/09/19 18:35:04 (5 years ago)
Author:
jgipsl
Message:

Homogenization of compilation scripts

Location:
CONFIG/UNIFORM/v6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CONFIG/UNIFORM/v6/IPSLCM6.2/compile_ipslcm6.sh

    r4642 r4643  
    334334echo >> $outfile 
    335335suffix=_${resol_atm}_phylmd_para_mem_orch_couple.e 
    336 echo gcm.e suffix = $suffix 
     336echo gcm suffix = $suffix 
    337337 
    338338if [ -f $modipsl/modeles/LMDZ/bin/gcm${suffix} ] ;  then  
  • CONFIG/UNIFORM/v6/LMDZOR_v6.2/compile_lmdzor.sh

    r4622 r4643  
    1818# Resolution of LMDZ in regular mode 
    1919resol_atm=144x142x79 
     20# Also compile ce0l subprogram to LMDZ (y/n) 
     21ce0l=y 
    2022 
    2123# fcm_arch 
     
    2527export fcm_arch parallel xios 
    2628full_flag="" 
     29full_xios="" 
     30full_lmdz="" 
     31full_orch="" 
     32 
    2733# Default netcdf_lib is used for XIOS but can be change by argument 
    2834netcdf_lib="" 
     
    3238outfile=$submitdir/out_compile_lmdzor.$datestr 
    3339echo > $outfile 
    34 echo; echo "Text output from compilation will be stored in file out_compile_lmdzor"; echo  
     40echo; echo "Text output from compilation will be stored in file out_compile_lmdzor.$datestr"; echo  
    3541 
    3642#### Read arguments  
     
    3844while (($# > 0)) ; do 
    3945    case $1 in 
    40         "-h") cat <<fin 
    41  
     46        "-h") cat <<end_help 
    4247######################################################################## 
    4348# Usage of the script compile_lmdzor.sh 
     
    6267./compile_lmdzor.sh -resol_atm 96x95x79 
    6368 
    64 fin 
    65             exit;; 
    66  
    67         "-parallel") 
    68             parallel=$2 ; shift ; shift ;;  
    69          
    70         "-arch") 
    71             fcm_arch="$2" ; shift ; shift ;; 
    72          
    73         "-xios") 
    74             xios="$2" ; shift ; shift ;; 
    75          
    76         "-debug") 
    77             optmode=debug ; shift ;; 
    78  
    79         "-dev") 
    80             optmode=dev ; shift ;; 
    81  
    82         "-prod") 
    83             optmode=prod ; shift ;; 
    84  
    85         "-resol_atm") 
    86             resol_atm=$2 ; shift ; shift ;; 
    87          
    88         "-full") 
    89             full_flag="-full"; shift ;; 
    90          
    91         "-netcdf_lib_seq") 
    92             netcdf_lib="--netcdf_lib netcdf4_seq"; shift ;; 
    93  
    94         *) 
    95             echo "unknown option "$2" , exiting..." 
    96             exit  
     69end_help 
     70exit;; 
     71        "-parallel")        parallel=$2 ; shift ; shift ;;  
     72        "-arch")            fcm_arch="$2" ; shift ; shift ;; 
     73        "-xios")            xios="$2" ; shift ; shift ;; 
     74        "-debug")           optmode=debug ; shift ;; 
     75        "-dev")             optmode=dev ; shift ;; 
     76        "-prod")            optmode=prod ; shift ;; 
     77        "-resol_atm")       resol_atm=$2 ; shift ; shift ;; 
     78        "CE0L")             ce0l=y ; shift ;; 
     79        "-full")            full_flag="-full"; shift ;; 
     80        "-full")            full_flag="-full"; full_xios="--full" ; full_lmdz="-full" ; full_orch="-full" ; shift ;; 
     81        "-full_xios")       full_xios="--full" ; shift ;;  # Note only full_xios is using double dash: --full 
     82        "-full_lmdz")       full_lmdz="-full"  ; shift ;; 
     83        "-full_orch")       full_orch="-full"  ; shift ;; 
     84        "-netcdf_lib_seq")  netcdf_lib="--netcdf_lib netcdf4_seq"; shift ;; 
     85        *)                  echo "unknown option "$2" , exiting..." ; exit  
    9786    esac 
    9887done 
    9988 
    100 echo "Following arguments are set in current compiling:" >> $outfile  
    101 echo "   optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch, full_flag=$full_flag resol_atm=${resol_atm}" >> $outfile  
     89echo "Following options are set in current compiling:" >> $outfile  
     90echo "   resol_atm=${resol_atm}" >> $outfile  
     91echo "   ce0l=${ce0l}" >> $outfile  
     92echo "   optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch " >> $outfile  
     93echo "   full_flag=$full_flag, full_xios=$full_xios, full_lmdz=$full_lmdz, full_orch=$full_orch" >> $outfile  
     94echo "   parallel = $parallel, fcm_arch = $fcm_arch" >> $outfile  
    10295echo >> $outfile 
    10396 
     
    171164echo; echo "NOW COMPILE XIOS" 
    172165echo >> $outfile ; echo " NOW COMPILE XIOS"   >> $outfile  
    173 echo ./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_flag   >> $outfile  
    174      ./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_flag   >> $outfile 2>&1 
     166echo ./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_xios   >> $outfile  
     167     ./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_xios   >> $outfile 2>&1 
    175168# Test if compiling succeded  
    176169if [[ $? != 0 ]] ; then  
     
    192185echo >> $outfile ; echo " NOW COMPILE ORCHIDEE"   >> $outfile  
    193186 
    194 echo    ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_flag -driver   >> $outfile  
    195         ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_flag -driver    >> $outfile 2>&1 
     187echo    ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch -driver   >> $outfile  
     188        ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch -driver    >> $outfile 2>&1 
    196189# Test if compiling finished 
    197190if [[ $? != 0 ]] ; then 
     
    199192    exit 
    200193fi 
     194 
     195# Rename executables to contain $optmode 
     196if [ -f $modipsl/bin/orchidee_ol ] ; then mv $modipsl/bin/orchidee_ol  $modipsl/bin/orchidee_ol_${optmode} ; fi 
     197if [ -f $modipsl/bin/orchideedriver ] ; then mv $modipsl/bin/orchideedriver  $modipsl/bin/orchideedriver_${optmode} ; fi 
    201198 
    202199 
     
    220217fi 
    221218 
    222 echo ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_flag gcm    >> $outfile  
    223 ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_flag gcm    >> $outfile 2>&1 
     219echo ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile  
     220./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile 2>&1 
    224221# Test if compiling finished 
    225222if [[ $? != 0 ]] ; then 
     
    228225fi 
    229226 
    230 # Compile ce0l initialization program for LMDZ regular lat-lon exectuable 
    231 echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}" 
    232 echo >> $outfile ; echo " NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"   >> $outfile  
    233      
    234 echo ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_flag ce0l    >> $outfile  
    235 ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_flag ce0l    >> $outfile 2>&1 
    236 # Test if compiling finished 
    237 if [[ $? != 0 ]] ; then 
    238     echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP" 
    239     exit 
    240 fi 
     227# Move executables to modipsl/bin folder 
     228echo >> $outfile 
     229echo "Move gcm.e executable to modipsl/bin" >> $outfile 
     230echo ls -lrt $modipsl/modeles/LMDZ/bin   >> $outfile 
     231ls -lrt $modipsl/modeles/LMDZ/bin  >> $outfile 
     232echo >> $outfile 
    241233 
    242234# Find executable suffix 
    243235if [ $parallel == seq ] || [ $parallel == none ] ; then 
    244     suffix=_${resol_atm}_phylmd_seq_orch 
     236    suffix=_${resol_atm}_phylmd_seq_orch.e 
    245237else 
    246     suffix=_${resol_atm}_phylmd_para_mem_orch 
    247 fi 
    248 echo suffix = $suffix 
    249  
    250 # Move executables to modipsl/bin folder 
    251 echo "Move gcm.e and ce0l executable to modipsl/bin" 
    252 if [ -f $modipsl/modeles/LMDZ/bin/gcm${suffix}.e ] ;  then mv $modipsl/modeles/LMDZ/bin/gcm${suffix}.e $modipsl/bin/gcm_${resol_atm}_${optmode}.e ; fi 
    253 if [ -f $modipsl/modeles/LMDZ/bin/ce0l${suffix}.e ] ;  then mv $modipsl/modeles/LMDZ/bin/ce0l${suffix}.e $modipsl/bin/ce0l_${resol_atm}_${optmode}.e ; fi 
     238    suffix=_${resol_atm}_phylmd_para_mem_orch.e 
     239fi 
     240echo gcm suffix = $suffix 
     241 
     242if [ -f $modipsl/modeles/LMDZ/bin/gcm${suffix} ] ;  then  
     243    mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${optmode}.e 
     244else 
     245    echo "ERROR gcm${suffix} executable does not exist."  
     246    echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP" 
     247    exit 
     248fi   
     249 
     250 
     251# Compile ce0l initialization program for LMDZ regular lat-lon exectuable 
     252if [ $ce0l == y ] ; then 
     253    echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}" 
     254    echo >> $outfile ; echo " NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"   >> $outfile  
     255     
     256    echo ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile  
     257    ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile 2>&1 
     258    # Test if compiling finished 
     259    if [[ $? != 0 ]] ; then 
     260        echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP" 
     261        exit 
     262    fi 
     263 
     264     
     265    # Move executables to modipsl/bin folder 
     266    echo >> $outfile 
     267    echo "Move ce0l.e executable to modipsl/bin" >> $outfile 
     268    echo ls -lrt $modipsl/modeles/LMDZ/bin   >> $outfile 
     269    ls -lrt $modipsl/modeles/LMDZ/bin  >> $outfile 
     270    echo >> $outfile 
     271    echo ce0l suffix = $suffix 
     272 
     273    if [ -f $modipsl/modeles/LMDZ/bin/ce0l${suffix} ] ;  then  
     274        mv $modipsl/modeles/LMDZ/bin/ce0l${suffix} $modipsl/bin/ce0l_${resol_atm}_${optmode}.e 
     275    else 
     276        echo "ERROR ce0l${suffix} executable does not exist."  
     277        echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP" 
     278        exit 
     279    fi   
     280fi 
    254281 
    255282 
    256283echo >>$outfile ; echo "ALL COMPILING FINISHED" >> $outfile 
    257 echo; echo "ALL COMPILING FINISHED" 
     284echo ls -lrt modipsl/bin >> $outfile 
     285ls -lrt $modipsl/bin >> $outfile 
     286 
     287echo; echo "ALL COMPILING FINISHED" ; echo 
     288echo "Executables are found in modipsl/bin" 
     289echo "Check that executable names correspond with the name set in config.card before launching the job" 
     290echo ls -lrt modipsl/bin 
     291ls -lrt $modipsl/bin 
    258292 
    259293date 
     294 
    260295exit 
    261  
    262  
Note: See TracChangeset for help on using the changeset viewer.