Ignore:
Timestamp:
02/10/20 15:10:20 (4 years ago)
Author:
jgipsl
Message:

Homogenization of v6.2 and v7. Main difference in compilation:

  • option -optmode has been removed. Instead use one of following: -prod, -dev or -debug
  • the name of the executable now contains the optimization mode used while compiling. In config.card, if compiling with -dev or -debug, OptMode? in the beginning of config.card must be changed accordingly.
File:
1 edited

Legend:

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

    r4663 r4921  
    1818optmode=prod 
    1919# Resolution if compiling LMDZ in regular mode without DYNAMICO 
    20 # Use for example following "./compile_icolmdzor.sh -regular_lonlat 144x142x79" 
     20# Use for example following "./compile_icolmdzor.sh -regular_latlon 144x142x79" 
    2121regular_latlon=no 
    2222# fcm_arch 
     
    2626export fcm_arch parallel xios 
    2727full_flag="" 
     28full_xios="" 
     29full_lmdz="" 
     30full_orch="" 
     31full_dyna="" 
     32 
    2833# Default netcdf_lib is used for XIOS but can be change by argument 
    2934netcdf_lib="" 
     
    3237datestr=`LC_ALL=C date +"%Y%m%dT%H%M"` 
    3338outfile=$submitdir/out_compile_icolmdzor.$datestr 
    34 rm -f $outfile; echo > $outfile 
     39echo > $outfile 
    3540echo; echo "Text output from compilation will be stored in file out_compile_icolmdzor.$datestr"; echo  
    3641 
     
    3944while (($# > 0)) ; do 
    4045    case $1 in 
    41         "-h") cat <<fin 
     46        "-h") cat <<end_help 
    4247 
    4348######################################################################## 
     
    6368./compile_icolmdzor.sh -regular_latlon 144x142x79 
    6469 
    65 fin 
     70end_help 
    6671            exit;; 
    6772 
    68         "-parallel") 
    69             parallel=$2 ; shift ; shift ;;  
    70          
    71         "-arch") 
    72             fcm_arch="$2" ; shift ; shift ;; 
    73          
    74         "-xios") 
    75             xios="$2" ; shift ; shift ;; 
    76          
    77         "-optmode") 
    78             optmode=$2 ; shift ; shift ;; 
    79  
    80         "-debug") 
    81             optmode=debug ; shift ;; 
    82  
    83         "-dev") 
    84             optmode=dev ; shift ;; 
    85  
    86         "-prod") 
    87             optmode=prod ; shift ;; 
    88  
    89         "-regular_latlon") 
    90             regular_latlon=yes ; 
    91             resol_atm_3d=$2 ; shift ; shift ;; 
    92          
    93         "-full") 
    94             full_flag="-full"; shift ;; 
    95          
    96         "-netcdf_lib_seq") 
    97             netcdf_lib="--netcdf_lib netcdf4_seq"; shift ;; 
    98  
    99         *) 
    100             echo "unknown option "$2" , exiting..." 
    101             exit  
     73        "-parallel")        parallel=$2 ; shift ; shift ;;  
     74        "-arch")            fcm_arch="$2" ; shift ; shift ;; 
     75        "-xios")            xios="$2" ; shift ; shift ;; 
     76        "-debug")           optmode=debug ; shift ;; 
     77        "-dev")             optmode=dev ; shift ;; 
     78        "-prod")            optmode=prod ; shift ;; 
     79        "-regular_latlon")  regular_latlon=yes ; resol_atm=$2 ; shift ; shift ;; 
     80        "-full")            full_flag="-full"; full_xios="--full" ; full_lmdz="-full" ; full_orch="-full" ; full_dyna="-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        "-full_dyna")       full_dyna="-full"  ; shift ;; 
     85        "-netcdf_lib_seq")  netcdf_lib="--netcdf_lib netcdf4_seq"; shift ;; 
     86        *)                  echo "unknown option "$1" , exiting..." ;  exit  
    10287    esac 
    10388done 
    10489 
    105 echo "Following arguments are set in current compiling:" >> $outfile  
    106 echo "   optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch, full_flag=$full_flag regular_latlon=$regular_latlon" >> $outfile  
     90echo "Following options are set in current compiling:" >> $outfile  
     91echo "   regular_latlon=$regular_latlon (if yes, then resol_atm=${resol_atm})" >> $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, full_dyna=$full_dyna" >> $outfile  
    10794echo >> $outfile 
    10895 
     
    115102    # Find out current host and source specific paths and commands for the host 
    116103    case $( hostname -s ) in 
    117         ada*) 
    118             fcm_arch=X64_ADA;; 
     104        jean-zay*) 
     105            fcm_arch=X64_JEANZAY;; 
    119106        irene*) 
    120107            fcm_arch=X64_IRENE;; 
     
    130117fi 
    131118 
    132 # Set a link to arch.env and source the file if arch-${fcm_arch}.env file exist for current fcm_arch. 
     119# Set a link to arch.env if arch-${fcm_arch}.env file exist for current fcm_arch. 
    133120# The link arch.env is also set in config.card and will be used by libIGCM to ensure the same running environnement. 
    134121if [ -f ARCH/arch-${fcm_arch}.env ] ; then 
    135122    echo >> $outfile 
    136     echo "The file ARCH/arch-${fcm_arch}.env will now be sourced with modules needed for compilation." 
    137     echo "Note that this new environement will be kept after compilation." 
    138     echo "You might want to source again your personal environment after compilation. This must be done manually or by reconnection." 
     123    echo "The file ARCH/arch-${fcm_arch}.env will now be sourced with modules needed for compilation for all components." 
     124    echo "Note that this new environement might be kept after compilation." 
     125    echo "If this is the case, source again your personal environment after compilation." 
    139126    echo " Personal module list before sourcing of ARCH/arch.env file:"    >> $outfile  
    140127    module list   >> $outfile 2>&1 
    141128 
     129    # Make a link to this file, to be used also in config.card 
    142130    rm -f ARCH/arch.env 
    143131    ln -s arch-${fcm_arch}.env ARCH/arch.env 
     132 
     133    # Source the file 
    144134    source ARCH/arch.env   >> $outfile 2>&1 
    145135 
     
    167157echo; echo "NOW COMPILE XIOS" 
    168158echo >> $outfile ; echo " NOW COMPILE XIOS"   >> $outfile  
    169 echo ./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_flag   >> $outfile  
    170      ./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_flag   >> $outfile 2>&1 
     159echo ./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_xios   >> $outfile  
     160     ./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_xios   >> $outfile 2>&1 
    171161# Test if compiling succeded  
    172162if [[ $? != 0 ]] ; then  
     
    175165fi 
    176166# Move executables to modipsl/bin 
    177 if [ $modipsl/modeles/XIOS/bin/xios_server.exe ] ; then  
    178     mv $modipsl/modeles/XIOS/bin/xios_server.exe $modipsl/bin/. 
     167if [ -f $modipsl/modeles/XIOS/bin/xios_server.exe ] ; then  
     168    mv $modipsl/modeles/XIOS/bin/xios_server.exe $modipsl/bin/xios_server_${optmode}.exe 
    179169else 
    180170    echo "THERE IS A PROBLEM IN XIOS COMPILATION EXECUTABLE MISSING - STOP" 
     
    188178echo >> $outfile ; echo " NOW COMPILE ORCHIDEE"   >> $outfile  
    189179 
    190 echo    ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} $full_flag    >> $outfile  
    191         ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} $full_flag    >> $outfile 2>&1 
     180echo    ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch    >> $outfile  
     181        ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch    >> $outfile 2>&1 
    192182# Test if compiling finished 
    193183if [[ $? != 0 ]] ; then 
     
    195185    exit 
    196186fi 
     187 
     188# If orchide driver executables have been compiled (option -driver), then rename executables to contain $optmode 
     189if [ -f $modipsl/bin/orchidee_ol ] ; then mv $modipsl/bin/orchidee_ol  $modipsl/bin/orchidee_ol_${optmode} ; fi 
     190if [ -f $modipsl/bin/orchideedriver ] ; then mv $modipsl/bin/orchideedriver  $modipsl/bin/orchideedriver_${optmode} ; fi 
     191 
    197192 
    198193## 2.4 Compile lmdz 
     
    215210fi 
    216211 
    217 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_flag    >> $outfile  
    218      ./makelmdz_fcm -p lmd -rrtm true -cosp true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_flag    >> $outfile 2>&1 
     212echo ./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  
     213     ./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 
    219214# Test if compiling finished 
    220215if [[ $? != 0 ]] ; then 
     
    229224echo >> $outfile ; echo " NOW COMPILE DYNAMICO"   >> $outfile  
    230225 
    231 echo ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_flag    >> $outfile  
    232      ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_flag    >> $outfile 2>&1 
     226echo ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna    >> $outfile  
     227     ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna    >> $outfile 2>&1 
    233228# Test if compiling finished 
    234229if [[ $? != 0 ]] ; then 
     
    242237echo >> $outfile ; echo " NOW COMPILE ICOSA_LMDZ"   >> $outfile  
    243238 
    244 echo ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_flag    >> $outfile  
    245      ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_flag    >> $outfile 2>&1 
     239echo ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna    >> $outfile  
     240     ./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 
    246241# Test if compiling finished 
    247242if [[ $? != 0 ]] ; then 
     
    251246# Move executables to modipsl/bin 
    252247if [ $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe ] ; then  
    253     mv $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe $modipsl/bin/.  
     248    mv $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe $modipsl/bin/icosa_lmdz_${optmode}.exe 
    254249else 
    255250    echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION EXECUTABLE MISSING - STOP" 
     
    264259    cd $modipsl/modeles/LMDZ 
    265260    # Compile LMDZ regular lat-lon exectuable 
    266     echo; echo "NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm_3d}" 
    267     echo >> $outfile ; echo " NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm_3d}"   >> $outfile  
     261    echo; echo "NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}" 
     262    echo >> $outfile ; echo " NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}"   >> $outfile  
    268263 
    269264    # Check if the compilation of LMDZ was previsouly interupted prematured.  
     
    279274        rm -f .lock 
    280275    fi 
    281     echo ./makelmdz_fcm -d ${resol_atm_3d} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_flag gcm    >> $outfile  
    282          ./makelmdz_fcm -d ${resol_atm_3d} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_flag gcm    >> $outfile 2>&1 
     276    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  
     277         ./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 
    283278    # Test if compiling finished 
    284279    if [[ $? != 0 ]] ; then 
     
    288283 
    289284    # Compile ce0l initialization program for LMDZ regular lat-lon exectuable 
    290     echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm_3d}" 
    291     echo >> $outfile ; echo " NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm_3d}"   >> $outfile  
    292  
    293     echo ./makelmdz_fcm -d ${resol_atm_3d} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_flag ce0l    >> $outfile  
    294          ./makelmdz_fcm -d ${resol_atm_3d} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_flag ce0l    >> $outfile 2>&1 
     285    echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}" 
     286    echo >> $outfile ; echo " NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"   >> $outfile  
     287 
     288    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 ce0l    >> $outfile  
     289         ./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 ce0l    >> $outfile 2>&1 
    295290    # Test if compiling finished 
    296291    if [[ $? != 0 ]] ; then 
     
    301296    # Find executable suffix 
    302297    if [ $parallel == seq ] || [ $parallel == none ] ; then 
    303         suffix=_${resol_atm_3d}_phylmd_seq_orch 
     298        suffix=_${resol_atm}_phylmd_seq_orch.e 
    304299    else 
    305         suffix=_${resol_atm_3d}_phylmd_para_mem_orch 
    306     fi 
    307     echo suffix = $suffix 
     300        suffix=_${resol_atm}_phylmd_para_mem_orch.e 
     301    fi 
     302    echo gcm suffix = $suffix 
    308303     
    309304    # Move executables to modipsl/bin folder 
    310305    echo "Move gcm.e and ce0l executable to modipsl/bin" 
    311     if [ $modipsl/modeles/LMDZ/bin/gcm${suffix}.e ] ;  then mv $modipsl/modeles/LMDZ/bin/gcm${suffix}.e $modipsl/bin/gcm_${resol_atm_3d}.e ; fi 
    312     if [ $modipsl/modeles/LMDZ/bin/ce0l${suffix}.e ] ;  then mv $modipsl/modeles/LMDZ/bin/ce0l${suffix}.e $modipsl/bin/ce0l_${resol_atm_3d}.e ; fi 
    313  
    314     # Write .resol file 
    315     cd $submitdir    
    316     resol2D=$( echo ${resol_atm_3d} | awk '-Fx' '{print $1}' )$( echo ${resol_atm_3d} | awk '-Fx' '{print $2}' ) 
    317     echo "noORCAxLMD$resol2D" >.resol 
    318     echo "RESOL_ATM_3D=${resol_atm_3d}" >>.resol 
     306    if [ -f $modipsl/modeles/LMDZ/bin/gcm${suffix} ] ;  then 
     307        mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${optmode}.e 
     308    else 
     309        echo "ERROR gcm${suffix} executable does not exist."  
     310        echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP" 
     311        exit 
     312    fi 
     313 
     314    if [ -f $modipsl/modeles/LMDZ/bin/ce0l${suffix} ] ;  then 
     315        mv $modipsl/modeles/LMDZ/bin/ce0l${suffix} $modipsl/bin/ce0l_${resol_atm}_${optmode}.e 
     316    else 
     317        echo "ERROR ce0l${suffix} executable does not exist."  
     318        echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP" 
     319        exit 
     320    fi 
    319321fi 
    320322 
Note: See TracChangeset for help on using the changeset viewer.