/[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.236 by jmc, Fri Aug 24 23:07:27 2012 UTC revision 1.276 by jmc, Thu Jan 7 20:21:42 2016 UTC
# Line 17  Usage: "$0" [OPTIONS] Line 17  Usage: "$0" [OPTIONS]
17    where [OPTIONS] can be:    where [OPTIONS] can be:
18    
19      -help | --help | -h | --h      -help | --help | -h | --h
20            Print this help message and exit.            Print this help message and exit.
21    
22        -oad | --oad
23              Generate a Makefile for an OpenAD built
24    
25        -nocat4ad | -dog4ad | -ncad | -dad
26              do not concatenate (cat) source code sent to TAF
27              resulting in compilation of multiple files
28    
29      -adoptfile NAME | --adoptfile NAME | -adof NAME | --adof NAME      -adoptfile NAME | --adoptfile NAME | -adof NAME | --adof NAME
30        -adoptfile=NAME | --adoptfile=NAME | -adof=NAME | --adof=NAME        -adoptfile=NAME | --adoptfile=NAME | -adof=NAME | --adof=NAME
31            Use "NAME" as the adoptfile.  By default, the file at            Use "NAME" as the adoptfile.  By default, the file at
32            "tools/adjoint_options/adjoint_default" will be used.            "tools/adjoint_options/adjoint_oad" (for OpenAD built) or
33              "tools/adjoint_options/adjoint_default" will be used.
34    
35      -nooptfile | --nooptfile      -nooptfile | --nooptfile
36        -optfile NAME | --optfile NAME | -of NAME | --of NAME        -optfile NAME | --optfile NAME | -of NAME | --of NAME
37        -optfile=NAME | --optfile=NAME | -of=NAME | --of=NAME        -optfile=NAME | --optfile=NAME | -of=NAME | --of=NAME
38            Use "NAME" as the optfile.  By default, an attempt will be            Use "NAME" as the optfile.  By default, an attempt will be
39            made to find an appropriate "standard" optfile in the            made to find an appropriate "standard" optfile in the
40            tools/build_options/ directory.            tools/build_options/ directory.
41    
42      -pdepend NAME | --pdepend NAME      -pdepend NAME | --pdepend NAME
43        -pdepend=NAME | --pdepend=NAME        -pdepend=NAME | --pdepend=NAME
44            Get package dependency information from "NAME".            Get package dependency information from "NAME".
45    
46      -pgroups NAME | --pgroups NAME      -pgroups NAME | --pgroups NAME
47        -pgroups=NAME | --pgroups=NAME        -pgroups=NAME | --pgroups=NAME
48            Get the package groups information from "NAME".            Get the package groups information from "NAME".
49    
50      -bash NAME      -bash NAME
51            Explicitly specify the Bourne or BASH shell to use            Explicitly specify the Bourne or BASH shell to use
52    
53      -make NAME | -m NAME      -make NAME | -m NAME
54        --make=NAME | -m=NAME        --make=NAME | -m=NAME
55            Use "NAME" for the MAKE program. The default is "make" but            Use "NAME" for the MAKE program. The default is "make" but
56            many platforms, "gmake" is the preferred choice.            many platforms, "gmake" is the preferred choice.
57    
58      -makefile NAME | -mf NAME      -makefile NAME | -mf NAME
59        --makefile=NAME | -mf=NAME        --makefile=NAME | -mf=NAME
60            Call the makefile "NAME".  The default is "Makefile".            Call the makefile "NAME".  The default is "Makefile".
61    
62      -makedepend NAME | -md NAME      -makedepend NAME | -md NAME
63        --makedepend=NAME | -md=NAME        --makedepend=NAME | -md=NAME
64            Use "NAME" for the MAKEDEPEND program.            Use "NAME" for the MAKEDEPEND program.
65    
66      -rootdir NAME | --rootdir NAME | -rd NAME | --rd NAME      -rootdir NAME | --rootdir NAME | -rd NAME | --rd NAME
67        -rootdir=NAME | --rootdir=NAME | -rd=NAME | --rd=NAME        -rootdir=NAME | --rootdir=NAME | -rd=NAME | --rd=NAME
68            Specify the location of the MITgcm ROOTDIR as "NAME".            Specify the location of the MITgcm ROOTDIR as "NAME".
69            By default, genamke will try to find the location by            By default, genamke will try to find the location by
70            looking in parent directories (up to the 5th parent).            looking in parent directories (up to the 5th parent).
71    
72      -mods NAME | --mods NAME | -mo NAME | --mo NAME      -mods NAME | --mods NAME | -mo NAME | --mo NAME
73        -mods=NAME | --mods=NAME | -mo=NAME | --mo=NAME        -mods=NAME | --mods=NAME | -mo=NAME | --mo=NAME
74            Here, "NAME" specifies a list of directories that are            Here, "NAME" specifies a list of directories that are
75            used for additional source code.  Files found in the            used for additional source code.  Files found in the
76            "mods list" are given preference over files of the same            "mods list" are given preference over files of the same
77            name found elsewhere.            name found elsewhere.
78    
79      -disable NAME | --disable NAME      -disable NAME | --disable NAME
80        -disable=NAME | --disable=NAME        -disable=NAME | --disable=NAME
81            Here "NAME" specifies a list of packages that we don't            Here "NAME" specifies a list of packages that we don't
82            want to use.  If this violates package dependencies,            want to use.  If this violates package dependencies,
83            genamke will exit with an error message.            genamke will exit with an error message.
84    
85      -enable NAME | --enable NAME      -enable NAME | --enable NAME
86        -enable=NAME | --enable=NAME        -enable=NAME | --enable=NAME
87            Here "NAME" specifies a list of packages that we wish            Here "NAME" specifies a list of packages that we wish
88            to specifically enable.  If this violates package            to specifically enable.  If this violates package
89            dependencies, genamke will exit with an error message.            dependencies, genamke will exit with an error message.
90    
91      -standarddirs NAME | --standarddirs NAME      -standarddirs NAME | --standarddirs NAME
92        -standarddirs=NAME | --standarddirs=NAME        -standarddirs=NAME | --standarddirs=NAME
93            Here, "NAME" specifies a list of directories to be            Here, "NAME" specifies a list of directories to be
94            used as the "standard" code.            used as the "standard" code.
95    
96      -fortran NAME | --fortran NAME | -fc NAME | --fc NAME      -fortran NAME | --fortran NAME | -fc NAME | --fc NAME
97        -fc=NAME | --fc=NAME        -fc=NAME | --fc=NAME
98            Use "NAME" as the fortran compiler.  By default, genmake            Use "NAME" as the fortran compiler.  By default, genmake
99            will search for a working compiler by trying a list of            will search for a working compiler by trying a list of
100            "usual suspects" such as g77, f77, etc.            "usual suspects" such as g77, f77, etc.
101    
102      -cc NAME | --cc NAME | -cc=NAME | --cc=NAME      -cc NAME | --cc NAME | -cc=NAME | --cc=NAME
103            Use "NAME" as the C compiler.  By default, genmake            Use "NAME" as the C compiler.  By default, genmake
104            will search for a working compiler by trying a list of            will search for a working compiler by trying a list of
105            "usual suspects" such as gcc, c89, cc, etc.            "usual suspects" such as gcc, c89, cc, etc.
106    
107      -use_real4 | -use_r4 | -ur4 | --use_real4 | --use_r4 | --ur4      -use_real4 | -use_r4 | -ur4 | --use_real4 | --use_r4 | --ur4
108            Use "real*4" type for _RS variable (#undef REAL4_IS_SLOW)            Use "real*4" type for _RS variable (#undef REAL4_IS_SLOW)
109            *only* works if CPP_EEOPTIONS.h allows this.            *only* works if CPP_EEOPTIONS.h allows this.
110    
111      -ignoretime | -ignore_time | --ignoretime | --ignore_time      -ignoretime | -ignore_time | --ignoretime | --ignore_time
112            Ignore all the "wall clock" routines entirely.  This will            Ignore all the "wall clock" routines entirely.  This will
113            not in any way hurt the model results -- it simply means            not in any way hurt the model results -- it simply means
114            that the code that checks how long the model spends in            that the code that checks how long the model spends in
115            various routines will give junk values.            various routines will give junk values.
116    
117      -ts | --ts      -ts | --ts
118            Produce timing information per timestep            Produce timing information per timestep
119      -papis | --papis      -papis | --papis
120            Produce summary MFlop/s (and IPC) with PAPI per timestep            Produce summary MFlop/s (and IPC) with PAPI per timestep
121      -pcls | --pcls      -pcls | --pcls
122            Produce summary MFlop/s etc. with PCL per timestep            Produce summary MFlop/s etc. with PCL per timestep
123      -foolad | --foolad      -foolad | --foolad
124            Fool the AD code generator            Fool the AD code generator
125      -papi | --papi      -papi | --papi
126            Performance analysis with PAPI            Performance analysis with PAPI
127      -pcl | --pcl      -pcl | --pcl
128            Performance analysis with PCL            Performance analysis with PCL
129      -hpmt | --hpmt      -hpmt | --hpmt
130            Performance analysis with the HPM Toolkit            Performance analysis with the HPM Toolkit
131    
132      -ieee | --ieee      -ieee | --ieee
133            use IEEE numerics.  Note that this option *only* works            use IEEE numerics.  Note that this option *only* works
134            if it is supported by the OPTFILE that is being used.            if it is supported by the OPTFILE that is being used.
135      -devel | --devel      -devel | --devel
136            Add additional warning and debugging flags for development            Add additional warning and debugging flags for development
137            (if supported by the OPTFILE); also switch to IEEE numerics.            (if supported by the OPTFILE); also switch to IEEE numerics.
138      -gsl | --gsl      -gsl | --gsl
139            Use GSL to control floating point rounding and precision            Use GSL to control floating point rounding and precision
140    
141      -mpi | --mpi      -mpi | --mpi
142            Include MPI header files and link to MPI libraries            Include MPI header files and link to MPI libraries
143      -mpi=PATH | --mpi=PATH      -mpi=PATH | --mpi=PATH
144            Include MPI header files and link to MPI libraries using MPI_ROOT            Include MPI header files and link to MPI libraries using MPI_ROOT
145            set to PATH. i.e. Include files from \$PATH/include, link to libraries            set to PATH. i.e. Include files from \$PATH/include, link to libraries
146            from \$PATH/lib and use binaries from \$PATH/bin.            from \$PATH/lib and use binaries from \$PATH/bin.
147    
148      -omp | --omp      -omp | --omp
149            Activate OpenMP code + use Compiler option OMPFLAG            Activate OpenMP code + use Compiler option OMPFLAG
150      -omp=OMPFLAG | --omp=OMPFLAG      -omp=OMPFLAG | --omp=OMPFLAG
151            Activate OpenMP code + use Compiler option OMPFLAG            Activate OpenMP code + use Compiler option OMPFLAG
152    
153      -es | --es | -embed-source | --embed-source      -es | --es | -embed-source | --embed-source
154            Embed a tarball containing the full source code            Embed a tarball containing the full source code
155            (including the Makefile, etc.) used to build the            (including the Makefile, etc.) used to build the
156            executable [off by default]            executable [off by default]
157    
158      -ds | --ds      -ds | --ds
159            Report genmake internal variables status (DUMPSTATE)            Report genmake internal variables status (DUMPSTATE)
160            to file "genmake_state" (for debug purpose)            to file "genmake_state" (for debug purpose)
161    
162    While it is most often a single word, the "NAME" variables specified    While it is most often a single word, the "NAME" variables specified
163    above can in many cases be a space-delimited string such as:    above can in many cases be a space-delimited string such as:
# Line 174  EOF Line 182  EOF
182  test_for_package_in_cpp_options() {  test_for_package_in_cpp_options() {
183      cpp_options=$1      cpp_options=$1
184      pkg=$2      pkg=$2
185      test_for_string_in_file $cpp_options "^[ ]*#define.*ALLOW_$pkg[ ]"      test_for_string_in_file $cpp_options "^ *# *define *\<ALLOW_$pkg\>"
186      test_for_string_in_file $cpp_options "^[ ]*#undef.*ALLOW_$pkg[ ]"      test_for_string_in_file $cpp_options "^ *# *undef *\<ALLOW_$pkg\>"
187      test_for_string_in_file $cpp_options "^[ ]*#define.*DISABLE_$pkg[ ]"      test_for_string_in_file $cpp_options "^ *# *define *\<DISABLE_$pkg\>"
188      test_for_string_in_file $cpp_options "^[ ]*#undef.*DISABLE_$pkg[ ]"      test_for_string_in_file $cpp_options "^ *# *undef *\<DISABLE_$pkg\>"
     test_for_string_in_file $cpp_options "^[ ]*#define.*ALLOW_$pkg$"  
     test_for_string_in_file $cpp_options "^[ ]*#undef.*ALLOW_$pkg$"  
     test_for_string_in_file $cpp_options "^[ ]*#define.*DISABLE_$pkg$"  
     test_for_string_in_file $cpp_options "^[ ]*#undef.*DISABLE_$pkg$"  
189  }  }
190    
191  # Search for particular CPP #cmds associated with MPI  # Search for particular CPP #cmds associated with MPI
192  # usage: test_for_mpi_in_cpp_eeoptions CPP_file  # usage: test_for_mpi_in_cpp_eeoptions CPP_file
193  test_for_mpi_in_cpp_eeoptions() {  test_for_mpi_in_cpp_eeoptions() {
194      cpp_options=$1      cpp_options=$1
195      test_for_string_in_file $cpp_options "^[ ]*#define.*ALLOW_USE_MPI[ ]"      test_for_string_in_file $cpp_options "^ *# *define *\<ALLOW_USE_MPI\>"
196      test_for_string_in_file $cpp_options "^[ ]*#undef.*ALLOW_USE_MPI[ ]"      test_for_string_in_file $cpp_options "^ *# *undef *\<ALLOW_USE_MPI\>"
     test_for_string_in_file $cpp_options "^[ ]*#define.*ALWAYS_USE_MPI[ ]"  
     test_for_string_in_file $cpp_options "^[ ]*#undef.*ALWAYS_USE_MPI[ ]"  
     test_for_string_in_file $cpp_options "^[ ]*#define.*ALLOW_USE_MPI$"  
     test_for_string_in_file $cpp_options "^[ ]*#undef.*ALLOW_USE_MPI$"  
     test_for_string_in_file $cpp_options "^[ ]*#define.*ALWAYS_USE_MPI$"  
     test_for_string_in_file $cpp_options "^[ ]*#undef.*ALWAYS_USE_MPI$"  
197  }  }
198    
199  # Search for particular string in a file. Return 1 if detected, 0 if not  # Search for particular string in a file. Return 1 if detected, 0 if not
# Line 203  test_for_mpi_in_cpp_eeoptions() { Line 201  test_for_mpi_in_cpp_eeoptions() {
201  test_for_string_in_file() {  test_for_string_in_file() {
202      file=$1      file=$1
203      strng=$2      strng=$2
204      grep -i "$strng" $file > /dev/null 2>&1      grep "$strng" $file > /dev/null 2>&1
205      RETVAL=$?      RETVAL=$?
206      if test "x${RETVAL}" = x0 ; then      if test "x${RETVAL}" = x0 ; then
207          printf "Error: In $file there is an illegal line: "          printf "Error: In $file there is an illegal line: "
208          grep -i "$strng" $file          grep -i "$strng" $file
209          exit 99          exit 99
210      fi      fi
211      return 0      return 0
# Line 218  test_for_string_in_file() { Line 216  test_for_string_in_file() {
216  expand_pkg_groups() {  expand_pkg_groups() {
217      new_packages=      new_packages=
218      if test -r $PKG_GROUPS ; then      if test -r $PKG_GROUPS ; then
219          cat $PKG_GROUPS | sed -e 's/#.*$//g' | sed -e 's/:/ : /g' > ./p1.tmp          cat $PKG_GROUPS | sed -e 's/#.*$//g' | sed -e 's/:/ : /g' > $TMP.p1
220          cat ./p1.tmp | $AWK '(NF>2 && $2==":"){ print $0 }' > ./p2.tmp          cat $TMP.p1 | $AWK '(NF>2 && $2==":"){ print $0 }' > $TMP.p2
221          matched=0          matched=0
222          for i in $PACKAGES ; do          for i in $PACKAGES ; do
223              line=`grep "^ *$i" ./p2.tmp`              line=`grep "^ *$i" $TMP.p2`
224              RETVAL=$?              RETVAL=$?
225              if test "x$RETVAL" = x0 ; then              if test "x$RETVAL" = x0 ; then
226                  matched=1                  matched=1
# Line 234  expand_pkg_groups() { Line 232  expand_pkg_groups() {
232              fi              fi
233          done          done
234          PACKAGES=$new_packages          PACKAGES=$new_packages
235          rm -f ./p[1,2].tmp          rm -f $TMP.p[1,2]
236          return $matched          return $matched
237      else      else
238          echo "Warning: can't read package groups definition file: $PKG_GROUPS"          echo "Warning: can't read package groups definition file: $PKG_GROUPS"
# Line 334  look_for_makedepend()  { Line 332  look_for_makedepend()  {
332      #      #
333      #    1) a makedepend implementation shipped with the cyrus-imapd      #    1) a makedepend implementation shipped with the cyrus-imapd
334      #       package:  ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/      #       package:  ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/
335      #      #    2) a local tools/xmakedepend shell script
     #    2) a known-buggy xmakedpend shell script  
336      #      #
337      #  So the choices are, in order:      #  So the choices are, in order:
     #  
338      #    1) use the user-specified program      #    1) use the user-specified program
339      #    2) use a system-wide default      #    2) use the local xmakedepend script (get all dependencies, but slower)
340      #    3) locally build and use the cyrus implementation      #    3) use a system-wide default
341      #    4) fall back to the buggy local xmakedpend script      #    4) locally build and use the cyrus makedepend
342        #             (faster, but can miss some dependencies)
343      #      #
344      echo >> $LOGFILE      echo >> $LOGFILE
345      echo "running: look_for_makedepend()" >> $LOGFILE      echo "running: look_for_makedepend()" >> $LOGFILE
# Line 353  look_for_makedepend()  { Line 350  look_for_makedepend()  {
350              build_cyrus_makedepend              build_cyrus_makedepend
351              RETVAL=$?              RETVAL=$?
352              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
353                  echo "WARNING: unable to build cyrus-makedepend. Try 'makedepend'"                  echo "WARNING: unable to build cyrus-makedepend. Try other 'makedepend'"
354                  MAKEDEPEND=                  MAKEDEPEND=
355              fi              fi
356          else          else
# Line 366  look_for_makedepend()  { Line 363  look_for_makedepend()  {
363          fi          fi
364      fi      fi
365      if test "x${MAKEDEPEND}" = x ; then      if test "x${MAKEDEPEND}" = x ; then
         which makedepend > /dev/null 2>&1  
         RV0=$?  
366          test -f $MAKEFILE  &&  mv -f $MAKEFILE $MAKEFILE".tst"          test -f $MAKEFILE  &&  mv -f $MAKEFILE $MAKEFILE".tst"
367          #  echo 'MAKEFILE="'$MAKEFILE'"'          #  echo 'MAKEFILE="'$MAKEFILE'"'
368          cat <<EOF >> $MAKEFILE          cat <<EOF >> $MAKEFILE
# Line 383  EOF Line 378  EOF
378        stop        stop
379        end        end
380  EOF  EOF
381          makedepend -f $MAKEFILE genmake_tc.f > /dev/null 2>&1          $ROOTDIR/tools/xmakedepend -f $MAKEFILE genmake_tc.f > /dev/null 2>&1
382          RV1=$?          RV1=$?
383            which makedepend > /dev/null 2>&1
384            RV2=$?
385            if test "x${RV2}" = x0 ; then
386                makedepend -f $MAKEFILE genmake_tc.f > /dev/null 2>&1
387                RV3=$? ; loc_msg='not working.'
388            else RV3=$RV2 ; loc_msg='not found.'
389            fi
390          test -f $MAKEFILE  &&  rm -f $MAKEFILE          test -f $MAKEFILE  &&  rm -f $MAKEFILE
391          test -f $MAKEFILE".tst"  &&  mv -f $MAKEFILE".tst" $MAKEFILE          test -f $MAKEFILE".tst"  &&  mv -f $MAKEFILE".tst" $MAKEFILE
392          if test "x${RV0}${RV1}" = x00 ; then          echo "  check makedepend (local: $RV1, system: $RV2, $RV3)"
393            if test "x${RV1}" = x0 ; then
394                MAKEDEPEND='$(TOOLSDIR)/xmakedepend'
395                echo " --> set MAKEDEPEND=${MAKEDEPEND}" >> $LOGFILE
396            elif test "x${RV3}" = x0 ; then
397                echo "    local tools/xmakedepend not working. Use system-default makedepend"
398              MAKEDEPEND=makedepend              MAKEDEPEND=makedepend
399              echo " --> set MAKEDEPEND=${MAKEDEPEND}" >> $LOGFILE              echo " --> set MAKEDEPEND=${MAKEDEPEND}" >> $LOGFILE
400          else          else
401              echo "    system-default makedepend not found. Try to build cyrus-makedepend"              echo "    local tools/xmakedepend not working; system-default makedepend $loc_msg"
402                echo -n "    Try to build cyrus-makedepend ..."
403              #  Try to build the cyrus implementation              #  Try to build the cyrus implementation
404              build_cyrus_makedepend              build_cyrus_makedepend
405              RETVAL=$?              RETVAL=$?
406              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" = x0 ; then
407                  echo "WARNING: unable to build cyrus-makedepend. Use local xmakedepend"                  echo "  Works"
408                  MAKEDEPEND='$(TOOLSDIR)/xmakedepend'              else
409                  echo " --> set MAKEDEPEND=${MAKEDEPEND}" >> $LOGFILE                  echo "  Fails" ; echo "" >> $LOGFILE
410                    echo "ERROR: no working makedepend found ; look_for_makedepend FAILED" | tee -a $LOGFILE
411                    echo ""
412                    exit -1
413                    return
414              fi              fi
415          fi          fi
416      fi      fi
# Line 411  build_cyrus_makedepend()  { Line 423  build_cyrus_makedepend()  {
423      (      (
424          cd $ROOTDIR/tools/cyrus-imapd-makedepend  \          cd $ROOTDIR/tools/cyrus-imapd-makedepend  \
425              &&  ./configure > /dev/null 2>&1  \              &&  ./configure > /dev/null 2>&1  \
426              &&  make > /dev/null 2>&1              &&  $MAKE > /dev/null 2>&1
427          if test -x ./makedepend.exe ; then          if test -x ./makedepend.exe ; then
428              $LN ./makedepend.exe ./makedepend              $LN ./makedepend.exe ./makedepend
429          fi          fi
# Line 435  build_embed_encode() Line 447  build_embed_encode()
447  {  {
448      printf "  building the embed-encode utility...  "      printf "  building the embed-encode utility...  "
449      if test ! -e "$ROOTDIR/tools/embed_encode/encode_files" ; then      if test ! -e "$ROOTDIR/tools/embed_encode/encode_files" ; then
450          if test ! -d "$ROOTDIR/tools/embed_encode" ; then          if test ! -d "$ROOTDIR/tools/embed_encode" ; then
451              echo              echo
452              echo "    Error: can't locate \"$ROOTDIR/tools/embed_encode\""              echo "    Error: can't locate \"$ROOTDIR/tools/embed_encode\""
453              echo              echo
454              EMBED_SRC=f              EMBED_SRC=f
455              return 1              return 1
456          fi          fi
457          clist="cc gcc c89 $CC"          clist="cc gcc c89 $CC"
458          for ic in $clist ; do          for ic in $clist ; do
459              comm="$ic -o encode_files encode_files.c"              comm="$ic -o encode_files encode_files.c"
# Line 596  Error: No options file was found in:  $R Line 608  Error: No options file was found in:  $R
608  EOF  EOF
609          exit 1          exit 1
610      fi      fi
611    }
612    
613    #  Do a local copy of MPI headers files (in local dir ./mpi_headers/) after
614    #  checking for additional included headers (in case of chain of included header)
615    mpi_headers_do_local_copy() {
616    
617        dBug=0
618        rm -rf ./mpi_headers
619        if test -d $MPIINCLUDEDIR ; then
620    
621            #----- check for additional headers (chain of included headers)
622            echo -n '  Check MPI headers ... '
623            listIni=$MPI_HEADER_FILES
624            echo $listIni | grep "\<mpif.h\>" > /dev/null 2>&1
625            outp=$?
626            #- always check mpif.h (the only mpi-header included in standard MITgcm code)
627            if test $outp != 0 ; then listIni="mpif.h $listIni" ; fi
628            if test $dBug = 1 ; then echo "listIni='$listIni'" ; fi
629    
630            doCheck=1 ; list2copy='' ; list2check=$listIni
631            while test $doCheck = 1 ; do
632              newList=''
633              for i in $list2check ; do
634                if test -f $MPIINCLUDEDIR/$i ; then
635                  newInc=`grep '^ *include ' $MPIINCLUDEDIR/$i | \
636                    sed -e 's/^ *include //' -e 's/\!.*$//' -e "s/'//g"  -e 's/\"//g'`
637                  if test $dBug = 1 ; then echo -n "checking $i : newInc='$newInc'" ; fi
638                  for j in $newInc ; do
639                    echo $listIni $list2copy $newList | grep "\<$j\>" > /dev/null 2>&1
640                    outp=$?
641                    if test $outp != 0 ; then
642                      if test $dBug = 1 ; then echo -n " ; adding $j" ; fi
643                      newList="$newList $j"
644                    fi
645                  done
646                  if test $dBug = 1 ; then echo "" ; fi
647                fi
648              done
649              if test "x$newList" = x ; then doCheck=0
650              else list2check=$newList ; list2copy="$list2copy $newList"
651              fi
652            done
653            list2copy="$MPI_HEADER_FILES $list2copy"
654            if test $dBug = 1 ; then echo "list2copy='$list2copy'" ; fi
655    
656  #     # look for possible MPI libraries          #----- create local mpi_headers dir if we have files to copy
657  #     mpi_libs=          mkListInc=`echo $list2copy | wc -w`
658  #     mpi_fort=`which mpif77 2>/dev/null`          if test $mkListInc != 0 ; then
659  #     RETVAL=$?            echo 'create local "./mpi_headers" dir'
660  #     if test "x${RETVAL}" = x0 ; then            mkdir -p ./mpi_headers
661  #       cat >>test.f <<EOF            INCLUDES="-I./mpi_headers $INCLUDES"
662  #       PROGRAM HELLO            mkListInc=1
663  #       DO 10, I=1,10          fi
664  #       PRINT *,'Hello World'          if test "x$LOCAL_MPI_HEADERS" != x ; then mkListInc=0 ; fi
665  #    10 CONTINUE  
666  #       STOP          #----- make local copy and update LOCAL_MPI_HEADERS (if not already set)
667  #       END          for i in $list2copy ; do
668  # EOF            if test -f $MPIINCLUDEDIR/$i ; then
669  #       eval "$mpi_fort -showme test.f > out"              cp -p $MPIINCLUDEDIR/$i ./mpi_headers
670  #       RETVAL=$?              if test $i = 'mpif.h' ; then
671  #       if test "x${RETVAL}" = x0 ; then                  perl -i -pe 's/MPI_DISPLACEMENT_CURRENT=-1_8/MPI_DISPLACEMENT_CURRENT=-1/g' mpi_headers/mpif.h
672  #           a=`cat out`              fi
673  #           for i in $a ; do              if test $mkListInc = 2 ; then
674  #               case $i in                  LOCAL_MPI_HEADERS="$LOCAL_MPI_HEADERS ./mpi_headers/$i"
675  #                   -*)              fi
676  #                       mpi_libs="$mpi_libs $i" ;;              if test $mkListInc = 1 ; then
677  #               esac                  LOCAL_MPI_HEADERS="./mpi_headers/$i" ; mkListInc=2
678  #           done              fi
679  #           echo "The MPI libs appear to be:"            fi
680  #           echo "  "$mpi_libs          done
681  #       fi      else
682  #       rm -f test.f out          echo "WARNING: MPIINCLUDEDIR='$MPIINCLUDEDIR' is not a directory"
683  #     fi          echo "WARNING: => skip checking for MPI headers (no ./mpi_headers dir)"
684    #       exit -1
685        fi
686  }  }
687    
688  #  Parse the package dependency information  #  Parse the package dependency information
# Line 946  check_netcdf_libs()  { Line 1004  check_netcdf_libs()  {
1004        program fgennc        program fgennc
1005  #include "netcdf.inc"  #include "netcdf.inc"
1006  EOF  EOF
1007      if test ! "x$MPI" = x ; then     #if test ! "x$MPI" = x ; then
1008          echo '#include "mpif.h"' >> genmake_tnc.F     #    echo '#include "mpif.h"' >> genmake_tnc.F
1009      fi     #fi
1010      cat <<EOF >> genmake_tnc.F      cat <<EOF >> genmake_tnc.F
1011        integer iret, ncid, xid        integer iret, ncid, xid
1012        iret = nf_create('genmake_tnc.nc', NF_CLOBBER, ncid)        iret = nf_create('genmake_tnc.nc', NF_CLOBBER, ncid)
# Line 1029  EOF Line 1087  EOF
1087  }  }
1088    
1089  check_lapack_libs()  {  check_lapack_libs()  {
1090      if test ! "x$SKIP_LAPACK_CHECK" = x ; then      if test "x$CHECK_FOR_LAPACK" = xf ; then return ; fi
         return  
     fi  
1091      echo >> $LOGFILE      echo >> $LOGFILE
1092      echo "running: check_lapack_libs()" >> $LOGFILE      echo "running: check_lapack_libs()" >> $LOGFILE
1093      cat <<EOF > genmake_tla.F      cat <<EOF > genmake_tla.F
# Line 1131  EOF Line 1187  EOF
1187      echo " --> set HAVE_LAPACK='$HAVE_LAPACK'" >> $LOGFILE      echo " --> set HAVE_LAPACK='$HAVE_LAPACK'" >> $LOGFILE
1188  }  }
1189    
1190    check_HAVE_FLUSH()  {
1191        if test ! "x$SKIP_CHECK_FLUSH" = x ; then
1192            return
1193        fi
1194        echo >> $LOGFILE
1195        echo "running: check_HAVE_FLUSH()" >> $LOGFILE
1196        cat <<EOF > genmake_tflsh.$FS
1197          program fgenflsh
1198          integer iounit
1199          character*9 fname
1200          iounit = 26
1201          fname = 'tmp.tflsh'
1202          open(iounit,FILE=fname,STATUS='unknown')
1203          write(iounit,*) 'genmake_tflsh: hello'
1204          call flush(iounit)
1205          close(iounit)
1206          end
1207    EOF
1208        echo "===  genmake_tflsh.$FS  >>>" > genmake_tflsh.log
1209        cat genmake_tflsh.$FS >> genmake_tflsh.log
1210        echo "<<<  genmake_tflsh.$FS  ===" >> genmake_tflsh.log
1211    
1212        echo "$FC $FFLAGS $FOPTIM -c genmake_tflsh.$FS  \ " >> genmake_tflsh.log
1213        echo "  &&  $LINK $FFLAGS $FOPTIM -o genmake_tflsh.o $LIBS" >> genmake_tflsh.log
1214        $FC $FFLAGS $FOPTIM -c genmake_tflsh.$FS >> genmake_tflsh.log 2>&1  \
1215            &&  $LINK $FFLAGS $FOPTIM -o genmake_tflsh genmake_tflsh.o $LIBS >> genmake_tflsh.log 2>&1
1216        RET_COMPILE=$?
1217    
1218        if test "x$RET_COMPILE" = x0 ; then
1219            HAVE_FLUSH=t
1220            #cat genmake_tflsh.log >> $LOGFILE
1221            echo "  check_HAVE_FLUSH: successful" >> $LOGFILE
1222        else
1223            HAVE_FLUSH=f
1224            cat genmake_tflsh.log >> $LOGFILE
1225        fi
1226        rm -f genmake_tflsh*
1227        echo " --> set HAVE_FLUSH='$HAVE_FLUSH'" >> $LOGFILE
1228    }
1229    
1230  ###############################################################################  ###############################################################################
1231  #   Sequential part of script starts here  #   Sequential part of script starts here
# Line 1188  GSL= Line 1283  GSL=
1283  DEVEL=  DEVEL=
1284  HAVE_TEST_L=  HAVE_TEST_L=
1285    
1286    # set this to "t" to enable lapack test
1287    CHECK_FOR_LAPACK=f
1288    
1289  # DEFINES checked by test compilation or command-line  # DEFINES checked by test compilation or command-line
1290  HAVE_SYSTEM=  HAVE_SYSTEM=
1291  HAVE_FDATE=  HAVE_FDATE=
# Line 1199  HAVE_NETCDF= Line 1297  HAVE_NETCDF=
1297  HAVE_ETIME=  HAVE_ETIME=
1298  IGNORE_TIME=  IGNORE_TIME=
1299  HAVE_LAPACK=  HAVE_LAPACK=
1300    HAVE_FLUSH=
1301    
1302  MODS=  MODS=
1303  TOOLSDIR=  TOOLSDIR=
# Line 1206  SOURCEDIRS= Line 1305  SOURCEDIRS=
1305  INCLUDEDIRS=  INCLUDEDIRS=
1306  STANDARDDIRS="USE_THE_DEFAULT"  STANDARDDIRS="USE_THE_DEFAULT"
1307    
1308    #- local config file
1309    gm_local="genmake_local"
1310    
1311  G2ARGS=  G2ARGS=
1312  BASH=  BASH=
1313  PWD=`pwd`  PWD=`pwd`
# Line 1229  FS= Line 1331  FS=
1331  FS90=  FS90=
1332    
1333  AUTODIFF_PKG_USED=f  AUTODIFF_PKG_USED=f
1334    OPENAD=
1335  AD_OPTFILE=  AD_OPTFILE=
1336    CAT_SRC_FOR_TAF=1
1337  TAF=  TAF=
1338  AD_TAF_FLAGS=  AD_TAF_FLAGS=
1339  FTL_TAF_FLAGS=  FTL_TAF_FLAGS=
# Line 1241  FTL_TAF_FLAGS= Line 1345  FTL_TAF_FLAGS=
1345  SVD_TAMC_FLAGS=  SVD_TAMC_FLAGS=
1346  TAMC_EXTRA=  TAMC_EXTRA=
1347    
1348    DIVA=
1349    MPIINCLUDEDIR=
1350    MPI_HEADER_FILES=
1351    LOCAL_MPI_HEADERS=
1352    
1353  #  The following state can be set directly by command-line switches  #  The following state can be set directly by command-line switches
1354  gm_s1="OPTFILE PKG_DEPEND PKG_GROUPS DISABLE ENABLE MAKEFILE MAKEDEPEND PLATFORM"  gm_s1="ROOTDIR STANDARDDIRS MODS PKG_DEPEND PKG_GROUPS DISABLE ENABLE"
1355  gm_s2="FC CC MPI OMP USE_R4 TS PAPIS PCLS PAPI PCL HPMT IEEE DEVEL GSL FEXTRAFLAGS"  gm_s2="PLATFORM OPTFILE MAKE MAKEFILE MAKEDEPEND FC CC MPI OMP USE_R4"
1356  gm_s3="ROOTDIR STANDARDDIRS MODS DUMPSTATE"  gm_s3="FEXTRAFLAGS IEEE DEVEL GSL TS PAPIS PCLS PAPI PCL HPMT DUMPSTATE"
1357    
1358  #  The following state is not directly set by command-line switches  #  The following state is not directly set by command-line switches
1359  gm_s4="LN S64 LINK MAKE PACKAGES INCLUDES FFLAGS FOPTIM"  gm_s4="LN S64 LINK PACKAGES INCLUDES FFLAGS FOPTIM"
1360  gm_s5="CFLAGS LIBS KPP KFLAGS1 KFLAGS2 KPPFILES NOOPTFILES NOOPTFLAGS"  gm_s5="CFLAGS LIBS KPP KFLAGS1 KFLAGS2 KPPFILES NOOPTFILES NOOPTFLAGS"
1361  gm_s6="TOOLSDIR SOURCEDIRS INCLUDEDIRS EXEDIR EXECUTABLE EXEHOOK"  gm_s6="PWD TOOLSDIR SOURCEDIRS INCLUDEDIRS EXEDIR EXECUTABLE EXEHOOK"
1362  gm_s7="PWD THISHOST THISUSER THISDATE THISVER MACHINE"  gm_s7="TMP THISHOST THISUSER THISDATE THISVER MACHINE FC_NAMEMANGLE"
1363  gm_s8="FC_NAMEMANGLE HAVE_NETCDF HAVE_SYSTEM HAVE_FDATE HAVE_ETIME HAVE_LAPACK"  gm_s8="HAVE_NETCDF HAVE_SYSTEM HAVE_FDATE HAVE_ETIME HAVE_LAPACK HAVE_FLUSH"
1364    
1365  #  The following are all related to adjoint/tangent-linear stuff  #  The following are all related to adjoint/tangent-linear stuff
1366  gm_s10="AUTODIFF_PKG_USED AD_OPTFILE TAMC TAF AD_TAMC_FLAGS AD_TAF_FLAGS"  gm_s10="AUTODIFF_PKG_USED AD_OPTFILE OPENAD TAMC TAF AD_TAMC_FLAGS AD_TAF_FLAGS"
1367  gm_s11="FTL_TAMC_FLAGS FTL_TAF_FLAGS SVD_TAMC_FLAGS SVD_TAF_FLAGS"  gm_s11="FTL_TAMC_FLAGS FTL_TAF_FLAGS SVD_TAMC_FLAGS SVD_TAF_FLAGS"
1368  gm_s12="TAF_EXTRA TAMC_EXTRA"  gm_s12="TAF_EXTRA TAMC_EXTRA DIVA MPIINCLUDEDIR MPI_HEADER_FILES"
1369    
1370  gm_state="COMMANDL $gm_s1 $gm_s2 $gm_s3 $gm_s4 $gm_s5 $gm_s6 $gm_s7 $gm_s8"  gm_state="COMMANDL $gm_s1 $gm_s2 $gm_s3 $gm_s4 $gm_s5 $gm_s6 $gm_s7 $gm_s8"
1371  gm_state="$gm_state $gm_s10 $gm_s11 $gm_s12"  gm_state="$gm_state $gm_s10 $gm_s11 $gm_s12"
# Line 1277  LOGFILE="genmake.log" Line 1386  LOGFILE="genmake.log"
1386  rm -f genmake_state genmake_*optfile $LOGFILE  rm -f genmake_state genmake_*optfile $LOGFILE
1387    
1388  echo "===  Processing options files and arguments  ==="  echo "===  Processing options files and arguments  ==="
 gm_local="genmake_local"  
 printf "  getting local config information:  "  
 if test -f $gm_local ; then  
     echo "using $gm_local"  
     . $gm_local  
     # echo "DISABLE=$DISABLE"  
     # echo "ENABLE=$ENABLE"  
 else  
     echo "none found"  
 fi  
1389    
1390  #echo "$0::$1:$2:$3:$4:$5:$6:$7:"  #echo "$0::$1:$2:$3:$4:$5:$6:$7:"
1391  #parse_options  #parse_options
# Line 1316  for ac_option in "$@" ; do Line 1415  for ac_option in "$@" ; do
1415          -optfile=* | --optfile=* | -of=* | --of=*)          -optfile=* | --optfile=* | -of=* | --of=*)
1416              OPTFILE=$ac_optarg ;;              OPTFILE=$ac_optarg ;;
1417    
1418            -oad | --oad)
1419                OPENAD="true" ; ALWAYS_USE_F90=1 ;;
1420            -nocat4ad | -dog4ad | -ncad | -dad)
1421                CAT_SRC_FOR_TAF=0 ;;
1422          -adoptfile | --adoptfile | -adof | --adof)          -adoptfile | --adoptfile | -adof | --adof)
1423              ac_prev=AD_OPTFILE ;;              ac_prev=AD_OPTFILE ;;
1424          -adoptfile=* | --adoptfile=* | -adof=* | --adof=*)          -adoptfile=* | --adoptfile=* | -adof=* | --adof=*)
# Line 1346  for ac_option in "$@" ; do Line 1449  for ac_option in "$@" ; do
1449          -makedepend=* | --makedepend=* | -md=* | --md=*)          -makedepend=* | --makedepend=* | -md=* | --md=*)
1450              MAKEDEPEND=$ac_optarg ;;              MAKEDEPEND=$ac_optarg ;;
1451    
1452          -makefile | --makefile | -ma | --ma)          -makefile | --makefile | -mf | --mf)
1453              ac_prev=MAKEFILE ;;              ac_prev=MAKEFILE ;;
1454          -makefile=* | --makefile=* | -ma=* | --ma=*)          -makefile=* | --makefile=* | -mf=* | --mf=*)
1455              MAKEFILE=$ac_optarg ;;              MAKEFILE=$ac_optarg ;;
1456    
1457          -platform | --platform | -pl | --pl | -platform=* | --platform=* | -pl=* | --pl=*)          -platform | --platform | -pl | --pl | -platform=* | --platform=* | -pl=* | --pl=*)
# Line 1415  for ac_option in "$@" ; do Line 1518  for ac_option in "$@" ; do
1518              IEEE=true ;;              IEEE=true ;;
1519          -noieee | --noieee)          -noieee | --noieee)
1520              echo "Warning: ignore option '$ac_option' (default is already without '-ieee')" ;;              echo "Warning: ignore option '$ac_option' (default is already without '-ieee')" ;;
1521          -devel | --devel)          -devel | --devel)
1522              IEEE=true ; DEVEL=true ;;              IEEE=true ; DEVEL=true ;;
1523          -gsl | --gsl)          -gsl | --gsl)
1524              GSL=true ;;              GSL=true ;;
1525    
1526          -ts | --ts)          -ts | --ts)
# Line 1485  for ac_option in "$@" ; do Line 1588  for ac_option in "$@" ; do
1588    
1589  done  done
1590    
1591    #TMP=./genmk_$$
1592    #- try to put temporary files in system-local /tmp dir
1593    TMP=/tmp/genmk_${USER}_$$
1594    touch $TMP ; retVal=$?
1595    if [ $retVal -eq 0 ] ; then
1596      if test ! -r $TMP ; then TMP=./genmk_$$ ; fi
1597    else
1598      TMP=./genmk_$$
1599    fi
1600    rm -f $TMP
1601    #echo "  temp files: $TMP.*"
1602    
1603    printf "  getting local config information:  "
1604    if test -f $gm_local ; then
1605        echo "using $gm_local"
1606        . $gm_local
1607    else
1608        echo "none found"
1609    fi
1610    
1611  if test -f ./.genmakerc ; then  if test -f ./.genmakerc ; then
1612      echo      echo
1613      echo "WARNING: genmake2 has detected a copy of the old-style \"./.genmakerc\""      echo "WARNING: genmake2 has detected a copy of the old-style \"./.genmakerc\""
# Line 1569  fi Line 1692  fi
1692    
1693  echo "  getting AD_OPTFILE information:"  echo "  getting AD_OPTFILE information:"
1694  if test "x${AD_OPTFILE}" = x ; then  if test "x${AD_OPTFILE}" = x ; then
1695      if test "x$MITGCM_AD_OF" = x ; then      if test "x$MITGCM_AD_OF" != x ; then
1696            AD_OPTFILE=$MITGCM_AD_OF
1697        elif test "x$OPENAD" = x ; then
1698          AD_OPTFILE=$ROOTDIR/tools/adjoint_options/adjoint_default          AD_OPTFILE=$ROOTDIR/tools/adjoint_options/adjoint_default
1699      else      else
1700          AD_OPTFILE=$MITGCM_AD_OF          AD_OPTFILE=$ROOTDIR/tools/adjoint_options/adjoint_oad
1701      fi      fi
1702  fi  fi
1703  if test "x${AD_OPTFILE}" != xNONE ; then  if test "x${AD_OPTFILE}" != xNONE ; then
# Line 1696  check_for_broken_Ff Line 1821  check_for_broken_Ff
1821    
1822  if test ! "x$MPI" = x ; then  if test ! "x$MPI" = x ; then
1823        echo "  Turning on MPI cpp macros"        echo "  Turning on MPI cpp macros"
1824        DEFINES="$DEFINES -DALLOW_USE_MPI -DALWAYS_USE_MPI"        DEFINES="$DEFINES -DALLOW_USE_MPI"
1825    #- To compile code older than checkpoint63s (2012/09/05), un-comment the following line:
1826    #     DEFINES="$DEFINES -DALWAYS_USE_MPI"
1827  fi  fi
1828  if test ! "x$OMP" = x ; then  if test ! "x$OMP" = x ; then
1829        echo "  Add OMPFLAG and turn on OpenMP cpp macros"        echo "  Add OMPFLAG and turn on OpenMP cpp macros"
# Line 1771  if test ! "x$HPMT" = x ; then Line 1898  if test ! "x$HPMT" = x ; then
1898        if test ! "x$PAPI" = x ; then        if test ! "x$PAPI" = x ; then
1899            echo "  PAPI and the HPM Toolkit cannot co-exist!"            echo "  PAPI and the HPM Toolkit cannot co-exist!"
1900            echo "  Sticking with PAPI!"            echo "  Sticking with PAPI!"
1901        else if test ! "x$PCL" = x ; then        else
1902            if test ! "x$PCL" = x ; then
1903            echo "  PCL and the HPM Toolkit cannot co-exist!"            echo "  PCL and the HPM Toolkit cannot co-exist!"
1904            echo "  Sticking with PCL!"            echo "  Sticking with PCL!"
1905        else          else
1906            echo "  Turning on performance analysis with the HPM Toolkit"            echo "  Turning on performance analysis with the HPM Toolkit"
1907            echo "  Please make sure HPMTINC, HPMTLIB are defined"            echo "  Please make sure HPMTINC, HPMTLIB are defined"
1908            DEFINES="$DEFINES -DUSE_LIBHPM"            DEFINES="$DEFINES -DUSE_LIBHPM"
1909            INCLUDES="$INCLUDES $HPMTINC"            INCLUDES="$INCLUDES $HPMTINC"
1910            LIBS="$LIBS $HPMTLIB"            LIBS="$LIBS $HPMTLIB"
1911        fi          fi
1912        fi        fi
1913  fi  fi
1914  if test ! "x$GSL" = x ; then  if test ! "x$GSL" = x ; then
# Line 1836  else Line 1964  else
1964  fi  fi
1965  rm -f genmake_tcomp*  rm -f genmake_tcomp*
1966    
1967  printf "  Do we have the etime() command using $FC...  "  printf "  Do we have the etime() command using $FC... "
1968  cat > genmake_tcomp.$FS <<EOF  cat > genmake_tcomp.$FS <<EOF
1969        program hello        program hello
1970        REAL*4 ACTUAL, TARRAY(2)        REAL*4 actual, tarray(2)
1971        EXTERNAL ETIME        actual = -999.
1972        REAL*4 ETIME        call ETIME( tarray, actual )
1973        actual = etime( tarray )        if ( actual.ge.0. ) then
1974        print *, tarray          print *, 0, tarray, actual
1975          else
1976            print *, 1, tarray, actual
1977          endif
1978        end        end
1979  EOF  EOF
1980  $FC $FFLAGS -o genmake_tcomp genmake_tcomp.$FS > genmake_tcomp.log 2>&1  $FC $FFLAGS -o genmake_tcomp genmake_tcomp.$FS > genmake_tcomp.log 2>&1
1981  RETVAL=$?  RETVAL=$?
1982  if test "x$RETVAL" = x0 ; then  if test "x$RETVAL" = x0 ; then
1983        echo -n 'c,'
1984        ./genmake_tcomp > genmake_tcomp.out 2>&1
1985        RETVAL=$?
1986    fi
1987    if test "x$RETVAL" = x0 ; then
1988        echo -n 'r:'
1989        RETVAL=`cat genmake_tcomp.out | $AWK '{print $1}'`
1990    fi
1991    if test "x$RETVAL" = x0 ; then
1992      HAVE_ETIME=t      HAVE_ETIME=t
1993      DEFINES="$DEFINES -DHAVE_ETIME"      DEFINES="$DEFINES -DHAVE_ETIME"
1994      echo "yes"      echo " yes"
1995  else  else
1996      HAVE_ETIME=      HAVE_ETIME=
1997      echo "no"      echo " no"
1998  fi  fi
1999    #mkdir chk_etime ; cp -p -f genmake_tcomp* chk_etime
2000  rm -f genmake_tcomp*  rm -f genmake_tcomp*
2001    
2002  printf "  Can we call simple C routines (here, \"cloc()\") using $FC...  "  printf "  Can we call simple C routines (here, \"cloc()\") using $FC...  "
# Line 1920  if test "x$HAVE_LAPACK" != x ; then Line 2061  if test "x$HAVE_LAPACK" != x ; then
2061  else  else
2062      echo "no"      echo "no"
2063  fi  fi
 DEFINES="$DEFINES $IGNORE_TIME"  
2064    
2065    printf "  Can we call FLUSH intrinsic subroutine...  "
2066    check_HAVE_FLUSH
2067    if test "x$HAVE_FLUSH" = xt ; then
2068        DEFINES="$DEFINES -DHAVE_FLUSH"
2069        echo "yes"
2070    else
2071        echo "no"
2072    fi
2073    
2074    DEFINES="$DEFINES $IGNORE_TIME"
2075  if test "x$EMBED_SRC" = xt ; then  if test "x$EMBED_SRC" = xt ; then
2076      build_embed_encode      build_embed_encode
2077  fi  fi
# Line 2105  else Line 2255  else
2255          exit 1          exit 1
2256      else      else
2257          echo "    using PKG_LIST=\"$PKG_LIST\""          echo "    using PKG_LIST=\"$PKG_LIST\""
2258          #  Strip the comments and add all the names          #  Strip the comments and add all the names
2259          pkg_list=`cat $PKG_LIST | sed -e 's/#.*$//g' | $AWK '(NF>0){print $0}'`          pkg_list=`cat $PKG_LIST | sed -e 's/#.*$//g' | $AWK '(NF>0){print $0}'`
2260          RETVAL=$?          RETVAL=$?
2261          if test "x${RETVAL}" != x0 ; then          if test "x${RETVAL}" != x0 ; then
# Line 2126  if test "x${PKG_GROUPS}" != x ; then Line 2276  if test "x${PKG_GROUPS}" != x ; then
2276  fi  fi
2277    
2278  echo "  applying DISABLE settings"  echo "  applying DISABLE settings"
2279  echo "" > ./.tmp_pack  echo "" > $TMP.pack
2280  for i in $PACKAGES ; do  for i in $PACKAGES ; do
2281      echo $i >> ./.tmp_pack      echo $i >> $TMP.pack
2282  done  done
2283  for i in `grep  "-" ./.tmp_pack` ; do  for i in `grep  "-" $TMP.pack` ; do
2284      j=`echo $i | sed 's/[-]//'`      j=`echo $i | sed 's/[-]//'`
2285      DISABLE="$DISABLE $j"      DISABLE="$DISABLE $j"
2286  done  done
# Line 2148  for p in $PACKAGES ; do Line 2298  for p in $PACKAGES ; do
2298  done  done
2299  PACKAGES="$pack"  PACKAGES="$pack"
2300  echo "  applying ENABLE settings"  echo "  applying ENABLE settings"
2301  echo "" > ./.tmp_pack  echo "" > $TMP.pack
2302  PACKAGES="$PACKAGES $ENABLE"  PACKAGES="$PACKAGES $ENABLE"
2303  # Test if each explicitly referenced package exists  # Test if each explicitly referenced package exists
2304  for i in $PACKAGES ; do  for i in $PACKAGES ; do
# Line 2157  for i in $PACKAGES ; do Line 2307  for i in $PACKAGES ; do
2307          echo "Error: dir '$ROOTDIR/pkg/$i' missing for package '$i'"          echo "Error: dir '$ROOTDIR/pkg/$i' missing for package '$i'"
2308          exit 1          exit 1
2309      fi      fi
2310      echo $i >> ./.tmp_pack      echo $i >> $TMP.pack
2311  done  done
2312  PACKAGES=  PACKAGES=
2313  for i in `grep -v "-" ./.tmp_pack | sort | uniq` ; do  for i in `grep -v "-" $TMP.pack | sort | uniq` ; do
2314      PACKAGES="$PACKAGES $i"      PACKAGES="$PACKAGES $i"
2315  done  done
2316  rm -f ./.tmp_pack  rm -f $TMP.pack
2317  echo "    packages are: $PACKAGES"  echo "    packages are: $PACKAGES"
2318    
2319  #  Check for package MNC: if NetCDF is available, then build the MNC  #  Check for package MNC: if NetCDF is available, then build the MNC
# Line 2200  else Line 2350  else
2350          echo "Error: problem encountered while building source files in pkg/mnc:"          echo "Error: problem encountered while building source files in pkg/mnc:"
2351          cat make_mnc.errors 1>&2          cat make_mnc.errors 1>&2
2352          if test "x$mnc_in" = x0 ; then          if test "x$mnc_in" = x0 ; then
2353              exit 1              exit 1
2354          else          else
2355              DISABLE="$DISABLE mnc"              DISABLE="$DISABLE mnc"
2356          fi          fi
# Line 2233  EOF Line 2383  EOF
2383      fi      fi
2384  fi  fi
2385    
2386  #  Check for package RADTRANS: if LAPACK is not available,  #  Make sure the openad package is enabled if using OpenAD
2387  #  then issue a warning that the direct radtrans solver is not available.  if test "x$OPENAD" != x ; then
2388  if test "x$HAVE_LAPACK" != xt ; then      echo " $PACKAGES " | grep ' openad ' > /dev/null 2>&1
     echo " $PACKAGES " | grep ' radtrans ' > /dev/null 2>&1  
2389      RETVAL=$?      RETVAL=$?
2390      if test "x$RETVAL" = x0 ; then      if test "x$RETVAL" != x0 ; then
2391          cat <<EOF          cat <<EOF
 *********************************************************************  
 WARNING: the "radtrans" package was enabled but tests failed to  
   compile LAPACK applications.  This means that the direct radtrans  
   solver is not available and compilation will fail if it is enabled.  
   If you want to use the direct solver, please check that:  
2392    
   1) LAPACK is correctly installed for this compiler and  
   2) the LIBS variable (within the "optfile") specifies the correct  
      LAPACK library to link against.  
2393  *********************************************************************  *********************************************************************
2394    ERROR: when generating an adjoint with OpenAD, the openad package
2395      must be enabled.  Please add it to packages.conf.
2396    *********************************************************************
2397    
2398  EOF  EOF
2399            exit 1
2400      fi      fi
2401  fi  fi
2402    
# Line 2442  fi Line 2588  fi
2588    
2589  #  Here, we build the list of files to be "run through" the adjoint  #  Here, we build the list of files to be "run through" the adjoint
2590  #  compiler.  #  compiler.
2591  if test -f ./adSrcFiles.tmp ; then  if test -f $TMP.adSrcFiles ; then
2592      rm -f ./adSrcFiles.tmp      rm -f $TMP.adSrcFiles
2593  fi  fi
2594  echo "  Creating the list of files for the adjoint compiler."  echo "  Creating the list of files for the adjoint compiler."
2595  touch adSrcFiles.tmp  touch $TMP.adSrcFiles
2596  for i in $SOURCEDIRS ; do  for i in $SOURCEDIRS ; do
2597      list_files=`( cd $i && ls -1 *.list 2>/dev/null )`      list_files=`( cd $i && ls -1 *.list 2>/dev/null )`
2598      for j in $list_files ; do      for j in $list_files ; do
2599          cat $i/$j >> adSrcFiles.tmp          cat $i/$j >> $TMP.adSrcFiles
2600      done      done
2601  done  done
2602  if test ! "x"$FS = "x.f" ; then  if test ! "x"$FS = "x.f" ; then
2603      cat adSrcFiles.tmp | sed -e "s/\.f/.$FS/g" > adSrcFiles.tmp_f      cat $TMP.adSrcFiles | sed -e "s/\.f/.$FS/g" > $TMP.adSrcFiles_f
2604      mv -f adSrcFiles.tmp_f adSrcFiles.tmp      mv -f $TMP.adSrcFiles_f $TMP.adSrcFiles
2605  fi  fi
2606    
2607  echo  echo
# Line 2467  for i in $INCLUDEDIRS ; do Line 2613  for i in $INCLUDEDIRS ; do
2613      fi      fi
2614  done  done
2615    
2616  if test ! "x$DIVA" = x ; then  if test ! "x$DIVA" = x -a ! "x$MPI" = x ; then
2617      echo "  Creating the pseudo-MPI include directory"      if test ! "x$MPIINCLUDEDIR" = x ; then
2618      INCLUDES="-I./mpi_headers $INCLUDES"          #  Do a local copy of MPI headers files (in local dir ./mpi_headers/) after
2619      rm -rf ./mpi_headers          #   checking for additional included headers (in case of chain of included
2620      mkdir -p ./mpi_headers          #   header); also set LOCAL_MPI_HEADERS (if not already set)
2621            mpi_headers_do_local_copy
     if test "x$MPIINCLUDEDIR" = x ; then  
         if test "x$MPIHOME" = x ; then  
             MPIHOME='/usr'  
         fi  
         MPIINCLUDEDIR='$MPIHOME/include'  
     fi  
   
     if test -r $MPIINCLUDEDIR/mpif.h ; then  
         for i in $MPI_HEADER_FILES; do  
             cp -p $MPIINCLUDEDIR/$i ./mpi_headers  
         done  
   
         perl -i -pe 's/MPI_DISPLACEMENT_CURRENT=-1_8/MPI_DISPLACEMENT_CURRENT=-1/g' mpi_headers/mpif.h  
     else  
         echo " We cannot create a copy of mpif.h!"  
 #       exit -1  
2622      fi      fi
2623  fi  fi
2624    
2625  echo "  Determining the list of source and include files"  echo "  Determining the list of source and include files"
2626  rm -rf .links.tmp  rm -rf $TMP.links
2627  mkdir .links.tmp  mkdir $TMP.links
2628  touch .links.tmp/foo  touch $TMP.links/foo
2629  if test ! -r ".links.tmp/foo" ; then  if test ! -r "$TMP.links/foo" ; then
2630      echo      echo
2631      echo "ERROR : something is wrong with your directory permissions or"      echo "ERROR : something is wrong with your directory permissions or"
2632      echo "   your user file-creation mask (\"umask\") since creating a"      echo "   your user file-creation mask (\"umask\") since creating a"
# Line 2512  if test ! -r ".links.tmp/foo" ; then Line 2642  if test ! -r ".links.tmp/foo" ; then
2642      echo      echo
2643      exit 1      exit 1
2644  fi  fi
2645  rm -f .links.tmp/foo  rm -f $TMP.links/foo
2646    
2647  if test "x$OPENAD" != x ; then  if test "x$OPENAD" != x ; then
2648      OAD_DONT_COMPILE="/dev/null"      OAD_DONT_COMPILE="/dev/null"
2649      OAD_DONT_TRANSFORM="/dev/null"      OAD_DONT_TRANSFORM="/dev/null"
2650      OAD_KEEP_ORIGINAL="/dev/null"      OAD_KEEP_ORIGINAL="/dev/null"
2651      OAD_CB2M_FILES="/dev/null"      OAD_CB2M_FILES="/dev/null"
2652        OADTOOLS="$TOOLSDIR/OAD_support"
2653      echo "  looking for dontCompile file:  "      echo "  looking for dontCompile file:  "
2654      for i in "." $MODS ; do      for i in "." $MODS $OADTOOLS ; do
2655          if test -r $i"/dontCompile" ; then          if test -r $i"/dontCompile" ; then
2656              OAD_DONT_COMPILE=$i"/dontCompile"              OAD_DONT_COMPILE=$i"/dontCompile"
2657              echo "     found $OAD_DONT_COMPILE"              echo "     found $OAD_DONT_COMPILE"
# Line 2528  if test "x$OPENAD" != x ; then Line 2659  if test "x$OPENAD" != x ; then
2659          fi          fi
2660      done      done
2661      echo "  looking for dontTransform file:  "      echo "  looking for dontTransform file:  "
2662      for i in "." $MODS ; do      for i in "." $MODS $OADTOOLS ; do
2663          if test -r $i"/dontTransform" ; then          if test -r $i"/dontTransform" ; then
2664              OAD_DONT_TRANSFORM=$i"/dontTransform"              OAD_DONT_TRANSFORM=$i"/dontTransform"
2665              echo "     found $OAD_DONT_TRANSFORM"              echo "     found $OAD_DONT_TRANSFORM"
# Line 2536  if test "x$OPENAD" != x ; then Line 2667  if test "x$OPENAD" != x ; then
2667          fi          fi
2668      done      done
2669      echo "  looking for keepOriginal file:  "      echo "  looking for keepOriginal file:  "
2670      for i in "." $MODS ; do      for i in "." $MODS $OADTOOLS ; do
2671          if test -r $i"/keepOriginal" ; then          if test -r $i"/keepOriginal" ; then
2672              OAD_KEEP_ORIGINAL=$i"/keepOriginal"              OAD_KEEP_ORIGINAL=$i"/keepOriginal"
2673              echo "     found $OAD_KEEP_ORIGINAL"              echo "     found $OAD_KEEP_ORIGINAL"
# Line 2544  if test "x$OPENAD" != x ; then Line 2675  if test "x$OPENAD" != x ; then
2675          fi          fi
2676      done      done
2677      echo "  looking for cb2mFiles:  "      echo "  looking for cb2mFiles:  "
2678      for i in "." $MODS ; do      for i in "." $MODS $OADTOOLS ; do
2679          if test -r $i"/cb2mFiles" ; then          if test -r $i"/cb2mFiles" ; then
2680              OAD_CB2M_FILES=$i"/cb2mFiles"              OAD_CB2M_FILES=$i"/cb2mFiles"
2681              echo "     found $OAD_CB2M_FILES"              echo "     found $OAD_CB2M_FILES"
# Line 2554  if test "x$OPENAD" != x ; then Line 2685  if test "x$OPENAD" != x ; then
2685      echo "   OpenAD exceptions:  "      echo "   OpenAD exceptions:  "
2686  fi  fi
2687    
2688  echo "# This section creates symbolic links" > srclinks.tmp  echo "# This section creates symbolic links" > $TMP.srclinks
2689  echo "" >> srclinks.tmp  echo "" >> $TMP.srclinks
2690  printf 'F77_SRC_FILES = ' > F77srclist.tmp  printf 'F77_SRC_FILES = ' > $TMP.F77srclist
2691  printf 'NON_AD_F77_SRC_FILES = ' > nonADF77srclist.tmp  printf 'NON_AD_F77_SRC_FILES = ' > $TMP.nonADF77srclist
2692  printf 'C_SRC_FILES = '   > csrclist.tmp  printf 'C_SRC_FILES = '   > $TMP.csrclist
2693  printf 'F90_SRC_FILES = ' > F90srclist.tmp  printf 'F90_SRC_FILES = ' > $TMP.F90srclist
2694  printf 'H_SRC_FILES = '   > hsrclist.tmp  printf 'H_SRC_FILES = '   > $TMP.hsrclist
2695  printf 'AD_FLOW_FILES = ' > ad_flow_files.tmp  printf 'AD_FLOW_FILES = ' > $TMP.ad_flow_files
2696  alldirs="$SOURCEDIRS $INCLUDEDIRS ."  alldirs="$SOURCEDIRS $INCLUDEDIRS ."
2697  for d in $alldirs ; do  for d in $alldirs ; do
2698      deplist=      deplist=
# Line 2571  for d in $alldirs ; do Line 2702  for d in $alldirs ; do
2702          sfiles=`( echo $sfiles | grep -v _cb2m\. )`          sfiles=`( echo $sfiles | grep -v _cb2m\. )`
2703      fi      fi
2704      for sf in $sfiles ; do      for sf in $sfiles ; do
2705          if test ! -r ".links.tmp/$sf" ; then          if test ! -r "$TMP.links/$sf" ; then
2706              if test -f "$d/$sf" ; then              if test -f "$d/$sf" ; then
2707                  ignore_f=f                  ignore_f=f
2708                  case $d/$sf in                  case $d/$sf in
# Line 2596  for d in $alldirs ; do Line 2727  for d in $alldirs ; do
2727                          if test "x$HAVE_TEST_L" = xt -a "x$d" = x. -a -L $sf ; then                          if test "x$HAVE_TEST_L" = xt -a "x$d" = x. -a -L $sf ; then
2728                              ignore_f=t                              ignore_f=t
2729                          else                          else
2730                              touch .links.tmp/$sf                              touch $TMP.links/$sf
2731                              deplist="$deplist $sf"                              deplist="$deplist $sf"
2732                          fi                          fi
2733                          ;;                          ;;
# Line 2605  for d in $alldirs ; do Line 2736  for d in $alldirs ; do
2736                      extn=`echo $sf | $AWK -F. '{print $NF}'`                      extn=`echo $sf | $AWK -F. '{print $NF}'`
2737                      case $extn in                      case $extn in
2738                        F)                        F)
2739                          echo    " \\"  >> F77srclist.tmp                          echo    " \\"  >> $TMP.F77srclist
2740                          printf " $sf" >> F77srclist.tmp                          printf " $sf" >> $TMP.F77srclist
2741                          if test "x$OPENAD" != x ; then                          if test "x$OPENAD" = x ; then
2742                                basename=${sf%%.F}
2743                                isAD=`egrep ^$basename.f'[  ]*' $TMP.adSrcFiles`
2744                                if test -z "$isAD" ; then
2745                                    echo    " \\"  >> $TMP.nonADF77srclist
2746                                    printf " $sf" >> $TMP.nonADF77srclist
2747                                fi
2748                            else #- OpenAD case:
2749                              basename=${sf%%.F}                              basename=${sf%%.F}
2750                              isAD=`egrep ^$basename.f'[  ]*' adSrcFiles.tmp`                              isAD=`egrep ^$basename.f'[  ]*' $TMP.adSrcFiles`
2751                              if test -z "$isAD" ; then                              if test -z "$isAD" ; then
2752                                  toBeIgnored=`egrep ^$basename'[      ]*' ${OAD_DONT_COMPILE}`                                  toBeIgnored=`egrep ^$basename'[      ]*' ${OAD_DONT_COMPILE}`
2753                                  if test -z "$toBeIgnored" ; then                                  if test -z "$toBeIgnored" ; then
2754                                      echo    " \\"  >> nonADF77srclist.tmp                                      echo    " \\"  >> $TMP.nonADF77srclist
2755                                      printf " $sf" >> nonADF77srclist.tmp                                      printf " $sf" >> $TMP.nonADF77srclist
2756                                  else                                  else
2757                                      echo "    not to be compiled   :  $sf"                                      echo "    not to be compiled   :  $sf"
2758                                  fi                                  fi
# Line 2629  for d in $alldirs ; do Line 2767  for d in $alldirs ; do
2767                                      echo "    original to be kept  :  $sf"                                      echo "    original to be kept  :  $sf"
2768                                  fi                                  fi
2769                                  if test -n "$notToBeTransformed" -o -n "$untransformedVersionToBeKept" ; then                                  if test -n "$notToBeTransformed" -o -n "$untransformedVersionToBeKept" ; then
2770                                      echo    " \\"  >> nonADF77srclist.tmp                                      echo    " \\"  >> $TMP.nonADF77srclist
2771                                      printf " $sf" >> nonADF77srclist.tmp                                      printf " $sf" >> $TMP.nonADF77srclist
2772                                  fi                                  fi
2773                              fi                              fi
2774                          fi                          fi
2775                          ;;                          ;;
2776                      F90)                      F90)
2777                          echo    " \\"  >> F90srclist.tmp                          echo    " \\"  >> $TMP.F90srclist
2778                          printf " $sf" >> F90srclist.tmp                          printf " $sf" >> $TMP.F90srclist
2779                          ;;                          ;;
2780                      c)                      c)
2781                          echo    " \\"  >> csrclist.tmp                          echo    " \\"  >> $TMP.csrclist
2782                          printf " $sf" >> csrclist.tmp                          printf " $sf" >> $TMP.csrclist
2783                          ;;                          ;;
2784                      h)                      h)
2785                          echo    " \\"  >> hsrclist.tmp                          echo    " \\"  >> $TMP.hsrclist
2786                          printf " $sf" >> hsrclist.tmp                          printf " $sf" >> $TMP.hsrclist
2787                          ;;                          ;;
2788                      flow)                      flow)
2789                          echo    " \\"  >> ad_flow_files.tmp                          echo    " \\"  >> $TMP.ad_flow_files
2790                          printf " $sf" >> ad_flow_files.tmp                          printf " $sf" >> $TMP.ad_flow_files
2791                          ;;                          ;;
2792                     esac                     esac
2793                  fi                  fi
# Line 2658  for d in $alldirs ; do Line 2796  for d in $alldirs ; do
2796      done      done
2797      if test "x$deplist" != x ; then      if test "x$deplist" != x ; then
2798        if test "$d" != "." ; then        if test "$d" != "." ; then
2799          echo "" >> srclinks.tmp          echo "" >> $TMP.srclinks
2800          echo "#  These files are linked from $d" >> srclinks.tmp          echo "#  These files are linked from $d" >> $TMP.srclinks
2801          echo "$deplist :" >> srclinks.tmp          echo "$deplist :" >> $TMP.srclinks
2802  # We need to make sure that the link isn't already there.  # We need to make sure that the link isn't already there.
2803  # This may happen when make thinks that a header file has to be "remade"  # This may happen when make thinks that a header file has to be "remade"
2804  # because a module it depends on has changed.  In this case we do nothing.  # because a module it depends on has changed.  In this case we do nothing.
2805          printf "\tif [ ! -L \$@ ]; then \$(LN) %s/\$@ \$@; fi\n" $d >> srclinks.tmp          printf "\tif [ ! -L \$@ ]; then \$(LN) %s/\$@ \$@; fi\n" $d >> $TMP.srclinks
2806        fi        fi
2807      fi      fi
2808  done  done
2809  rm -rf .links.tmp  rm -rf $TMP.links
2810  echo "" >> F77srclist.tmp  echo "" >> $TMP.F77srclist
2811  echo "" >> nonADF77srclist.tmp  echo "" >> $TMP.nonADF77srclist
2812  echo "" >> csrclist.tmp  echo "" >> $TMP.csrclist
2813  echo "" >> F90srclist.tmp  echo "" >> $TMP.F90srclist
2814  echo "" >> hsrclist.tmp  echo "" >> $TMP.hsrclist
2815  echo "" >> ad_flow_files.tmp  echo "" >> $TMP.ad_flow_files
2816    
2817  CMDLINE=$0  CMDLINE=$0
2818  for xx in "$@" ; do nw=`echo $xx | wc -w`  for xx in "$@" ; do nw=`echo $xx | wc -w`
2819      if test $nw = '1' ; then CMDLINE="$CMDLINE $xx"      if test $nw = '1' ; then CMDLINE="$CMDLINE $xx"
2820                          else CMDLINE="$CMDLINE '$xx'" ; fi                          else CMDLINE="$CMDLINE '$xx'" ; fi
2821  done  done
2822    
2823  if test -f $MAKEFILE ; then  if test -f $MAKEFILE ; then
# Line 2713  cat >>$MAKEFILE <<EOF Line 2851  cat >>$MAKEFILE <<EOF
2851  # INCLUDES     : Directories searched for header files  # INCLUDES     : Directories searched for header files
2852  # DEFINES      : Macro definitions for CPP  # DEFINES      : Macro definitions for CPP
2853  # MAKEDEPEND   : Dependency generator  # MAKEDEPEND   : Dependency generator
 # KPP          : Special preprocessor command (specific to platform)  
 # KFLAGS       : Flags for KPP  
2854  # FC           : Fortran compiler command  # FC           : Fortran compiler command
2855  # FFLAGS       : Configuration/debugging options for FC  # FFLAGS       : Configuration/debugging options for FC
2856  # FOPTIM       : Optimization options for FC  # FOPTIM       : Optimization options for FC
# Line 2728  INCLUDEDIRS = ${INCLUDEDIRS} Line 2864  INCLUDEDIRS = ${INCLUDEDIRS}
2864  EXEDIR      = ${EXEDIR}  EXEDIR      = ${EXEDIR}
2865  EXECUTABLE  = \$(EXEDIR)/${EXECUTABLE}  EXECUTABLE  = \$(EXEDIR)/${EXECUTABLE}
2866  TOOLSDIR    = ${TOOLSDIR}  TOOLSDIR    = ${TOOLSDIR}
2867    OADTOOLS    = ${OADTOOLS}
2868    
2869  #eh3  new defines for the adjoint work  #eh3  new defines for the adjoint work
2870  AUTODIFF    = ${ROOTDIR}/pkg/autodiff  AUTODIFF    = ${ROOTDIR}/pkg/autodiff
# Line 2748  else Line 2885  else
2885      echo "EMBEDDED_FILES = " >>$MAKEFILE      echo "EMBEDDED_FILES = " >>$MAKEFILE
2886  fi  fi
2887    
2888    # extract default cpp search path so we can pass it to makedepend
2889    CPPINCLUDES=`cat /dev/null | $CPP -v 2>&1 | awk '/^End of search/{f=0}!/^\#/{if(f){printf " -I%s", $1;}}/^\#include "..." search start/{f=1}'`
2890    
2891  cat >>$MAKEFILE <<EOF  cat >>$MAKEFILE <<EOF
2892  # Unix ln (link)  # Unix ln (link)
2893  LN = ${LN}  LN = ${LN}
 # C preprocessor  
 CPP = cat \$< | ${S64} | ${CPP}  
2894  # Dependency generator  # Dependency generator
2895  MAKEDEPEND = ${MAKEDEPEND}  MAKEDEPEND = ${MAKEDEPEND}
2896  # Special preprocessor (KAP on DECs, FPP on Crays)  # Special preprocessor (KAP on DECs, FPP on Crays)
# Line 2770  LINK = ${LINK} ${LDADD} Line 2908  LINK = ${LINK} ${LDADD}
2908  DEFINES = ${DEFINES}  DEFINES = ${DEFINES}
2909  # Includes for CPP  # Includes for CPP
2910  INCLUDES = ${INCLUDES}  INCLUDES = ${INCLUDES}
2911    # default CPP includes for makedepend
2912    CPPINCLUDES = ${CPPINCLUDES}
2913  # Flags for KPP  # Flags for KPP
2914  KFLAGS1 = ${KFLAGS1}  KFLAGS1 = ${KFLAGS1}
2915  KFLAGS2 = ${KFLAGS2}  KFLAGS2 = ${KFLAGS2}
2916  # Optim./debug for FC  # Optim./debug for FC
2917  FFLAGS = ${FFLAGS} ${FEXTRAFLAGS}  FFLAGS = ${FFLAGS}
2918  FOPTIM = ${FOPTIM}  FOPTIM = ${FOPTIM} ${FEXTRAFLAGS}
2919  # Optim./debug for FC  # Optim./debug for FC
2920  F90FLAGS = ${F90FLAGS}  F90FLAGS = ${F90FLAGS}
2921  F90OPTIM = ${F90OPTIM}  F90OPTIM = ${F90OPTIM}
# Line 2788  NOOPTFLAGS = ${NOOPTFLAGS} Line 2928  NOOPTFLAGS = ${NOOPTFLAGS}
2928  # Flags and libraries needed for linking  # Flags and libraries needed for linking
2929  LIBS = ${LIBS}  LIBS = ${LIBS}
2930  # Name of the makefile  # Name of the makefile
2931  MAKEFILE=${MAKEFILE}  MAKEFILE = ${MAKEFILE}
2932    # Name of the make program
2933    MAKE = ${MAKE}
2934    
2935  EOF  EOF
2936    
2937  cat F77srclist.tmp      >> $MAKEFILE  cat $TMP.F77srclist      >> $MAKEFILE
2938  cat nonADF77srclist.tmp >> $MAKEFILE  cat $TMP.nonADF77srclist >> $MAKEFILE
2939  cat csrclist.tmp        >> $MAKEFILE  cat $TMP.csrclist        >> $MAKEFILE
2940  cat F90srclist.tmp      >> $MAKEFILE  cat $TMP.F90srclist      >> $MAKEFILE
2941  cat hsrclist.tmp        >> $MAKEFILE  cat $TMP.hsrclist        >> $MAKEFILE
2942  cat ad_flow_files.tmp   >> $MAKEFILE  cat $TMP.ad_flow_files   >> $MAKEFILE
2943    
2944  rm -f F77srclist.tmp nonADF77srclist.tmp csrclist.tmp F90srclist.tmp hsrclist.tmp ad_flow_files.tmp  rm -f $TMP.F77srclist $TMP.nonADF77srclist $TMP.csrclist $TMP.F90srclist $TMP.hsrclist $TMP.ad_flow_files
2945    
2946  echo >> $MAKEFILE  echo >> $MAKEFILE
2947    
# Line 2819  echo '.SUFFIXES: .o .'$FS' .p .F .c .f'$ Line 2961  echo '.SUFFIXES: .o .'$FS' .p .F .c .f'$
2961    
2962  cat >>$MAKEFILE <<EOF  cat >>$MAKEFILE <<EOF
2963    
2964  all: \$(EXECUTABLE)  all: fwd_exe_target
2965    fwd_exe_target:
2966            @echo Update AD_CONFIG.h and make \$(EXECUTABLE)
2967            @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Forward version" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > ad_config.template
2968            @cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h
2969            @-rm -f ad_config.template
2970            \$(MAKE) -f \$(MAKEFILE) \$(EXECUTABLE)
2971    
2972  \$(EXECUTABLE): \$(SPECIAL_FILES) \$(F77_SRC_FILES) \$(C_SRC_FILES) \$(H_SRC_FILES) \$(F90_SRC_FILES) \$(OBJFILES) \$(EMBEDDED_FILES)  \$(EXECUTABLE): \$(SPECIAL_FILES) \$(F77_SRC_FILES) \$(C_SRC_FILES) \$(H_SRC_FILES) \$(F90_SRC_FILES) \$(OBJFILES) \$(EMBEDDED_FILES)
2973          @echo Creating \$@ ...          @echo Creating \$@ ...
2974          \$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) \$(LIBS)          \$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) \$(LIBS)
2975    
2976  depend:  depend:
2977          @make -f \$(MAKEFILE) links          @\$(MAKE) -f \$(MAKEFILE) links
2978          \$(MAKEDEPEND) -f \$(MAKEFILE) -o .$FS \$(DEFINES) \$(INCLUDES) \$(F77_SRC_FILES)          \$(MAKEDEPEND) -f \$(MAKEFILE) -o .$FS \$(DEFINES) \$(INCLUDES) \$(CPPINCLUDES) \$(F77_SRC_FILES)
2979          \$(TOOLSDIR)/f90mkdepend >> \$(MAKEFILE)          \$(TOOLSDIR)/f90mkdepend >> \$(MAKEFILE)
2980          -rm -f makedepend.out          -rm -f makedepend.out
2981    
# Line 2842  links: \$(F77_SRC_FILES) \$(C_SRC_FILES) Line 2991  links: \$(F77_SRC_FILES) \$(C_SRC_FILES)
2991    
2992  small_f: \$(F77_PP_SRC_FILES) \$(F90_PP_SRC_FILES)  small_f: \$(F77_PP_SRC_FILES) \$(F90_PP_SRC_FILES)
2993    
 output.txt: \$(EXECUTABLE)  
         @printf 'running ... '  
         @\$(EXECUTABLE) > \$@  
   
2994  # remove most of the files that "make" generates  # remove most of the files that "make" generates
2995  clean:  clean:
2996          -rm -rf *.p *.$FS90 *.mod ${RMFILES} work.{pc,pcl} *.template          -rm -rf *.p *.$FS90 *.mod ${RMFILES} work.{pc,pcl} *.template
# Line 2855  clean: Line 3000  clean:
3000    
3001  # remove most of the files that "make" and "make depend" generate  # remove most of the files that "make" and "make depend" generate
3002  Clean:  Clean:
3003          @make -f \$(MAKEFILE) clean          @\$(MAKE) -f \$(MAKEFILE) clean
3004          @make -f \$(MAKEFILE) cleanlinks          @\$(MAKE) -f \$(MAKEFILE) cleanlinks
3005          -rm -f \$(SPECIAL_FILES) f90mkdepend.log $MAKEFILE.old          -rm -f \$(SPECIAL_FILES) f90mkdepend.log $MAKEFILE.old
3006          -rm -f taf_command taf_output taf_ad.log taf_ad_flow.log taf_ftl.log          -rm -f taf_command taf_output taf_ad.log taf_ad_flow.log taf_ftl.log
         -rm -f genmake_warnings genmake_errors make.log  
3007    
3008  # remove also the executable, files that "genmake2" generates (except Makefile)  # remove also the executable, files that "genmake2" generates (except Makefile)
3009  #         and output from a run (plus log files from testreport)  #         and output from a run (plus log files from testreport)
3010  CLEAN:  CLEAN:
3011          @make -f \$(MAKEFILE) Clean          @\$(MAKE) -f \$(MAKEFILE) Clean
3012          -rm -f \$(EXECUTABLE) \$(EXE_AD) \$(EXE_FTL) *.bak          -rm -f \$(EXECUTABLE) \$(EXE_AD) \$(EXE_FTL) *.bak
3013          -rm -f $LOGFILE genmake_state genmake_*optfile          -rm -f $LOGFILE genmake_state genmake_*optfile
3014          -rm -f SIZE.h.mpi genmake.tr_log make.tr_log          -rm -f SIZE.h.mpi genmake.tr_log make.tr_log
3015            -rm -rf mpi_headers mnc_test_*
3016          -find \$(EXEDIR) -name "*.meta" -exec rm {} \;          -find \$(EXEDIR) -name "*.meta" -exec rm {} \;
3017          -find \$(EXEDIR) -name "*.data" -exec rm {} \;          -find \$(EXEDIR) -name "*.data" -exec rm {} \;
3018          -find \$(EXEDIR) -name "fort.*" -exec rm {} \;          -find \$(EXEDIR) -name "fort.*" -exec rm {} \;
3019          -rm -f *.txt STD* *diagnostics.log datetime          -rm -f *.txt STDOUT.* STDERR.* *diagnostics.log *.[0-9][0-9][0-9][0-9].log
3020            -rm -f datetime costfinal divided.ctrl snapshot* output_adm.txt.diva_*
3021          -rm -f *_MIT_CE_000.opt0000 costfunction*0000          -rm -f *_MIT_CE_000.opt0000 costfunction*0000
3022          -rm -rf mnc_test_*          -rm -f oad_cp.[0-9][0-9][0-9].?????
3023    
3024  makefile:  makefile:
3025          $THIS_SCRIPT $G2ARGS          $THIS_SCRIPT $G2ARGS
# Line 2883  cleanlinks: Line 3029  cleanlinks:
3029  # Special targets (SPECIAL_FILES) which are created by make  # Special targets (SPECIAL_FILES) which are created by make
3030  ${PACKAGES_DOT_H}:  ${PACKAGES_DOT_H}:
3031          @echo Creating \$@ ...          @echo Creating \$@ ...
3032          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -bPACKAGES_CONFIG_H "Disabled packages:" \$(DISABLED_PACKAGES) " " "Enabled packages:" \$(ENABLED_PACKAGES) > \$@          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines -bPACKAGES_CONFIG_H "Disabled packages:" \$(DISABLED_PACKAGES) " " "Enabled packages:" \$(ENABLED_PACKAGES) > \$@
3033  AD_CONFIG.h:  AD_CONFIG.h:
3034          @echo Creating \$@ ...          @echo Creating \$@ ...
3035          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > \$@          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Default version" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > \$@
3036  FC_NAMEMANGLE.h:  FC_NAMEMANGLE.h:
3037          @echo Creating \$@ ...          @echo Creating \$@ ...
3038          echo "$FC_NAMEMANGLE" > \$@          echo "$FC_NAMEMANGLE" > \$@
# Line 2926  cat >>$MAKEFILE <<EOF Line 3072  cat >>$MAKEFILE <<EOF
3072  ## This nullifies any default implicit rules concerning these two file types:  ## This nullifies any default implicit rules concerning these two file types:
3073  ## %.o : %.F  ## %.o : %.F
3074    
3075    # C preprocessing and replacing the _d in constants:
3076    CPPCMD = cat \$< | ${CPP} \$(DEFINES) \$(INCLUDES) | ${S64}
3077    
3078  .F.$FS:  .F.$FS:
3079          \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@          \$(CPPCMD)  > \$@
3080  .$FS.o:  .$FS.o:
3081          \$(FC) \$(FFLAGS) \$(FOPTIM) -c \$<          \$(FC) \$(FFLAGS) \$(FOPTIM) -c \$<
3082  .F.o:  .F.o:
3083          \$(FC) \$(FFLAGS) \$(FOPTIM) -c \$<          \$(FC) \$(FFLAGS) \$(FOPTIM) -c \$<
3084  .F90.$FS90:  .F90.$FS90:
3085          \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@          \$(CPPCMD)  > \$@
3086  .FF90.f$FS90:  .FF90.f$FS90:
3087          \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@          \$(CPPCMD)  > \$@
3088  .$FS90.o:  .$FS90.o:
3089          \$(F90C) \$(F90FLAGS) \$(F90OPTIM) -c \$<          \$(F90C) \$(F90FLAGS) \$(F90OPTIM) -c \$<
3090  .f$FS90.o:  .f$FS90.o:
# Line 2944  cat >>$MAKEFILE <<EOF Line 3093  cat >>$MAKEFILE <<EOF
3093  .c.o:  .c.o:
3094          \$(CC) \$(CFLAGS) \$(DEFINES) \$(INCLUDES) -c \$<          \$(CC) \$(CFLAGS) \$(DEFINES) \$(INCLUDES) -c \$<
3095  .flow.flowdir:  .flow.flowdir:
3096          \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@          \$(CPPCMD) > \$@
3097    
3098  # Special exceptions that use the ( .F - .p - .$FS - .o ) rule-chain  # Special exceptions that use the ( .F - .p - .$FS - .o ) rule-chain
3099  .F.p:  .F.p:
3100          \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@          \$(CPPCMD) > \$@
3101  .p.$FS:  .p.$FS:
3102          \$(KPP) \$(KFLAGS1)\$@ \$(KFLAGS2) \$<          \$(KPP) \$(KFLAGS1)\$@ \$(KFLAGS2) \$<
3103    
# Line 2967  TAF            = ${TAF} Line 3116  TAF            = ${TAF}
3116    
3117  TAF_EXTRA      = ${TAF_EXTRA}  TAF_EXTRA      = ${TAF_EXTRA}
3118  TAMC_EXTRA     = ${TAMC_EXTRA}  TAMC_EXTRA     = ${TAMC_EXTRA}
3119    LOCAL_MPI_HEADERS    = ${LOCAL_MPI_HEADERS}
3120    
3121  EOF  EOF
3122    
# Line 2984  done Line 3134  done
3134  echo "  Add the source list for AD code generation"  echo "  Add the source list for AD code generation"
3135  echo >> $MAKEFILE  echo >> $MAKEFILE
3136  printf "AD_FILES = " >> $MAKEFILE  printf "AD_FILES = " >> $MAKEFILE
3137  AD_FILES=`cat adSrcFiles.tmp`  AD_FILES=`cat $TMP.adSrcFiles`
3138  for i in $AD_FILES ; do  for i in $AD_FILES ; do
3139      echo    " \\" >> $MAKEFILE      echo    " \\" >> $MAKEFILE
3140      printf " $i" >> $MAKEFILE      printf " $i" >> $MAKEFILE
3141  done  done
3142  echo >> $MAKEFILE  echo >> $MAKEFILE
3143  rm -f adSrcFiles.tmp  rm -f $TMP.adSrcFiles
3144    
3145    if test $CAT_SRC_FOR_TAF = 0 ; then
3146    cat >>$MAKEFILE <<EOF
3147    
3148    # ... Utilities ...
3149    remove_comments:
3150            sed -i.bak -f \$(TOOLSDIR)/remove_comments_sed \$(AD_FILES)
3151            @-rm -f \$(AD_FILES:.$FS=.$FS.bak)
3152    adj_sed:
3153            sed -i.bak -f \$(TOOLSDIR)/adjoint_sed \$(AD_FILES:.$FS=_ad.$FS)
3154            @-rm -f \$(AD_FILES:.$FS=_ad.$FS.bak)
3155    ftl_sed:
3156            sed -i.bak -f \$(TOOLSDIR)/adjoint_sed \$(AD_FILES:.$FS=_tl.$FS)
3157            @-rm -f \$(AD_FILES:.$FS=_tl.$FS.bak)
3158    adobjfiles: \$(AD_FILES:.$FS=_ad.o)
3159    ftlobjfiles: \$(AD_FILES:.$FS=_tl.o)
3160    EOF
3161    fi
3162    
3163  cat >>$MAKEFILE <<EOF  cat >>$MAKEFILE <<EOF
3164    
3165  # ... AD ...  # ... AD ...
3166  adall: \$(EXE_AD)  adall: ad_exe_target
3167  adtaf: ad_taf_output.$FS  adtaf: ad_taf_output.$FS
3168  adtamc: ad_tamc_output.$FS  adtamc: ad_tamc_output.$FS
3169    
3170  ad_input_code.$FS: \$(AD_FILES) \$(H_SRC_FILES) \$(AD_FLOW_FILES)  ad_exe_target:
3171          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > ad_config.template          @echo Update AD_CONFIG.h and make \$(EXE_AD)
3172            @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Adjoint version" -bAD_CONFIG_H -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > ad_config.template
3173            @cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h
3174            @-rm -f ad_config.template
3175            \$(MAKE) -f \$(MAKEFILE) \$(EXE_AD)
3176    
3177    ad_input_code.$FS: \$(AD_FILES) \$(AD_FLOW_FILES)
3178            @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Adjoint version" -bAD_CONFIG_H -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > ad_config.template
3179          cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h          cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h
3180          -rm -f ad_config.template          @-rm -f ad_config.template
3181          @make -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)          @\$(MAKE) -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)
3182          @make -f \$(MAKEFILE) \$(FLOWFILES)          @\$(MAKE) -f \$(MAKEFILE) \$(FLOWFILES)
3183          cat \$(FLOWFILES) \$(AD_FILES) | sed -f \$(TOOLSDIR)/remove_comments_sed > ad_input_code.$FS          cat \$(FLOWFILES) \$(AD_FILES) | sed -f \$(TOOLSDIR)/remove_comments_sed > ad_input_code.$FS
3184    
3185  ad_taf_output.$FS: ad_input_code.$FS  adtafonly:
3186          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS
3187          ls -l ad_input_code_ad.$FS          ls -l ad_input_code_ad.$FS
3188          cat ad_input_code_ad.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ad_taf_output.$FS          cat ad_input_code_ad.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ad_taf_output.$FS
3189    
3190  adtafonly:  EOF
3191    
3192    if test $CAT_SRC_FOR_TAF = 1 ; then
3193    cat >>$MAKEFILE <<EOF
3194    # ... send 1 file to TAF ...
3195    ad_taf_output.$FS: ad_input_code.$FS
3196            @-rm -f ad_input_code_ad.$FS ; echo ''
3197          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS          \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) ad_input_code.$FS
3198          ls -l ad_input_code_ad.$FS          ls -l ad_input_code_ad.$FS
3199          cat ad_input_code_ad.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ad_taf_output.$FS          cat ad_input_code_ad.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ad_taf_output.$FS
3200    
3201  \${EXE_AD}: ad_taf_output.o \$(OBJFILES)  \$(EXE_AD): \$(SPECIAL_FILES) \$(H_SRC_FILES) ad_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(EMBEDDED_FILES)
3202          \$(LINK) -o \${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_taf_output.o \$(LIBS)          \$(LINK) -o \${EXE_AD} \$(FFLAGS) \$(FOPTIM) ad_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(LIBS)
3203    
3204  ad_tamc_output.$FS: ad_input_code.$FS  adobj: ad_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o)
         \$(TAMC) \$(AD_TAMC_FLAGS) \$(TAMC_EXTRA) ad_input_code.$FS  
         cat ad_input_code_ad.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ad_tamc_output.$FS  
3205    
3206  ad_tamc: ad_tamc_output.o \$(OBJFILES)  EOF
3207          \$(LINK) -o ${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_tamc_output.o \$(LIBS)  
3208    else
3209    cat >>$MAKEFILE <<EOF
3210    # ... send multiple files to TAF ...
3211    ad_taf_output.$FS: \$(AD_FLOW_FILES) \$(AD_FILES)
3212            @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Adjoint version" -bAD_CONFIG_H -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > ad_config.template
3213            cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h
3214            @-rm -f ad_config.template
3215            @\$(MAKE) -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)
3216            @\$(MAKE) -f \$(MAKEFILE) \$(FLOWFILES)
3217            @-rm -f \$(AD_FILES:.$FS=_ad.$FS) \$(AD_FILES:.$FS=_ad.o); echo ''
3218            \$(MAKE) -f \$(MAKEFILE) remove_comments
3219            \$(TAF) \$(AD_TAF_FLAGS) \$(TAF_EXTRA) \$(FLOWFILES) \$(AD_FILES)
3220            \$(MAKE) -f \$(MAKEFILE) adj_sed
3221            cat \$(AD_FILES:.$FS=_ad.$FS) > ad_taf_output.$FS
3222    
3223    \$(EXE_AD): \$(SPECIAL_FILES) \$(H_SRC_FILES) ad_taf_output.$FS \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(EMBEDDED_FILES)
3224            \$(MAKE) -f \$(MAKEFILE) adobjfiles
3225            \$(LINK) -o \${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(AD_FILES:.$FS=_ad.o) \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(LIBS)
3226    
3227    adobj: ad_taf_output.$FS \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o)
3228            \$(MAKE) -f \$(MAKEFILE) adobjfiles
3229    
3230    EOF
3231    fi
3232    
3233    cat >>$MAKEFILE <<EOF
3234  adonlyfwd:  adonlyfwd:
3235          patch < \$(TOOLSDIR)/ad_taf_output.f.onlyfwd.diff          patch < \$(TOOLSDIR)/ad_taf_output.f.onlyfwd.diff
3236    
3237  adtrick:  adtrick:
3238          patch < \$(TOOLSDIR)/ad_taf_output.f.adtrick.diff          patch < \$(TOOLSDIR)/ad_taf_output.f.adtrick.diff
3239    
3240  adobj: ad_taf_output.o \$(OBJFILES)  ad_tamc_output.$FS: ad_input_code.$FS
3241            \$(TAMC) \$(AD_TAMC_FLAGS) \$(TAMC_EXTRA) ad_input_code.$FS
3242            cat ad_input_code_ad.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ad_tamc_output.$FS
3243    
3244    ad_tamc: ad_tamc_output.o \$(OBJFILES)
3245            \$(LINK) -o ${EXE_AD} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ad_tamc_output.o \$(LIBS)
3246    
3247  # ... FTL ...  # ... FTL ...
3248  ftlall: \$(EXE_FTL)  ftlall: ftl_exe_target
3249  ftltaf: ftl_taf_output.$FS  ftltaf: ftl_taf_output.$FS
3250  ftltamc: ftl_tamc_output.$FS  ftltamc: ftl_tamc_output.$FS
3251    
3252  ftl_input_code.$FS: \$(AD_FILES) \$(H_SRC_FILES)  ftl_exe_target:
3253          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN > ftl_config.template          @echo Update AD_CONFIG.h and make \$(EXE_FTL)
3254          cmp ftl_config.template AD_CONFIG.h || cat ftl_config.template > AD_CONFIG.h          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "TangLin version" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN > ad_config.template
3255          -rm -f ftl_config.template          @cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h
3256          @make -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)          @-rm -f ad_config.template
3257          @make -f \$(MAKEFILE) \$(AD_FLOW_FILES)          \$(MAKE) -f \$(MAKEFILE) \$(EXE_FTL)
3258    
3259    ftl_input_code.$FS: \$(AD_FILES)
3260            @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "TangLin version" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN > ad_config.template
3261            cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h
3262            @-rm -f ad_config.template
3263            @\$(MAKE) -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)
3264            @\$(MAKE) -f \$(MAKEFILE) \$(AD_FLOW_FILES)
3265          cat \$(AD_FLOW_FILES) \$(AD_FILES) | sed -f \$(TOOLSDIR)/remove_comments_sed > ftl_input_code.$FS          cat \$(AD_FLOW_FILES) \$(AD_FILES) | sed -f \$(TOOLSDIR)/remove_comments_sed > ftl_input_code.$FS
3266    
3267  ftl_taf_output.$FS: ftl_input_code.$FS  ftltafonly:
3268          \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.$FS          \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.$FS
3269          ls -l ftl_input_code_ftl.$FS          ls -l ftl_input_code_tl.$FS
3270          cat ftl_input_code_ftl.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_taf_output.$FS          cat ftl_input_code_tl.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_taf_output.$FS
3271    
3272  ftltafonly:  EOF
3273    
3274    if test $CAT_SRC_FOR_TAF = 1 ; then
3275    cat >>$MAKEFILE <<EOF
3276    # ... send 1 file to TAF ...
3277    ftl_taf_output.$FS: ftl_input_code.$FS
3278            @-rm -f ftl_input_code_tl.$FS ; echo ''
3279          \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.$FS          \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) ftl_input_code.$FS
3280          ls -l ftl_input_code_ftl.$FS          ls -l ftl_input_code_tl.$FS
3281          cat ftl_input_code_ftl.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_taf_output.$FS          cat ftl_input_code_tl.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_taf_output.$FS
3282    
3283    \$(EXE_FTL): \$(SPECIAL_FILES) \$(H_SRC_FILES) ftl_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(EMBEDDED_FILES)
3284            \$(LINK) -o \${EXE_FTL} \$(FFLAGS) \$(FOPTIM) ftl_taf_output.o \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(LIBS)
3285    
3286    EOF
3287    
3288  \${EXE_FTL}: ftl_taf_output.o \$(OBJFILES)  else
3289          \$(LINK) -o \${EXE_FTL} \$(FFLAGS) \$(FOPTIM) \$(OBJFILES) ftl_taf_output.o \$(LIBS)  cat >>$MAKEFILE <<EOF
3290    # ... send multiple files to TAF ...
3291    ftl_taf_output.$FS: \$(AD_FLOW_FILES) \$(AD_FILES)
3292            @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "TangLin version" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN > ad_config.template
3293            cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h
3294            @-rm -f ad_config.template
3295            @\$(MAKE) -f \$(MAKEFILE) \$(F77_PP_SRC_FILES)
3296            @\$(MAKE) -f \$(MAKEFILE) \$(AD_FLOW_FILES)
3297            @-rm -f \$(AD_FILES:.$FS=_tl.$FS) \$(AD_FILES:.$FS=_tl.o); echo ''
3298            \$(MAKE) -f \$(MAKEFILE) remove_comments
3299            \$(TAF) \$(FTL_TAF_FLAGS) \$(TAF_EXTRA) \$(AD_FLOW_FILES) \$(AD_FILES)
3300            \$(MAKE) -f \$(MAKEFILE) ftl_sed
3301            cat \$(AD_FILES:.$FS=_tl.$FS) > ftl_taf_output.$FS
3302    
3303    \$(EXE_FTL): \$(SPECIAL_FILES) \$(H_SRC_FILES) ftl_taf_output.$FS \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(EMBEDDED_FILES)
3304            \$(MAKE) -f \$(MAKEFILE) ftlobjfiles
3305            \$(LINK) -o \${EXE_FTL} \$(FFLAGS) \$(FOPTIM) \$(AD_FILES:.$FS=_tl.o) \$(NON_AD_F77_SRC_FILES:.F=.o) \$(F90_SRC_FILES:.F90=.o) \$(C_SRC_FILES:.c=.o) \$(LIBS)
3306    
3307    EOF
3308    fi
3309    
3310    cat >>$MAKEFILE <<EOF
3311  ftl_tamc_output.$FS: ftl_input_code.$FS  ftl_tamc_output.$FS: ftl_input_code.$FS
3312          \$(TAMC) \$(FTL_TAMC_FLAGS) \$(TAMC_EXTRA) ftl_input_code.$FS          \$(TAMC) \$(FTL_TAMC_FLAGS) \$(TAMC_EXTRA) ftl_input_code.$FS
3313          cat ftl_input_code_ftl.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_tamc_output.$FS          cat ftl_input_code_ftl.$FS | sed -f \$(TOOLSDIR)/adjoint_sed > ftl_tamc_output.$FS
# Line 3088  svd_touch: Line 3335  svd_touch:
3335          touch ad_taf_output.$FS ftl_taf_output.$FS          touch ad_taf_output.$FS ftl_taf_output.$FS
3336          \$(FC) \$(FFLAGS) \$(FOPTIM) -c ad_taf_output.$FS          \$(FC) \$(FFLAGS) \$(FOPTIM) -c ad_taf_output.$FS
3337          \$(FC) \$(FFLAGS) \$(FOPTIM) -c ftl_taf_output.$FS          \$(FC) \$(FFLAGS) \$(FOPTIM) -c ftl_taf_output.$FS
3338          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN > ftl_config.template          @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "SVD version" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -DALLOW_TANGENTLINEAR_RUN > ad_config.template
3339          cmp ftl_config.template AD_CONFIG.h || cat ftl_config.template > AD_CONFIG.h          cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h
3340          -rm -f ftl_config.template          @-rm -f ad_config.template
3341    
3342  EOF  EOF
3343    
# Line 3103  if test "x$OPENAD" != x ; then Line 3350  if test "x$OPENAD" != x ; then
3350  # ============ begin OpenAD specific section ==============  # ============ begin OpenAD specific section ==============
3351    
3352  cat >>$MAKEFILE <<EOF  cat >>$MAKEFILE <<EOF
3353    # ... OpenAD ...
3354    
3355  # all the source files linked from the various locations:  # all the source files linked from the various locations:
3356  ALL_LINKED_FILES= \  ALL_LINKED_FILES= \
# Line 3142  for i in `cat ${OAD_CB2M_FILES}` ; do Line 3390  for i in `cat ${OAD_CB2M_FILES}` ; do
3390    echo    " \\" >> $MAKEFILE    echo    " \\" >> $MAKEFILE
3391    printf " ${i}_mod.f$FS90" >> $MAKEFILE    printf " ${i}_mod.f$FS90" >> $MAKEFILE
3392  done  done
3393  AD_FILES=`cat adSrcFiles.tmp`  AD_FILES=`cat $TMP.adSrcFiles`
3394  for i in $AD_FILES ; do  for i in $AD_FILES ; do
3395    basename=${i%%.f}    basename=${i%%.f}
3396    toBeIgnored=`egrep ^$basename'[      ]*' ${OAD_DONT_COMPILE} ${OAD_DONT_TRANSFORM}`    toBeIgnored=`egrep ^$basename'[      ]*' ${OAD_DONT_COMPILE} ${OAD_DONT_TRANSFORM}`
# Line 3152  for i in $AD_FILES ; do Line 3400  for i in $AD_FILES ; do
3400    fi    fi
3401  done  done
3402  echo >> $MAKEFILE  echo >> $MAKEFILE
3403  rm -f adSrcFiles.tmp  rm -f $TMP.adSrcFiles
3404    
3405  cat >>$MAKEFILE <<EOF  cat >>$MAKEFILE <<EOF
3406    
3407  adAll: \$(EXE_AD)  adAll: ad_exe_target
3408  .PHONY: adAll  .PHONY: adAll
3409    
3410    ad_exe_target:
3411            @echo Update AD_CONFIG.h and make \$(EXE_AD)
3412            @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Adjoint version" -bAD_CONFIG_H -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > ad_config.template
3413            @cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h
3414            @-rm -f ad_config.template
3415            \$(MAKE) -f \$(MAKEFILE) \$(EXE_AD)
3416    
3417  CB2M_F90_PP_SRC_FILES=\$(addsuffix _mod.f$FS90, \$(CB2M_F90_SRC_NAMES))  CB2M_F90_PP_SRC_FILES=\$(addsuffix _mod.f$FS90, \$(CB2M_F90_SRC_NAMES))
3418    
3419  .PRECIOUS: \$(CB2M_F90_PP_SRC_FILES) \$(NON_AD_F77_SRC_FILES:.F=_cb2m.f$FS90)  .PRECIOUS: \$(CB2M_F90_PP_SRC_FILES) \$(NON_AD_F77_SRC_FILES:.F=_cb2m.f$FS90)
# Line 3174  w2f__types.F90 \ Line 3429  w2f__types.F90 \
3429  OAD_active.F90 \  OAD_active.F90 \
3430  OAD_cp.F90 \  OAD_cp.F90 \
3431  OAD_rev.F90 \  OAD_rev.F90 \
3432  OAD_tape.F90  OAD_tape.F90 \
3433    OAD_regular_cp.F90 \
3434    revolve.F90
3435    
3436  OPENAD_SUPPORT_C_SRC_FILES = \  OPENAD_SUPPORT_C_SRC_FILES = \
3437  iaddr.c \  iaddr.c \
# Line 3200  AD_OBJ_FILES_S2=\$(AD_OBJ_FILES_S1) \$(N Line 3457  AD_OBJ_FILES_S2=\$(AD_OBJ_FILES_S1) \$(N
3457          \$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(AD_OBJ_FILES_S2) \$(LIBS)          \$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(AD_OBJ_FILES_S2) \$(LIBS)
3458    
3459  # create sources files modules from header files containing common blocks  # create sources files modules from header files containing common blocks
3460  %_mod.FF90 : %.h ../OAD_support/cb2mGetModules.csh ../OAD_support/cb2mGetModules.awk  %_mod.FF90 : %.h \${OADTOOLS}/cb2mGetModules.csh \${OADTOOLS}/cb2mGetModules.awk
3461          ../OAD_support/cb2mGetModules.csh $< ../OAD_support/cb2mGetModules.awk          \${OADTOOLS}/cb2mGetModules.csh $< \${OADTOOLS}/cb2mGetModules.awk
3462    
3463  # create new header files with USE statements for the new modules made above  # create new header files with USE statements for the new modules made above
3464  %_mod.h : %.h ../OAD_support/cb2mGetHeaders.csh ../OAD_support/cb2mGetHeaders.awk  %_mod.h : %.h \${OADTOOLS}/cb2mGetHeaders.csh \${OADTOOLS}/cb2mGetHeaders.awk
3465          ../OAD_support/cb2mGetHeaders.csh $< ../OAD_support/cb2mGetHeaders.awk \$(CB2M_F90_SRC_NAMES)          \${OADTOOLS}/cb2mGetHeaders.csh $< \${OADTOOLS}/cb2mGetHeaders.awk \$(CB2M_F90_SRC_NAMES)
3466    
3467  # change the include directives of everybody to refer to  the new header files with the USE statements  # change the include directives of everybody to refer to  the new header files with the USE statements
3468  %_cb2m.FF90 : %.F ../OAD_support/cb2mUseModules.bash  %_cb2m.FF90 : %.F \${OADTOOLS}/cb2mUseModules.bash
3469          ../OAD_support/cb2mUseModules.bash $< ${MPI}          \${OADTOOLS}/cb2mUseModules.bash $< ${MPI}
3470    
3471  # makefile debug rule  # makefile debug rule
3472  small_f: \$(CB2M_F90_PP_SRC_FILES)  small_f: \$(CB2M_F90_PP_SRC_FILES)
3473  .PHONY: small_f  .PHONY: small_f
3474    
 ad_output.txt: \$(EXE_AD)  
         @printf 'linking data files ... '  
         \$(LN) -f ../input_ad/data* ../input_ad/eedata .  
         \$(LN) -f ../../global_ocean.90x40x15/input/*.bin .  
         @printf 'running ... '  
         @./\$(EXE_AD) > \$@  
   
3475  ad_input_code.f$FS90:  \$(CB2M_AD_FILES)  ad_input_code.f$FS90:  \$(CB2M_AD_FILES)
3476          cat \$^ > \$@          cat \$^ > \$@
3477    
# Line 3231  ad_input_code_sf.pre.f90 : \$(CB2M_AD_FI Line 3481  ad_input_code_sf.pre.f90 : \$(CB2M_AD_FI
3481    
3482  # replace stop statements (to avoid the implied unstructured control flow)  with print statements  # replace stop statements (to avoid the implied unstructured control flow)  with print statements
3483  ad_input_code_sf.pre.s2p.f90 : ad_input_code_sf.pre.f90  ad_input_code_sf.pre.s2p.f90 : ad_input_code_sf.pre.f90
3484          cat \$< | sed -f ../OAD_support/stop2print.sed > ad_input_code_sf.pre.s2p.f90          cat \$< | sed -f \${OADTOOLS}/stop2print.sed > ad_input_code_sf.pre.s2p.f90
3485    
3486  # F -> WHIRL  # F -> WHIRL
3487  ad_input_code_sf.pre.s2p.B: ad_input_code_sf.pre.s2p.f90  ad_input_code_sf.pre.s2p.B: ad_input_code_sf.pre.s2p.f90
# Line 3254  ad_input_code_sf.pre.s2p.xb.x2w.w2f.f$FS Line 3504  ad_input_code_sf.pre.s2p.xb.x2w.w2f.f$FS
3504          \${OPEN64ROOT}/whirl2f/whirl2f -FLIST:ftn_file=\$@ -openad \$<          \${OPEN64ROOT}/whirl2f/whirl2f -FLIST:ftn_file=\$@ -openad \$<
3505    
3506  # insert template directives  # insert template directives
3507  ad_input_code_sf.pre.s2p.xb.x2w.w2f.td.f$FS90: ad_input_code_sf.pre.s2p.xb.x2w.w2f.f$FS90 ../OAD_support/insertTemplateDir.bash  ad_input_code_sf.pre.s2p.xb.x2w.w2f.td.f$FS90: ad_input_code_sf.pre.s2p.xb.x2w.w2f.f$FS90 \${OADTOOLS}/insertTemplateDir.bash
3508          ../OAD_support/insertTemplateDir.bash \$< \$@          \${OADTOOLS}/insertTemplateDir.bash \$< \$@
3509    
3510  PPEXTRAS=\$(wildcard ../OAD_support/ad_template.*.F) ../OAD_support/ad_inline.F  PPEXTRAS=\$(notdir \$(wildcard \${OADTOOLS}/ad_template.*.F)) ad_inline.F
3511  # postprocess F'  # postprocess F'
3512  postProcess.tag: ad_input_code_sf.pre.s2p.xb.x2w.w2f.td.f$FS90 \$(PPEXTRAS:.F=.f) | w2f__types.f90  postProcess.tag: ad_input_code_sf.pre.s2p.xb.x2w.w2f.td.f$FS90 \$(PPEXTRAS:.F=.f) | w2f__types.f90
3513          \${OPENADFORTTK_BASE}/tools/SourceProcessing/postProcess.py --progress --timing --infoUnitFile w2f__types.f90 --outputFormat=fixed --separateOutput --pathSuffix "" --filenameSuffix "_oad" -m r -i ../OAD_support/ad_inline.f \$<          \${OPENADFORTTK_BASE}/tools/SourceProcessing/postProcess.py --progress --timing --infoUnitFile w2f__types.f90 --outputFormat=fixed --separateOutput --pathSuffix "" --filenameSuffix "_oad" -m r -i ad_inline.f \$<
3514          # the target is a placeholder to trigger a single execution of the rule          # the target is a placeholder to trigger a single execution of the rule
3515          touch \$@          touch \$@
3516  # put this so make knows about the postprocessing output  # put this so make knows about the postprocessing output
# Line 3271  OAD_intrinsics_oad.f \$(CB2M_AD_FILES:.f Line 3521  OAD_intrinsics_oad.f \$(CB2M_AD_FILES:.f
3521          \$(LN) \${XAIFSCHEMAROOT}/schema/\$@ .          \$(LN) \${XAIFSCHEMAROOT}/schema/\$@ .
3522    
3523  # link the support files:  # link the support files:
3524  \$(OPENAD_SUPPORT_F90_SRC_FILES) \$(OPENAD_SUPPORT_C_SRC_FILES):  \$(OPENAD_SUPPORT_F90_SRC_FILES) \$(OPENAD_SUPPORT_C_SRC_FILES) \$(PPEXTRAS):
3525          \$(LN) ../OAD_support/\$@ .          \$(LN) \${OADTOOLS}/\$@ .
3526    
3527  AD_CLEAN += *_mod.h *_mod.F90 *.FF90 *.mod-whirl temp.sed oad_cp.* postProcess.tag \$(PPEXTRAS:.F=.f)  AD_CLEAN += *_mod.h *_mod.F90 *.FF90 *.mod-whirl temp.sed oad_cp.* postProcess.tag
3528    
3529  # ============ end OpenAD specific section ==============  # ============ end OpenAD specific section ==============
3530    
# Line 3310  for i in $NOOPTFILES ; do Line 3560  for i in $NOOPTFILES ; do
3560  done  done
3561    
3562  echo "  Add rules for links"  echo "  Add rules for links"
3563  cat srclinks.tmp >> $MAKEFILE  cat $TMP.srclinks >> $MAKEFILE
3564  rm -f srclinks.tmp  rm -f $TMP.srclinks
3565    
3566  echo "  Adding makedepend marker"  echo "  Adding makedepend marker"
3567  printf "\n\n# DO NOT DELETE\n" >> $MAKEFILE  printf "\n\n# DO NOT DELETE\n" >> $MAKEFILE
# Line 3319  printf "\n\n# DO NOT DELETE\n" >> $MAKEF Line 3569  printf "\n\n# DO NOT DELETE\n" >> $MAKEF
3569  printf "\n===  Done  ===\n"  printf "\n===  Done  ===\n"
3570    
3571  # Create special header files  # Create special header files
3572  $BASH $TOOLSDIR/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -bPACKAGES_CONFIG_H "Disabled packages:" $DISABLED_PACKAGES " " "Enabled packages:" $ENABLED_PACKAGES > $PACKAGES_DOT_H".tmp"  $BASH $TOOLSDIR/convert_cpp_cmd2defines -bPACKAGES_CONFIG_H "Disabled packages:" $DISABLED_PACKAGES " " "Enabled packages:" $ENABLED_PACKAGES > $PACKAGES_DOT_H".tmp"
3573  if test ! -f $PACKAGES_DOT_H ; then  if test ! -f $PACKAGES_DOT_H ; then
3574      mv -f $PACKAGES_DOT_H".tmp" $PACKAGES_DOT_H      mv -f $PACKAGES_DOT_H".tmp" $PACKAGES_DOT_H
3575  else  else
# Line 3333  else Line 3583  else
3583      fi      fi
3584  fi  fi
3585  if test ! -f AD_CONFIG.h ; then  if test ! -f AD_CONFIG.h ; then
3586      $BASH $TOOLSDIR/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > AD_CONFIG.h      $BASH $TOOLSDIR/convert_cpp_cmd2defines "Default version" -bAD_CONFIG_H -UALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN > AD_CONFIG.h
3587  fi  fi
3588    
3589  #  Write the "state" for future records  #  Write the "state" for future records

Legend:
Removed from v.1.236  
changed lines
  Added in v.1.276

  ViewVC Help
Powered by ViewVC 1.1.22