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

Log of /MITgcm_contrib/mlosch/tools/genmake2

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


Links to HEAD: (view) (download) (annotate)
Links to HEAD: (view) (download) (annotate)
Sticky Tag:

Revision 1.2
Wed May 2 13:25:27 2018 UTC (6 years ago) by mlosch
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
removing obsolete files that have long been merged into the main repository


Revision 1.1 - (view) (download) (annotate) - [select for diffs]
Wed Dec 10 08:37:48 2014 UTC (9 years, 5 months ago) by mlosch
Branch: MAIN
This version of genmake2 handles the new type of output of TAF v2,
i.e. the fact that the forward code that TAF thinks relevant is
returned together with the derivative code, in a different way than
the original genmake2: Instead of concatenating all fortran sources
and sending one monolithic ad_input_code.f to TAF, the sources are
sent to TAF directly: staf [options] $(FLOWFILES) $(AD_FILES). This
makes it faster to compile the returned sources because you can use
the "parallel" capabilities of (g)make (with option -j n); also you
can modify individual sources (that have been returned by TAF) without
having to recompile a large ad_taf_output.f making debugging a little
easier.

This version of genmake2 works with both testreport -adm and testreport -tlm.

genmake2_patch.diff patches the "official" genmake2 until hopefully
this version makes into the main repository.  Usage:
patch -p1 your_genmake2 genmake2_patch.diff

In order to make this work I had to modify the target ad_taf_output.f
(and similarly ftl_taf_output.f) and introduce new targets:

- remove_comments applies \$(TOOLSDIR)/remove_comments_sed to all
$(AD_FILES) will remove the comments, this may be annoying, if you are
used to working with the *.f files and need to comments for
orientation within the file, but I think that the *.f files can be
generated so easily, that this does not matter much. This target is
really only needed if you have a slow uplink and want to sent smaller
files to staf

- adj_sed and ftl_sed apply $(TOOLSDIR)/adjoint_sed to
  $(AD_FILES:.$FS=_ad/tl.$FS)

- adjobjfiles and ftlobjfiles force compiling the taf-generated files
  after the $(TAF) command

The TAMC related target are not touched, but I did not test the result

Issues:
>>>> The Makefile still generates ad_taf_output.f and ftl_taf_output.f to
be used for svd_taf (although I am not sure, if this will work,
because I don't know how it is supposed to work). <<<<

>>>> The targets adonlyfwd, adtrick will probably not work, but do we
still need them? <<<<

>>>> The $(EXE_AD/FTL) targets now depends on ad/ftl_taf_output.$FS
(not .o anymore), which is generated after making adjobjfiles. This is
a bit of a hack and potentially fragile, but I couldn't think of
anything else to trick "make" into compiling in two separate
steps. <<<<

>>>> Another weakness is the "inplace" use of sed, (sed -i), which
will not work with some sed implementations (POSIX?). Alternatively
one could modify the .F.$FS and .$FS.o rules like this:

.F.$FS:
	sed -f \$(TOOLSDIR)/remove_comments_sed \$< > \$<.tmp && mv \$<.tmp \$<
	\$(CPPCMD) > \$@
.$FS.o:
	sed -f \$(TOOLSDIR)/adjoint_sed \$< > \$<.tmp && mv \$<.tmp \$<
 	$(FC) $(FFLAGS) $(FOPTIM) -c $<

but these would then be applied to all files and not only
the $(AD_FILES). Any suggestion how to improve this is very welcome. <<<<


This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, select a symbolic revision name using the selection box, or choose 'Use Text Field' and enter a numeric revision.

  Diffs between and
  Type of Diff should be a

Sort log by:

  ViewVC Help
Powered by ViewVC 1.1.22