Changeset 4900
- Timestamp:
- Apr 15, 2024, 11:18:38 AM (7 months ago)
- Location:
- BOL/script_install_amaury
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/script_install_amaury/arch_local/arch-local-gfortran-parallel.fcm
r4896 r4900 12 12 %BASE_CFLAGS -w -std=c++11 -D__XIOS_EXCEPTION # xios 13 13 # /!\ LD must be written in Makefile syntax 14 %BASE_LD -Wl,-rpath=$(shell dirname $( readlink -f "$(which mpif90)"))/../lib:$(shell nf-config --prefix)/lib -lstdc++14 %BASE_LD -Wl,-rpath=$(shell dirname $(shell readlink -f "$(shell which mpif90)"))/../lib:$(shell nf-config --prefix)/lib -lstdc++ 15 15 %BASE_INC -D__NONE__ # xios 16 16 … … 25 25 26 26 %MPI_FFLAGS -fcray-pointer 27 %MPI_LD -L$(shell dirname $( readlink -f "$(which mpif90)"))/../lib -lmpi27 %MPI_LD -L$(shell dirname $(shell readlink -f "$(shell which mpif90)"))/../lib -lmpi 28 28 %OMP_LD -fopenmp 29 29 %OMP_FFLAGS -fopenmp -fcray-pointer -
BOL/script_install_amaury/arch_local/arch-local-gfortran.path
r4896 r4900 1 NETCDF_INCDIR=" $(nf-config --fflags)"2 NETCDF_LIBDIR="$(nf-config --flibs)" 3 NETCDF_LIB ="$(nf-config --flibs)"1 NETCDF_INCDIR="-I$(nf-config --includedir)" 2 # Ugly hack for orchidee <=2.0 3 NETCDF_LIBDIR="-L$(nf-config --flibs | sed -e "s/-L//")" 4 4 NETCDF95_INCDIR="-I$LMDGCM/../../include" 5 5 NETCDF95_LIBDIR="-L$LMDGCM/../../lib" -
BOL/script_install_amaury/install_lmdz.sh
r4896 r4900 37 37 38 38 ### Functions 39 # TODO add make_j parallel argument -> check what is used for libigcm40 39 41 40 function myget { # Get a file from LMDZ repository … … 137 136 -physiq to choose which physics package to use (default <$physiq>) 138 137 139 -veget surface/vegetation scheme treatment controlled by the single variable veget which can have the following values: none: bucket scheme (default); CMIP6 : orchidee version used in CMIP exercise, rev 5661; number: orchidee version number (default $veget)138 -veget surface/vegetation scheme treatment controlled by the single variable veget which can have the following values: none: bucket scheme (default); CMIP6 | veget2.0: orchidee version used in CMIP exercise, rev 5661; veget2.2: orchidee branch 2.2, rev 8529 (bundled); number: orchidee version number (default $veget) 140 139 141 140 -arch name of the arch to use (default <$arch>) … … 190 189 191 190 # Check on veget version 192 if [[ $veget != 'none' && $veget != "CMIP6" ]]; then191 if [[ $veget != 'none' && $veget != "CMIP6" && $veget != "orch2.0" && $veget != "orch2.2" ]]; then 193 192 re='^[0-9]+$' 194 193 if ! [[ $veget =~ $re ]]; then … … 200 199 if [[ $veget = 'none' ]]; then 201 200 suff_orc='' 202 #For use with tutorial, orchidee_rev is also defined (will be203 #written in surface_env at the end of the script)204 orchidee_rev=''205 201 else 206 202 suff_orc='_orch' … … 284 280 } 285 281 286 function download_model_AMAURY { # TODO 282 function download_model_AMAURY { # TODO TEMP while waiting for tar: we copy the base from a local path = IPSLCM7 + ORCH2.2 latest 283 if [[ ! -d ../MODEL_REF ]]; then 284 cd .. 285 mkdir MODEL_REF 286 cd MODEL_REF 287 svn co --username icmc_users https://forge.ipsl.fr/igcmg/svn/modipsl/trunk modipsl 288 cd modipsl/util 289 ./model IPSLCM7_work 290 rm -rf oasis3-mct 291 cd ../modeles 292 rm -rf ICOSA_LMDZ ORCHIDEE_4 ORCHIDEE_2_2 NEMO DYNAMICO XIOS INCA 293 svn co svn://forge.ipsl.fr/orchidee/branches/ORCHIDEE_2_2/ORCHIDEE 294 cd ../../../script_install 295 fi 296 297 if [[ ! -d "$MODEL" ]]; then 298 \cp -r ../MODEL_REF . 299 mv MODEL_REF "$MODEL" 300 fi 287 301 MODEL=$(readlink -f "$MODEL"); echo "$MODEL" # absolute path 288 302 … … 295 309 } 296 310 297 function in stall_arch {311 function init_arch { 298 312 if [[ ! -d $arch_dir ]]; then 299 313 echo "Error: no arch dir $arch_dir"; exit 1 … … 314 328 # check compiler 315 329 compiler=$(< "$fcm_path" grep "%COMPILER" | sed -e "s/%COMPILER\s*//") 316 317 # Copy arch to different components 318 # TODO check that this doesn't error if the source and destination are the same 319 for dir in "IOIPSL" "ORCHIDEE" "LMDZ" "XIOS"; do 320 \cp -f "$arch_dir/arch-$arch.fcm" "$MODEL/modipsl/modeles/$dir/arch" 321 \cp -f "$arch_dir/arch-$arch.path" "$MODEL/modipsl/modeles/$dir/arch" 322 done 323 324 # TODO TEMP compat w/ old orch version - make a proper case later 325 sed -i'' -e "s/-I//" -e "s/-L//" "$MODEL/modipsl/modeles/ORCHIDEE/arch/arch-$arch.path" # /!\ we only replace first occurence on purpose 326 327 # Adapt for XIOS, which uses different naming conventions 328 sed -i'' -e "s/%COMPILER/%FCOMPILER/" -e "s/%LINK/%LINKER/" -e "s/-fdefault-real-8//" "$MODEL/modipsl/modeles/XIOS/arch/arch-$arch.fcm" 330 } 331 332 function install_arch { 333 local component=$1 334 335 if [[ ! -f "$MODEL/modipsl/modeles/$component/arch/arch-$arch.fcm" ]]; then 336 \cp -f "$arch_dir/arch-$arch.fcm" "$MODEL/modipsl/modeles/$component/arch" 337 \cp -f "$arch_dir/arch-$arch.path" "$MODEL/modipsl/modeles/$component/arch" 338 339 if [[ $component = "XIOS" ]]; then 340 # Adapt for XIOS, which uses different naming conventions 341 sed -i'' -e "s/%COMPILER/%FCOMPILER/" -e "s/%LINK/%LINKER/" -e "s/-fdefault-real-8//" "$MODEL/modipsl/modeles/XIOS/arch/arch-$arch.fcm" 342 elif [[ $component = "ORCHIDEE" ]]; then 343 if [[ $orcbranch = "/tags/ORCHIDEE_2_0/ORCHIDEE" ]]; then # 2.0 and before have a different fcm convention 344 sed -i'' -e "s/-I//" -e "s/-L//" "$MODEL/modipsl/modeles/ORCHIDEE/arch/arch-$arch.path" # /!\ we only replace first occurence on purpose 345 fi 346 fi 347 fi 329 348 } 330 349 331 350 function install_netcdf { 332 351 echo "Installing Netcdf" 352 local ncdf_compiler="$compiler" 333 353 334 354 if [[ $netcdf = 0 ]]; then … … 338 358 339 359 # Convert non-basic compiler 340 local ncdf_compiler="$compiler"341 360 case $compiler in # TODO check if it works with other base compilers 342 361 mpif90) ncdf_compiler=$($compiler --help | head -n 1 | cut -f 2 -d " ") … … 365 384 fi 366 385 367 368 386 echo "Repertoire netcdf $ncdfdir" 369 387 if [[ ! -d $ncdfdir ]]; then … … 426 444 427 445 function install_IOIPSL { 446 install_arch "IOIPSL" 447 428 448 cd "$MODEL/modipsl/modeles/IOIPSL" 429 449 ioipsllog="$(pwd)/ioipsl.log" … … 466 486 467 487 cd XIOS 488 489 install_arch "XIOS" 490 491 echo "Starting XIOS compilation" 468 492 if ! ./make_xios --arch "$arch" --job 8 > "$xioslog" 2>&1; then 469 493 echo "XIOS compilation failed, exiting"; exit 1 … … 478 502 479 503 function get_orchidee_version { # Set / Check ORCHIDEE version 480 if [[ $veget = "none" ]]; then 481 veget_version="false" 482 elif [[ $veget = "CMIP6" ]]; then 483 veget_version=orchidee2.0 484 else # specific orchidee revision newer than CMIP6, on 2_1 or 2_2 branches 485 veget_version=orchidee2.1 486 if [[ $veget -lt 4465 ]]; then 487 echo 'ORCHIDEE version must be >=4465, exiting' 488 exit 1 489 fi 490 504 local fetch_rev="" 505 orcbranch="" 506 case $veget in 507 "none") fcm_veget_version="false";; 508 "orch2.0" | "CMIP6") fcm_veget_version=orchidee2.0; fetch_rev=6592;; 509 "orch2.2") fcm_veget_version=orchidee2.1; orcbranch="ORCHIDEE_2_2" ;; # the bundled version 510 *) fetch_rev=$veget 511 esac 512 513 if [[ -n $fetch_rev ]]; then 514 echo "Fetching orch $fetch_rev from the repository" 515 orcbranch=$(svn log -v -q svn://forge.ipsl.jussieu.fr/orchidee/ -r "$fetch_rev" |grep ORCHIDEE |head -1| sed -e 's:ORCHIDEE/.*$:ORCHIDEE:' | awk '{print $2}') 516 echo "branch is $orcbranch" 517 if [[ $fetch_rev -lt 4465 ]]; then echo 'ORCHIDEE version must be >=4465, exiting'; exit 1; fi 518 \rm -rf "$MODEL/modipsl/modeles/ORCHIDEE" 519 echo "IF YOU INSTALL ORCHIDEE THE VERY FIRST TIME, ASK for PASSWORD at orchidee-help@listes.ipsl.fr" 520 cd "$MODEL/modipsl/modeles" 491 521 set +e 492 svn upgrade 493 local orcbranch 494 orcbranch=$(svn log -v -q svn://forge.ipsl.jussieu.fr/orchidee/ -r "$veget" |grep ORCHIDEE |head -1| sed -e 's:ORCHIDEE/.*$:ORCHIDEE:' | awk '{print $2}') 495 echo "IF YOU INSTALL ORCHIDEE THE VERY FIRST TIME, ASK for PASSWORD at orchidee-help@listes.ipsl.fr" 496 svn switch -r "$veget" --accept theirs-full "svn://forge.ipsl.jussieu.fr/orchidee/$orcbranch" 497 svn log -r "$veget" | grep "$veget" 498 if ! svn log -r "$veget" | grep "$veget"; then 499 echo 'Cannot update ORCHIDEE as not on the right branch for ORCHIDEE' 500 exit 1 501 fi 502 svn update -r "$veget" 522 svn co -r "$fetch_rev" "svn://forge.ipsl.jussieu.fr/orchidee/$orcbranch" 503 523 set -e 524 cd - 504 525 fi 505 526 } … … 507 528 function compile_orchidee { 508 529 get_orchidee_version 530 install_arch "ORCHIDEE" 531 509 532 ORCHPATH="" 510 533 … … 529 552 fi 530 553 531 # TODO check that this works with old orchidee versions (cf. -d tools) 532 local varenv="IOIPSL_LIBDIR_=$IOIPSL_LIBDIR_ IOIPSL_INCDIR_=$IOIPSL_INCDIR_ ORCHPATH=$ORCHPATH" 554 local varenv="IOIPSL_LIBDIR_=$IOIPSL_LIBDIR_ IOIPSL_INCDIR_=$IOIPSL_INCDIR_ ORCHPATH=$ORCHPATH XIOS_INCDIR_=$XIOS_INCDIR_ XIOS_LIBDIR_=$XIOS_LIBDIR_" 533 555 if [[ $parallel = "none" ]]; then 534 556 echo "$varenv ./makeorchidee_fcm $xios_orchid $opt_orc -parallel none -arch $arch -j $make_j" > compile.sh … … 578 600 function compile_lmdz { 579 601 get_lmdz_version 602 install_arch "LMDZ" 580 603 581 604 exe_name="bin/gcm_${grid_resolution}_phylmd_${rad}${suff_exe}${suff_orc}.e" … … 601 624 makelmdz="makelmdz_fcm $optim_debug -arch $arch -j $make_j" 602 625 if [[ $parallel = "none" ]]; then 603 echo "$varenv ./$makelmdz $opt_rad $opt_cosp -d ${grid_resolution} -v $ veget_version gcm " > compile.sh604 else 605 echo "$varenv ./$makelmdz $opt_rad $opt_cosp $opt_makelmdz_xios -d ${grid_resolution} -v $ veget_version -mem -parallel $parallel gcm" > compile.sh626 echo "$varenv ./$makelmdz $opt_rad $opt_cosp -d ${grid_resolution} -v $fcm_veget_version gcm " > compile.sh 627 else 628 echo "$varenv ./$makelmdz $opt_rad $opt_cosp $opt_makelmdz_xios -d ${grid_resolution} -v $fcm_veget_version -mem -parallel $parallel gcm" > compile.sh 606 629 fi 607 630 echo "Compiling lmdz using $(\cat compile.sh) (log: $lmdzlog) $(date)" … … 828 851 #download_model 829 852 download_model_AMAURY 830 in stall_arch853 init_arch 831 854 check_available_software 832 855 install_netcdf
Note: See TracChangeset
for help on using the changeset viewer.