- Timestamp:
- 08/05/19 12:02:20 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CONFIG/UNIFORM/v6/IPSLCM6.2/compile_ipslcm6.sh
r4629 r4641 24 24 # Version ESM CO2: CO2 interactif ocean/atmosphere (y/n) 25 25 esmco2=n 26 # Also compile ce0l subprogram to LMDZ (y/n) 27 ce0l=n 26 28 27 29 # Optimization mode … … 35 37 full_flag="" 36 38 full_nemo=n 37 # Default netcdf_lib is used for XIOS but can be change by argument 38 netcdf_lib="" 39 full_xios="" 40 full_lmdz="" 41 full_orch="" 42 43 39 44 40 45 # Output text file for compilation of each component … … 42 47 outfile=$submitdir/out_compile_ipslcm6.$datestr 43 48 echo > $outfile 44 echo; echo "Text output from compilation will be stored in file out_compile_ipslcm6 "; echo49 echo; echo "Text output from compilation will be stored in file out_compile_ipslcm6.$datestr"; echo 45 50 46 51 #### Read arguments … … 48 53 while (($# > 0)) ; do 49 54 case $1 in 50 "-h") cat <<fin 51 55 "-h") cat <<end_help 52 56 ######################################################################## 53 57 # Usage of the script compile_ipslcm6.sh … … 85 89 ./compile_ipslcm6.sh MR025 -debug -full 86 90 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 91 end_help 92 exit;; 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 132 111 esac 133 112 done 134 113 135 echo "Following options are set in current compiling:" >> $outfile 136 echo " resol_atm=${resol_atm}, resol_oce=${resol_oce}, icemodel=${icemodel}, withpisces=${pisces}" >> $outfile114 echo "Following options are set in current compiling:" >> $outfile 115 echo " resol_atm=${resol_atm}, resol_oce=${resol_oce}, icemodel=${icemodel}, oceanbio=${oceanbio}" >> $outfile 137 116 echo " esmco2=${esmco2}" >> $outfile 138 echo " optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch, full_flag=$full_flag" >> $outfile 117 echo " ce0l=${ce0l}" >> $outfile 118 echo " optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch " >> $outfile 119 echo " full_flag=$full_flag, full_xios=$full_xios, full_lmdz=$full_lmdz, full_orch=$full_orch, full_nemo=$full_nemo," >> $outfile 139 120 echo >> $outfile 140 121 … … 218 199 echo; echo "NOW COMPILE XIOS" 219 200 echo >> $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>> $outfile221 ./make_xios --use_oasis oasis3_mct --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_flag>> $outfile 2>&1201 echo ./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 222 203 # Test if compiling succeded 223 204 if [[ $? != 0 ]] ; then … … 239 220 echo >> $outfile ; echo " NOW COMPILE ORCHIDEE" >> $outfile 240 221 241 echo ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_ flag>> $outfile242 ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_ flag>> $outfile 2>&1222 echo ./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 243 224 # Test if compiling finished 244 225 if [[ $? != 0 ]] ; then … … 288 269 289 270 if [ $full_nemo == y ] ; then 290 # To make a full compilation, first clean all what has beenproduced during previous compilation271 # To make a full compilation, first make a clean to remove all files produced during previous compilation 291 272 echo ./makenemo -m ${fcm_arch} -n $cfg_wrk clean >> $outfile 292 273 echo >> $outfile … … 333 314 fi 334 315 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_ flaggcm >> $outfile336 ./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_ flaggcm >> $outfile 2>&1316 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_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 337 318 # Test if compiling finished 338 319 if [[ $? != 0 ]] ; then … … 341 322 fi 342 323 343 # Compile ce0l initialization program for LMDZ regular lat-lon exectuable344 echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"345 echo >> $outfile ; echo " NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}" >> $outfile346 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 >> $outfile348 ./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>&1349 # Test if compiling finished350 if [[ $? != 0 ]] ; then351 echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP"352 exit353 fi354 355 # Find executable suffix356 if [ $parallel == seq ] || [ $parallel == none ] ; then357 suffix=_${resol_atm}_phylmd_seq_orch358 else359 suffix=_${resol_atm}_phylmd_para_mem_orch360 fi361 echo suffix = $suffix362 363 324 # Move executables to modipsl/bin folder 364 325 echo >> $outfile 365 echo "Move gcm.e and ce0lexecutable to modipsl/bin" >> $outfile326 echo "Move gcm.e executable to modipsl/bin" >> $outfile 366 327 echo ls -lrt $modipsl/modeles/LMDZ/bin >> $outfile 367 328 ls -lrt $modipsl/modeles/LMDZ/bin >> $outfile 368 329 echo >> $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 330 suffix=_${resol_atm}_phylmd_para_mem_orch_couple.e 331 echo gcm.e suffix = $suffix 332 333 if [ -f $modipsl/modeles/LMDZ/bin/gcm${suffix} ] ; then 334 mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${optmode}.e 335 else 336 echo "ERROR gcm${suffix} executable does not exist." 337 echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP" 338 exit 339 fi 340 341 342 # Compile ce0l initialization program for LMDZ regular lat-lon exectuable 343 if [ $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 372 fi 373 373 374 374 echo >>$outfile ; echo "ALL COMPILING FINISHED" >> $outfile
Note: See TracChangeset
for help on using the changeset viewer.