/[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.1 by heimbach, Tue Dec 13 15:15:30 2005 UTC revision 1.4 by utke, Wed Jan 11 06:05:47 2006 UTC
# Line 923  EOF Line 923  EOF
923    
924  echo "===  Processing options files and arguments  ==="  echo "===  Processing options files and arguments  ==="
925  gm_local="genmake_local"  gm_local="genmake_local"
926    modsCount=0
927  for i in . $MODS ; do  for i in . $MODS ; do
928      if test -r $i/$gm_local ; then      if test -r $i/$gm_local ; then
929          . $i/$gm_local          . $i/$gm_local
930          break          break
931      fi      fi
932        let modsCount=modsCount+1
933  done  done
934    if test modsCount -gt 1 ; then
935      echo "ERROR: some uses of MODS break with more than one directory specified"
936      exit -1;
937    fi
938  printf "  getting local config information:  "  printf "  getting local config information:  "
939  if test -f $gm_local ; then  if test -f $gm_local ; then
940      echo "using $gm_local"      echo "using $gm_local"
# Line 1897  for d in $alldirs ; do Line 1903  for d in $alldirs ; do
1903                          basename=${sf%%.F}                          basename=${sf%%.F}
1904                          isAD=`egrep ^$basename.f'[      ]*' adSrcFiles.tmp`                          isAD=`egrep ^$basename.f'[      ]*' adSrcFiles.tmp`
1905                          if test -z "$isAD" ; then                          if test -z "$isAD" ; then
1906                            echo    " \\"  >> nonADF77srclist.tmp                            toBeIgnored=`egrep ^$basename'[      ]*' ${MODS}/dontCompile`
1907                            printf " $sf" >> nonADF77srclist.tmp                            if test -z "$toBeIgnored" ; then
1908                                echo    " \\"  >> nonADF77srclist.tmp
1909                                printf " $sf" >> nonADF77srclist.tmp
1910                              fi
1911                          fi                          fi
1912                          ;;                          ;;
1913                      F90)                      F90)
# Line 2311  ad_output.txt: \$(EXE_AD) Line 2320  ad_output.txt: \$(EXE_AD)
2320          @./\$(EXE_AD) > \$@          @./\$(EXE_AD) > \$@
2321    
2322  CB2M_AD_FILES=\$(AD_FILES:.f=_cb2m.ff90)  CB2M_AD_FILES=\$(AD_FILES:.f=_cb2m.ff90)
2323  ad_input_code.$FS: \$(CB2M_AD_FILES)  ad_input_code.$FS: ${MODS}/maxMinDefs.f \$(CB2M_AD_FILES)
2324  #       @$BASH\$(TOOLSDIR)/convert_cpp_cmd2defines "Warning - this file is automatically generated - do NOT edit" -DALLOW_ADJOINT_RUN -UALLOW_TANGENTLINEAR_RUN -UALLOW_ECCO_OPTIMIZATION > ad_config.template          cat \$^ > \$@
 #       cmp ad_config.template AD_CONFIG.h || cat ad_config.template > AD_CONFIG.h  
 #       -rm -f ad_config.template  
         cat ../code_ad/maxMinDefs.f \$(CB2M_AD_FILES) > ad_input_code.$FS  
2325    
2326  \$(CB2MFILES):  \$(CB2MFILES):
2327          \$(LN) \$(addprefix ../code_ad/, \$(CB2MFILES)) .          \$(LN) \$(addprefix ${MODS}/, \$(CB2MFILES)) .
2328    
2329  # strip all comments and blanks to reduce  # strip all comments and blanks to reduce
2330  # the file size in order to reduce perl's memory requirements  # the file size in order to reduce perl's memory requirements
2331  ad_input_code_sf.f : ad_input_code.f  ad_input_code_sf.f : ad_input_code.f
2332          cat \$^ | sed -f ../code_ad/strip.sed | sed -f ../code_ad/stop2print.sed > \$@          cat \$^ | sed -f ${MODS}/strip.sed | sed -f ${MODS}/stop2print.sed > \$@
2333    
2334  # mfef90 preprocessing  # mfef90 preprocessing
2335  # expand statement functions  # expand statement functions
# Line 2366  ad_input_code_sf.w2f.canon.xb.x2w.w2f.f: Line 2372  ad_input_code_sf.w2f.canon.xb.x2w.w2f.f:
2372    
2373  # undo slice hiding  # undo slice hiding
2374  # insert template directives  # insert template directives
2375  ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs.f: ad_input_code_sf.w2f.canon.xb.x2w.w2f.f reslicer.py ../code_ad/insertTemplateDir.bash  ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs.f: ad_input_code_sf.w2f.canon.xb.x2w.w2f.f reslicer.py ${MODS}/insertTemplateDir.bash
2376          python reslicer.py \$< > \$<.1          python reslicer.py \$< > \$<.1
2377          ../code_ad/insertTemplateDir.bash \$<.1  \$@          ${MODS}/insertTemplateDir.bash \$<.1  \$@
2378          rm \$<.1          rm \$<.1
2379    
2380  # postprocess F'  # postprocess F'
2381  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 ../code_ad/ad_inline.f ../code_ad/ad_template.checkpoint.f ../code_ad/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
2382          perl multi-pp.pl -inline=../code_ad/ad_inline.f \$<          perl multi-pp.pl -inline=${MODS}/ad_inline.f \$<
2383          cat \$@ | sed 's/RETURN//' > \$@.1          cat \$@ | sed 's/RETURN//' > \$@.1
2384          mv \$@.1 \$@          mv \$@.1 \$@
2385    
# Line 2384  all_mods.xb.x2w.w2f.pp.f: ad_input_code_ Line 2390  all_mods.xb.x2w.w2f.pp.f: ad_input_code_
2390  # remove the transformed globals module from the  # remove the transformed globals module from the
2391  # transformed ad_input_code file  # transformed ad_input_code file
2392  # and remove for now the duplicate variables  # and remove for now the duplicate variables
2393  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
2394          cat \$< | sed '/MODULE /,/END MODULE/d' | sed '/^      INTEGER(w2f__i4) DOLOOP_UB/d' > \$@  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
2395            cat \$< | sed '/MODULE /,/END MODULE/d' | sed '/^      INTEGER(w2f__i4) DOLOOP_UB/d' | sed -f ${MODS}/fixData.sed > \$@
2396    
2397  # setup some links  # setup some links
2398  %.xsd:  %.xsd:
# Line 2396  mfef90: Line 2403  mfef90:
2403    
2404  # link the support files:  # link the support files:
2405  \$(OPENAD_SUPPORT_F90_SRC_FILES) \$(OPENAD_SUPPORT_C_SRC_FILES) :  \$(OPENAD_SUPPORT_F90_SRC_FILES) \$(OPENAD_SUPPORT_C_SRC_FILES) :
2406          \$(LN) ../code_ad/\$@ .          \$(LN) ${MODS}/\$@ .
2407    
2408  whirl2xaif xaif2whirl:  whirl2xaif xaif2whirl:
2409          \$(LN) \${OPENADROOT}/OpenADFortTk/OpenADFortTk-i686-Linux/bin/\$@ .          \$(LN) \${OPENADROOT}/OpenADFortTk/OpenADFortTk-i686-Linux/bin/\$@ .

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.22