Changeset 1403 for trunk/LMDZ.MARS/makegcm_g95
- Timestamp:
- Mar 31, 2015, 3:49:07 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/makegcm_g95
r1246 r1403 8 8 set physique=mars 9 9 set phys="PHYS=$physique" 10 set include='-I$(LIBF)/grid -I$(LIBF)/ bibio -I. -I$(LIBF)/aeronomars'10 set include='-I$(LIBF)/grid -I$(LIBF)/misc -I. -I$(LIBF)/dynlonlat_phylonlat' 11 11 set ntrac = 1 12 12 set filtre=filtrez … … 14 14 set dyntype="dyn" 15 15 set full="" 16 #src_dirs: directories containing source files 17 set src_dirs="grid misc" 18 16 19 ######################################################################## 17 20 # path a changer contenant les sources et les objets du modele 18 21 ######################################################################## 19 22 20 #### #If you want you can set environment variables here (instead of21 #### #relying on the C-shell environment variables)22 # #default LMDGCM to where makegcm script is located:23 #set scriptdir=`dirname $0`24 #setenv LMDGCM `readlink -f $scriptdir`25 # #You may set LIBOGCM to something else; otherwise we default to:26 #setenv LIBOGCM $LMDGCM/libo27 ## #NetCDF Libraries: what follows is OK for LMD 32 and 64bit Linux Machines28 # #if ( `uname -m` == "x86_64" ) then29 # ##64 bit machines30 #setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_g95/lib31 #setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_g95/include32 # #else33 # #setenv NCDFLIB /donnees/emlmd/netcdf-4.0.1_g95/lib34 # #setenv NCDFINC /donnees/emlmd/netcdf-4.0.1_g95/include35 # #endif36 #### #23 #### If you want you can set environment variables here (instead of 24 #### relying on the C-shell environment variables) 25 # default LMDGCM to where makegcm script is located: 26 set scriptdir=`dirname $0` 27 setenv LMDGCM `readlink -f $scriptdir` 28 # You may set LIBOGCM to something else; otherwise we default to: 29 setenv LIBOGCM $LMDGCM/libo 30 ## NetCDF Libraries: what follows is OK for LMD 32 and 64bit Linux Machines 31 #if ( `uname -m` == "x86_64" ) then 32 # 64 bit machines 33 setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_g95/lib 34 setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_g95/include 35 #else 36 # setenv NCDFLIB /donnees/emlmd/netcdf-4.0.1_g95/lib 37 # setenv NCDFINC /donnees/emlmd/netcdf-4.0.1_g95/include 38 #endif 39 #### 37 40 38 41 setenv localdir "`pwd`" … … 183 186 # Ehouarn 'g95' compiler 184 187 set optim="-O3 -fstatic -funroll-loops " 185 set optim90=" -O3 -fstatic -funroll-loops " 186 set optimtru90=" -O3 -fstatic -funroll-loops " 187 # set opt_link=" -Mfree -L/usr/local/pgi/linux86/lib -lpgf90 -lpgftnrtl -lpghpf -lpghpf2 -L$NCDFLIB -lnetcdf -Wl,-Bstatic " 188 # Ehouarn: there is no /usr/local/pgi/linux86/lib, but it doesn't matter 189 # also changed -Wl,-Bstatic to -Bstatic 188 set optim90="-O3 -fstatic -funroll-loops " 189 set optimtru90="-O3 -fstatic -funroll-loops " 190 # 190 191 set opt_link=" -L$NCDFLIB -lnetcdf " 191 192 set mod_loc_dir=$localdir … … 217 218 endif 218 219 219 # Ehouarn: add 'g9 5' string to pathname220 # Ehouarn: add 'g9fortran' string to pathname 220 221 set nomlib=${machine}_g95 221 222 … … 405 406 if ( "$physique" == 'nophys' ) then 406 407 set phys="L_PHY= LIBPHY=" 407 endif 408 408 else 409 set src_dirs="$src_dirs aerono$physique phy$physique" 410 set include="$include "'-I$(LIBF)/aerono'"$physique"' -I$(LIBF)/phy'"$physique" 411 endif 412 set libdyn_phy="" 413 set LIBDYN_PHYS="" 409 414 ######################################################################## 410 415 # choix du nombre de traceur par defaut si il n'a pas ete choisi, … … 488 493 set include="$include "'-I$(LIBF)/dyn2d ' 489 494 set dimh=$dim 490 else 495 endif 496 if ( "$dimc" == "3" ) then 491 497 if ( "$dyntype" == "olddyn" ) then 492 498 set include="$include "'-I$(LIBF)/olddyn3d ' 499 set src_dirs="$src_dirs olddyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique" 493 500 else 494 501 set include="$include "'-I$(LIBF)/dyn3d ' 502 set src_dirs="$src_dirs dyn3d dynlonlat_phylonlat dynlonlat_phylonlat/phy$physique" 495 503 endif 504 set libdyn_phy="-ldynlonlat_phylonlat" 505 set LIBDYN_PHYS='$(LIBO)/libdynlonlat_phylonlat.a' 496 506 set dimh=`echo $dim | awk ' { print $1 "." $2 } '` 497 507 endif … … 532 542 cat $libf/grid/dimensions.h 533 543 534 #535 544 cd $LMDGCM 536 545 # set path to objects directory … … 553 562 ## NB: we still need to have L_DYN=libdyn3d to reach routines and module 554 563 ## objects which are located in dyn3d 555 set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique " 564 set dyntype="" 565 set filtre="L_DYN= DYN= FILTRE= L_FILTRE= " 566 set dyn="L_DYN= DYN= L_FILTRE= " 567 set dirmain="phy$physique/dyn1d" 568 set src_dirs="$src_dirs phy$physique/dyn1d " 569 set include="$include "' -I$(LIBF)/phy'"$physique"'/dyn1d' 556 570 endif 557 571 endif … … 593 607 if ( `expr $dimc \> 2` == 1 ) then 594 608 set filtre="FILTRE=$filtre" 609 if ( "$dyntype" == "olddyn" ) then 610 set src_dirs="$src_dirs oldfiltrez" 611 else 612 set src_dirs="$src_dirs filtrez" 613 endif 595 614 else 596 set filtre="FILTRE= L_FILTRE= "615 set filtre="FILTRE= L_FILTRE= L_DYN= " 597 616 endif 598 617 echo "MACRO FILTRE $filtre" … … 636 655 \cp tmp90 liste_des_sources_f90 637 656 echo "On recree le makefile" 638 if ("$dyntype" == "olddyn") then 639 ./create_make_gcm olddyn3d grid bibio aeronomars phy$physique >! tmp 640 else 641 ./create_make_gcm dyn3d grid bibio aeronomars phy$physique >! tmp 642 endif 657 echo "src_dirs: $src_dirs" 658 create_make_gcm $src_dirs >! tmp 643 659 \mv tmp makefile 644 660 echo "Nouveau makefile cree." … … 721 737 else if $LINUX then 722 738 # Ehouarn : adapt to g95 723 set optim="$optim -fmod=$ libo"724 set optim90="$optim90 -fmod=$ libo"725 set optimtru90="$optimtru90 -fmod=$ libo"739 set optim="$optim -fmod=${libo}" 740 set optim90="$optim90 -fmod=${libo}" 741 set optimtru90="$optimtru90 -fmod=${libo}" 726 742 # Ehouarn: remove set mod_loc_dir def below; mod_loc_dir=$localdir (set above) 727 743 # set mod_loc_dir=$libo … … 741 757 cd $localdir 742 758 743 ## locate main program (could be in dyn3d or phy$physique744 ## 759 ## locate main program (could be in dyn3d or dynlonlat_phylonlat/phy$physique 760 ## or phy$physique/dyn1d and could be .F or .F90) 745 761 set source_code=${code}.F 762 set dirmain=dyn${dimc}d 746 763 if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then 747 764 set source_code=${code}.F90 748 765 endif 749 if ( -f $LMDGCM/libf/phy${physique}/${code}.F ) then 766 if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F ) then 767 set dirmain=phy${physique}/dyn1d 750 768 set source_code=${code}.F 751 769 endif 752 if ( -f $LMDGCM/libf/phy${physique}/${code}.F90 ) then 770 if ( -f $LMDGCM/libf/phy${physique}/dyn1d/${code}.F90 ) then 771 set dirmain=phy${physique}/dyn1d 753 772 set source_code=${code}.F90 754 773 endif 755 756 ## locate directory where main program is located 757 if ( $dimension == 3 ) then 758 if ( -f $LMDGCM/libf/dyn3d/${source_code} ) then 759 set dyn="DIRMAIN=dyn3d " 760 endif 761 if ( -f $LMDGCM/libf/phy${physique}/${source_code} ) then 762 set dyn="DIRMAIN=phy${physique} " 763 endif 774 if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F ) then 775 set dirmain=dynlonlat_phylonlat/phy${physique} 776 set source_code=${code}.F 777 endif 778 if ( -f $LMDGCM/libf/dynlonlat_phylonlat/phy${physique}/${code}.F90 ) then 779 set dirmain=dynlonlat_phylonlat/phy${physique} 780 set source_code=${code}.F90 764 781 endif 765 782 … … 772 789 $filtre \ 773 790 LIBO=$libo \ 774 $dyn \775 791 $phys \ 792 LIBDYN_PHYS=${LIBDYN_PHYS} \ 776 793 DIM=$dimc \ 777 794 DYNTYPE="$dyntype" \ 795 L_DYN_PHY="$libdyn_phy" \ 778 796 L_ADJNT="$adjnt" \ 779 797 LOCAL_DIR="$localdir" \ … … 786 804 MOD_SUFFIX=$mod_suffix \ 787 805 AR=$ar \ 806 DIRMAIN=$dirmain \ 788 807 SOURCE=$source_code \ 789 808 PROG=$code … … 798 817 $filtre \ 799 818 LIBO=$libo \ 800 $dyn \801 819 $phys \ 820 LIBDYN_PHYS=${LIBDYN_PHYS} \ 802 821 DIM=$dimc \ 803 822 DYNTYPE="$dyntype" \ 823 L_DYN_PHY="$libdyn_phy" \ 804 824 L_ADJNT="$adjnt" \ 805 825 LOCAL_DIR="$localdir" \ … … 812 832 MOD_SUFFIX=$mod_suffix \ 813 833 AR=$ar \ 834 DIRMAIN=$dirmain \ 814 835 SOURCE=$source_code \ 815 836 PROG=$code 816 837 817 # cleanup, remove dimensions.h 838 # cleanup, remove dimensions.h 818 839 \rm -f $libf/grid/dimensions.h
Note: See TracChangeset
for help on using the changeset viewer.