Changeset 4611 for CONFIG/UNIFORM


Ignore:
Timestamp:
07/10/19 09:14:20 (5 years ago)
Author:
cetlod
Message:

Improvment of compilation script : Add NEMO configurations & OASIS-MCT. Still a preliminary version

File:
1 edited

Legend:

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

    r4472 r4611  
    1111modipsl=$submitdir/../.. 
    1212arch_path=$submitdir/ARCH  
     13mysrc_path=$submitdir/SOURCES 
    1314 
    1415#### Set default options  
     
    1819resol_oce=ORCA1 
    1920# Version of ice model lim2/lim3 
    20 version_lim=lim3 
     21icemodel=lim3 
     22# Coupled with ocean biogeochemistry (y/n) 
     23oceanbio=y 
    2124# Version ESM CO2: CO2 interactif ocean/atmosphere (y/n) 
    2225esmco2=n 
     
    3134export fcm_arch parallel xios 
    3235full_flag="" 
     36full_nemo=n 
    3337# Default netcdf_lib is used for XIOS but can be change by argument 
    3438netcdf_lib="" 
     
    5357 
    5458 
    55 Options: [LR / VLR / MR025] Model resolution, choose only one. Default: LR. 
     59Options: [LR / VLR / MR1 / MR025] Model resolution, choose only one. Default: LR. 
    5660         [ESMCO2] Compile IPSLCM6 for CO2 interactif ocean/atmosphere. 
    5761         [-full] Full recompilation of all components. This option can be added to all other options. 
     62         [-cleannemo] Full recompilation of NEMO component  only. 
    5863         [-debug / -dev / -prod] Level of optimization. One of these can be added to all other compile options. Default: -prod. 
    5964 
     
    6873 
    6974Example 3: Compilation of IPSLCM6 for ESM CO2 
    70 ./compile_ipslcm6.sh ESMCO2 
     75./compile_ipslcm6.sh ESMCO2 -cleannemo 
    7176 
    7277Example 4: Default resoltuion (LR) compiled in debug mode 
     
    8287            exit;; 
    8388 
    84         "VLR") 
    85             resol_atm=96x95x39; resol_oce=ORCA1 ; version_lim=lim2;  shift ;;  
    86  
    87         "LR") 
    88             resol_atm=144x142x79; resol_oce=ORCA1 ; version_lim=lim3; shift ;;  
    89  
    90         "MR025") 
    91             resol_atm=256x256x79; resol_oce=ORCA025 ; version_lim=lim3;  shift ;;  
    92  
    93         "ESMCO2") 
     89   "VLR") 
     90        resol_atm=96x95x39; resol_oce=ORCA2 ; icemodel=lim2; oceanbio=y; shift ;; 
     91 
     92    "LR") 
     93        resol_atm=144x142x79; resol_oce=ORCA1 ; icemodel=lim3; oceanbio=y; shift ;; 
     94 
     95    "MR1") 
     96        resol_atm=256x256x79; resol_oce=ORCA1 ; icemodel=lim3; oceanbio=y; shift ;; 
     97 
     98    "MR025") 
     99        resol_atm=256x256x79; resol_oce=ORCA025 ; icemodel=lim3; oceanbio=n;   shift ;; 
     100 
     101    "ESMCO2") 
    94102            esmco2=y;  shift ;;  
    95103 
     
    109117            optmode=prod ; shift ;; 
    110118 
    111         "-full") 
    112             full_flag="-full"; shift ;; 
     119    "-full") 
     120        full_flag="-full"; full_nemo=y ; shift ;; 
     121 
     122    "-cleannemo") 
     123        full_nemo=y ; shift ;; 
    113124         
    114125        "-netcdf_lib_seq") 
     
    122133 
    123134echo "Following options are set in current compiling:" >> $outfile  
    124 echo "   resol_atm=${resol_atm}, resol_oce=${resol_oce}, $version_lim=${version_lim}" >> $outfile  
     135echo "   resol_atm=${resol_atm}, resol_oce=${resol_oce}, icemodel=${icemodel}, withpisces=${pisces}" >> $outfile  
    125136echo "   esmco2=${esmco2}" >> $outfile  
    126137echo "   optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch, full_flag=$full_flag" >> $outfile  
     
    192203fi 
    193204 
    194 ## 2.2 Compile xios 
     205## 2.2 Compile oasis3-mct 
     206oasis_dir=$modipsl/oasis3-mct 
     207echo; echo "NOW COMPILE OASIS3-MCT" 
     208echo >> $outfile ; echo " NOW COMPILE OASIS3-MCT"   >> $outfile 
     209cd $oasis_dir/util/make_dir  ; cp $mysrc_path/OASIS3-MCT/make_${fcm_arch} make.inc  ; make -f TopMakefileOasis3 ; 
     210 
     211## 2.3 Compile xios 
    195212cd $modipsl/modeles/XIOS 
    196213echo; echo "NOW COMPILE XIOS" 
     
    212229 
    213230 
    214 ## 2.3 Compile orchidee 
     231## 2.4 Compile orchidee 
    215232cd $modipsl/modeles/ORCHIDEE 
    216233echo; echo "NOW COMPILE ORCHIDEE" 
     
    226243 
    227244 
    228 ## 2.4 Compile LMDZ for regular latlon configuration 
     245## 2.5 Compile NEMO 
     246nemo_root=$modipsl/modeles/NEMOGCM/CONFIG 
     247if [ ${icemodel} == lim2 ] ; then 
     248   addkeys="key_lim2_vp key_diahth key_oasis3" 
     249   delkeys="key_nosignedzero key_mpp_rep" 
     250else 
     251   addkeys="key_top key_pisces key_age key_cfc key_cpl_carbon_cycle key_gas key_oasis" 
     252   if [ ${oceanbio} == y ] ; then 
     253      if [ ${esmco2} == y ] ; then 
     254         delkeys="key_nosignedzero key_mpp_rep" 
     255      else 
     256         delkeys="key_nosignedzero key_mpp_rep key_cpl_carbon_cycle key_gas" 
     257      fi 
     258   else 
     259      delkeys="key_nosignedzero key_mpp_rep key_top key_pisces key_cfc key_age key_cpl_carbon_cycle key_gas" 
     260   fi 
     261fi 
     262 
     263if [ ${oceanbio} == n ] ; then 
     264   echo; echo "NOW COMPILE NEMO. Resolution = ${resol_oce} with icemodel ${icemodel} and without PISCES" 
     265   echo >> $outfile ; echo " NOW COMPILE NEMO. Resolution = ${resol_oce} with icemodel ${icemodel} and without PISCES"   >> $outfile 
     266else 
     267   echo; echo "NOW COMPILE NEMO. Resolution = ${resol_oce} with icemodel ${icemodel} and PISCES" 
     268   echo >> $outfile ; echo " NOW COMPILE NEMO. Resolution = ${resol_oce} with icemodel ${icemodel} and PISCES"   >> $outfile 
     269fi 
     270echo >> $outfile ; echo cd $nemo_root  >> $outfile 
     271echo >> $outfile ; echo cp $modipsl/config/IPSLCM6/SOURCES/NEMO/arch-${fcm_arch}.fcm ../ARCH/.   >> $outfile 
     272echo >> $outfile 
     273 
     274cd $nemo_root ; cp $mysrc_path/NEMO/arch-${fcm_arch}.fcm ../ARCH/. 
     275 
     276if [ ${resol_oce} == ORCA2 ]   ; then  cfg_wrk=ORCA2_LIM_PISCES    ; fi 
     277if [ ${resol_oce} == ORCA1 ]   ; then  cfg_wrk=ORCA1_LIM3_PISCES    ; fi 
     278if [ ${resol_oce} == ORCA025 ] ; then  cfg_wrk=ORCA025_LIM3_PISCES  ; fi 
     279 
     280echo cp $modipsl/config/IPSLCM6/SOURCES/NEMO/*.*90 $nemo_root/$cfg_wrk/MY_SRC/   >> $outfile 
     281echo >> $outfile 
     282cp $mysrc_path/NEMO/*.*90  $nemo_root/$cfg_wrk/MY_SRC/ 
     283 
     284if [ $full_nemo == y ] ; then 
     285   echo ./makenemo -m ${fcm_arch} -n $cfg_wrk clean   >> $outfile 
     286   echo ./makenemo -m ${fcm_arch} -n $cfg_wrk -j16 add_key "$addkeys"  del_key "$delkeys"   >> $outfile 
     287   echo >> $outfile 
     288   ./makenemo -m ${fcm_arch} -n $cfg_wrk clean  >> $outfile 2>&1 
     289   ./makenemo -m ${fcm_arch} -n $cfg_wrk -j16 add_key "$addkeys"  del_key "$delkeys"  >> $outfile 2>&1 
     290else 
     291   echo ./makenemo -m ${fcm_arch} -n $cfg_wrk -j16 add_key "$addkeys"  del_key "$delkeys"   >> $outfile 
     292   echo >> $outfile 
     293   ./makenemo -m ${fcm_arch} -n $cfg_wrk -j16 add_key "$addkeys"  del_key "$delkeys"  >> $outfile 2>&1 
     294fi 
     295 
     296# Test if compiling finished 
     297if [[ $? != 0 ]] ; then 
     298    echo "THERE IS A PROBLEM IN NEMO COMPILATION - STOP" 
     299    exit 
     300fi 
     301 
     302echo 
     303echo "copy nemo executable to modipsl/bin" 
     304if [ -f $nemo_root/$cfg_wrk/BLD/bin/nemo.exe ]                       ;  then cp $nemo_root/$cfg_wrk/BLD/bin/nemo.exe $modipsl/bin/opa     ; fi 
     305if [ -f $nemo_root/$cfg_wrk/BLD/bin/nemo.exe ] && [ ${esmco2} == y ] ;  then cp $nemo_root/$cfg_wrk/BLD/bin/nemo.exe $modipsl/bin/opa.esm ; fi 
     306 
     307 
     308## 2.6 Compile LMDZ for regular latlon configuration 
    229309cd $modipsl/modeles/LMDZ 
    230310# Compile LMDZ regular lat-lon exectuable 
Note: See TracChangeset for help on using the changeset viewer.