Changeset 519
- Timestamp:
- Feb 9, 2012, 3:48:30 PM (13 years ago)
- Location:
- trunk/LMDZ.MARS
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/README
r517 r519 1378 1378 Also updated "phymars/comdiurn.h", "aeronomars/conc.h" and 1379 1379 "aeronomars/chimiedata.h" to be fixed/free form compatible. 1380 1381 == 09/02/12 == EM 1382 >> Updated the makegcm(s) so that default behaviour is to set LMDGCM env variable 1383 to be the directory in which the makegcm script is. Updated the makegcm_* 1384 to use "SOURCE" to identify main program to compile 1385 >> Adapted "create_make_gcm" script so that it can compile a main program that 1386 is either something.F or something.F90. Also added that object files are 1387 removed from archive before compiling a new version. -
trunk/LMDZ.MARS/create_make_gcm
r38 r519 109 109 echo ' cd $(LIBO) ; $(RANLIB) lib*.a ; cd $(GCM) ;\' 110 110 echo ' cd $(LOCAL_DIR); \' 111 echo ' $(COMPILE90) $(LIBF)/$(DIRMAIN)/$( PROG).F-o $(PROG).o ; \'111 echo ' $(COMPILE90) $(LIBF)/$(DIRMAIN)/$(SOURCE) -o $(PROG).o ; \' 112 112 if [ "$CRAY" = '0' ] ; then 113 113 echo ' $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_ADJNT) $(L_FILTRE) $(L_AERONOMARS) $(L_PHY) $(L_BIBIO) $(L_DYN) $(L_AERONOMARS) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o ' … … 219 219 done 220 220 echo $str1 221 # Compile in LOCAL_DIR directory, and before compiling, 222 # remove the object from the library 223 echo ' cd $(LOCAL_DIR); \' 224 echo ' $(AR) d $(LIBO)/lib'$diri'.a '$fili'.o ; \' 221 225 if [ "$F90" -eq '0' ] ; then 222 echo ' cd $(LOCAL_DIR); \'226 ## Fixed Form Fortran 77 223 227 echo ' $(COMPILE) $(LIBF)/'$diri'/'$trufile' ; \' 224 228 else 229 ## Fortran 90 225 230 echo ' cd $(LOCAL_DIR); \' 226 231 if [ -f $fili.F90 ] ; then 227 echo ' $(COMPTRU90) $(LIBF)/'$diri'/'$trufile' ; \' 232 ## Free Form Fortran 90 233 echo ' $(COMPTRU90) $(LIBF)/'$diri'/'$trufile' ; \' 228 234 else 229 echo ' $(COMPILE90) $(LIBF)/'$diri'/'$trufile' ; \' 235 ## Fixed Form Fortran 90 236 echo ' $(COMPILE90) $(LIBF)/'$diri'/'$trufile' ; \' 230 237 fi 238 ## If a module, handle created module descriptor file 231 239 MODU=0; egrep -i '^ *module ' $trufile> /dev/null 2>&1 && MODU=1 232 240 if [ "$MODU" -eq '1' -a "$CRAY" != '1' ] ; then … … 242 250 echo ' sxar r $(LIBO)/libsx'$diri'.a '$fili'.o ; \' 243 251 fi 252 # Put generated object in library 244 253 echo ' $(AR) r $(LIBO)/lib'$diri'.a '$fili'.o ; $(RM) '$fili'.o ; \' 245 254 echo ' cd $(GCM)' -
trunk/LMDZ.MARS/makegcm
r148 r519 21 21 #### relying on the C-shell environment variables) 22 22 # default LMDGCM to where makegcm script is located: 23 #setenv LMDGCM "`dirname $0`" 23 set scriptdir=`dirname $0` 24 setenv LMDGCM `readlink -f $scriptdir` 24 25 # You may set LIBOGCM to something else; otherwise we default to: 25 #setenv LIBOGCM $LMDGCM/libo26 setenv LIBOGCM $LMDGCM/libo 26 27 ## NetCDF Libraries: what follows is OK for LMD 32 and 64bit Linux Machines 27 28 #if ( `uname -m` == "x86_64" ) then 28 29 ## 64 bit machines 29 #setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_pgi/lib30 #setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_pgi/include30 setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_pgi/lib 31 setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_pgi/include 31 32 #else 32 33 # setenv NCDFLIB /donnees/emlmd/netcdf-4.0.1_pgi/lib … … 735 736 cd $localdir 736 737 738 ## locate main program (could be in dyn3d or phy$physique 739 ## and could be .F or .F90) 740 set source_code=${code}.F 741 if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then 742 set source_code=${code}.F90 743 endif 744 if ( -f $LMDGCM/libf/phy${physique}/${code}.F ) then 745 set source_code=${code}.F 746 endif 747 if ( -f $LMDGCM/libf/phy${physique}/${code}.F90 ) then 748 set source_code=${code}.F90 749 endif 750 751 ## locate directory where main program is located 752 if ( $dimension == 3 ) then 753 if ( -f $LMDGCM/libf/dyn3d/${source_code} ) then 754 set dyn="DIRMAIN=dyn3d " 755 endif 756 if ( -f $LMDGCM/libf/phy${physique}/${source_code} ) then 757 set dyn="DIRMAIN=phy${physique} " 758 endif 759 endif 760 737 761 echo $make -f $LMDGCM/makefile \ 738 762 OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \ … … 757 781 MOD_SUFFIX=$mod_suffix \ 758 782 AR=$ar \ 783 SOURCE=$source_code \ 759 784 PROG=$code 760 785 … … 782 807 MOD_SUFFIX=$mod_suffix \ 783 808 AR=$ar \ 809 SOURCE=$source_code \ 784 810 PROG=$code 785 811 -
trunk/LMDZ.MARS/makegcm_g95
r148 r519 21 21 #### relying on the C-shell environment variables) 22 22 # default LMDGCM to where makegcm script is located: 23 #setenv LMDGCM "`dirname $0`" 23 set scriptdir=`dirname $0` 24 setenv LMDGCM `readlink -f $scriptdir` 24 25 # You may set LIBOGCM to something else; otherwise we default to: 25 #setenv LIBOGCM $LMDGCM/libo26 setenv LIBOGCM $LMDGCM/libo 26 27 ## NetCDF Libraries: what follows is OK for LMD 32 and 64bit Linux Machines 27 28 #if ( `uname -m` == "x86_64" ) then 28 29 ## 64 bit machines 29 #setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_g95/lib30 #setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_g95/include30 setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_g95/lib 31 setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_g95/include 31 32 #else 32 33 # setenv NCDFLIB /donnees/emlmd/netcdf-4.0.1_g95/lib … … 736 737 cd $localdir 737 738 739 ## locate main program (could be in dyn3d or phy$physique 740 ## and could be .F or .F90) 741 set source_code=${code}.F 742 if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then 743 set source_code=${code}.F90 744 endif 745 if ( -f $LMDGCM/libf/phy${physique}/${code}.F ) then 746 set source_code=${code}.F 747 endif 748 if ( -f $LMDGCM/libf/phy${physique}/${code}.F90 ) then 749 set source_code=${code}.F90 750 endif 751 752 ## locate directory where main program is located 753 if ( $dimension == 3 ) then 754 if ( -f $LMDGCM/libf/dyn3d/${source_code} ) then 755 set dyn="DIRMAIN=dyn3d " 756 endif 757 if ( -f $LMDGCM/libf/phy${physique}/${source_code} ) then 758 set dyn="DIRMAIN=phy${physique} " 759 endif 760 endif 761 738 762 echo $make -f $LMDGCM/makefile \ 739 763 OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \ … … 758 782 MOD_SUFFIX=$mod_suffix \ 759 783 AR=$ar \ 784 SOURCE=$source_code \ 760 785 PROG=$code 761 786 … … 783 808 MOD_SUFFIX=$mod_suffix \ 784 809 AR=$ar \ 810 SOURCE=$source_code \ 785 811 PROG=$code 786 812 -
trunk/LMDZ.MARS/makegcm_gfortran
r148 r519 21 21 #### relying on the C-shell environment variables) 22 22 # default LMDGCM to where makegcm script is located: 23 #setenv LMDGCM "`dirname $0`" 23 set scriptdir=`dirname $0` 24 setenv LMDGCM `readlink -f $scriptdir` 24 25 # You may set LIBOGCM to something else; otherwise we default to: 25 #setenv LIBOGCM $LMDGCM/libo26 setenv LIBOGCM $LMDGCM/libo 26 27 ## NetCDF Libraries: what follows is OK for LMD 32 and 64bit Linux Machines 27 28 #if ( `uname -m` == "x86_64" ) then 28 29 # 64 bit machines 29 #setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_gfortran/lib30 #setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_gfortran/include30 setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_gfortran/lib 31 setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_gfortran/include 31 32 #else 32 33 # setenv NCDFLIB /donnees/emlmd/netcdf-4.0.1_gfortran/lib … … 734 735 cd $localdir 735 736 737 ## locate main program (could be in dyn3d or phy$physique 738 ## and could be .F or .F90) 739 set source_code=${code}.F 740 if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then 741 set source_code=${code}.F90 742 endif 743 if ( -f $LMDGCM/libf/phy${physique}/${code}.F ) then 744 set source_code=${code}.F 745 endif 746 if ( -f $LMDGCM/libf/phy${physique}/${code}.F90 ) then 747 set source_code=${code}.F90 748 endif 749 750 ## locate directory where main program is located 751 if ( $dimension == 3 ) then 752 if ( -f $LMDGCM/libf/dyn3d/${source_code} ) then 753 set dyn="DIRMAIN=dyn3d " 754 endif 755 if ( -f $LMDGCM/libf/phy${physique}/${source_code} ) then 756 set dyn="DIRMAIN=phy${physique} " 757 endif 758 endif 759 736 760 echo $make -f $LMDGCM/makefile \ 737 761 OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \ … … 756 780 MOD_SUFFIX=$mod_suffix \ 757 781 AR=$ar \ 782 SOURCE=$source_code \ 758 783 PROG=$code 759 784 … … 781 806 MOD_SUFFIX=$mod_suffix \ 782 807 AR=$ar \ 808 SOURCE=$source_code \ 783 809 PROG=$code 784 810 -
trunk/LMDZ.MARS/makegcm_ifort
r352 r519 21 21 #### relying on the C-shell environment variables) 22 22 # default LMDGCM to where makegcm script is located: 23 #setenv LMDGCM "`dirname $0`" 23 set scriptdir=`dirname $0` 24 setenv LMDGCM `readlink -f $scriptdir` 24 25 # You may set LIBOGCM to something else; otherwise we default to: 25 26 setenv LIBOGCM $LMDGCM/libo … … 740 741 cd $localdir 741 742 743 ## locate main program (could be in dyn3d or phy$physique 744 ## and could be .F or .F90) 745 set source_code=${code}.F 746 if ( -f $LMDGCM/libf/dyn3d/${code}.F90 ) then 747 set source_code=${code}.F90 748 endif 749 if ( -f $LMDGCM/libf/phy${physique}/${code}.F ) then 750 set source_code=${code}.F 751 endif 752 if ( -f $LMDGCM/libf/phy${physique}/${code}.F90 ) then 753 set source_code=${code}.F90 754 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 764 endif 765 742 766 echo $make -f $LMDGCM/makefile \ 743 767 OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \ … … 762 786 MOD_SUFFIX=$mod_suffix \ 763 787 AR=$ar \ 788 SOURCE=$source_code \ 764 789 PROG=$code 765 790 … … 787 812 MOD_SUFFIX=$mod_suffix \ 788 813 AR=$ar \ 814 SOURCE=$source_code \ 789 815 PROG=$code 790 816
Note: See TracChangeset
for help on using the changeset viewer.