[MITgcm-devel] Makefile for adjoint

Martin Losch Martin.Losch at awi.de
Mon Dec 8 09:51:15 EST 2014


Hi there,

since TAF v2 the forward code is replicated in ad_taf_output.f, which makes this file very large and very slow to compile. Not so much of a problem if you just want to have something that runs, but annoying if you want to debug the adjoint model (as I am doing unsuccessfully). It appears to be pretty straightforward to skip the cat-everything-into-ad_input_code.f and call TAF with taf -options $(FLOWFILES) $(AD_FILES) instead. As a result you get back $(AD_FILES:.f=_ad.f) that contain the adjoint code and the forward code of each routine in $(AD_FILES), that you can compiler much faster (with make -j adall or similar), also I can make changes in individual _ad.f and don’t have to recompile a huge file for minutes. This procedure requires only a few changes in genmake2, and I can debug the code much faster.

The problem starts with the dependencies within the makefile, i.e. because there are no longer any monolithic files like ad_input_code.f and ad_taf_output.f, I find it hard to tell “make” when taf should be called again etc. With this I probably would need some help.

Q1: Is there any general interest in changing the way taf is called and in having faster compiles? If not, I’ll just keep my genmake2 version and fiddle with it for debugging purposes. If yes, then
Q2: would anyone be willing to help me with the makefile/genmake? I would check in a “genmake3” (or maybe heretically a “genmake”) to work on, possibly in the contrib-area.

Martin




More information about the MITgcm-devel mailing list