[MITgcm-support] obcs adjoint issue (I need dynamics.F help)

Patrick Heimbach heimbach at MIT.EDU
Fri Nov 10 09:13:06 EST 2006


Hi there,

for the record, the adgv code is correct.
There was some confusion over calls to obcs_apply_uv.
Although argument list is gU, gV, it contains
updated uVel, vVel from S/R timestep,
so that applied OBN?u, OBN?v are correct.

There are indeed other issues,
unrelated to obcs package.

-Patrick



On Fri, 2006-11-10 at 08:58, chris hill wrote:
> FYI
> 
>   If you do the same thing twice in the forward code it should not 
> create double sensitivities in _correct_ adjoint code.
>   e.g.
> 
>   x=a
>    :
>   x=a
> 
>   will transform into reverse code something like
> 
>   dx=1
> 
>   da=da+dx
>   dx=0
>    :
>   da=da+dx
> 
>   remembering to set terminal variables in a statement to 0 is a key 
> piece of the AD transformation that the compiler does.
> 
> Chris
> Martin Losch wrote:
> > Hi Matt,
> > 
> > I have no time to look into this right now, but I suggest, that you try 
> > it yourself: use exp4 and see whether keeping removing the extra calls 
> > to obcs_apply_uv change the result (by running ./testreport -q -t exp4). 
> > If removing a call does change the result, then this call is necessary. 
> > (I believe exp4 does not use the vector invariant moment equations, but 
> > you can put that in for your tests and have an extra personal 
> > verifcation experiment for that case, too).
> > 
> > Are you sure that the odd structions in adgv does not have other origins?
> > 
> > Martin
> > On 9 Nov 2006, at 02:41, Matthew Mazloff wrote:
> > 
> >> Hello,
> >>
> >> I have been using the open boundary controls.  The sensitivities for 
> >> the velocity normal to the boundary appear unphysical.  (I am using a 
> >> northern boundary so for my case V is the normal vel.)  I have tracked 
> >> down what is causing this.  It is that on the open boundary the 
> >> adjoint variable of gV has an odd structure.  And because dynamics.F 
> >> calls OBCS_APPLY_UV twice, this odd structure gets added to the 
> >> sensitivities twice.  Calling  OBCS_APPLY_UV( bi, bj, k, gU, gV, 
> >> myThid ) is rather benign in the forward integration, U and V on the 
> >> open boundary get written over anyway.  In the adjoint integration, 
> >> however, every call matters.  Could someone more expert in the 
> >> dynamics.F routine please check if all these calls are necessary.  And 
> >> I'd really appreciate it if they could also fill me in as to why they 
> >> are there.
> >>
> >> Thanks,
> >> Matt
> >>
> >> ps> I'm using vectorInvariantMomentum and implicitViscosity
> >> _______________________________________________
> >> MITgcm-support mailing list
> >> MITgcm-support at mitgcm.org
> >> http://mitgcm.org/mailman/listinfo/mitgcm-support
> > 
> > _______________________________________________
> > MITgcm-support mailing list
> > MITgcm-support at mitgcm.org
> > http://mitgcm.org/mailman/listinfo/mitgcm-support
> > 
> 
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support
-- 
Dr Patrick Heimbach | heimbach at mit.edu | http://www.mit.edu/~heimbach
MIT | EAPS, 54-1518 | 77 Massachusetts Ave | Cambridge, MA 02139, USA
FON: +1-617-253-5259 | FAX: +1-617-253-4464 | SKYPE: patrick.heimbach




More information about the MITgcm-support mailing list