Changeset 253 for trunk/LMDZ.GENERIC/makegcm_pgf90
- Timestamp:
- Aug 2, 2011, 11:13:07 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/makegcm_pgf90
r135 r253 6 6 ######################################################################## 7 7 set dim="64x48x32" 8 set physique= mars8 set physique=std 9 9 set phys="PHYS=$physique" 10 10 set include='-I$(LIBF)/grid -I$(LIBF)/bibio -I.' … … 13 13 set grille=reg 14 14 set dyntype="dyn" 15 set bands="32x36" 15 16 ######################################################################## 16 17 # path a changer contenant les sources et les objets du modele 17 18 ######################################################################## 18 19 19 ###### VERSION LMDZ.3.320 # set LMDGCM=$HOME/LMDZ.3.321 #22 23 20 #### If you want you can set environment variables here 24 #setenv LMDGCM /d5/emlmd/test_universal/LMDZ.UCM.v0.221 #setenv LMDGCM "/san/home/rdword/gcm/LMDZ.GENERIC" 25 22 #setenv LIBOGCM $LMDGCM/libo 26 #if ( `uname -m` == "x86_64" ) then 27 ## 64 bit machines 28 # setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_pgi/lib 29 # setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_pgi/include 30 #else 31 # setenv NCDFLIB /distrib/local/netcdf/pgi_32bits/lib 32 # setenv NCDFINC /distrib/local/netcdf/pgi_32bits/include 33 #endif 23 #setenv NCDFLIB /usr/local/lib 24 #setenv NCDFINC /usr/local/include 25 if ( `uname -m` == "x86_64" ) then 26 # 64 bit machines 27 setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_pgi/lib 28 setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_pgi/include 29 else 30 setenv NCDFLIB /donnees/emlmd/netcdf-4.0.1_pgi/lib 31 setenv NCDFINC /donnees/emlmd/netcdf-4.0.1_pgi/include 32 endif 34 33 #### 35 34 … … 179 178 else if $DEC then 180 179 else if $LINUX then 181 set optim90=" -fast" 182 set optimtru90=" -fast -c -Mfree " 183 # set opt_link=" -Mfree -L/usr/local/pgi/linux86/lib -lpgf90 -lpgftnrtl -lpghpf -lpghpf2 -L$NCDFLIB -lnetcdf -Wl,-Bstatic " 184 # Ehouarn: there is no /usr/local/pgi/linux86/lib, but it doesn't matter 185 # also changed -Wl,-Bstatic to -Bstatic 186 set opt_link=" -Mfree -lpgf90 -lpgftnrtl -lpghpf -lpghpf2 -L$NCDFLIB -lnetcdf -Bstatic " 180 set optim=" -O2 -Munroll -Mcache_align " 181 set optim90=" -O2 -Munroll -Mcache_align " 182 set optimtru90=" -O2 -Munroll -Mcache_align " 183 set opt_link=" -L$NCDFLIB -lnetcdf" 187 184 set mod_loc_dir=$localdir 188 185 set mod_suffix=mod 186 # Ehouarn 'ifort' compiler 187 # #NB: on gnome -O3 ==> NaNs ... 188 # set optim=" -O2 -ip -mkl=sequential -align common " 189 # set optim90=" -O2 -ip -mkl=sequential -align common " 190 # set optimtru90=" -O2 -ip -mkl=sequential -align common " 191 # set mod_loc_dir=$LIBOGCM 192 # set mod_suffix=mod 189 193 else if $NEC then 190 194 set optim90=' -clear -C hopt -float0 -ew -P static -Wf,"-pvctl fullmsg noassume "' … … 335 339 ######################################################################## 336 340 337 case -d :341 case -d 338 342 set dim=$2 ; shift ; shift ; goto top 339 343 340 344 case -O: 341 set optim90="$2" ; s hift ; shift ; goto top345 set optim90="$2" ; set optim="$2" ; set optimtru90="$2" ; shift ; shift ; goto top 342 346 343 347 case -p … … 347 351 set grille="$2" ; shift ; shift ; goto top 348 352 353 case -b 354 set bands=$2 ; shift ; shift ; goto top 355 349 356 case -t 350 357 set ntrac=$2 ; shift ; shift ; goto top … … 375 382 set optim90="$optim90"" -G1 " 376 383 else if $LINUX then 377 set optim90="-g -Mbounds " 384 set optim="-g -Mbounds -Kieee -Ktrap=fp -traceback" 385 set optim90="-g -Mbounds -Kieee -Ktrap=fp -traceback" 386 set optimtru90="-g -Mbounds -Kieee -Ktrap=fp -traceback" 387 # set optim=" -g -no-ftz -traceback -ftrapuv -fp-stack-check " 388 # set optim90=" -g -no-ftz -traceback -ftrapuv -fp-stack-check " 389 # set optimtru90=" -g -no-ftz -traceback -ftrapuv -fp-stack-check " 378 390 else 379 391 echo "pas d option debug predefinie pour cette machine" … … 387 399 endsw 388 400 endif 401 389 402 390 403 echo "apres les opts dim $dim" … … 420 433 ######################################################################## 421 434 435 422 436 \rm tmp ; touch tmp 423 437 \rm tmp90 ; touch tmp90 … … 437 451 438 452 # dimension 439 440 453 echo "dimension avant sed $dim" 441 454 if ( $IBM ) then … … 446 459 set dim_=`echo $dim | sed -e 's/[^0-9]/_/g'` 447 460 else 448 # set dim=`echo $dim | sed -n -e 's/[^0-9]/ /gp'`449 # set dim_=`echo $dim | sed -n -e 's/[^0-9]/_/gp'`450 461 set dim=`echo $dim | sed -e 's/[^0-9]/ /g'` 451 462 set dim_=`echo $dim | sed -e 's/[^0-9]/_/g'` 452 463 endif 464 465 # bands 466 echo "bands avant sed $bands" 467 if ( $IBM ) then 468 set bands=`echo $bands | sed -en 's/[^0-9]/ /g'` 469 set bands_=`echo $bands | sed -en 's/[^0-9]/_/g'` 470 else if ( $SUN || $XNEC ) then 471 set bands=`echo $bands | sed -e 's/[^0-9]/ /g'` 472 set bands_=`echo $bands | sed -e 's/[^0-9]/_/g'` 473 else 474 set bands=`echo $bands | sed -e 's/[^0-9]/ /g'` 475 set bands_=`echo $bands | sed -e 's/[^0-9]/_/g'` 476 endif 477 453 478 454 479 # build final name of libraries directory: … … 458 483 set nomlib=${nomlib}_${dim_}_t${ntrac}_${grille} 459 484 endif 485 486 # Append number of bands to nomlib (new for universal model) 487 set nomlib=${nomlib}_${bands_} 460 488 461 489 # Append 'physique' type, if it is not mars, to nomlib … … 502 530 cd $libf/grid 503 531 if ( -f dimensions.h ) then 504 echo "ATTENTION: vous etes sans doute en train de compiler le modele par ailleurs" 505 echo "Attendez que la premiere compilation soit terminee pour relancer la suivante." 506 echo "Si vous etes sur que vous ne compilez pas le modele par ailleurs," 507 echo "vous pouvez continuer en repondant oui." 508 echo "Voulez-vous vraiment continuer?" 509 if ( $< == "oui" ) then 532 echo "WARNING: you are already compiling the model somewhere else" 533 echo "Wait until the first compilation is finished before starting." 534 echo "If you are sure that you are not compiling elsewhere, you can" 535 echo "type [yes] to continue." 536 echo "Do you want to continue?" 537 # echo "ATTENTION: vous etes sans doute en train de compiler le modele par ailleurs" 538 # echo "Attendez que la premiere compilation soit terminee pour relancer la suivante." 539 # echo "Si vous etes sur que vous ne compilez pas le modele par ailleurs," 540 # echo "vous pouvez continuer en repondant oui." 541 # echo "Voulez-vous vraiment continuer?" 542 if ( $< == "yes" ) then 510 543 #remove old dimensions.h file 511 544 \rm $libf/grid/dimensions.h 545 \rm $libf/grid/bands.h 512 546 else 513 547 exit … … 520 554 # echo contents of dimensions.h to standard output 521 555 cat $libf/grid/dimensions.h 556 557 # Build the appropriate 'bands.h' file 558 makbands $bands 559 # echo contents of bands.h to standard output 560 cat $libf/grid/bands.h 522 561 523 562 cd $LMDGCM … … 552 591 # Traitement special pour le nouveau rayonnement de Laurent Li. 553 592 ###################################################################### 554 555 if ( -f $libf/phy$physique/raddim.h ) then 556 if ( -f $libf/phy$physique/raddim.$dimh.h ) then 557 \rm $libf/phy$physique/raddim.h 558 cp -p $libf/phy$physique/raddim.$dimh.h $libf/phy$physique/raddim.h 559 echo $libf/phy$physique/raddim.$dimh.h 560 cat $libf/phy$physique/raddim.$dimh.h 561 cat $libf/phy$physique/raddim.h 562 else 563 echo On peut diminuer la taille de l executable en creant 564 echo le fichier $libf/phy$physique/raddim.$dimh.h 565 \cp -p $libf/phy$physique/raddim.defaut.h $libf/phy$physique/raddim.h 566 endif 567 endif 593 #if ( -f $libf/phy$physique/raddim.h ) then 594 # if ( -f $libf/phy$physique/raddim.$dimh.h ) then 595 # \rm $libf/phy$physique/raddim.h 596 # cp -p $libf/phy$physique/raddim.$dimh.h $libf/phy$physique/raddim.h 597 # echo $libf/phy$physique/raddim.$dimh.h 598 # cat $libf/phy$physique/raddim.$dimh.h 599 # cat $libf/phy$physique/raddim.h 600 # else 601 # echo On peut diminuer la taille de l executable en creant 602 # echo le fichier $libf/phy$physique/raddim.$dimh.h 603 # \cp -p $libf/phy$physique/raddim.defaut.h $libf/phy$physique/raddim.h 604 # endif 605 #endif 568 606 569 607 ###################################################################### … … 612 650 \cp tmp77 liste_des_sources_f77 613 651 \cp tmp90 liste_des_sources_f90 614 echo " On recree le makefile"652 echo "Remaking the makefile!" 615 653 if ("$dyntype" == "olddyn") then 616 654 ./create_make_gcm olddyn3d grid bibio phy$physique >! tmp … … 619 657 endif 620 658 \mv tmp makefile 621 echo "N ouveau makefile cree."659 echo "New makefile created." 622 660 endif 623 661 … … 625 663 # Execution de la comande make 626 664 ######################################################################## 665 627 666 628 667 echo PHYSIQUE $phys … … 643 682 set f90=f90 644 683 else if $LINUX then 684 # set f77=ifort 685 # set f90=ifort 686 # set opt_link=" -L$LIBOGCM -L$NCDFLIB -lnetcdf " 645 687 set f77=pgf90 646 688 set f90=pgf90 … … 704 746 # l'optimisation de startvar se passe mal 705 747 # 706 if ($code == 'create_etat0' && $VPP) then707 if ( ! -f $libo/libdyn3d.a ) then708 echo "Priere de compiler gcm en premier pour des raisons d'optimisation"709 \rm $libf/grid/dimensions.h710 exit711 endif712 set optim90="$optim90"" -X9 -w"713 set opt_link="-L$NCDFLIB -lnetcdf"714 touch $LMDGCM/libf/dyn3d/startvar.F715 touch $LMDGCM/libf/dyn3d/etat0_netcdf.F716 endif748 #if ($code == 'create_etat0' && $VPP) then 749 # if ( ! -f $libo/libdyn3d.a ) then 750 # echo "Priere de compiler gcm en premier pour des raisons d'optimisation" 751 # \rm $libf/grid/dimensions.h 752 # exit 753 # endif 754 # set optim90="$optim90"" -X9 -w" 755 # set opt_link="-L$NCDFLIB -lnetcdf" 756 # touch $LMDGCM/libf/dyn3d/startvar.F 757 # touch $LMDGCM/libf/dyn3d/etat0_netcdf.F 758 #endif 717 759 718 760 # … … 738 780 set optimtru90=" $optimtru90 -I$libo " 739 781 else if $LINUX then 782 # set optim="$optim -I${libo}" 783 # set optim90="$optim90 -I${libo}" 784 # set optimtru90="$optimtru90 -ffree-form -I${libo}" 785 set optim="$optim -module $libo" 740 786 set optim90="$optim90 -module $libo" 741 787 set optimtru90="$optimtru90 -module $libo" … … 757 803 cd $localdir 758 804 805 759 806 echo $make -f $LMDGCM/makefile \ 760 807 OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \ 808 OPTIM="$optim" \ 761 809 OPTIM90="$optim90" \ 762 810 OPTIMTRU90="$optimtru90" \ … … 783 831 $make -f $LMDGCM/makefile \ 784 832 OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \ 833 OPTIM="$optim" \ 785 834 OPTIM90="$optim90" \ 786 835 OPTIMTRU90="$optimtru90" \ … … 805 854 806 855 \rm $libf/grid/dimensions.h 856 \rm $libf/grid/bands.h
Note: See TracChangeset
for help on using the changeset viewer.