--- MITgcm/tools/genmake2 2005/03/22 19:45:03 1.121 +++ MITgcm/tools/genmake2 2005/09/05 13:39:28 1.128 @@ -1,6 +1,6 @@ #! /usr/bin/env bash # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/genmake2,v 1.121 2005/03/22 19:45:03 edhill Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/genmake2,v 1.128 2005/09/05 13:39:28 edhill Exp $ # # Makefile generator for MITgcm UV codes # created by cnh 03/98 @@ -321,7 +321,7 @@ #================================================================ # look for possible FORTRAN compilers - tmp="$MITGCM_FC $FC efc g77 f77 pgf77 pgf95 ifc f90 f95 mpif77 mpf77 mpxlf95" + tmp="$MITGCM_FC $FC efc g77 f77 pgf77 pgf95 ifc f90 f95 mpif77 mpf77 mpxlf95 gfortran" p_FC= for c in $tmp ; do rm -f ./hello.f ./hello @@ -527,6 +527,9 @@ *only* works if it is supported by the OPTFILE that is being used. + -ts | --ts + Produce timing information per timestep + -mpi | --mpi Include MPI header files and link to MPI libraries -mpi=PATH | --mpi=PATH @@ -672,7 +675,7 @@ external cloc call cloc(wtime) print *," HELLO WORLD", wtime - end program hello + end EOF $FC $FFLAGS -o genmake_tc genmake_tc_2.$FS genmake_tc_1.o >> genmake_warnings 2>&1 RET_F=$? @@ -714,7 +717,7 @@ integer nbyte call tfsize(nbyte) print *," HELLO WORLD", nbyte - end program hello + end EOF $FC $FFLAGS -o genmake_tc genmake_tc_2.$FS genmake_tc_1.o >> genmake_tc.log 2>&1 RET_F=$? @@ -834,8 +837,9 @@ NOOPTFLAGS= MPI= MPIPATH= +TS= -# DEFINES checked by test compilation +# DEFINES checked by test compilation or command-line HAVE_SYSTEM= HAVE_FDATE= FC_NAMEMANGLE= @@ -843,6 +847,7 @@ HAVE_STAT= HAVE_NETCDF= HAVE_ETIME= +IGNORE_TIME= MODS= TOOLSDIR= @@ -888,7 +893,7 @@ # The following state can be set directly by command-line switches gm_s1="OPTFILE PDEPEND PDEFAULT MAKEFILE PLATFORM ROOTDIR MODS DISABLE ENABLE" -gm_s2="FC CPP IEEE MPI JAM DUMPSTATE STANDARDDIRS" +gm_s2="FC CPP IEEE TS MPI JAM DUMPSTATE STANDARDDIRS" # The following state is not directly set by command-line switches gm_s3="LN S64 KPP LINK PACKAGES MAKEDEPEND PDEPEND PDEFAULT INCLUDES FFLAGS FOPTIM " @@ -1068,6 +1073,9 @@ -noieee | --noieee) IEEE= ;; + -ts | --ts) + TS=true ;; + -mpi | --mpi) MPI=true ;; -mpi=* | --mpi=*) @@ -1091,6 +1099,9 @@ ac_prev=TAMC_EXTRA ;; -tamc_extra=* | --tamc_extra=*) TAMC_EXTRA=$ac_optarg ;; + + -ignoretime | -ignore_time | --ignoretime | --ignore_time) + IGNORE_TIME="-DIGNORE_TIME" ;; -*) echo "Error: unrecognized option: "$ac_option @@ -1148,7 +1159,7 @@ # Find the MITgcm ${THISVER} if test -f "${ROOTDIR}/doc/tag-index" ; then - THISVER=`grep checkpoint ${ROOTDIR}/doc/tag-index | head -1` + THISVER=`grep '^checkpoint' ${ROOTDIR}/doc/tag-index | head -1` fi if test "x$MAKEFILE" = x ; then @@ -1300,6 +1311,11 @@ DEFINES="$DEFINES -DALLOW_USE_MPI -DALWAYS_USE_MPI" fi +if test ! "x$TS" = x ; then + echo " Turning on timing per timestep" + DEFINES="$DEFINES -DTIME_PER_TIMESTEP" +fi + printf "\n=== Checking system libraries ===\n" printf " Do we have the system() command using $FC... " cat > genmake_tcomp.$FS < ad_files_f + cat ad_files | sed -e "s/\.f/.$FS/g" > ad_files_f mv -f ad_files_f ad_files fi @@ -2025,7 +2041,7 @@ cat ad_flow_files.inc >> $MAKEFILE echo >> $MAKEFILE echo 'F77FILES = $(SRCFILES:.F=.'$FS')' >> $MAKEFILE -echo 'F90FILES = $(F90SRCFILES:.F=.'$FS90')' >> $MAKEFILE +echo 'F90FILES = $(F90SRCFILES:.F90=.'$FS90')' >> $MAKEFILE echo 'OBJFILES = $(SRCFILES:.F=.o) $(CSRCFILES:.c=.o) $(F90SRCFILES:.F90=.o)' >> $MAKEFILE echo >> $MAKEFILE echo '.SUFFIXES:' >> $MAKEFILE