Changeset 6639
- Timestamp:
- 10/05/23 14:33:38 (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CONFIG/UNIFORM/v7/IPSLCM7/compile_ipslcm7.sh
r6638 r6639 318 318 319 319 320 ## 2.5 Compile NEMO 320 321 if [ $compnemo == y ] ; then 321 ## 2.5 Compile NEMO 322 nemo_root=$modipsl/modeles/NEMO 323 cfg_ref=ORCA2_ICE_PISCES 324 cfg_wrk=ORCA_ICE_TRC 325 addkeys="key_oasis3 key_top key_si3 key_isf" 326 delkeys="" 327 328 if [ ${nemotop} == n ] ; then 329 cfg_wrk=ORCA_ICE 330 delkeys="key_top" 331 fi 332 333 if [ ${nemotop} == n ] ; then 334 echo; echo "NOW COMPILE NEMO with ice model SI3 without passive tracer model TOP" 335 echo >> $outfile ; echo " NOW COMPILE NEMO with ice model SI3 without passive tracer model TOP" >> $outfile 322 nemo_root=$modipsl/modeles/NEMO 323 cfg_ref=ORCA2_ICE_PISCES 324 cfg_wrk=ORCA_ICE_TRC 325 addkeys="key_oasis3 key_top key_si3 key_isf" 326 delkeys="" 327 328 if [ ${nemotop} == n ] ; then 329 cfg_wrk=ORCA_ICE 330 delkeys="key_top" 331 fi 332 333 if [ ${nemotop} == n ] ; then 334 echo; echo "NOW COMPILE NEMO with ice model SI3 without passive tracer model TOP" 335 echo >> $outfile ; echo " NOW COMPILE NEMO with ice model SI3 without passive tracer model TOP" >> $outfile 336 else 337 echo; echo "NOW COMPILE NEMO with ice model SI3 and passive tracer model TOP" 338 echo >> $outfile ; echo " NOW COMPILE NEMO with ice model SI3 and passive tracer model TOP" >> $outfile 339 fi 340 341 echo >> $outfile ; echo cd $nemo_root >> $outfile 342 echo >> $outfile ; echo cp $mysrc_path/NEMO/arch-${fcm_arch}.fcm arch/CNRS/. >> $outfile 343 echo >> $outfile 344 345 cd $nemo_root ; cp $mysrc_path/NEMO/arch-${fcm_arch}.fcm arch/CNRS/. 346 347 # creation of config 348 echo >> $outfile ; echo cd $nemo_root >> $outfile 349 echo ./makenemo -m ${fcm_arch} -n $cfg_wrk -r $cfg_ref -j0 add_key "$addkeys" del_key "$delkeys" >> $outfile 350 echo >> $outfile 351 cd $nemo_root 352 ./makenemo -m ${fcm_arch} -n $cfg_wrk -r $cfg_ref -j0 add_key "$addkeys" del_key "$delkeys" >> $outfile 2>&1 353 354 355 # Copy of specfic source files 356 echo >> $outfile ; echo cp $mysrc_path/NEMO/*.*90 $nemo_root/cfgs/$cfg_wrk/MY_SRC/. >> $outfile 357 echo >> $outfile 358 cp $mysrc_path/NEMO/*.*90 $nemo_root/cfgs/$cfg_wrk/MY_SRC/. 359 360 361 if [ $full_nemo == y ] ; then 362 # To make a full compilation, first make a clean to remove all files produced during previous compilation 363 echo ./makenemo -m ${fcm_arch} -n $cfg_wrk -r $cfg_ref clean >> $outfile 364 echo >> $outfile 365 ./makenemo -m ${fcm_arch} -n $cfg_wrk -r $cfg_ref clean >> $outfile 2>&1 366 fi 367 echo ./makenemo -m ${fcm_arch} -n $cfg_wrk -r $cfg_ref -j8 >> $outfile 368 echo >> $outfile 369 ./makenemo -m ${fcm_arch} -n $cfg_wrk -r $cfg_ref -j8 >> $outfile 2>&1 370 371 echo >> $outfile 372 echo "Move nemo executable to modipsl/bin" >> $outfile 373 echo ls -lrt $nemo_root/cfgs/$cfg_wrk/BLD/bin >> $outfile 374 ls -lrt $nemo_root/cfgs/$cfg_wrk/BLD/bin >> $outfile 375 echo >> $outfile 376 377 if [ -f $nemo_root/cfgs/$cfg_wrk/BLD/bin/nemo.exe ] ; then 378 mv $nemo_root/cfgs/$cfg_wrk/BLD/bin/nemo.exe $modipsl/bin/opa_${optmode}.exe 379 else 380 echo "ERROR nemo.exe executable does not exist." 381 echo "THERE IS A PROBLEM IN NEMO COMPILATION - STOP" 382 exit 383 fi 384 336 385 else 337 echo; echo "NOW COMPILE NEMO with ice model SI3 and passive tracer model TOP" 338 echo >> $outfile ; echo " NOW COMPILE NEMO with ice model SI3 and passive tracer model TOP" >> $outfile 339 fi 340 341 echo >> $outfile ; echo cd $nemo_root >> $outfile 342 echo >> $outfile ; echo cp $mysrc_path/NEMO/arch-${fcm_arch}.fcm arch/CNRS/. >> $outfile 343 echo >> $outfile 344 345 cd $nemo_root ; cp $mysrc_path/NEMO/arch-${fcm_arch}.fcm arch/CNRS/. 346 347 # creation of config 348 echo >> $outfile ; echo cd $nemo_root >> $outfile 349 echo ./makenemo -m ${fcm_arch} -n $cfg_wrk -r $cfg_ref -j0 add_key "$addkeys" del_key "$delkeys" >> $outfile 350 echo >> $outfile 351 cd $nemo_root 352 ./makenemo -m ${fcm_arch} -n $cfg_wrk -r $cfg_ref -j0 add_key "$addkeys" del_key "$delkeys" >> $outfile 2>&1 353 354 355 # Copy of specfic source files 356 echo >> $outfile ; echo cp $mysrc_path/NEMO/*.*90 $nemo_root/cfgs/$cfg_wrk/MY_SRC/. >> $outfile 357 echo >> $outfile 358 cp $mysrc_path/NEMO/*.*90 $nemo_root/cfgs/$cfg_wrk/MY_SRC/. 359 360 361 if [ $full_nemo == y ] ; then 362 # To make a full compilation, first make a clean to remove all files produced during previous compilation 363 echo ./makenemo -m ${fcm_arch} -n $cfg_wrk -r $cfg_ref clean >> $outfile 364 echo >> $outfile 365 ./makenemo -m ${fcm_arch} -n $cfg_wrk -r $cfg_ref clean >> $outfile 2>&1 366 fi 367 echo ./makenemo -m ${fcm_arch} -n $cfg_wrk -r $cfg_ref -j8 >> $outfile 368 echo >> $outfile 369 ./makenemo -m ${fcm_arch} -n $cfg_wrk -r $cfg_ref -j8 >> $outfile 2>&1 370 371 echo >> $outfile 372 echo "Move nemo executable to modipsl/bin" >> $outfile 373 echo ls -lrt $nemo_root/cfgs/$cfg_wrk/BLD/bin >> $outfile 374 ls -lrt $nemo_root/cfgs/$cfg_wrk/BLD/bin >> $outfile 375 echo >> $outfile 376 377 if [ -f $nemo_root/cfgs/$cfg_wrk/BLD/bin/nemo.exe ] ; then 378 mv $nemo_root/cfgs/$cfg_wrk/BLD/bin/nemo.exe $modipsl/bin/opa_${optmode}.exe 379 else 380 echo "ERROR nemo.exe executable does not exist." 381 echo "THERE IS A PROBLEM IN NEMO COMPILATION - STOP" 382 exit 383 fi 384 385 else 386 echo ; echo No compilation of NEMO 387 fi 388 386 echo ; echo No compilation of NEMO 387 fi 388 389 ##2.6 Compile INCA 389 390 if [ $compinca == y ] ; then 390 ##2.6 Compile INCA391 391 cd $modipsl/modeles/INCA 392 392 393 393 echo; echo "NOW COMPILE INCA ${optchimie}" 394 394 echo >> $outfile ; echo " NOW COMPILE INCA ${optchimie}" >> $outfile … … 396 396 echo ./makeinca_fcm -chimie ${optchimie} -$optmode -xios -parallel mpi_omp -j 8 -arch ${fcm_arch} -arch_path $arch_path $full_flag >> $outfile 397 397 ./makeinca_fcm -chimie ${optchimie} -$optmode -xios -parallel mpi_omp -j 8 -arch ${fcm_arch} -arch_path $arch_path $full_flag >> $outfile 2>&1 398 398 399 399 # Test if compiling finished 400 400 if [[ $? != 0 ]] ; then … … 403 403 exit 404 404 fi 405 405 406 406 echo "Move inca.dat modipsl/bin" 407 407 if [[ -f $modipsl/modeles/INCA/SIMULATIONS/${optchimie}/inca.dat ]] ; then … … 412 412 exit 413 413 fi 414 414 415 415 echo "Move tracer.def to modipsl/bin" 416 416 if [[ -f $modipsl/modeles/INCA/tracer.def ]] ; then 417 417 mv $modipsl/modeles/INCA/tracer.def $modipsl/bin/tracer_${optchimie}.def ; 418 418 fi 419 419 420 420 else 421 echo ; echo No compilation of INCA421 echo ; echo No compilation of INCA 422 422 fi 423 423 … … 425 425 cd $modipsl/modeles/LMDZ 426 426 # Compile LMDZ as library to couple to DYNAMICO 427 echo; echo "NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO" 428 echo >> $outfile ; echo " NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO" >> $outfile 429 430 # Retrieve the final svn release number, needed for radiative code suffix of executable 431 lmdzsvn=`svnversion . | egrep -o "[0-9]+" | awk 'NR==1'` 432 # Temporary use of SOURCES/LMDZ to handle modifications needed by IPSLCM7 433 cp $mysrc_path/LMDZ/phylmd/*.*90 libf/phylmd/. 434 cp $mysrc_path/LMDZ/dyn3d_common/*.*90 libf/dyn3d_common/. 435 436 # Check if the compilation of LMDZ was previsouly interupted prematured. 437 # In that case, the files dimension.h and .lock exist. If the files exist, they are here removed to avoid makelmdz_fcm 438 # to ask question and wait for interactivly answer from the user. 439 if [ -f libf/grid/dimensions.h ] || [ -f .lock ] ; then 440 echo >> $outfile 441 echo " WARNING!! The file LMDZ/libf/grid/dimension.h and/or the LMDZ/.lock exist. " >> $outfile 442 echo " This means that the compilation is either currently on going in another terminal was previous interupted before the end." >> $outfile 443 echo " The files dimension.h and .lock will now be removed. " >> $outfile 444 echo >> $outfile 445 rm -f libf/grid/dimensions.h 446 rm -f .lock 447 fi 448 449 # Need to define the proper option for radiative code compilation. By default, we use rrtm 450 case $rad in 451 oldrad) opt_rad="" ;; 452 rrtm) if [ $lmdzsvn -le 4185 ] ; then opt_rad="-rrtm true" ; else opt_rad="-rad rrtm" ; fi ;; 453 ecrad) opt_rad="-rad ecrad" ;; 454 *) echo Only oldrad rrtm ecrad for rad option ; exit 455 esac 456 457 if [ $lmdzsvn -le 4185 -a $rad = "ecrad" ] ; then echo "ecrad only available for LMDZ rev starting with 4186 " ; exit ; fi 458 459 if [ $compinca == y ] ; then 460 arginca="-chimie INCA " 461 else 462 arginca=" " 463 fi 464 465 if [ $compoasis == y ] ; then 466 argoasis="-c OMCT " 467 else 468 argoasis=" " 469 fi 427 if [ $compdyna == y ] ; then 428 echo; echo "NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO" 429 echo >> $outfile ; echo " NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO" >> $outfile 430 431 # Retrieve the final svn release number, needed for radiative code suffix of executable 432 lmdzsvn=`svnversion . | egrep -o "[0-9]+" | awk 'NR==1'` 433 # Temporary use of SOURCES/LMDZ to handle modifications needed by IPSLCM7 434 cp $mysrc_path/LMDZ/phylmd/*.*90 libf/phylmd/. 435 cp $mysrc_path/LMDZ/dyn3d_common/*.*90 libf/dyn3d_common/. 436 437 # Check if the compilation of LMDZ was previsouly interupted prematured. 438 # In that case, the files dimension.h and .lock exist. If the files exist, they are here removed to avoid makelmdz_fcm 439 # to ask question and wait for interactivly answer from the user. 440 if [ -f libf/grid/dimensions.h ] || [ -f .lock ] ; then 441 echo >> $outfile 442 echo " WARNING!! The file LMDZ/libf/grid/dimension.h and/or the LMDZ/.lock exist. " >> $outfile 443 echo " This means that the compilation is either currently on going in another terminal was previous interupted before the end." >> $outfile 444 echo " The files dimension.h and .lock will now be removed. " >> $outfile 445 echo >> $outfile 446 rm -f libf/grid/dimensions.h 447 rm -f .lock 448 fi 449 450 # Need to define the proper option for radiative code compilation. By default, we use rrtm 451 case $rad in 452 oldrad) opt_rad="" ;; 453 rrtm) if [ $lmdzsvn -le 4185 ] ; then opt_rad="-rrtm true" ; else opt_rad="-rad rrtm" ; fi ;; 454 ecrad) opt_rad="-rad ecrad" ;; 455 *) echo Only oldrad rrtm ecrad for rad option ; exit 456 esac 457 458 if [ $lmdzsvn -le 4185 -a $rad = "ecrad" ] ; then echo "ecrad only available for LMDZ rev starting with 4186 " ; exit ; fi 459 460 if [ $compinca == y ] ; then 461 arginca="-chimie INCA " 462 else 463 arginca=" " 464 fi 465 466 if [ $compoasis == y ] ; then 467 argoasis="-c OMCT " 468 else 469 argoasis=" " 470 fi 470 471 echo ./makelmdz_fcm -p lmd $argoasis $opt_rad -$optmode -mem -parallel $parallel -libphy -v $orchcomp $arginca -io xios -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz >> $outfile 471 472 473 474 # Test if compiling finished475 if [[ $? != 0 ]] ; then476 477 478 fi479 472 ./makelmdz_fcm -p lmd $argoasis $opt_rad -$optmode -mem -parallel $parallel -libphy -v $orchcomp $arginca -io xios -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz >> $outfile 2>&1 473 474 475 # Test if compiling finished 476 if [[ $? != 0 ]] ; then 477 echo "THERE IS A PROBLEM IN LMDZ PHYSICS COMPILATION - STOP" 478 exit 479 fi 480 fi 480 481 481 482 482 483 ## 2.8 Compile DYNAMICO 483 cd $modipsl/modeles/DYNAMICO 484 echo; echo "NOW COMPILE DYNAMICO " 485 echo >> $outfile ; echo " NOW COMPILE DYNAMICO" >> $outfile 486 487 if [ $compoasis == y ] ; then 488 argoasis="-with_oasis " 489 else 490 argoasis=" " 491 fi 492 if [ $compinca == y ] ; then 493 arginca="-with_inca " 494 else 495 arginca=" " 496 fi 497 498 499 echo ./make_icosa -$optmode -with_fcm1 -parallel $parallel -external_ioipsl $argoasis -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna >> $outfile 500 ./make_icosa -$optmode -with_fcm1 -parallel $parallel -external_ioipsl $argoasis -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna >> $outfile 2>&1 501 # Test if compiling finished 502 if [[ $? != 0 ]] ; then 503 echo "THERE IS A PROBLEM IN DYNAMICO COMPILATION - STOP" 504 exit 505 fi 506 507 484 if [ $compdyna == y ] ; then 485 cd $modipsl/modeles/DYNAMICO 486 echo; echo "NOW COMPILE DYNAMICO " 487 echo >> $outfile ; echo " NOW COMPILE DYNAMICO" >> $outfile 488 489 if [ $compoasis == y ] ; then 490 argoasis="-with_oasis " 491 else 492 argoasis=" " 493 fi 494 if [ $compinca == y ] ; then 495 arginca="-with_inca " 496 else 497 arginca=" " 498 fi 499 500 501 echo ./make_icosa -$optmode -with_fcm1 -parallel $parallel -external_ioipsl $argoasis -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna >> $outfile 502 ./make_icosa -$optmode -with_fcm1 -parallel $parallel -external_ioipsl $argoasis -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna >> $outfile 2>&1 503 # Test if compiling finished 504 if [[ $? != 0 ]] ; then 505 echo "THERE IS A PROBLEM IN DYNAMICO COMPILATION - STOP" 506 exit 507 fi 508 fi 509 508 510 ## 2.9 Compile interface ICOSA_LMDZ 509 cd $modipsl/modeles/ICOSA_LMDZ 510 echo; echo "NOW COMPILE ICOSA_LMDZ " 511 echo >> $outfile ; echo " NOW COMPILE ICOSA_LMDZ" >> $outfile 512 513 echo ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel $argoasis -with_orchidee $arginca -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna >> $outfile 514 ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel $argoasis -with_orchidee $arginca -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna >> $outfile 2>&1 515 # Test if compiling finished 516 if [[ $? != 0 ]] ; then 517 echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION - STOP" 518 exit 519 fi 520 # Move executables to modipsl/bin 521 if [ -f $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe ] ; then 522 if [ $compinca == y ] ; then 523 mv $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe $modipsl/bin/icosa_lmdz_${orchversion}_${optmode}_${optchimie}.exe 524 # Create link to be use by IPSLCM and LMDZOR without any change in the executable name 525 cd $modipsl/bin 526 rm -f icosa_lmdz_${orchversion}_${optmode}.exe 527 ln -s icosa_lmdz_${orchversion}_${optmode}_${optchimie}.exe icosa_lmdz_${orchversion}_${optmode}.exe 528 else 529 mv $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe $modipsl/bin/icosa_lmdz_${orchversion}_${optmode}.exe 530 fi 531 else 532 echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION EXECUTABLE MISSING - STOP" 533 exit 534 fi 535 511 if [ $compdyna ==y ] ; then 512 cd $modipsl/modeles/ICOSA_LMDZ 513 echo; echo "NOW COMPILE ICOSA_LMDZ " 514 echo >> $outfile ; echo " NOW COMPILE ICOSA_LMDZ" >> $outfile 515 516 echo ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel $argoasis -with_orchidee $arginca -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna >> $outfile 517 ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel $argoasis -with_orchidee $arginca -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna >> $outfile 2>&1 518 # Test if compiling finished 519 if [[ $? != 0 ]] ; then 520 echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION - STOP" 521 exit 522 fi 523 # Move executables to modipsl/bin 524 if [ -f $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe ] ; then 525 if [ $compinca == y ] ; then 526 mv $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe $modipsl/bin/icosa_lmdz_${orchversion}_${optmode}_${optchimie}.exe 527 # Create link to be use by IPSLCM and LMDZOR without any change in the executable name 528 cd $modipsl/bin 529 rm -f icosa_lmdz_${orchversion}_${optmode}.exe 530 ln -s icosa_lmdz_${orchversion}_${optmode}_${optchimie}.exe icosa_lmdz_${orchversion}_${optmode}.exe 531 else 532 mv $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe $modipsl/bin/icosa_lmdz_${orchversion}_${optmode}.exe 533 fi 534 else 535 echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION EXECUTABLE MISSING - STOP" 536 exit 537 fi 538 fi 536 539 537 540
Note: See TracChangeset
for help on using the changeset viewer.