/[MITgcm]/MITgcm_contrib/heimbach/OpenAD/code_shallow_openad/genmake2
ViewVC logotype

Diff of /MITgcm_contrib/heimbach/OpenAD/code_shallow_openad/genmake2

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

revision 1.3 by utke, Tue Jan 3 19:21:36 2006 UTC revision 1.12 by utke, Sat Jan 27 04:37:54 2007 UTC
# Line 1  Line 1 
1    
2  #! /usr/bin/env bash  #! /usr/bin/env bash
3  #  #
4  # $Header$  # $Header$
# Line 931  for i in . $MODS ; do Line 932  for i in . $MODS ; do
932      fi      fi
933      let modsCount=modsCount+1      let modsCount=modsCount+1
934  done  done
935  if test modsCount -gt 1 ; then  if test $modsCount -gt 1 ; then
936    echo "ERROR: some uses of MODS break with more than one directory specified"    echo "ERROR: some uses of MODS break with more than one directory specified"
937    exit -1;    exit -1;
938  fi  fi
# Line 1903  for d in $alldirs ; do Line 1904  for d in $alldirs ; do
1904                          basename=${sf%%.F}                          basename=${sf%%.F}
1905                          isAD=`egrep ^$basename.f'[      ]*' adSrcFiles.tmp`                          isAD=`egrep ^$basename.f'[      ]*' adSrcFiles.tmp`
1906                          if test -z "$isAD" ; then                          if test -z "$isAD" ; then
1907                            echo    " \\"  >> nonADF77srclist.tmp                            toBeIgnored=`egrep ^$basename'[      ]*' ${MODS}/dontCompile`
1908                            printf " $sf" >> nonADF77srclist.tmp                            if test -z "$toBeIgnored" ; then
1909                                echo    " \\"  >> nonADF77srclist.tmp
1910                                printf " $sf" >> nonADF77srclist.tmp
1911                              else
1912                                echo "Ignoring $sf"
1913                              fi
1914                          fi                          fi
1915                          ;;                          ;;
1916                      F90)                      F90)
# Line 1934  for d in $alldirs ; do Line 1940  for d in $alldirs ; do
1940  done  done
1941  rm -rf .links.tmp  rm -rf .links.tmp
1942  echo "" >> F77srclist.tmp  echo "" >> F77srclist.tmp
1943    for i in `cat ${MODS}/keepOriginal`
1944    do
1945      echo   " \\" >> nonADF77srclist.tmp
1946      printf " $i" >> nonADF77srclist.tmp
1947    done  
1948  echo "" >> nonADF77srclist.tmp  echo "" >> nonADF77srclist.tmp
1949  echo "" >> csrclist.tmp  echo "" >> csrclist.tmp
1950  echo "" >> F90srclist.tmp  echo "" >> F90srclist.tmp
# Line 2284  OpenAD_rev.f90 \ Line 2295  OpenAD_rev.f90 \
2295  OpenAD_tape.f90          OpenAD_tape.f90        
2296    
2297  OPENAD_SUPPORT_C_SRC_FILES = \  OPENAD_SUPPORT_C_SRC_FILES = \
2298  iaddr.c  iaddr.c \
2299    timeRatio.c
2300    
2301    f95_test_mods.f90: \$(OPENAD_SUPPORT_F90_SRC_FILES)
2302            cat \$^ > \$@
2303    
2304    f95_test.f90: all_mods.xb.x2w.w2f.pp.f \$(NON_AD_F77_SRC_FILES:.F=_cb2m.ff90) ad_input_code.w2f.canon.xb.x2w.w2f.rs.pp.f
2305            cat \$^ > \$@
2306    
2307    f95_test.out: f95_test_mods.f90 f95_test.f90
2308            f95 -w=unused -maxcontin=132 -c f95_test_mods.f90 > \$@ 2>&1
2309            f95 -w=unused -maxcontin=132 -c -fixed f95_test.f90 >> \$@ 2>&1
2310    
2311  AD_OBJ_FILES=\$(OPENAD_SUPPORT_F90_SRC_FILES:.f90=.o) \$(OPENAD_SUPPORT_C_SRC_FILES:.c=.o) all_mods.xb.x2w.w2f.pp.o ad_input_code.w2f.canon.xb.x2w.w2f.rs.pp.o \$(NON_AD_F77_SRC_FILES:.F=_cb2m.o) \$(C_SRC_FILES:.c=.o) \$(F90_SRC_FILES:.F90=.o)  AD_OBJ_FILES=\$(OPENAD_SUPPORT_F90_SRC_FILES:.f90=.o) \$(OPENAD_SUPPORT_C_SRC_FILES:.c=.o) all_mods.xb.x2w.w2f.pp.o ad_input_code.w2f.canon.xb.x2w.w2f.rs.pp.o \$(NON_AD_F77_SRC_FILES:.F=_cb2m.o) \$(C_SRC_FILES:.c=.o) \$(F90_SRC_FILES:.F90=.o)
2312    
# Line 2357  ad_input_code_sf.w2f.canon.xaif : ad_inp Line 2379  ad_input_code_sf.w2f.canon.xaif : ad_inp
2379    
2380  # XAIF -> XAIF'  # XAIF -> XAIF'
2381  ad_input_code_sf.w2f.canon.xb.xaif : ad_input_code_sf.w2f.canon.xaif xaif.xsd xaif_base.xsd xaif_inlinable_intrinsics.xsd xaif_derivative_propagator.xsd xaif_output.xsd openad_adm  ad_input_code_sf.w2f.canon.xb.xaif : ad_input_code_sf.w2f.canon.xaif xaif.xsd xaif_base.xsd xaif_inlinable_intrinsics.xsd xaif_derivative_propagator.xsd xaif_output.xsd openad_adm
2382          ./openad_adm -i \$< -c \${XAIFSCHEMAROOT}/schema/examples/inlinable_intrinsics.xaif -o \$@ -I          ./openad_adm -i \$< -c \${XAIFSCHEMAROOT}/schema/examples/inlinable_intrinsics.xaif -o \$@ -I -r -p "recip_hFacC recip_rA"
2383    
2384  # XAIF' -> WHIRL'  # XAIF' -> WHIRL'
2385  ad_input_code_sf.w2f.canon.xb.x2w.B : ad_input_code_sf.w2f.canon.xb.xaif xaif2whirl  ad_input_code_sf.w2f.canon.xb.x2w.B : ad_input_code_sf.w2f.canon.xb.xaif xaif2whirl
2386          ./xaif2whirl --structured ad_input_code_sf.w2f.canon.B \$<          ./xaif2whirl --debug 1 --structured ad_input_code_sf.w2f.canon.B \$<
2387    
2388  # WHIRL' -> F'  # WHIRL' -> F'
2389  ad_input_code_sf.w2f.canon.xb.x2w.w2f.f: ad_input_code_sf.w2f.canon.xb.x2w.B whirl2f whirl2f_be  ad_input_code_sf.w2f.canon.xb.x2w.w2f.f: ad_input_code_sf.w2f.canon.xb.x2w.B whirl2f whirl2f_be
# Line 2375  ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs Line 2397  ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs
2397          rm \$<.1          rm \$<.1
2398    
2399  # postprocess F'  # postprocess F'
2400  ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs.pp.f: ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs.f multi-pp.pl ${MODS}/ad_inline.f ${MODS}/ad_template.checkpoint.f ${MODS}/ad_template.plain.f ${MODS}/ad_template.split.f  ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs.pp.f: ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs.f multi-pp.pl ${MODS}/ad_inline.f ${MODS}/ad_template.checkpoint.f ${MODS}/ad_template.plain.f ${MODS}/ad_template.split.f ${MODS}/ad_template.sa_cg2d.f
2401          perl multi-pp.pl -inline=${MODS}/ad_inline.f \$<          perl multi-pp.pl -inline=${MODS}/ad_inline.f \$<
2402          cat \$@ | sed 's/RETURN//' > \$@.1          cat \$@ | sed 's/RETURN//' > \$@.1
2403          mv \$@.1 \$@          mv \$@.1 \$@
# Line 2387  all_mods.xb.x2w.w2f.pp.f: ad_input_code_ Line 2409  all_mods.xb.x2w.w2f.pp.f: ad_input_code_
2409  # remove the transformed globals module from the  # remove the transformed globals module from the
2410  # transformed ad_input_code file  # transformed ad_input_code file
2411  # and remove for now the duplicate variables  # and remove for now the duplicate variables
2412  ad_input_code.w2f.canon.xb.x2w.w2f.rs.pp.f: ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs.pp.f  # and fix 2 data statements
2413    ad_input_code.w2f.canon.xb.x2w.w2f.rs.pp.f: ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs.pp.f ${MODS}/fixData.sed
2414    #       cat \$< | sed '/MODULE /,/END MODULE/d' | sed '/^      INTEGER(w2f__i4) DOLOOP_UB/d' | sed -f ${MODS}/fixData.sed > \$@
2415          cat \$< | sed '/MODULE /,/END MODULE/d' | sed '/^      INTEGER(w2f__i4) DOLOOP_UB/d' > \$@          cat \$< | sed '/MODULE /,/END MODULE/d' | sed '/^      INTEGER(w2f__i4) DOLOOP_UB/d' > \$@
2416    
2417  # setup some links  # setup some links
# Line 2402  mfef90: Line 2426  mfef90:
2426          \$(LN) ${MODS}/\$@ .          \$(LN) ${MODS}/\$@ .
2427    
2428  whirl2xaif xaif2whirl:  whirl2xaif xaif2whirl:
2429          \$(LN) \${OPENADROOT}/OpenADFortTk/OpenADFortTk-i686-Linux/bin/\$@ .          \$(LN) \${OPENADROOT}/OpenADFortTk/OpenADFortTk-x86-Linux/bin/\$@ .
2430    
2431  %.pl:  %.pl:
2432          \$(LN) \${OPENADROOT}/OpenADFortTk/OpenADFortTk-i686-Linux/bin/\$@ .          \$(LN) \${OPENADROOT}/OpenADFortTk/OpenADFortTk-x86-Linux/bin/\$@ .
2433    
2434  %.py:  %.py:
2435          \$(LN) \${OPENADROOT}/OpenADFortTk/tools/canonicalize/\$@ .          \$(LN) \${OPENADROOT}/OpenADFortTk/tools/canonicalize/\$@ .

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.22