[MITgcm-devel] viscFacAdj = viscFacInAd has no effect on simulation

Martin Losch Martin.Losch at awi.de
Mon Nov 2 12:21:23 EST 2020


Hi Matt,

you probably rely (or used to rely) on increased viscosity to stabilize the adjoint with viscFacAdj. 
Together with a post-doc I am trying to use viscFacAdj with an ECCOv4ish variant of the llc90 configuration and find that this factor (via viscFacInAd) has no effect on the solution. I think store directives in mom_vecinv.F that suppress recomputing the viscosities via S/R mom_calc_visc are responsible for this (because the viscosities are saved in the tape computations). Before I make this an issue or even a PR on github I would like to hear from you how you actually do (or used to do) this (increase viscosity in AD-mode) and if you have an example that you are willing to share.

I know that you are working on combining high res forward with low res ad models (which I am also very much interested in), but for now I would be very happy to get the increased viscosity method to work with current code. Any help is appreciated.

There’s a second problem that I idendified:
viscFacAdj = 0 (default) before autodiff_inadmode_set_ad is called for the first time, then it is set to viscFacInAd (which then has no effect), and then is is reset to 1 in autodiff_inadmode_unset_ad, so that part of the tape computations are with a different viscFacAdj than the forward simulation. I cannot imagine that this is intentional, but maybe I am overlooking something?
I plan to have a new runtime parameter viscFacInFw (which defaults to zero) that then becomes the default for viscFacAdj, so that we can set this parameter to something that is the same in all forward and tape compuation parts of the code. Do you have an opinion on that?

Best,

Martin


More information about the MITgcm-devel mailing list