Changeset 4641


Ignore:
Timestamp:
08/05/19 12:02:20 (5 years ago)
Author:
jgipsl
Message:
  • Add option CE0L to compile ce0l from LMDZ. This is not done by default anymore. Note also that there is a problem with this compilation probably since compilation of XIOS changed by adding --use_oasis oasis3_mct
  • Add individual full options per component.
  • Corrected full option for XIOS
  • compressed lines for reading options


  • test if gcm.e executable exist and set error message if so because first error message after makelmdz_fcm does not work for all cases.
File:
1 edited

Legend:

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

    r4629 r4641  
    2424# Version ESM CO2: CO2 interactif ocean/atmosphere (y/n) 
    2525esmco2=n 
     26# Also compile ce0l subprogram to LMDZ (y/n) 
     27ce0l=n 
    2628 
    2729# Optimization mode 
     
    3537full_flag="" 
    3638full_nemo=n 
    37 # Default netcdf_lib is used for XIOS but can be change by argument 
    38 netcdf_lib="" 
     39full_xios="" 
     40full_lmdz="" 
     41full_orch="" 
     42 
     43 
    3944 
    4045# Output text file for compilation of each component 
     
    4247outfile=$submitdir/out_compile_ipslcm6.$datestr 
    4348echo > $outfile 
    44 echo; echo "Text output from compilation will be stored in file out_compile_ipslcm6"; echo  
     49echo; echo "Text output from compilation will be stored in file out_compile_ipslcm6.$datestr"; echo  
    4550 
    4651#### Read arguments  
     
    4853while (($# > 0)) ; do 
    4954    case $1 in 
    50         "-h") cat <<fin 
    51  
     55        "-h") cat <<end_help 
    5256######################################################################## 
    5357# Usage of the script compile_ipslcm6.sh 
     
    8589./compile_ipslcm6.sh MR025 -debug -full 
    8690 
    87 fin 
    88             exit;; 
    89  
    90    "VLR") 
    91         resol_atm=96x95x39; resol_oce=ORCA2 ; icemodel=lim2; oceanbio=y; shift ;; 
    92  
    93     "LR") 
    94         resol_atm=144x142x79; resol_oce=ORCA1 ; icemodel=lim3; oceanbio=y; shift ;; 
    95  
    96     "MR1") 
    97         resol_atm=256x256x79; resol_oce=ORCA1 ; icemodel=lim3; oceanbio=y; shift ;; 
    98  
    99     "MR025") 
    100         resol_atm=256x256x79; resol_oce=ORCA025 ; icemodel=lim3; oceanbio=n;   shift ;; 
    101  
    102     "ESMCO2") 
    103             esmco2=y;  shift ;;  
    104  
    105         "-parallel") 
    106             parallel=$2 ; shift ; shift ;;  
    107          
    108         "-arch") 
    109             fcm_arch="$2" ; shift ; shift ;; 
    110          
    111         "-debug") 
    112             optmode=debug ; shift ;; 
    113  
    114         "-dev") 
    115             optmode=dev ; shift ;; 
    116  
    117         "-prod") 
    118             optmode=prod ; shift ;; 
    119  
    120     "-full") 
    121         full_flag="-full"; full_nemo=y ; shift ;; 
    122  
    123     "-cleannemo") 
    124         full_nemo=y ; shift ;; 
    125          
    126         "-netcdf_lib_seq") 
    127             netcdf_lib="--netcdf_lib netcdf4_seq"; shift ;; 
    128  
    129         *) 
    130             echo "unknown option "$2" , exiting..." 
    131             exit  
     91end_help 
     92exit;; 
     93        "VLR")         resol_atm=96x95x39; resol_oce=ORCA2 ; icemodel=lim2; oceanbio=y; shift ;; 
     94        "LR")          resol_atm=144x142x79; resol_oce=ORCA1 ; icemodel=lim3; oceanbio=y; shift ;; 
     95        "MR1")         resol_atm=256x256x79; resol_oce=ORCA1 ; icemodel=lim3; oceanbio=y; shift ;; 
     96        "MR025")       resol_atm=256x256x79; resol_oce=ORCA025 ; icemodel=lim3; oceanbio=n;   shift ;; 
     97        "ESMCO2")      esmco2=y;  shift ;;  
     98        "CE0L")        ce0l=y ; shift ;; 
     99        "-parallel")   parallel=$2 ; shift ; shift ;;  
     100        "-arch")       fcm_arch="$2" ; shift ; shift ;; 
     101        "-debug")      optmode=debug ; shift ;; 
     102        "-dev")        optmode=dev ; shift ;; 
     103        "-prod")       optmode=prod ; shift ;; 
     104        "-full")       full_flag="-full"; full_nemo=y ; full_xios="--full" ; full_lmdz="-full" ; full_orch="-full" ; shift ;; 
     105        "-full_xios")  full_xios="--full" ; shift ;;  # Note only full_xios is using double dash: --full 
     106        "-full_lmdz")  full_lmdz="-full"  ; shift ;; 
     107        "-full_orch")  full_orch="-full"  ; shift ;; 
     108        "-full_nemo")  full_nemo=y ; shift ;; 
     109        "-cleannemo")  full_nemo=y ; shift ;; 
     110        *)             echo "unknown option "$2" , exiting..." ; exit 
    132111    esac 
    133112done 
    134113 
    135 echo "Following options are set in current compiling:" >> $outfile  
    136 echo "   resol_atm=${resol_atm}, resol_oce=${resol_oce}, icemodel=${icemodel}, withpisces=${pisces}" >> $outfile  
     114echo "Following options are set in current compiling:" >> $outfile 
     115echo "   resol_atm=${resol_atm}, resol_oce=${resol_oce}, icemodel=${icemodel}, oceanbio=${oceanbio}" >> $outfile  
    137116echo "   esmco2=${esmco2}" >> $outfile  
    138 echo "   optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch, full_flag=$full_flag" >> $outfile  
     117echo "   ce0l=${ce0l}" >> $outfile  
     118echo "   optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch " >> $outfile  
     119echo "   full_flag=$full_flag, full_xios=$full_xios, full_lmdz=$full_lmdz, full_orch=$full_orch, full_nemo=$full_nemo," >> $outfile  
    139120echo >> $outfile 
    140121 
     
    218199echo; echo "NOW COMPILE XIOS" 
    219200echo >> $outfile ; echo " NOW COMPILE XIOS"   >> $outfile  
    220 echo ./make_xios --use_oasis oasis3_mct --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_flag   >> $outfile  
    221      ./make_xios --use_oasis oasis3_mct --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_flag   >> $outfile 2>&1 
     201echo ./make_xios --use_oasis oasis3_mct --$optmode --arch $fcm_arch --arch_path $arch_path --job 4 $full_xios   >> $outfile  
     202     ./make_xios --use_oasis oasis3_mct --$optmode --arch $fcm_arch --arch_path $arch_path --job 4 $full_xios   >> $outfile 2>&1 
    222203# Test if compiling succeded  
    223204if [[ $? != 0 ]] ; then  
     
    239220echo >> $outfile ; echo " NOW COMPILE ORCHIDEE"   >> $outfile  
    240221 
    241 echo    ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_flag   >> $outfile  
    242         ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_flag   >> $outfile 2>&1 
     222echo    ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch   >> $outfile  
     223        ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch   >> $outfile 2>&1 
    243224# Test if compiling finished 
    244225if [[ $? != 0 ]] ; then 
     
    288269 
    289270if [ $full_nemo == y ] ; then 
    290    # To make a full compilation, first clean all what has been produced during previous compilation 
     271   # To make a full compilation, first make a clean to remove all files produced during previous compilation 
    291272   echo ./makenemo -m ${fcm_arch} -n $cfg_wrk clean   >> $outfile 
    292273   echo >> $outfile 
     
    333314fi 
    334315 
    335 echo ./makelmdz_fcm -d ${resol_atm} -c OMCT -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_flag gcm    >> $outfile  
    336      ./makelmdz_fcm -d ${resol_atm} -c OMCT -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 
     316echo ./makelmdz_fcm -d ${resol_atm} -c OMCT -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile  
     317     ./makelmdz_fcm -d ${resol_atm} -c OMCT -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 
    337318# Test if compiling finished 
    338319if [[ $? != 0 ]] ; then 
     
    341322fi 
    342323 
    343 # Compile ce0l initialization program for LMDZ regular lat-lon exectuable 
    344 echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}" 
    345 echo >> $outfile ; echo " NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"   >> $outfile  
    346      
    347 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  
    348 ./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 
    349 # Test if compiling finished 
    350 if [[ $? != 0 ]] ; then 
    351     echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP" 
    352     exit 
    353 fi 
    354  
    355 # Find executable suffix 
    356 if [ $parallel == seq ] || [ $parallel == none ] ; then 
    357     suffix=_${resol_atm}_phylmd_seq_orch 
    358 else 
    359     suffix=_${resol_atm}_phylmd_para_mem_orch 
    360 fi 
    361 echo suffix = $suffix 
    362  
    363324# Move executables to modipsl/bin folder 
    364325echo >> $outfile 
    365 echo "Move gcm.e and ce0l executable to modipsl/bin" >> $outfile 
     326echo "Move gcm.e executable to modipsl/bin" >> $outfile 
    366327echo ls -lrt $modipsl/modeles/LMDZ/bin   >> $outfile 
    367328ls -lrt $modipsl/modeles/LMDZ/bin  >> $outfile 
    368329echo >> $outfile 
    369  
    370 if [ -f $modipsl/modeles/LMDZ/bin/gcm${suffix}_couple.e ] ;  then mv $modipsl/modeles/LMDZ/bin/gcm${suffix}_couple.e $modipsl/bin/gcm_${resol_atm}_${optmode}.e ; fi 
    371 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 
    372  
     330suffix=_${resol_atm}_phylmd_para_mem_orch_couple.e 
     331echo gcm.e suffix = $suffix 
     332 
     333if [ -f $modipsl/modeles/LMDZ/bin/gcm${suffix} ] ;  then  
     334    mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${optmode}.e 
     335else 
     336    echo "ERROR gcm${suffix} executable does not exist."  
     337    echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP" 
     338    exit 
     339fi   
     340 
     341 
     342# Compile ce0l initialization program for LMDZ regular lat-lon exectuable 
     343if [ $ce0l == y ] ; then 
     344    echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}" 
     345    echo >> $outfile ; echo " NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"   >> $outfile  
     346     
     347    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  
     348    ./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 
     349    # Test if compiling finished 
     350    if [[ $? != 0 ]] ; then 
     351        echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP" 
     352        exit 
     353    fi 
     354 
     355 
     356    # Move executables to modipsl/bin folder 
     357    echo >> $outfile 
     358    echo "Move ce0l.e executable to modipsl/bin" >> $outfile 
     359    echo ls -lrt $modipsl/modeles/LMDZ/bin   >> $outfile 
     360    ls -lrt $modipsl/modeles/LMDZ/bin  >> $outfile 
     361    echo >> $outfile 
     362    suffix=_${resol_atm}_phylmd_para_mem_orch.e 
     363    echo ce0l suffix = $suffix 
     364 
     365    if [ -f $modipsl/modeles/LMDZ/bin/ce0l${suffix} ] ;  then  
     366        mv $modipsl/modeles/LMDZ/bin/ce0l${suffix} $modipsl/bin/ce0l_${resol_atm}_${optmode}.e 
     367    else 
     368        echo "ERROR ce0l${suffix} executable does not exist."  
     369        echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP" 
     370        exit 
     371    fi   
     372fi 
    373373 
    374374echo >>$outfile ; echo "ALL COMPILING FINISHED" >> $outfile 
Note: See TracChangeset for help on using the changeset viewer.