/[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.176 by jmc, Fri Nov 7 04:34:19 2008 UTC revision 1.179 by jmc, Fri Nov 21 16:15:00 2008 UTC
# Line 1402  if test ! -d ${ROOTDIR} ; then Line 1402  if test ! -d ${ROOTDIR} ; then
1402  fi  fi
1403    
1404  #  Find the MITgcm ${THISVER}  #  Find the MITgcm ${THISVER}
1405  if test -f "${ROOTDIR}/doc/tag-index" ; then  version_file="${ROOTDIR}/doc/tag-index"
1406      THISVER=`grep '^checkpoint' ${ROOTDIR}/doc/tag-index | head -1`  if test -f $version_file ; then
1407        THISVER=`grep '^checkpoint' $version_file | head -1`
1408    #-  remove ./BUILD_INFO.h file if older than version_file
1409        if test -f ./BUILD_INFO.h -a ./BUILD_INFO.h -ot $version_file ; then
1410            echo "  remove ./BUILD_INFO.h (older than ${version_file})"
1411            rm -f ./BUILD_INFO.h
1412        fi
1413  fi  fi
1414    
1415  if test "x$MAKEFILE" = x ; then  if test "x$MAKEFILE" = x ; then
# Line 2616  clean: Line 2622  clean:
2622          -rm -rf *.o          -rm -rf *.o
2623          -rm -rf *.$FS *.flowdir          -rm -rf *.$FS *.flowdir
2624          -rm -rf *.f$FS90 *_mod.h *_mod.F90 *.FF90 *.mod-whirl ad_input*          -rm -rf *.f$FS90 *_mod.h *_mod.F90 *.FF90 *.mod-whirl ad_input*
2625          -rm -rf temp.sed reslice.dat          -rm -rf temp.sed
2626  Clean:  Clean:
2627          @make clean          @make clean
2628          @make cleanlinks          @make cleanlinks
# Line 2682  cat >>$MAKEFILE <<EOF Line 2688  cat >>$MAKEFILE <<EOF
2688  # The normal chain of rules is (  .F - .$FS - .o  )  # The normal chain of rules is (  .F - .$FS - .o  )
2689    
2690  ## This nullifies any default implicit rules concerning these two file types:  ## This nullifies any default implicit rules concerning these two file types:
2691  %.o : %.F  ## %.o : %.F
2692    
2693  .F.$FS:  .F.$FS:
2694          \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@          \$(CPP) \$(DEFINES) \$(INCLUDES) > \$@
# Line 2938  timeRatio.c Line 2944  timeRatio.c
2944  f95_test_mods.f90: \$(OPENAD_SUPPORT_F90_SRC_FILES:F90=$FS90)  f95_test_mods.f90: \$(OPENAD_SUPPORT_F90_SRC_FILES:F90=$FS90)
2945          cat \$^ > \$@          cat \$^ > \$@
2946    
2947  f95_test.f90: all_mods.xb.x2w.w2f.pp.f$FS90 \$(NON_AD_F77_SRC_FILES:.F=_cb2m.f$FS90) ad_input_code.w2f.canon.xb.x2w.w2f.rs.pp.f$FS90  f95_test.f90: all_mods.xb.x2w.w2f.pp.f$FS90 \$(NON_AD_F77_SRC_FILES:.F=_cb2m.f$FS90) ad_input_code.w2f.pre.xb.x2w.w2f.td.pp.f$FS90
2948          cat \$^ > \$@          cat \$^ > \$@
2949    
2950  f95_test.out: f95_test_mods.f90 f95_test.f90  f95_test.out: f95_test_mods.f90 f95_test.f90
2951          f95 -fixed -w=unused -maxcontin=132 -c f95_test_mods.f90 > \$@ 2>&1          f95 -fixed -w=unused -maxcontin=132 -c f95_test_mods.f90 > \$@ 2>&1
2952          f95 -fixed -w=unused -maxcontin=132 -c -fixed f95_test.f90 >> \$@ 2>&1          f95 -fixed -w=unused -maxcontin=132 -c -fixed f95_test.f90 >> \$@ 2>&1
2953    
2954  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.pre.xb.x2w.w2f.td.pp.o \$(NON_AD_F77_SRC_FILES:.F=_cb2m.o) \$(C_SRC_FILES:.c=.o) \$(F90_SRC_FILES:.F90=.o)
2955    
2956  \$(EXE_AD): \$(ALL_LINKED_FILES) \$(addsuffix _mod.h, \$(CB2M_F90_SRC_NAMES)) \$(AD_OBJ_FILES)  \$(EXE_AD): \$(ALL_LINKED_FILES) \$(addsuffix _mod.h, \$(CB2M_F90_SRC_NAMES)) \$(AD_OBJ_FILES)
2957          @echo Creating \$@ ...          @echo Creating \$@ ...
2958          \$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(AD_OBJ_FILES) \$(LIBS)          \$(LINK) -o \$@ \$(FFLAGS) \$(FOPTIM) \$(AD_OBJ_FILES) \$(LIBS)
2959    
2960  # makefile debug rule  # makefile debug rule
2961  openad: ad_input_code.w2f.canon.xb.x2w.w2f.rs.pp.f$FS90  openad: ad_input_code.w2f.pre.xb.x2w.w2f.td.pp.f$FS90
2962  .PHONY: openad  .PHONY: openad
2963    
2964  # create the module files  # create the module files
# Line 2998  ad_input_code_sf.w2f.f$FS90: ad_input_co Line 3004  ad_input_code_sf.w2f.f$FS90: ad_input_co
3004          cat w2f__types.f90 \$(basename \$<).w2f.f > \$@          cat w2f__types.f90 \$(basename \$<).w2f.f > \$@
3005    
3006  # canonicalizer  # canonicalizer
3007  ad_input_code_sf.w2f.canon.f$FS90: ad_input_code_sf.w2f.f$FS90 canon.v1.py  ad_input_code_sf.w2f.pre.f$FS90: ad_input_code_sf.w2f.f$FS90 preProcess.py
3008          python canon.v1.py --r8 \$< > \$@          ./preProcess.py -H \$< -o \$@
3009    
3010  # F -> WHIRL  # F -> WHIRL
3011  # note that the canonicalized version cuts off at col 72  # note that the canonicalized version cuts off at col 72
# Line 3007  ad_input_code_sf.w2f.canon.f$FS90: ad_in Line 3013  ad_input_code_sf.w2f.canon.f$FS90: ad_in
3013  # as we are in fixed mode and cut of exactly there.  # as we are in fixed mode and cut of exactly there.
3014  # Otherwise mfef90 patches in spaces to fill up to 72 (or 132)  # Otherwise mfef90 patches in spaces to fill up to 72 (or 132)
3015  # characters respectively.  # characters respectively.
3016  ad_input_code_sf.w2f.canon.B: ad_input_code_sf.w2f.canon.f$FS90 mfef90  ad_input_code_sf.w2f.pre.B: ad_input_code_sf.w2f.pre.f$FS90 mfef90
3017          ./mfef90 -r8 -z -F \$<          ./mfef90 -r8 -z -F \$<
3018          mv \$<.B \$@          mv \$<.B \$@
3019    
3020  # WHIRL -> XAIF  # WHIRL -> XAIF
3021  ad_input_code_sf.w2f.canon.xaif : ad_input_code_sf.w2f.canon.B whirl2xaif  ad_input_code_sf.w2f.pre.xaif : ad_input_code_sf.w2f.pre.B whirl2xaif
3022          ./whirl2xaif -s -n --debug 1 -o \$@ \$<          ./whirl2xaif -s -n --debug 1 -o \$@ \$<
3023    
3024  # XAIF -> XAIF'  # XAIF -> XAIF'
3025  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.pre.xb.xaif : ad_input_code_sf.w2f.pre.xaif xaif.xsd xaif_base.xsd xaif_inlinable_intrinsics.xsd xaif_derivative_propagator.xsd xaif_output.xsd openad_adm
3026          ./openad_adm -f -t forward_step -i \$< -c \${XAIFSCHEMAROOT}/schema/examples/inlinable_intrinsics.xaif -o \$@ -I -r          ./openad_adm -f -t forward_step -i \$< -c \${XAIFSCHEMAROOT}/schema/examples/inlinable_intrinsics.xaif -o \$@ -I -r
3027    
3028  # XAIF' -> WHIRL'  # XAIF' -> WHIRL'
3029  ad_input_code_sf.w2f.canon.xb.x2w.B : ad_input_code_sf.w2f.canon.xb.xaif xaif2whirl  ad_input_code_sf.w2f.pre.xb.x2w.B : ad_input_code_sf.w2f.pre.xb.xaif xaif2whirl
3030          ./xaif2whirl --debug 1 --structured ad_input_code_sf.w2f.canon.B \$<          ./xaif2whirl --debug 1 --structured ad_input_code_sf.w2f.pre.B \$<
3031    
3032  # WHIRL' -> F'  # WHIRL' -> F'
3033  ad_input_code_sf.w2f.canon.xb.x2w.w2f.f$FS90: ad_input_code_sf.w2f.canon.xb.x2w.B whirl2f whirl2f_be  ad_input_code_sf.w2f.pre.xb.x2w.w2f.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.B whirl2f whirl2f_be
3034          ./whirl2f -FLIST:ftn_file=\$@ -openad \$<          ./whirl2f -FLIST:ftn_file=\$@ -openad \$<
3035    
 # undo slice hiding  
3036  # insert template directives  # insert template directives
3037  ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs.f$FS90: ad_input_code_sf.w2f.canon.xb.x2w.w2f.f$FS90 reslicer.py ../OAD_support/insertTemplateDir.bash  ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.f$FS90 ../OAD_support/insertTemplateDir.bash
3038          python reslicer.py \$< > \$<.1          ../OAD_support/insertTemplateDir.bash \$< \$@
         ../OAD_support/insertTemplateDir.bash \$<.1  \$@  
         rm \$<.1  
3039    
3040  # postprocess F'  # postprocess F'
3041  ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs.pp.f$FS90: ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs.f$FS90 multi-pp.pl ../OAD_support/ad_inline.f \$(wildcard ../OAD_support/ad_template.*.f)  ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.pp.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.f$FS90 multi-pp.pl ../OAD_support/ad_inline.f \$(wildcard ../OAD_support/ad_template.*.f)
3042          perl multi-pp.pl -inline=../OAD_support/ad_inline.f \$<          perl multi-pp.pl -inline=../OAD_support/ad_inline.f \$<
3043          # the postprocessor still gets the name wrong          # the postprocessor still gets the name wrong
3044          cat \$<.pp | sed 's/RETURN//' > \$@          cat \$<.pp | sed 's/RETURN//' > \$@
3045    
3046  # extract all transformed modules  # extract all transformed modules
3047  all_mods.xb.x2w.w2f.pp.f$FS90: ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs.pp.f$FS90  all_mods.xb.x2w.w2f.pp.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.pp.f$FS90
3048          cat \$< | sed -n '/MODULE /,/END MODULE/p' > \$@          cat \$< | sed -n '/MODULE /,/END MODULE/p' > \$@
3049    
3050  # remove the transformed globals module from the  # remove the transformed globals module from the
3051  # transformed ad_input_code file  # transformed ad_input_code file
3052  # and remove for now the duplicate variables  # and remove for now the duplicate variables
3053  # and fix 2 data statements  # and fix 2 data statements
3054  ad_input_code.w2f.canon.xb.x2w.w2f.rs.pp.f$FS90: ad_input_code_sf.w2f.canon.xb.x2w.w2f.rs.pp.f$FS90  ad_input_code.w2f.pre.xb.x2w.w2f.td.pp.f$FS90: ad_input_code_sf.w2f.pre.xb.x2w.w2f.td.pp.f$FS90
3055          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' > \$@
3056    
3057  # setup some links  # setup some links
# Line 3068  whirl2xaif xaif2whirl: Line 3071  whirl2xaif xaif2whirl:
3071  %.pl:  %.pl:
3072          \$(LN) \${OPENADFORTTK}/bin/\$@ .          \$(LN) \${OPENADFORTTK}/bin/\$@ .
3073    
3074  %.py:  preProcess.py:
3075          \$(LN) \${OPENADROOT}/OpenADFortTk/tools/canonicalize/\$@ .          \$(LN) \${OPENADFORTTK_BASE}/tools/SourceProcessing/\$@ .
3076    
3077  whirl2f whirl2f_be:  whirl2f whirl2f_be:
3078          \$(LN) \${OPEN64ROOT}/whirl2f/\$@ .          \$(LN) \${OPEN64ROOT}/whirl2f/\$@ .

Legend:
Removed from v.1.176  
changed lines
  Added in v.1.179

  ViewVC Help
Powered by ViewVC 1.1.22