[MITgcm-devel] restoring tapenade-tangent linear for STREAMICE: proposed solution

Daniel Goldberg Dan.Goldberg at ed.ac.uk
Mon Dec 15 07:46:39 EST 2025


Dear J-M and all:

Upon the merging of 927<https://github.com/MITgcm/MITgcm/pull/927>(which was a good thing!), the tangent linear test of STREAMICE under Tapenade no longer worked, whereas it seemed to be giving accurate values. I am writing this email to run a proposed solution by the team, rather than submitting a PR unannounced, to get a feel for whether it would be welcomed, and looked at.

The reason is that streamice_cg_solve.f is no longer passed to Tapenade, instead using a "manual" approach as with cg2d.f. This is necessary for large problems where the ad-generated adjoint code would be very slow and/or memory intensive and would preclude external library solvers. These issues would not apply as much to the TLM — but no "manual" solution exists.

My idea for a solution, is to pass streamice_cg_solve.f through tapenade only when the TLM is compiled. I propose to do this by modifying genmake2 to look for "supplemental" files *_tlm_diff.list (in addition to *_ad_diff.list). A list of S/Rs called $(TLM_FILES) (or something) will be created and passed as an argument to tapenade, only for the TLM call. The *_tlm_diff.list files (e.g. streamice_tlm_diff.list) files will be optional, and only need contain files that are passed to the TLM but not adjoint. I think this is justified as in general the set of functions that the TLM can parse easily is larger than that of the adjoint.

All the best
Dan



--
Daniel Goldberg, PhD (he/him)
Reader in Glaciology
School of Geosciences, University of Edinburgh
Geography Building, Drummond Street, Edinburgh EH8 9XP
https://dngoldberg.github.io/
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. Is e buidheann carthannais a th’ ann an Oilthigh Dhùn Èideann, clàraichte an Alba, àireamh clàraidh SC005336.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-devel/attachments/20251215/77ee2627/attachment.html>


More information about the MITgcm-devel mailing list