/[MITgcm]/MITgcm/tools/genmake2
ViewVC logotype

Diff of /MITgcm/tools/genmake2

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.272 by heimbach, Fri Jul 3 21:33:55 2015 UTC revision 1.278 by jmc, Fri Jan 15 22:08:17 2016 UTC
# Line 32  Usage: "$0" [OPTIONS] Line 32  Usage: "$0" [OPTIONS]
32            "tools/adjoint_options/adjoint_oad" (for OpenAD built) or            "tools/adjoint_options/adjoint_oad" (for OpenAD built) or
33            "tools/adjoint_options/adjoint_default" will be used.            "tools/adjoint_options/adjoint_default" will be used.
34    
35      -nooptfile | --nooptfile      -optfile NAME | --optfile NAME | -of NAME | --of NAME
       -optfile NAME | --optfile NAME | -of NAME | --of NAME  
36        -optfile=NAME | --optfile=NAME | -of=NAME | --of=NAME        -optfile=NAME | --optfile=NAME | -of=NAME | --of=NAME
37            Use "NAME" as the optfile.  By default, an attempt will be            Use "NAME" as the optfile.  By default, an attempt will be
38            made to find an appropriate "standard" optfile in the            made to find an appropriate "standard" optfile in the
# Line 1332  FS90= Line 1331  FS90=
1331    
1332  AUTODIFF_PKG_USED=f  AUTODIFF_PKG_USED=f
1333  OPENAD=  OPENAD=
 OPENAD_DIVA=  
1334  AD_OPTFILE=  AD_OPTFILE=
1335  CAT_SRC_FOR_TAF=1  CAT_SRC_FOR_TAF=1
1336  TAF=  TAF=
# Line 1409  for ac_option in "$@" ; do Line 1407  for ac_option in "$@" ; do
1407          -help | --help | -h | --h)          -help | --help | -h | --h)
1408              usage ;;              usage ;;
1409    
         -nooptfile | --nooptfile)  
             OPTFILE="NONE" ;;  
1410          -optfile | --optfile | -of | --of)          -optfile | --optfile | -of | --of)
1411              ac_prev=OPTFILE ;;              ac_prev=OPTFILE ;;
1412          -optfile=* | --optfile=* | -of=* | --of=*)          -optfile=* | --optfile=* | -of=* | --of=*)
# Line 1425  for ac_option in "$@" ; do Line 1421  for ac_option in "$@" ; do
1421          -adoptfile=* | --adoptfile=* | -adof=* | --adof=*)          -adoptfile=* | --adoptfile=* | -adof=* | --adof=*)
1422              AD_OPTFILE=$ac_optarg ;;              AD_OPTFILE=$ac_optarg ;;
1423    
         -diva | --diva)  
             OPENAD_DIVA="ALLOW_OPENAD_DIVA=" ;;  
   
1424          -pdepend | --pdepend)          -pdepend | --pdepend)
1425              ac_prev=PKG_DEPEND ;;              ac_prev=PKG_DEPEND ;;
1426          -pdepend=* | --pdepend=*)          -pdepend=* | --pdepend=*)
# Line 1968  else Line 1961  else
1961  fi  fi
1962  rm -f genmake_tcomp*  rm -f genmake_tcomp*
1963    
1964  printf "  Do we have the etime() command using $FC...  "  printf "  Do we have the etime() command using $FC... "
1965  cat > genmake_tcomp.$FS <<EOF  cat > genmake_tcomp_1.$FS <<EOF
1966        program hello        program hello
1967        REAL*4 ACTUAL, TARRAY(2)        REAL*4 actual, tarray(2)
1968        EXTERNAL ETIME        EXTERNAL ETIME
1969        REAL*4 ETIME        REAL*4 ETIME
1970        actual = etime( tarray )        actual = ETIME( tarray )
1971        print *, tarray        print *, tarray
1972        end        end
1973  EOF  EOF
1974  $FC $FFLAGS -o genmake_tcomp genmake_tcomp.$FS > genmake_tcomp.log 2>&1  $FC $FFLAGS -o genmake_tcomp_1 genmake_tcomp_1.$FS > genmake_tcomp.log 2>&1
1975  RETVAL=$?  RETVAL=$?
1976  if test "x$RETVAL" = x0 ; then  if test "x$RETVAL" = x0 ; then
1977      HAVE_ETIME=t      HAVE_ETIME='Fct'
1978      DEFINES="$DEFINES -DHAVE_ETIME"      DEFINES="$DEFINES -DHAVE_ETIME_FCT"
1979      echo "yes"      echo " yes (${HAVE_ETIME})"
1980  else  else
1981      cat > genmake_tcomp_2.$FS <<EOF
1982          program hello
1983          REAL*4 actual, tarray(2)
1984          actual = -999.
1985          call ETIME( tarray, actual )
1986          if ( actual.ge.0. ) then
1987            print *, 0, tarray, actual
1988          else
1989            print *, 1, tarray, actual
1990          endif
1991          end
1992    EOF
1993      $FC $FFLAGS -o genmake_tcomp_2 genmake_tcomp_2.$FS >> genmake_tcomp.log 2>&1
1994      RETVAL=$?
1995      if test "x$RETVAL" = x0 ; then
1996        echo -n 'c,'
1997        ./genmake_tcomp_2 > genmake_tcomp_2.out 2>&1
1998        RETVAL=$?
1999      fi
2000      if test "x$RETVAL" = x0 ; then
2001        echo -n 'r:'
2002        RETVAL=`cat genmake_tcomp_2.out | $AWK '{print $1}'`
2003      fi
2004      if test "x$RETVAL" = x0 ; then
2005        HAVE_ETIME='SbR'
2006        DEFINES="$DEFINES -DHAVE_ETIME_SBR"
2007        echo " yes (${HAVE_ETIME})"
2008      else
2009      HAVE_ETIME=      HAVE_ETIME=
2010      echo "no"      echo " no"
2011      fi
2012  fi  fi
2013    #mkdir chk_etime ; cp -p -f genmake_tcomp* chk_etime
2014  rm -f genmake_tcomp*  rm -f genmake_tcomp*
2015    
2016  printf "  Can we call simple C routines (here, \"cloc()\") using $FC...  "  printf "  Can we call simple C routines (here, \"cloc()\") using $FC...  "
# Line 2894  F90C = ${F90C} Line 2917  F90C = ${F90C}
2917  CC = ${CC}  CC = ${CC}
2918  # Link editor  # Link editor
2919  LINK = ${LINK} ${LDADD}  LINK = ${LINK} ${LDADD}
 export $OPENAD_DIVA  
2920    
2921  # Defines for CPP  # Defines for CPP
2922  DEFINES = ${DEFINES}  DEFINES = ${DEFINES}

Legend:
Removed from v.1.272  
changed lines
  Added in v.1.278

  ViewVC Help
Powered by ViewVC 1.1.22